From: Diane Trout Date: Mon, 1 Jul 2013 23:02:46 +0000 (-0700) Subject: Merge branch 'django1.4' of mus.cacr.caltech.edu:htsworkflow into django1.4 X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=htsworkflow.git;a=commitdiff_plain;h=6f05ae54b482745afbacc8da7d9cc31f9b067d23;hp=d9697c7e4a93736e5bb17bcc771c86ce377713c1 Merge branch 'django1.4' of mus.cacr.caltech.edu:htsworkflow into django1.4 --- diff --git a/encode_submission/trackhub.py b/encode_submission/trackhub.py index c5c2543..fb0cea8 100644 --- a/encode_submission/trackhub.py +++ b/encode_submission/trackhub.py @@ -27,7 +27,6 @@ import RDF if not 'DJANGO_SETTINGS_MODULE' in os.environ: os.environ['DJANGO_SETTINGS_MODULE'] = 'htsworkflow.settings' - from htsworkflow.util import api from htsworkflow.util.rdfhelp import \ dafTermOntology, \ @@ -78,10 +77,10 @@ def main(cmdline=None): logger.warn("File %s doesn't exist.", a) if opts.make_link_tree_from is not None: - results.make_tree_from(opts.make_tree_from, link=True) + results.make_tree_from(opts.make_link_tree_from, link=True) if opts.copy_tree_from is not None: - results.make_tree_from(opts.make_tree_from, link=False) + results.make_tree_from(opts.copy_tree_from, link=False) if opts.fastq: logger.info("Building fastq extraction scripts") diff --git a/htsworkflow/submission/results.py b/htsworkflow/submission/results.py index 5007752..5633745 100644 --- a/htsworkflow/submission/results.py +++ b/htsworkflow/submission/results.py @@ -2,6 +2,7 @@ """ from collections import MutableMapping import os +import shutil import logging from collections import namedtuple @@ -75,11 +76,11 @@ class ResultMap(MutableMapping): if not os.path.exists(source_pathname): raise IOError( "{0} does not exist".format(source_pathname)) - if not os.path.exists(target_pathname): + if not (os.path.exists(target_pathname) or os.path.isdir(source_pathname)): if link: os.symlink(source_pathname, target_pathname) else: - os.copy(source_pathname, target_pathname) + shutil.copy(source_pathname, target_pathname) LOGGER.info( 'LINK {0} to {1}'.format(source_pathname, target_pathname))