Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
aokad committed Jan 24, 2017
1 parent c9621d9 commit 9e24d79
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 8 deletions.
4 changes: 2 additions & 2 deletions scripts/paplot/pmsignature.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
########### functions
def output_html(params, config):
dataset = convert_tojs(params, config)
if dataset != None:
if dataset != None and dataset != {}:
create_html(dataset, params, config)

return dataset
Expand Down Expand Up @@ -225,7 +225,7 @@ def convert_tojs(params, config):

if sig_num == 0:
print ("no data %s" % params["data"])
return None
return {}

# signature names
signature_list = []
Expand Down
16 changes: 12 additions & 4 deletions scripts/paplot/prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,12 @@ def _convert_index_item(jsonData):
if graph["composite"] == True:
td_text = ""
for item in graph["items"]:
link_text = item["sub_text"] + ", No Data."
link_text = item["sub_text"]
if link_text == "":
link_text = "No Data."
else:
link_text += ", No Data."

icon = "block.png"
if item["exists"]:
link_text = link_templete_td.format(proj = data["proj"], output_html = item["output_html"], sub_text = item["sub_text"])
Expand Down Expand Up @@ -224,9 +229,12 @@ def create_index(

import paplot.subcode.tools as tools
import os

jsonData = _load_metadata(output_dir, output_html, project_name, name, overview, sub_text, composite,
os.path.exists(output_dir + "/" + project_name + "/" + output_html))

html_exists = os.path.exists(output_dir + "/" + project_name + "/" + output_html)
if output_html == "":
html_exists = False

jsonData = _load_metadata(output_dir, output_html, project_name, name, overview, sub_text, composite, html_exists)

link_text = _convert_index_item(jsonData)

Expand Down
12 changes: 12 additions & 0 deletions scripts/paplot/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,12 @@ def signature_main(args):
if params_out == None:
continue

if params_out == {}:
prep.create_index(config, tools.win_to_unix(args.output_dir), "", args.project_name, args.title,
overview = args.overview, sub_text = "",
composite = True, remarks = args.remarks)
continue

sig_num_sift = 0
if tools.config_getboolean(config, "result_format_signature", "background"):
sig_num_sift = 1
Expand Down Expand Up @@ -195,6 +201,12 @@ def pmsignature_main(args):
if params_out == None:
continue

if params_out == {}:
prep.create_index(config, tools.win_to_unix(args.output_dir), "", args.project_name, args.title,
overview = args.overview, sub_text = "",
composite = True, remarks = args.remarks)
continue

sig_num_sift = 0
if tools.config_getboolean(config, "result_format_pmsignature", "background"):
sig_num_sift = 1
Expand Down
4 changes: 2 additions & 2 deletions scripts/paplot/signature.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
########### functions
def output_html(params, config):
dataset = convert_tojs(params, config)
if dataset != None:
if dataset != None and dataset != {}:
create_html(dataset, params, config)

return dataset
Expand Down Expand Up @@ -191,7 +191,7 @@ def convert_tojs(params, config):

if sig_num == 0:
print ("no data %s" % params["data"])
return None
return {}

# signature names
signature_list = []
Expand Down

0 comments on commit 9e24d79

Please sign in to comment.