def initialize(self): self.sourceCache = sqlite.sqlite() self.sourceCache.setCacheLocation(self.sourceCachePath + ("DB-%s.sqlite" % (self.label))) self.sourceReader = LocalPathReaderCached.LocalPathReaderCached() self.sourceReader.setCache(self.sourceCache) self.sourceReader.setPath(self.sourcePath) self.sourceReader.initialize() self.sourceHasher = FastContentHashV1Cached.FastContentHashV1Cached() self.sourceHasher.setCache(self.sourceCache) self.sourceHasher.initialize()
parser.add_argument('--fast', dest='fast', action='store', type=int, default=0,help='TODO') parser.add_argument('--Hasher', dest='Hasher', action='store', type=str, default='FastAttributeHashV1.Cached', help='TODO') args = vars(parser.parse_args()) if args['verbose']>=4: logging.basicConfig(format='%(asctime)s:%(levelname)s:%(message)s', level=logging.DEBUG, datefmt='%Y%m%d %I:%M:%S') elif args['verbose']>=2: logging.basicConfig(format='%(asctime)s:%(levelname)s:%(message)s', level=logging.WARNING, datefmt='%Y%m%d %I:%M:%S') elif args['verbose']>=1: logging.basicConfig(format='%(asctime)s:%(levelname)s:%(message)s', level=logging.ERROR, datefmt='%Y%m%d %I:%M:%S') else: logging.basicConfig(format='%(asctime)s:%(levelname)s:%(message)s', level=logging.ERROR, datefmt='%Y%m%d %I:%M:%S') pfmt = PathFormatter(120) cache = sqlite.sqlite(); cache.setCacheLocation(args['cacheOld']) cache.initialize() analyzer = BackupAnalyzer() analyzer.setCache(cache) analyzer.initialize() logging.info("files with full hashes: %s files" % (analyzer.getFilesWithFullHashesCount())) hh = Hasher.FullContentHashV1.Base() hh.initialize() fh = None if args['Hasher'] == 'FastContentHashV1.Cached': fh = Hasher.FastContentHashV1.Cached()
parser.add_argument("--cacheOld", dest="cacheOld", action="store", type=str, default="", help="TODO") parser.add_argument("--source", dest="source", action="store", type=str, default="", help="TODO") parser.add_argument("--destination", dest="destination", action="store", type=str, default="", help="TODO") parser.add_argument("--destinationBackup", dest="destinationBackup", action="store", type=str, default="", help="TODO") parser.add_argument("--verbose", dest="verbose", action="store", type=int, default="", help="TODO") args = vars(parser.parse_args()) if args["verbose"] >= 4: logging.basicConfig(format="%(asctime)s:%(levelname)s:%(message)s", level=logging.DEBUG, datefmt="%Y%m%d %I:%M:%S") else: logging.basicConfig( format="%(asctime)s:%(levelname)s:%(message)s", level=logging.WARNING, datefmt="%Y%m%d %I:%M:%S" ) cacheNew = sqlite.sqlite() cacheNew.setCacheLocation(args["cacheNew"]) cacheNew.initialize() cacheOld = sqlite.sqlite() cacheOld.setCacheLocation(args["cacheOld"]) cacheOld.initialize() cmpr = CompleteComparer() cmpr.setNewCache(cacheNew) cmpr.setOldCache(cacheOld) cmpr.initialize() stats = {
help='TODO') parser.add_argument('--path', dest='path', action='store', type=str, default='', help='TODO') parser.add_argument('--verbose', dest='verbose', action='store', type=int, default=1, help='TODO') args = vars(parser.parse_args()) cache = sqlite.sqlite() cache.setCacheLocation(args['cache']) cache.initialize() if args['destination'] == 'auto': args['destination'] = cache.getFlag('destination.path') print "autoload destination: %s" % (args['destination']) if args['source'] == 'auto': args['source'] = cache.getFlag('source.path') print "autoload source: %s" % (args['source']) if args['destinationBackup'] == 'auto': args['destinationBackup'] = cache.getFlag('destinationBackup.path') print "autoload destinationBackup: %s" % (args['destinationBackup'])
action='store', type=int, default='', help='TODO') args = vars(parser.parse_args()) if args['verbose'] >= 4: logging.basicConfig(format='%(asctime)s:%(levelname)s:%(message)s', level=logging.DEBUG, datefmt='%Y%m%d %I:%M:%S') else: logging.basicConfig(format='%(asctime)s:%(levelname)s:%(message)s', level=logging.WARNING, datefmt='%Y%m%d %I:%M:%S') cacheNew = sqlite.sqlite() cacheNew.setCacheLocation(args['cacheNew']) cacheNew.initialize() cacheOld = sqlite.sqlite() cacheOld.setCacheLocation(args['cacheOld']) cacheOld.initialize() cmpr = CompleteComparer() cmpr.setNewCache(cacheNew) cmpr.setOldCache(cacheOld) cmpr.initialize() stats = { 'count': {