Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2309,25 +2309,19 @@ def parse_script_metadata(filepath):
with open(filepath, "r", encoding="utf-8", errors="replace") as f:
for line in f:
line = line.strip()
if line.startswith("# name:"):
metadata["name"] = line[7:].strip()
elif line.startswith("# desc:"):
metadata["desc"] = line[7:].strip()
elif line.startswith("# tag:"):
metadata["tag"] = line[6:].strip()
elif line.startswith("# url:"):
metadata["url"] = line[6:].strip()
elif not line.startswith("#") and line:
if line.startswith('# name:'):
name_val = line[7:].strip()
if name_val:
metadata['name'] = name_val
name_val = line[7:].strip()
if name_val:
metadata['name'] = name_val
elif line.startswith('# desc:'):
metadata['desc'] = line[7:].strip()
elif line.startswith('# tag:'):
metadata['tag'] = line[6:].strip()
elif line.startswith('# url:'):
metadata['url'] = line[6:].strip()
elif not line.startswith('#') and line:
break

except Exception: # nosec B110
pass
return metadata
Expand Down
Loading
Loading