Skip to content

Commit

Permalink
properties_model: Fix bad logging call, Codacy flags
Browse files Browse the repository at this point in the history
  • Loading branch information
ferdnyc committed Nov 25, 2021
1 parent 7df87dd commit 33cf68c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/windows/models/properties_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ def value_updated(self, item, interpolation=-1, value=None, interpolation_detail
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
Expand Down Expand Up @@ -517,21 +517,21 @@ def value_updated(self, item, interpolation=-1, value=None, interpolation_detail
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":
Expand All @@ -558,7 +558,7 @@ def value_updated(self, item, interpolation=-1, value=None, interpolation_detail
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)}
Expand Down

0 comments on commit 33cf68c

Please sign in to comment.