# HG changeset patch # User sanbi-uwc # Date 1465563009 14400 # Node ID 3212320e3c19a85aa35831450690aa034ee20cb0 # Parent 4af7d0144c82864c2a5e988e8db4040bd3e80632 planemo upload for repository https://github.com/SANBI-SA/tools-sanbi-uwc/tree/master/tools/build_ctb_explorer commit 4137cd3016ef2d6e7d8f56b4ff294884aa097c92 diff -r 4af7d0144c82 -r 3212320e3c19 build_ctb_explorer.py --- a/build_ctb_explorer.py Fri Jun 10 06:05:02 2016 -0400 +++ b/build_ctb_explorer.py Fri Jun 10 08:50:09 2016 -0400 @@ -35,11 +35,23 @@ return False for file_name in src_files: if os.path.isfile(file_name): - shutil.copy2(file_name, dir_name) + try: + shutil.copy2(file_name, dir_name) + except shutil.Error as e: + log.debug('Error: %s' % e) + # eg. source or destination doesn't exist + except IOError as e: + log.debug('Error: %s' % e.strerror) elif os.path.isdir(file_name): # create the parent dir before copytree - os.chdir(dir_name) - shutil.copytree(file_name, file_name.rsplit('/', 1)[-1]) + try: + os.chdir(dir_name) + shutil.copytree(file_name, file_name.rsplit('/', 1)[-1]) + except shutil.Error as e: + log.debug('Error: %s' % e) + # eg. source or destination doesn't exist + except IOError as e: + log.debug('Error: %s' % e.strerror) return True @@ -61,6 +73,15 @@ """ if copy_output_file_to_dataset(self.output_neo4jdb, self.input_neo4jdb, dt_type="neo4jdb") and \ copy_output_file_to_dataset(self.output_jbrowser, self.input_jbrowser, dt_type="jbrowser"): + + """Copy the jbrowser input data file to the outputdir @TODO: investigate altenatives""" + try: + shutil.copy2(self.input_jbrowser, self.output_jbrowser) + except shutil.Error as e: + log.debug('Error: %s' % e) + # eg. source or destination doesn't exist + except IOError as e: + log.debug('Error: %s' % e.strerror) print("CTB Report run time: %s" % str(datetime.date.today())) print("Neo4jDB - Input: %s" % str(self.args.input_neo4jdb)) print("JBrowser - Input: %s" % str(self.args.input_jbrowser))