Skip to content

Commit

Permalink
Mark outputDirectory usage in code
Browse files Browse the repository at this point in the history
  • Loading branch information
remram44 committed Jul 8, 2015
1 parent 4274cda commit af2e5ea
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions vistrails/core/console_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@

################################################################################

def run_and_get_results(w_list, parameters='', output_dir=None,
update_vistrail=True, extra_info=None,
def run_and_get_results(w_list, parameters='', output_dir=None, # output_dir no longer used here!
update_vistrail=True, extra_info=None,
reason='Console Mode Execution'):
"""run_and_get_results(w_list: list of (locator, version), parameters: str,
output_dir:str, update_vistrail: boolean,
Expand Down Expand Up @@ -266,7 +266,7 @@ def run(w_list, parameters='', output_dir=None, update_vistrail=True,
Returns list of errors (empty list if there are no errors)
"""
all_errors = []
results = run_and_get_results(w_list, parameters, output_dir,
results = run_and_get_results(w_list, parameters, output_dir, # output_dir no longer used
update_vistrail,extra_info, reason)
for result in results:
(objs, errors, executed) = (result.objects,
Expand Down
2 changes: 1 addition & 1 deletion vistrails/core/modules/basic_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ def compute(self):
self.get_input("publishFile") or
not self.has_input("publishFile")):
if self.moduleInfo.has_key('extra_info'):
if self.moduleInfo['extra_info'].has_key('pathDumpCells'):
if self.moduleInfo['extra_info'].has_key('pathDumpCells'): # used
folder = self.moduleInfo['extra_info']['pathDumpCells']
base_fname = os.path.basename(full_path)
(base_fname, file_extension) = os.path.splitext(base_fname)
Expand Down
4 changes: 2 additions & 2 deletions vistrails/gui/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ def noninteractiveMode(self):

extra_info = None
if output_dir:
extra_info = {'pathDumpCells': output_dir}
extra_info = {'pathDumpCells': output_dir} # carried over to pathDumpCells
if not self.temp_configuration.check('noExecute'):
if self.temp_configuration.check('parameterExploration'):
errs.extend(
Expand All @@ -561,7 +561,7 @@ def noninteractiveMode(self):
errs.extend(vistrails.core.console_mode.run(
w_list,
self.temp_configuration.check('parameters') or '',
output_dir if self.temp_configuration.check('withWorkflowInfo') else None,
output_dir if self.temp_configuration.check('withWorkflowInfo') else None, # this is actually ignored
update_vistrail=True,
extra_info=extra_info))
if len(errs) > 0:
Expand Down
4 changes: 2 additions & 2 deletions vistrails/gui/application_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ def executeMedley(self, xml_medley, extra_info=None):
extra_info['pathDumpCells'] = path_to_images

ok = False
if not self.path_exists_and_not_empty(extra_info['pathDumpCells']):
if not self.path_exists_and_not_empty(extra_info['pathDumpCells']): # I don't even know
if not os.path.exists(extra_info['pathDumpCells']):
os.mkdir(extra_info['pathDumpCells'])

Expand Down Expand Up @@ -808,7 +808,7 @@ def executeMedley(self, xml_medley, extra_info=None):
result += str(errors[i])
if ok:
self.server_logger.info("renaming files")
for root, dirs, file_names in os.walk(extra_info['pathDumpCells']):
for root, dirs, file_names in os.walk(extra_info['pathDumpCells']): # an empty loop!?
break
for f in file_names:
if f.lower().endswith(".png"):
Expand Down
4 changes: 2 additions & 2 deletions vistrails/gui/vistrail_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -1281,7 +1281,7 @@ def moduleExecuted(objId):
name = os.path.splitext(self.name)[0] + \
("_%s_%s_%s" % pipelinePositions[pi])
extra_info['nameDumpCells'] = name
if 'pathDumpCells' in extra_info:
if 'pathDumpCells' in extra_info: # used
images[pipelinePositions[pi]] = \
os.path.join(extra_info['pathDumpCells'], name)
pe_cell_id = (pe_log_id,) + pipelinePositions[pi]
Expand Down Expand Up @@ -1311,7 +1311,7 @@ def moduleExecuted(objId):

if showProgress:
progress.setValue(totalProgress)
if 'pathDumpCells' in extra_info:
if 'pathDumpCells' in extra_info: # used
filename = os.path.join(extra_info['pathDumpCells'],
os.path.splitext(self.name)[0])
assembleThumbnails(images, filename)
Expand Down
2 changes: 1 addition & 1 deletion vistrails/packages/spreadsheet/spreadsheet_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ def displayCellEvent(self, e):
if cell and e.vistrail.has_key('extra_info'):
dump_as_pdf = False
extra_info = e.vistrail['extra_info']
if extra_info.has_key('pathDumpCells'):
if extra_info.has_key('pathDumpCells'): # used
dumppath = extra_info['pathDumpCells']
if extra_info.has_key('nameDumpCells'):
name = extra_info['nameDumpCells']
Expand Down
2 changes: 1 addition & 1 deletion vistrails/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def main():
traceback.print_exc(None, sys.stderr)
sys.exit(255)
if (not app.temp_configuration.batch and
not app.temp_configuration.check('outputDirectory')):
not app.temp_configuration.check('outputDirectory')): # used
v = app.exec_()

vistrails.gui.application.stop_application()
Expand Down

0 comments on commit af2e5ea

Please sign in to comment.