# Delete the file
try:
os.remove(fullname)
- print 'rm', fullname
- logging.debug('Deleting: %s' % fullname)
except OSError:
logging.error('Failed to delete: %s' % fullname)
+ else:
+ print 'rm', fullname
+ logging.debug('Deleting: %s' % fullname)
############################################################################
try:
c = PAR2Set.CompareSet(directory, f)
-
- if c not in s:
- s.append(c)
except:
# We just ignore any errors that happen, such as
# parsing the PAR file
pass
+ else:
+ # Ok, we got a valid set, add it to s
+ if c not in s:
+ s.append(c)
return s
for t in types:
try:
instance = t(cs, options)
- detected = True
- logging.debug('%s detected for %s' % (t.__name__, cs.parityFile))
except TypeError:
logging.debug('%s not detected for %s' % (t.__name__, cs.parityFile))
continue
+ else:
+ detected = True
+ logging.debug('%s detected for %s' % (t.__name__, cs.parityFile))
# We detected something, try to run it
try:
instance.run()
- logging.info('Success: %s' % instance)
-
- # Leave early, we're done
- return
except (OSError, CalledProcessError):
logging.critical('Failure: %s' % instance)
+ else:
+ # Leave early, we're done
+ logging.info('Success: %s' % instance)
+ return
# Check that at least one detection worked
if not detected: