33from pathlib import Path
44from typing import Callable , Optional
55
6- from PyQt6 .QtCore import QDir , qDebug , qInfo , qWarning , QLoggingCategory
6+ from PyQt6 .QtCore import QDir , QLoggingCategory , qDebug , qInfo , qWarning
77from PyQt6 .QtWidgets import QApplication
88
99import mobase
@@ -45,23 +45,30 @@ def mappings(self) -> list[mobase.Mapping]:
4545 if progress .wasCanceled ():
4646 qWarning ("mapping canceled by user" )
4747 return self .current_mappings
48- (self ._utils .overwrite_path / 'Script Extender' ).mkdir (parents = True , exist_ok = True )
49- (self ._utils .overwrite_path / 'Stats' ).mkdir (parents = True , exist_ok = True )
50- (self ._utils .overwrite_path / 'Temp' ).mkdir (parents = True , exist_ok = True )
51- (self ._utils .overwrite_path / 'LevelCache' ).mkdir (parents = True , exist_ok = True )
52- (self ._utils .overwrite_path / 'Stats' ).mkdir (parents = True , exist_ok = True )
53- (self ._utils .overwrite_path / 'Mods' ).mkdir (parents = True , exist_ok = True )
54- (self ._utils .overwrite_path / 'GMCampaigns' ).mkdir (parents = True , exist_ok = True )
48+ (self ._utils .overwrite_path / "Script Extender" ).mkdir (
49+ parents = True , exist_ok = True
50+ )
51+ (self ._utils .overwrite_path / "Stats" ).mkdir (parents = True , exist_ok = True )
52+ (self ._utils .overwrite_path / "Temp" ).mkdir (parents = True , exist_ok = True )
53+ (self ._utils .overwrite_path / "LevelCache" ).mkdir (parents = True , exist_ok = True )
54+ (self ._utils .overwrite_path / "Stats" ).mkdir (parents = True , exist_ok = True )
55+ (self ._utils .overwrite_path / "Mods" ).mkdir (parents = True , exist_ok = True )
56+ (self ._utils .overwrite_path / "GMCampaigns" ).mkdir (parents = True , exist_ok = True )
5557 self .map_files (self ._utils .overwrite_path )
5658 self .create_mapping (
5759 self ._utils .modsettings_path ,
58- self .doc_path / "PlayerProfiles" / "Public" / self ._utils .modsettings_path .name ,
60+ self .doc_path
61+ / "PlayerProfiles"
62+ / "Public"
63+ / self ._utils .modsettings_path .name ,
5964 )
6065 progress .setValue (len (active_mods ) + 1 )
6166 QApplication .processEvents ()
6267 progress .close ()
6368 if QLoggingCategory .defaultCategory ().isDebugEnabled ():
64- qDebug (f"resolved mappings: { {m .source : m .destination for m in self .current_mappings } } " )
69+ qDebug (
70+ f"resolved mappings: { {m .source : m .destination for m in self .current_mappings } } "
71+ )
6572 return self .current_mappings
6673
6774 def map_files (
@@ -70,7 +77,7 @@ def map_files(
7077 dest : Optional [Path ] = None ,
7178 pattern : str = "*" ,
7279 rel : bool = True ,
73- only_convert : bool = False
80+ only_convert : bool = False ,
7481 ):
7582 dest = dest if dest else self .doc_path
7683 dest_func : Callable [[Path ], str ] = (
@@ -89,7 +96,9 @@ def map_files(
8996 file
9097 ) > os .path .getmtime (converted_path ):
9198 import json
99+
92100 import yaml
101+
93102 with open (file , "r" ) as yaml_file :
94103 with open (converted_path , "w" ) as json_file :
95104 json .dump (
0 commit comments