Skip to content

Commit

Permalink
Merge pull request #93 from zas/rework_sigma2aurora_py2
Browse files Browse the repository at this point in the history
Ensure chnames.txt can be overwritten
  • Loading branch information
dspverden committed Nov 23, 2021
2 parents 0c080cd + dd42ca6 commit 7bbd8f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion SOURCES/sigma2aurora/sigma2aurora.py
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,7 @@ def intaddr(node):
# GUI creation
# ------------------------------------------------------------------------------
chnames_txt_path = os.path.join(project_path, "chnames.txt")
chnames_txt_created = False

if args.gui:
# --- Copy custom GUI html
Expand Down Expand Up @@ -819,14 +820,15 @@ def intaddr(node):
if os.path.isfile(custom_chnames_path):
print("Copying custom chnames.txt from " + custom_chnames_path)
shutil.copy2(custom_chnames_path, chnames_txt_path)
chnames_txt_created = True
else:
# --- Copy GUI template
print("Copying template dsp.html")
template_dsp_html_path = os.path.join(webapp_path, 'plugins', 'template', 'dsp.html')
project_dsp_html_path = os.path.join(project_path, 'dsp.html')
shutil.copy2(template_dsp_html_path, project_dsp_html_path)

if not os.path.isfile(chnames_txt_path):
if not chnames_txt_created:
# --- Writing chnames.txt
print("Writing default chnames.txt")
with open(chnames_txt_path, 'w') as file:
Expand Down

0 comments on commit 7bbd8f7

Please sign in to comment.