@@ -32,7 +32,7 @@ def main():
32
32
33
33
total_progress = get_total_progress ()
34
34
35
- for input_folder_path , input_subfolders , full_filename_list in os .walk (cfg .sg .user_settings_get_entry ("mods_folder " )):
35
+ for input_folder_path , input_subfolders , full_filename_list in os .walk (cfg .sg .user_settings_get_entry ("input_folder " )):
36
36
mod_subfolder = get_mod_subfolder (input_folder_path )
37
37
output_folder = get_output_folder_path (mod_subfolder )
38
38
@@ -53,23 +53,23 @@ def main():
53
53
54
54
55
55
def unzip ():
56
- mods_folder = cfg .sg .user_settings_get_entry ("mods_folder " )
57
- for f in os .listdir (mods_folder ):
58
- zip_path = os .path .join (mods_folder , f )
56
+ input_folder = cfg .sg .user_settings_get_entry ("input_folder " )
57
+ for f in os .listdir (input_folder ):
58
+ zip_path = os .path .join (input_folder , f )
59
59
if zipfile .is_zipfile (zip_path ):
60
60
with zipfile .ZipFile (zip_path ) as item :
61
- item .extractall (mods_folder )
61
+ item .extractall (input_folder )
62
62
os .remove (zip_path )
63
63
64
64
65
65
def get_total_progress ():
66
- mods_folder = cfg .sg .user_settings_get_entry ("mods_folder " )
67
- mod_count = len ([name for name in os .listdir (mods_folder ) if os .path .isdir (os .path .join (mods_folder , name ))])
66
+ input_folder = cfg .sg .user_settings_get_entry ("input_folder " )
67
+ mod_count = len ([name for name in os .listdir (input_folder ) if os .path .isdir (os .path .join (input_folder , name ))])
68
68
return mod_count * 2 if cfg .sg .user_settings_get_entry ("output_zips" ) else mod_count
69
69
70
70
71
71
def get_mod_subfolder (input_folder_path ):
72
- return input_folder_path .replace (cfg .sg .user_settings_get_entry ("mods_folder " ) + "\\ " , "" ) # TODO: Find proper replacement for removing the \\ part that will also work for Unix.
72
+ return input_folder_path .replace (cfg .sg .user_settings_get_entry ("input_folder " ) + "\\ " , "" ) # TODO: Find proper replacement for removing the \\ part that will also work for Unix.
73
73
74
74
75
75
def get_output_folder_path (mod_subfolder ):
@@ -91,8 +91,8 @@ def update_progress():
91
91
92
92
93
93
def create_folder (input_folder_path , output_folder ):
94
- # Prevents putting the mods_folder itself into the output_folder.
95
- if input_folder_path != cfg .sg .user_settings_get_entry ("mods_folder " ):
94
+ # Prevents putting the input_folder itself into the output_folder.
95
+ if input_folder_path != cfg .sg .user_settings_get_entry ("input_folder " ):
96
96
try :
97
97
os .makedirs (output_folder )
98
98
except FileExistsError :
@@ -205,9 +205,9 @@ def regex_replace_bmps_and_wavs(all_lines):
205
205
206
206
207
207
def create_zips ():
208
- # Get mod folder names from the mods_folder .
208
+ # Get mod folder names from the input_folder .
209
209
output_folder = cfg .sg .user_settings_get_entry ("output_folder" )
210
- folder_names = [f for f in os .listdir (cfg .sg .user_settings_get_entry ("mods_folder " )) if os .path .isdir (os .path .join (output_folder , f ))]
210
+ folder_names = [f for f in os .listdir (cfg .sg .user_settings_get_entry ("input_folder " )) if os .path .isdir (os .path .join (output_folder , f ))]
211
211
212
212
for f in folder_names :
213
213
print ("Zipping '{}'" .format (f ))
0 commit comments