Skip to content

Commit

Permalink
Autoparsing lists in shuffle tools parse list
Browse files Browse the repository at this point in the history
  • Loading branch information
frikky committed Nov 29, 2023
1 parent cd2aaf1 commit 44d6a83
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions shuffle-tools/1.2.0/src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,15 @@ def parse(data):
return return_value

def parse_list(self, items, splitter="\n"):
# Check if it's already a list first
try:
newlist = json.loads(items)
if isinstance(newlist, list):
return newlist

except Exception as e:
self.logger.info("[WARNING] Parse error - fallback: %s" % e)

if splitter == "":
splitter = "\n"

Expand Down

0 comments on commit 44d6a83

Please sign in to comment.