Skip to content

Commit

Permalink
#5 linter
Browse files Browse the repository at this point in the history
  • Loading branch information
funkchaser committed Apr 17, 2024
1 parent b275072 commit 6fb9365
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/aixd_grasshopper/gh_ui_helper.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import json
import urllib


import Grasshopper
import urllib2
Expand Down Expand Up @@ -84,17 +84,19 @@ def clear_sticky(ghenv, st):
# There might be other keys in the sticky dictionary, so we need to filter them out.
for key in keys:

session_id = None
guid_str = None
try:
session_id = key.split("_")[0]
guid_str = key.split("_")[1]
except:
session_id = None
guid_str = None
except Exception:
pass

if not session_id or not guid_str:
continue

# The retrieved session_id and guid_str may either come from a different Grasshopper document, or from some other process and be incorrect/meaningless.
# The retrieved session_id and guid_str may either come from a different Grasshopper document,
# or from some other process and be incorrect/meaningless.
# In these cases, the following code will do nothing anyway.
if session_id == ghdoc_id:
reset_component(ghdoc, guid_str)
Expand All @@ -103,7 +105,8 @@ def clear_sticky(ghenv, st):

def reset_component(ghdoc, guid_str):
"""
adapted from: https://github.com/compas-dev/compas/blob/ea4b5b5191a350d24cbb479c6770daa68dbe53fd/src/compas_ghpython/timer.py#L8
adapted from:
https://github.com/compas-dev/compas/blob/ea4b5b5191a350d24cbb479c6770daa68dbe53fd/src/compas_ghpython/timer.py#L8
"""

guid = Guid(guid_str)
Expand Down

0 comments on commit 6fb9365

Please sign in to comment.