@@ -60,15 +60,15 @@ def __init__(self):
60
60
self .new ()
61
61
62
62
def needs_save (self ):
63
- """Returns if project data Has unsaved changes"""
63
+ """Returns if project data has unsaved changes"""
64
64
return self .has_unsaved_changes
65
65
66
66
def get (self , key ):
67
- """ Get copied value of a given key in data store """
67
+ """Get copied value of a given key in data store"""
68
68
69
69
# Verify key is valid type
70
70
if not key :
71
- log .warning ("Cannot get empty key." )
71
+ log .warning ("ProjectDataStore cannot get empty key." )
72
72
return None
73
73
if not isinstance (key , list ):
74
74
key = [key ]
@@ -149,10 +149,10 @@ def _set(self, key, values=None, add=False, partial_update=False, remove=False):
149
149
150
150
# Verify key is valid type
151
151
if not isinstance (key , list ):
152
- log .warning ("_set() key must be a list. key: {}" . format ( key ) )
152
+ log .warning ("_set() key must be a list. key=%s" , key )
153
153
return None
154
154
if not key :
155
- log .warning ("Cannot set empty key." )
155
+ log .warning ("Cannot set empty key (key=%s)" , key )
156
156
return None
157
157
158
158
# Get reference to internal data structure
@@ -255,8 +255,8 @@ def new(self):
255
255
if os .path .exists (info .USER_DEFAULT_PROJECT ):
256
256
try :
257
257
self ._data = self .read_from_file (info .USER_DEFAULT_PROJECT )
258
- except (FileNotFoundError , PermissionError ) as ex :
259
- log .warning ("Unable to load user project defaults from {}: {}" . format ( info .USER_DEFAULT_PROJECT , ex ) )
258
+ except (FileNotFoundError , PermissionError ):
259
+ log .warning ("Unable to load user project defaults from %s" , info .USER_DEFAULT_PROJECT , exc_info = 1 )
260
260
except Exception :
261
261
raise
262
262
else :
@@ -533,10 +533,10 @@ def read_legacy_project_file(self, file_path):
533
533
# Keep track of new ids and old ids
534
534
file_lookup [item .unique_id ] = file
535
535
536
- except Exception as ex :
537
- # Handle exception quietly
538
- msg = ( "%s is not a valid video, audio, or image file: %s" % ( item .name , str ( ex )))
539
- log . error ( msg )
536
+ except Exception :
537
+ log . error ( "%s is not a valid video, audio, or image file" ,
538
+ item .name ,
539
+ exc_info = 1 )
540
540
failed_files .append (item .name )
541
541
542
542
# Delete all tracks
@@ -693,10 +693,10 @@ def read_legacy_project_file(self, file_path):
693
693
# Increment track counter
694
694
track_counter += 1
695
695
696
- except Exception as ex :
696
+ except Exception :
697
697
# Error parsing legacy contents
698
- msg = "Failed to load project file %(path)s: %(error)s " % {"path" : file_path , "error" : ex }
699
- log .error (msg )
698
+ msg = "Failed to load legacy project file %(path)s" % {"path" : file_path }
699
+ log .error (msg , exc_info = 1 )
700
700
raise RuntimeError (msg ) from ex
701
701
702
702
# Show warning if some files failed to load
@@ -891,8 +891,8 @@ def move_temp_paths_to_project_folder(self, file_path, previous_path=None):
891
891
clip ["reader" ]["path" ] = reader_paths [file_id ]
892
892
log .info ("Updated clip {} path for file {}" .format (clip ["id" ], file_id ))
893
893
894
- except Exception as ex :
895
- log .error ("Error while moving temp paths to project assets folder {}: {}" . format ( asset_path , ex ) )
894
+ except Exception :
895
+ log .error ("Error while moving temp paths to project assets folder %s" , asset_path , exc_info = 1 )
896
896
897
897
def add_to_recent_files (self , file_path ):
898
898
""" Add this project to the recent files list """
0 commit comments