Skip to content

Commit 297e228

Browse files
committed
Minor edits
1 parent 9ea1ea3 commit 297e228

2 files changed

Lines changed: 17 additions & 16 deletions

File tree

toontown/leveleditor/AutoSaver.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
class AutoSaver:
1010
autoSaverToggled = False
1111
autoSaverInterval = 15.0
12-
maxAutoSaveCount = 10
12+
maxAutoSaveCount = 10.0
1313

1414
@staticmethod
1515
def initializeAutoSaver():
16-
threading.Thread(target=AutoSaver.autoSaverProcess, daemon=True).start()
16+
threading.Thread(target = AutoSaver.autoSaverProcess, daemon = True).start()
1717

1818
@staticmethod
1919
def autoSaverProcess():
@@ -63,8 +63,10 @@ def manageAutoSaveFiles():
6363
if basename[-16:] == '_autosave-latest':
6464
DNASerializer.outputDNADefaultFile() # Saves working DNA file
6565
return
66-
DNASerializer.outputFile = os.path.join(dir, basename + '_autosave-latest' + extension).replace('\\', '/')
66+
DNASerializer.outputFile = os.path.join(dir, basename + '_autosave-latest' + extension)
6767

68+
# Change mix of separators to forward slashes
69+
DNASerializer.outputFile.replace('\\', '/')
6870
# Deletes 'latest' from filename
6971
basename = basename[:-6]
7072

toontown/leveleditor/LevelEditorPanel.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -187,32 +187,31 @@ def __init__(self, levelEditor, parent = None, **kw):
187187
message_text = CONTROLS)
188188
self.controlsDialog.withdraw()
189189

190-
self.autoSaverDialog = Pmw.Dialog(parent, title='Autosaver Options',
191-
buttons=('Save Options',),
192-
command=self.setAutoSaverInterval
193-
)
190+
self.autoSaverDialog = Pmw.Dialog(parent, title = 'Autosaver Options',
191+
buttons = ('Save Options',),
192+
command = self.setAutoSaverInterval)
194193
self.autoSaverDialog.withdraw()
195194

196195
self.autoSaverDialogInterval = Pmw.Counter(self.autoSaverDialog.interior(),
197-
labelpos='w',
196+
labelpos = 'w',
198197
label_text = 'Auto save interval in minutes:',
199-
entry_width=10,
198+
entry_width = 10,
200199
entryfield_value = int(AutoSaver.autoSaverInterval),
201-
entryfield_validate={'validator': 'real',
200+
entryfield_validate = {'validator': 'real',
202201
'min': 1, 'max': 60})
203202

204203
self.autoSaverDialogMax = Pmw.Counter(self.autoSaverDialog.interior(),
205-
labelpos='w',
204+
labelpos = 'w',
206205
label_text = 'Max auto save files:',
207-
entry_width=10,
206+
entry_width = 10,
208207
entryfield_value = int(AutoSaver.maxAutoSaveCount),
209-
entryfield_validate={'validator': 'numeric',
208+
entryfield_validate = {'validator': 'numeric',
210209
'min': 0, 'max': 99})
211210

212211
counters = (self.autoSaverDialogInterval, self.autoSaverDialogMax)
213212
Pmw.alignlabels(counters)
214213
for counter in counters:
215-
counter.pack(fill='both', expand=1, padx=10, pady=10)
214+
counter.pack(fill = 'both', expand = 1)
216215

217216
self.editMenu = Pmw.ComboBox(
218217
menuFrame, labelpos = W,
@@ -1592,10 +1591,10 @@ def toggleAutoSaver(self):
15921591
# If no working DNA outputFile is selected, one is chosen here
15931592
if DNASerializer.outputFile is None:
15941593
DNASerializer.saveToSpecifiedDNAFile()
1595-
print(f'Started auto saver on an interval of {AutoSaver.autoSaverInterval} minutes')
1594+
print(f'Starting auto saver on an interval of {AutoSaver.autoSaverInterval} minutes')
15961595
# Toggles auto saver to begin auto saving loop
15971596
AutoSaver.autoSaverToggled = True
15981597
else:
1599-
print('Stopped auto saver process')
1598+
print('Stopping auto saver')
16001599
# Stops auto saving loop
16011600
AutoSaver.autoSaverToggled = False

0 commit comments

Comments
 (0)