Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 79a0ce8eb7
Fetching contributors…

Cannot retrieve contributors at this time

24 lines (21 sloc) 0.703 kb
#!/usr/bin/env python2.6
from collections import defaultdict
import sys
class FSCopyError(Exception): pass
class FSCopy(object):
"""
Provides common exception handling for fs copy objects, cleanup is supposed
to run when the copy function terminates or has an exception raised
"""
exception_list = (Exception,)
_persistent_vars = defaultdict(lambda: None)
def __call__(self, inpath, outpath, **kwargs):
try:
self.fscopy(inpath, outpath, **kwargs)
except self.exception_list as err:
#print sys.exc_info()[2]
#raise FSCopyError(err)
raise
finally:
self.cleanup()
__init__ = __call__
Jump to Line
Something went wrong with that request. Please try again.