1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
From: "FeRD (Frank Dana)" <ferdnyc@gmail.com>
Date: Thu, 25 Nov 2021 02:18:32 -0500
Subject: properties_model: Fix bad logging call, Codacy flags
---
src/windows/models/properties_model.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/windows/models/properties_model.py b/src/windows/models/properties_model.py
index de6ff75..e25b2d5 100644
--- a/src/windows/models/properties_model.py
+++ b/src/windows/models/properties_model.py
@@ -442,7 +442,7 @@ class PropertiesModel(updates.UpdateInterface):
log.debug("%s: update property %s. %s", log_id, property_key, clip_data.get(property_key))
# Check the type of property (some are keyframe, and some are not)
- if property_type != "reader" and type(clip_data[property_key]) == dict:
+ if property_type != "reader" and isinstance(clip_data[property_key], dict):
# Keyframe
# Loop through points, find a matching points on this frame
found_point = False
@@ -513,21 +513,21 @@ class PropertiesModel(updates.UpdateInterface):
clip_updated = True
try:
clip_data[property_key] = int(new_value)
- except Exception as ex:
+ except Exception:
log.warn('Invalid Integer value passed to property', exc_info=1)
elif property_type == "float":
clip_updated = True
try:
clip_data[property_key] = float(new_value)
- except Exception as ex:
+ except Exception:
log.warn('Invalid Float value passed to property', exc_info=1)
elif property_type == "bool":
clip_updated = True
try:
clip_data[property_key] = bool(new_value)
- except Exception as ex:
+ except Exception:
log.warn('Invalid Boolean value passed to property', exc_info=1)
elif property_type == "string":
@@ -554,7 +554,7 @@ class PropertiesModel(updates.UpdateInterface):
clip_object.Close()
clip_object = None
except Exception:
- log.warn('Invalid Reader value passed to property: %s (%s)', value, exc_info=1)
+ log.warn('Invalid Reader value passed to property: %s', value, exc_info=1)
# Reduce # of clip properties we are saving (performance boost)
clip_data = {property_key: clip_data.get(property_key)}
|