Skip to content

Commit 524fbdc

Browse files
jonoomphferdnyc
andauthored
Apply suggestions from code review
Applying @ferdnyc suggestions for 'less chatty' and more descriptive exceptions, where needed. Co-authored-by: Frank Dana <[email protected]>
1 parent 43ab9de commit 524fbdc

7 files changed

+12
-12
lines changed

src/windows/main_window.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ def create_lock_file(self):
292292
f.write(lock_value)
293293
break
294294
except Exception:
295-
log.warning('Failed to write lock file (attempt: %s)' % attempts)
295+
log.debug('Failed to write lock file (attempt: %s)' % attempts)
296296
attempts -= 1
297297
sleep(0.25)
298298

@@ -307,7 +307,7 @@ def destroy_lock_file(self):
307307
os.remove(lock_path)
308308
break
309309
except Exception:
310-
log.warning('Failed to destroy lock file (attempt: %s)' % attempts)
310+
log.debug('Failed to destroy lock file (attempt: %s)' % attempts)
311311
attempts -= 1
312312
sleep(0.25)
313313

@@ -2591,7 +2591,7 @@ def FrameExported(self, title_message, start_frame, end_frame, current_frame):
25912591
self.unity_launcher.set_property("progress", current_frame / (end_frame - start_frame))
25922592
self.unity_launcher.set_property("progress_visible", True)
25932593
except Exception:
2594-
log.warning('Failed to notify unity launcher of export progress. Frame: %s' % current_frame)
2594+
log.debug('Failed to notify unity launcher of export progress. Frame: %s' % current_frame)
25952595

25962596
def ExportFinished(self, path):
25972597
"""Show completion in Unity Launcher (if connected)"""
@@ -2600,7 +2600,7 @@ def ExportFinished(self, path):
26002600
self.unity_launcher.set_property("progress", 0.0)
26012601
self.unity_launcher.set_property("progress_visible", False)
26022602
except Exception:
2603-
log.warning('Failed to notify unity launcher of export progress. Completed.')
2603+
log.debug('Failed to notify unity launcher of export progress. Completed.')
26042604

26052605
def __init__(self, mode=None):
26062606

src/windows/preferences.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ def text_value_changed(self, widget, param, value=None):
498498
if not value:
499499
value = widget.toPlainText()
500500
except:
501-
log.warning('Failed to get plain text from widget')
501+
log.debug('Failed to get plain text from widget')
502502

503503
# If this setting is a keyboard mapping, parse it first
504504
if param.get("category") == "Keyboard":

src/windows/title_editor.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ def load_svg_template(self):
222222
self.settingsContainer.layout().removeWidget(child)
223223
child.deleteLater()
224224
except Exception:
225-
log.warning('Failed to delete child settings widget')
225+
log.debug('Failed to delete child settings widget')
226226

227227
# Get text nodes and rect nodes
228228
self.text_node = self.xmldoc.getElementsByTagName('text')
@@ -441,7 +441,7 @@ def update_font_color_button(self):
441441
color = txt[5:]
442442
except Exception:
443443
# If the color was in an invalid format, try the next text element
444-
log.warning('Failed to parse color value from text element')
444+
log.debug('Failed to parse {} as color value'.format(txt))
445445

446446
opacity = self.find_in_list(ar, "opacity:")
447447

@@ -450,7 +450,7 @@ def update_font_color_button(self):
450450
txt = ar[opacity]
451451
opacity = float(txt[8:])
452452
except Exception:
453-
log.warning('Failed to parse opacity value from text element')
453+
log.debug('Failed to parse {} as opacity value'.format(txt))
454454

455455
# Default the font color to white if non-existing
456456
if color is None:

src/windows/views/blender_listview.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def text_value_changed(self, widget, param, value=None):
210210
if not value:
211211
value = widget.toPlainText()
212212
except Exception:
213-
log.warning('Failed to read plain text value from widget')
213+
log.debug('Failed to read plain text value from widget')
214214
return
215215
self.params[param["name"]] = value.replace("\n", "\\n")
216216
# XXX: This will log every individual KEYPRESS in the text field.

src/windows/views/properties_tableview.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def mouseMoveEvent(self, event):
181181
except Exception:
182182
# If item is deleted during this drag... an exception can occur
183183
# Just ignore, since this is harmless
184-
log.warning('Failed to access data on selected label widget')
184+
log.debug('Failed to access data on selected label widget')
185185

186186
property_key = cur_property[0]
187187
property_name = cur_property[1]["name"]

src/windows/views/timeline_webview.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def update_clip_data(self, clip_json, only_basic_props=True, ignore_reader=False
229229
clip_data = clip_json
230230
except Exception:
231231
# Failed to parse json, do nothing
232-
log.warning('Failed to parse clip JSON data')
232+
log.warning('Failed to parse clip JSON data', exc_info=1)
233233

234234
# Search for matching clip in project data (if any)
235235
existing_clip = Clip.get(id=clip_data["id"])

src/windows/views/tutorial.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ def exit_manager(self):
297297
self.win.dockProperties.visibilityChanged.disconnect()
298298
self.win.dockVideo.visibilityChanged.disconnect()
299299
except Exception:
300-
log.warning('Failed to properly disconnect from dock signals')
300+
log.debug('Failed to properly disconnect from dock signals', exc_info=1)
301301

302302
# Close dialog window
303303
self.close_dialogs()

0 commit comments

Comments
 (0)