From: Diane Trout Date: Sat, 8 May 2010 00:32:32 +0000 (+0000) Subject: Always return a count from carefully_make_hardlinks X-Git-Tag: 0.4.0~2 X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=htsworkflow.git;a=commitdiff_plain;h=646783204499645dfdaacaf8db28fc39de98fd90 Always return a count from carefully_make_hardlinks Be more flexible about which json parser to use --- diff --git a/scripts/make-library-tree b/scripts/make-library-tree index f4e854a..822af48 100644 --- a/scripts/make-library-tree +++ b/scripts/make-library-tree @@ -1,7 +1,12 @@ #!/usr/bin/env python from ConfigParser import SafeConfigParser -import json +# try to deal with python <2.6 +try: + import json +except ImportError: + import simplejson as json + import logging import os from optparse import OptionParser @@ -193,8 +198,9 @@ def carefully_make_hardlink(source, destination, dry_run=False): logging.debug('SAME: %s -> %s' % (source, destination)) return 0 else: - raise IOError('%s and %s are different files' % \ - (source, destination)) + logging.error('%s and %s are different files, skipping' % \ + (source, destination)) + return 0 logging.debug('Linking: %s -> %s' % (source, destination)) # we would do something by this part