rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
if not msg: return retval = _prelude.prelude_option_recv_set(msg) return retval | if _prelude.prelude_option_recv_set(msg) < 0: raise Error("could not read destroy answer") | def destroy(self, analyzer_path, instance): msg = self._request(analyzer_path, _prelude.PRELUDE_MSG_OPTION_DESTROY, instance) if not msg: return retval = _prelude.prelude_option_recv_set(msg) | 3d2f8d947615f8dc41c8549dd2184704ff9aee5c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11628/3d2f8d947615f8dc41c8549dd2184704ff9aee5c/prelude.py |
def __init__(self, capability, name=None, config=None): self._client = None self._msgbuf = None self._exit_status = _prelude.PRELUDE_CLIENT_EXIT_STATUS_FAILURE if not name: name = sys.argv[0] self._client = _prelude.prelude_client_new(capability) if not self._client: raise ClientError() | ca993d7bedc20a8b801a911e9981c7242533d1da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11628/ca993d7bedc20a8b801a911e9981c7242533d1da/prelude.py | ||
self._exit_status = _prelude.PRELUDE_CLIENT_EXIST_STATUS_SUCCESS | self._exit_status = _prelude.PRELUDE_CLIENT_EXIT_STATUS_SUCCESS | def set_success(self): self._exit_status = _prelude.PRELUDE_CLIENT_EXIST_STATUS_SUCCESS | ca993d7bedc20a8b801a911e9981c7242533d1da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11628/ca993d7bedc20a8b801a911e9981c7242533d1da/prelude.py |
self._exit_status = _prelude.PRELUDE_CLIENT_EXIST_STATUS_FAILURE | self._exit_status = _prelude.PRELUDE_CLIENT_EXIT_STATUS_FAILURE | def set_failure(self): self._exit_status = _prelude.PRELUDE_CLIENT_EXIST_STATUS_FAILURE | ca993d7bedc20a8b801a911e9981c7242533d1da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11628/ca993d7bedc20a8b801a911e9981c7242533d1da/prelude.py |
def __del__(self): #print "Client.__del__" if self._msgbuf: _prelude.prelude_msgbuf_close(self._msgbuf) #self._msgbuf = None | ca993d7bedc20a8b801a911e9981c7242533d1da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11628/ca993d7bedc20a8b801a911e9981c7242533d1da/prelude.py | ||
_prelude.prelude_client_destroy(self._client) | _prelude.prelude_client_destroy(self._client, self._exit_status) | def __del__(self): #print "Client.__del__" if self._msgbuf: _prelude.prelude_msgbuf_close(self._msgbuf) #self._msgbuf = None | ca993d7bedc20a8b801a911e9981c7242533d1da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11628/ca993d7bedc20a8b801a911e9981c7242533d1da/prelude.py |
_prelude.prelude_client_destroy(self._client) | _prelude.prelude_client_destroy(self._client, _prelude.PRELUDE_CLIENT_EXIT_STATUS_FAILURE) | def __init__(self, name, config=None): if not config: file = os.popen("libprelude-config --prefix") path = file.read() file.close() config = path[:-1] + "/etc/prelude/default/client.conf" Client.__init__(self, Client.SEND_IDMEF, name, config) self._analyzer = _prelude.prelude_client_get_analyzer(self._client) if not ... | ca993d7bedc20a8b801a911e9981c7242533d1da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11628/ca993d7bedc20a8b801a911e9981c7242533d1da/prelude.py |
_prelude.prelude_client_set_connection(self._client, self._manager_connection) _prelude.prelude_connection_connect(self._manager_connection) | if not self._manager_connection: raise ClientError("could not create new connection to %s:%p" % (address, port)) if _prelude.prelude_client_set_connection(self._client, self._manager_connection) < 0: raise ClientError("could not set client connection") if _prelude.prelude_connection_connect(self._manager_connection) ... | def __init__(self, name=None, address="127.0.0.1", port=5554): Client.__init__(self, Client.SEND_ADMIN, name, None) self._manager_connection = _prelude.prelude_connection_new(self._client, address, port) _prelude.prelude_client_set_connection(self._client, self._manager_connection) _prelude.prelude_connection_connect(s... | ca993d7bedc20a8b801a911e9981c7242533d1da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11628/ca993d7bedc20a8b801a911e9981c7242533d1da/prelude.py |
def maintainence_price(): | def maintainence_price(addMarkup = True): | def maintainence_price(): "Calculate the price of maintainence" price = (float(maintainenceCost[1]) / float(maintainenceCost[0])) / 1000.0 price = price * transfer if addMarkup: price = addPercent(price, markup) return price | d3f2c0a0850f52eb2ff1045ad7b14363f01847c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3020/d3f2c0a0850f52eb2ff1045ad7b14363f01847c2/hosting.py |
price = (float(maintainenceCost[1]) / float(maintainenceCost[0])) / 1000.0 price = price * transfer | price = float(maintainenceCost[1]) / float(maintainenceCost[0]) price = price | def maintainence_price(): "Calculate the price of maintainence" price = (float(maintainenceCost[1]) / float(maintainenceCost[0])) / 1000.0 price = price * transfer if addMarkup: price = addPercent(price, markup) return price | d3f2c0a0850f52eb2ff1045ad7b14363f01847c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3020/d3f2c0a0850f52eb2ff1045ad7b14363f01847c2/hosting.py |
def cmdITIME(self, source, name): | def cmdITIME(self, source): | def cmdITIME(self, source, name): """Synonym, of BEAT See: BEAT """ | 4357ea1bde670b9671a7d1f9930895b1d638cb0c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3020/4357ea1bde670b9671a7d1f9930895b1d638cb0c/swatch.py |
if tokens.peek().upper() == "LIST": tokens.next() self.doLIST(target) elif tokens.peek().upper() == "INFO": tokens.next() plugin = tokens.next() self.doINFO(target, plugin) | if tokens.more(): if tokens.peek().upper() == "LIST": tokens.next() self.doLIST(target) elif tokens.peek().upper() == "INFO": tokens.next() plugin = tokens.next() self.doINFO(target, plugin) | def onMESSAGE(self, source, target, message): | c82a2b7dbb9e08821d4d031780663eefb5b00a89 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3020/c82a2b7dbb9e08821d4d031780663eefb5b00a89/plugins.py |
msg = 'Hostname: ' + socket.gethostbyaddr(host) else: msg = source[0] + ', Hostname: ' + socket.gethostbyaddr(host) | msg = "Hostname: %s" + name else: msg = "%s, Hostname: %s" % (source[0], name) | def doHOST(self, source, target, host): if re.search('[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+', host): if source[0] == target: msg = 'Hostname: ' + socket.gethostbyaddr(host) else: msg = source[0] + ', Hostname: ' + socket.gethostbyaddr(host) else: if source[0] == target: msg = 'IP: ' + socket.gethostbyname(host) else: msg = so... | aff3af048ea9b22b79b20c071d8fcae276222153 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3020/aff3af048ea9b22b79b20c071d8fcae276222153/Bot.py |
msg = 'IP: ' + socket.gethostbyname(host) else: msg = source[0] + ', IP: ' + socket.gethostbyname(host) | msg = "IP: %s" % name else: msg = "%s, IP: %s" % (source[0], name) | def doHOST(self, source, target, host): if re.search('[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+', host): if source[0] == target: msg = 'Hostname: ' + socket.gethostbyaddr(host) else: msg = source[0] + ', Hostname: ' + socket.gethostbyaddr(host) else: if source[0] == target: msg = 'IP: ' + socket.gethostbyname(host) else: msg = so... | aff3af048ea9b22b79b20c071d8fcae276222153 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3020/aff3af048ea9b22b79b20c071d8fcae276222153/Bot.py |
win.show() | def sighndl(sig, stack): win.show() | a044918e5e808942f17f0cf3027c645854966a52 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2342/a044918e5e808942f17f0cf3027c645854966a52/ui.py | |
ret=self.__parse_results(cursor,callback, sofar) | ret=self.__parse_results(cursor,callback, sofar=sofar) | def query(self, query, callback): """execute a query and call callback on all the results, in the correct order. | 43dd1c6a3981dfe31ac4b33531b337e92ef7587c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2342/43dd1c6a3981dfe31ac4b33531b337e92ef7587c/catalog.py |
ret=self.__parse_results(cursor,callback, sofar) | ret=self.__parse_results(cursor,callback, sofar=sofar) | def query(self, query, callback): """execute a query and call callback on all the results, in the correct order. | 43dd1c6a3981dfe31ac4b33531b337e92ef7587c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2342/43dd1c6a3981dfe31ac4b33531b337e92ef7587c/catalog.py |
if not sofar or id not in sofar: if sofar: | if sofar==None or id not in sofar: if sofar!=None: | def __parse_results(self, cursor, callback, sofar=None): """Call callback on all the results, in the correct order. | 43dd1c6a3981dfe31ac4b33531b337e92ef7587c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2342/43dd1c6a3981dfe31ac4b33531b337e92ef7587c/catalog.py |
assert (RPath(self.lc, self.mainprefix, ("sampledir",)).listdir() == ["1", "2", "3", "4"]) | dirlist = RPath(self.lc, self.mainprefix, ("sampledir",)).listdir() dirlist.sort() assert dirlist == ["1", "2", "3", "4"], dirlist | def testListdir(self): """Checking dir listings""" assert (RPath(self.lc, self.mainprefix, ("sampledir",)).listdir() == ["1", "2", "3", "4"]) | d1559ec9e9284b73841b363cbab6755505f5d9c4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/d1559ec9e9284b73841b363cbab6755505f5d9c4/rpathtest.py |
if attr == 'com.apple.FinderInfo' or attr == 'come.apple.ResourceFork': | if attr == 'com.apple.FinderInfo' or attr == 'com.apple.ResourceFork': | def read_from_rp(self, rp): """Set the extended attributes from an rpath""" try: attr_list = rp.conn.xattr.listxattr(rp.path) except IOError, exc: if exc[0] == errno.EOPNOTSUPP: return # if not sup, consider empty if exc[0] == errno.EACCES: log.Log("Warning: listattr(%s): %s" % (rp.path, exc), 3) return raise for attr ... | f505487a27f494d7e9eaa3781ae5e4a279782412 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/f505487a27f494d7e9eaa3781ae5e4a279782412/eas_acls.py |
if diff_rorp.isspecial(): | if rf.metadata_rorp.isspecial(): | def fast_process(self, index, rf): """Process when nothing is a directory""" if not rf.metadata_rorp.equal_loose(rf.mirror_rp): log.Log("Regressing file %s" % (rf.metadata_rorp.get_indexpath()), 5) if rf.metadata_rorp.isreg(): self.restore_orig_regfile(rf) else: if rf.mirror_rp.lstat(): rf.mirror_rp.delete() if diff_ro... | baa951395dc842da7c1bdd4c6e5d3da31645826e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/baa951395dc842da7c1bdd4c6e5d3da31645826e/regress.py |
assert not ext_rp.lstat() | if ext_rp: assert not ext_rp.lstat() | def set_extended_filenames(self, subdir): """Set self.extended_filenames by trying to write a path""" assert not self.read_only | c965b0445713eae99de49bd316ecf0d7e102f694 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/c965b0445713eae99de49bd316ecf0d7e102f694/fs_abilities.py |
The quoting this session appears to need do not match those in | The quoting chars this session needs (%s) do not match the repository settings (%s) listed in | def compare_ctq_file(self, rbdir, suggested_ctq): """Compare ctq file with suggested result, return actual ctq""" ctq_rp = rbdir.append("chars_to_quote") if not ctq_rp.lstat(): if Globals.chars_to_quote is None: actual_ctq = suggested_ctq else: actual_ctq = Globals.chars_to_quote ctq_rp.write_string(actual_ctq) return ... | c3d90b74fa5bc1d061aa989b3608052ab314e863 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/c3d90b74fa5bc1d061aa989b3608052ab314e863/fs_abilities.py |
backed up onto it. If you want to risk it, remove the file rdiff-backup-data/chars_to_quote.""" % (ctq_rp.path,)) | backed up onto it.""" % (suggested_ctq, actual_ctq, ctq_rp.path)) | def compare_ctq_file(self, rbdir, suggested_ctq): """Compare ctq file with suggested result, return actual ctq""" ctq_rp = rbdir.append("chars_to_quote") if not ctq_rp.lstat(): if Globals.chars_to_quote is None: actual_ctq = suggested_ctq else: actual_ctq = Globals.chars_to_quote ctq_rp.write_string(actual_ctq) return ... | c3d90b74fa5bc1d061aa989b3608052ab314e863 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/c3d90b74fa5bc1d061aa989b3608052ab314e863/fs_abilities.py |
if len(session_times) < session_num: | if len(session_times) <= session_num: | def time_from_session(session_num, rp = None): """Return time in seconds of given backup The current mirror is session_num 0, the next oldest increment has number 1, etc. Requires that the Globals.rbdir directory be set. """ session_times = Globals.rbdir.conn.restore.MirrorStruct \ .get_increment_times() session_tim... | af39d809a51b2726c1e75c767c10a51bb0250eba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/af39d809a51b2726c1e75c767c10a51bb0250eba/Time.py |
str_list.append(" Uname %s\n" % rorpath.getuname() or ":") | str_list.append(" Uname %s\n" % (rorpath.getuname() or ":")) | def RORP2Record(rorpath): """From RORPath, return text record of file's metadata""" str_list = ["File %s\n" % quote_path(rorpath.get_indexpath())] # Store file type, e.g. "dev", "reg", or "sym", and type-specific data type = rorpath.gettype() if type is None: type = "None" str_list.append(" Type %s\n" % type) if type... | 17c5eb9f41d611f71a5b165fed165ab4f6d75b79 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/17c5eb9f41d611f71a5b165fed165ab4f6d75b79/metadata.py |
str_list.append(" Gname %s\n" % rorpath.getgname() or ":") | str_list.append(" Gname %s\n" % (rorpath.getgname() or ":")) | def RORP2Record(rorpath): """From RORPath, return text record of file's metadata""" str_list = ["File %s\n" % quote_path(rorpath.get_indexpath())] # Store file type, e.g. "dev", "reg", or "sym", and type-specific data type = rorpath.gettype() if type is None: type = "None" str_list.append(" Type %s\n" % type) if type... | 17c5eb9f41d611f71a5b165fed165ab4f6d75b79 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/17c5eb9f41d611f71a5b165fed165ab4f6d75b79/metadata.py |
if data == ":": data_dict['uname'] = None | if data == ":" or data == 'None': data_dict['uname'] = None | def Record2RORP(record_string): """Given record_string, return RORPath For speed reasons, write the RORPath data dictionary directly instead of calling rorpath functions. Profiling has shown this to be a time critical function. """ data_dict = {} for field, data in line_parsing_regexp.findall(record_string): if fiel... | 17c5eb9f41d611f71a5b165fed165ab4f6d75b79 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/17c5eb9f41d611f71a5b165fed165ab4f6d75b79/metadata.py |
if data == ':': data_dict['gname'] = None | if data == ':' or data == 'None': data_dict['gname'] = None | def Record2RORP(record_string): """Given record_string, return RORPath For speed reasons, write the RORPath data dictionary directly instead of calling rorpath functions. Profiling has shown this to be a time critical function. """ data_dict = {} for field, data in line_parsing_regexp.findall(record_string): if fiel... | 17c5eb9f41d611f71a5b165fed165ab4f6d75b79 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/17c5eb9f41d611f71a5b165fed165ab4f6d75b79/metadata.py |
self.conn.os.utime(self.path, (accesstime, modtime)) self.data['atime'] = accesstime self.data['mtime'] = modtime | try: self.conn.os.utime(self.path, (accesstime, modtime)) except OverflowError: log.Log("Cannot change times of %s to %s - problem is probably" "64->32bit conversion" % (self.path, (accesstime, modtime)), 2) else: self.data['atime'] = accesstime self.data['mtime'] = modtime | def settime(self, accesstime, modtime): """Change file modification times""" log.Log("Setting time of %s to %d" % (self.path, modtime), 7) self.conn.os.utime(self.path, (accesstime, modtime)) self.data['atime'] = accesstime self.data['mtime'] = modtime | 8cf39d7e284d9327e8dacbfc1cd7a9d955cd7b77 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/8cf39d7e284d9327e8dacbfc1cd7a9d955cd7b77/rpath.py |
self.conn.os.utime(self.path, (long(time.time()), modtime)) self.data['mtime'] = modtime | try: self.conn.os.utime(self.path, (long(time.time()), modtime)) except OverflowError: log.Log("Cannot change mtime of %s to %s - problem is probably" "64->32bit conversion" % (self.path, modtime), 2) else: self.data['mtime'] = modtime | def setmtime(self, modtime): """Set only modtime (access time to present)""" log.Log(lambda: "Setting time of %s to %d" % (self.path, modtime), 7) self.conn.os.utime(self.path, (long(time.time()), modtime)) self.data['mtime'] = modtime | 8cf39d7e284d9327e8dacbfc1cd7a9d955cd7b77 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/8cf39d7e284d9327e8dacbfc1cd7a9d955cd7b77/rpath.py |
retvalparts.append('createDate:%d' % cfile['createDate']) | try: retvalparts.append('createDate:%d' % cfile['createDate']) except KeyError: log.Log("Writing pre-1.1.6 style metadata, without creation date", 9) | def carbonfile2string(cfile): """Convert CarbonFile data to a string suitable for storing.""" if not cfile: return "None" retvalparts = [] retvalparts.append('creator:%s' % binascii.hexlify(cfile['creator'])) retvalparts.append('type:%s' % binascii.hexlify(cfile['type'])) retvalparts.append('location:%d,%d' % cfile['lo... | c4a70ae0a405c96bddbbd5d54b7f7b10160ca54e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/c4a70ae0a405c96bddbbd5d54b7f7b10160ca54e/metadata.py |
if raw_rf: raw_rf.set_metadata_rorp(metadata_rorp) yield raw_rf else: | if not raw_rf: | def iterate_meta_rfs(mirror_rp, inc_rp): """Yield RegressFile objects with extra metadata information added Each RegressFile will have an extra object variable .metadata_rorp which will contain the metadata attributes of the mirror file at regress_time. """ raw_rfs = iterate_raw_rfs(mirror_rp, inc_rp) collated = rorp... | 78dc8c60f49284c35d13e88237ad571efb25ef9f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/78dc8c60f49284c35d13e88237ad571efb25ef9f/regress.py |
yield RegressFile(mirror_rp.new_index(metadata_rorp.index), inc_rp.new_index(metadata_rorp.index), ()) | continue raw_rf.set_metadata_rorp(metadata_rorp) yield raw_rf | def iterate_meta_rfs(mirror_rp, inc_rp): """Yield RegressFile objects with extra metadata information added Each RegressFile will have an extra object variable .metadata_rorp which will contain the metadata attributes of the mirror file at regress_time. """ raw_rfs = iterate_raw_rfs(mirror_rp, inc_rp) collated = rorp... | 78dc8c60f49284c35d13e88237ad571efb25ef9f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/78dc8c60f49284c35d13e88237ad571efb25ef9f/regress.py |
if rid.inc_list: print "/".join(rid.index) | if rid.inc_list: if not rid.index: path = "." else: path = "/".join(rid.index) print "%-11s: %s" % (determineChangeType(rid.inc_list), path) | def get_rids_recursive(rid): """Yield all the rids under rid that have inc newer than rest_time""" yield rid for sub_rid in Restore.yield_rids(rid, rest_time, mirror_time): for sub_sub_rid in get_rids_recursive(sub_rid): yield sub_sub_rid | 0ea1133dd2ccdd7837445581a24e5ca8ff473a92 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/0ea1133dd2ccdd7837445581a24e5ca8ff473a92/Main.py |
if Globals.get(attr) is not None: | if Globals.get(attr) is None: | def update_bool_global(attr, bool): """If bool is not None, update Globals.attr accordingly""" if Globals.get(attr) is not None: SetConnections.UpdateGlobal(attr, bool) | e916e92d61832ff4979e4be3e953b982e6371460 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/e916e92d61832ff4979e4be3e953b982e6371460/Main.py |
if Globals.get(attr) is not None: SetConnections.UpdateGlobal(attr, bool) | if Globals.get(attr) is None: SetConnections.UpdateGlobal(attr, bool) | def update_bool_global(attr, bool): """If bool is not None, update Globals.attr accordingly""" if Globals.get(attr) is not None: SetConnections.UpdateGlobal(attr, bool) | e916e92d61832ff4979e4be3e953b982e6371460 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/e916e92d61832ff4979e4be3e953b982e6371460/Main.py |
fp = RepoSide.rf_cache.get_fp(base_index + repo_rorp.index) | fp = RepoSide.rf_cache.get_fp(base_index + repo_rorp.index, repo_rorp) | def Verify(mirror_rp, inc_rp, verify_time): """Compute SHA1 sums of repository files and check against metadata""" assert mirror_rp.conn is Globals.local_connection repo_iter = RepoSide.init_and_get_iter(mirror_rp, inc_rp, verify_time) base_index = RepoSide.mirror_base.index bad_files = 0 for repo_rorp in repo_iter: i... | 9e035d032991ddbf80645135dc12ddd4ff3604d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/9e035d032991ddbf80645135dc12ddd4ff3604d4/compare.py |
mir_rorp.setfile(cls.rf_cache.get_fp(base_index + index)) | fp = cls.rf_cache.get_fp(base_index + index, mir_rorp) mir_rorp.setfile(fp) | def attach_files(cls, src_iter, mirror_rp, inc_rp, compare_time): """Attach data to all the files that need checking | 9e035d032991ddbf80645135dc12ddd4ff3604d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/9e035d032991ddbf80645135dc12ddd4ff3604d4/compare.py |
"unable to compare." % (index,), 2) | "unable to compare." % (mir_rorp.get_indexpath(),), 2) | def hashes_changed(src_rp, mir_rorp): """Return 0 if their data hashes same, 1 otherwise""" if not mir_rorp.has_sha1(): log.Log("Warning: Metadata file has no digest for %s, " "unable to compare." % (index,), 2) return 0 elif (src_rp.getsize() == mir_rorp.getsize() and hash.compute_sha1(src_rp) == mir_rorp.get_sha1()):... | 9e035d032991ddbf80645135dc12ddd4ff3604d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/9e035d032991ddbf80645135dc12ddd4ff3604d4/compare.py |
avoid this message by removing the rdiff_backup_data directory; | avoid this message by removing the rdiff-backup-data directory; | def checkdest_need_check(dest_rp): """Return None if no dest dir found, 1 if dest dir needs check, 0 o/w""" if not dest_rp.isdir() or not Globals.rbdir.isdir(): return None for filename in Globals.rbdir.listdir(): if filename not in ['chars_to_quote', 'backup.log']: break else: # This may happen the first backup just a... | a86b3e439df59ae6c97e443fac90dd62397c8042 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/a86b3e439df59ae6c97e443fac90dd62397c8042/Main.py |
the rdiff_backup_data directory because there is no important | the rdiff-backup-data directory because there is no important | def checkdest_need_check(dest_rp): """Return None if no dest dir found, 1 if dest dir needs check, 0 o/w""" if not dest_rp.isdir() or not Globals.rbdir.isdir(): return None for filename in Globals.rbdir.listdir(): if filename not in ['chars_to_quote', 'backup.log']: break else: # This may happen the first backup just a... | a86b3e439df59ae6c97e443fac90dd62397c8042 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/a86b3e439df59ae6c97e443fac90dd62397c8042/Main.py |
fsobj = FSSpec(self.path) | fsobj = FSSpec(rpath.path) | def carbonfile_get(rpath): """Return carbonfile value for local rpath""" from Carbon.File import FSSpec import MacOS try: fsobj = FSSpec(self.path) finderinfo = fsobj.FSpGetFInfo() cfile = {'creator': finderinfo.Creator, 'type': finderinfo.Type, 'location': finderinfo.Location, 'flags': finderinfo.Flags} return cfile e... | 204ddb563714d51ce910592f47548f903a01bac2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/204ddb563714d51ce910592f47548f903a01bac2/rpath.py |
(self.path,), 2) | (rpath.path,), 2) | def carbonfile_get(rpath): """Return carbonfile value for local rpath""" from Carbon.File import FSSpec import MacOS try: fsobj = FSSpec(self.path) finderinfo = fsobj.FSpGetFInfo() cfile = {'creator': finderinfo.Creator, 'type': finderinfo.Type, 'location': finderinfo.Location, 'flags': finderinfo.Flags} return cfile e... | 204ddb563714d51ce910592f47548f903a01bac2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/204ddb563714d51ce910592f47548f903a01bac2/rpath.py |
So here we assume all rdiff-backup events were recorded in "increments" increments, and if it's in-between we pick the older one here. """ global _rest_time base_incs = get_inclist(Globals.rbdir.append("increments")) if not base_incs: return _mirror_time inctimes = [inc.getinctime() for inc in base_incs] inctimes.appe... | So if restore_to_time is inbetween two increments, return the older one. """ inctimes = cls.get_increment_times() | def get_rest_time(cls, restore_to_time): """Return older time, if restore_to_time is in between two inc times | fb2e575f371d9d84b36d50d62d0102872d2fb0d8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/fb2e575f371d9d84b36d50d62d0102872d2fb0d8/restore.py |
elif action == 'test-server': pass | elif action == 'test-server' or action == 'calculate-average': pass | def check_action(): """Check to make sure action is compatible with args""" global action arg_action_dict = {0: ['server'], 1: ['list-increments', 'list-increment-sizes', 'remove-older-than', 'list-at-time', 'list-changed-since', 'check-destination-dir'], 2: ['backup', 'restore', 'restore-as-of', 'compare']} l = len(ar... | d9147b840c285d6e14847c4345989ba504e8906c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/d9147b840c285d6e14847c4345989ba504e8906c/Main.py |
log.Log.FatalError("Cannot get id for user or group name" | log.Log.FatalError("Cannot get id for user or group name " | def init_get_new_id(self, id_or_name): """Return id of id_or_name, failing if cannot. Used in __init__""" try: return int(id_or_name) except ValueError: try: id = self.name2id_func(id_or_name) except KeyError: log.Log.FatalError("Cannot get id for user or group name" + id_or_name) return id | 8af9b0377b9145307cd2a086eae1f38d7e0fde0c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/8af9b0377b9145307cd2a086eae1f38d7e0fde0c/user_group.py |
else: raise ParsingError("Unknown field in line '%s'" % line) | else: raise ParsingError("Unknown field in line '%s %s'" % (field, data)) | def Record2RORP(record_string): """Given record_string, return RORPath For speed reasons, write the RORPath data dictionary directly instead of calling rorpath functions. Profiling has shown this to be a time critical function. """ data_dict = {} for field, data in line_parsing_regexp.findall(record_string): if fiel... | 116c1209a0cae5b5009824bdc00ada09f9ae8e03 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/116c1209a0cae5b5009824bdc00ada09f9ae8e03/metadata.py |
try: id = int(qualifier) | try: uid = int(qualifier) | def text_to_entrytuple(self, text): """Return entrytuple given text like 'user:foo:r--'""" typetext, qualifier, permtext = text.split(':') if qualifier: try: id = int(qualifier) except ValueError: namepair = (None, qualifier) else: namepair = (uid, None) | edf68632dab8c73b2959a25dc8085fbdb1db887e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/edf68632dab8c73b2959a25dc8085fbdb1db887e/eas_acls.py |
Log.FatalError("Increment file %s does not exist" % src_path) | Log.FatalError("Increment file %s does not exist" % rpin.path) | def restore_check_paths(self, rpin, rpout): """Check paths and return pair of corresponding rps""" if not rpin.lstat(): Log.FatalError("Increment file %s does not exist" % src_path) if not rpin.isincfile(): Log.FatalError("""File %s does not look like an increment file. | 95ef4f2323889de805b635154a0b4342599216e2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/95ef4f2323889de805b635154a0b4342599216e2/main.py |
"foobar.2001-09-01T04:49:04-07:00.diff").""") | "foobar.2001-09-01T04:49:04-07:00.diff").""" % rpin.path) | def restore_check_paths(self, rpin, rpout): """Check paths and return pair of corresponding rps""" if not rpin.lstat(): Log.FatalError("Increment file %s does not exist" % src_path) if not rpin.isincfile(): Log.FatalError("""File %s does not look like an increment file. | 95ef4f2323889de805b635154a0b4342599216e2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/95ef4f2323889de805b635154a0b4342599216e2/main.py |
else: raise ParsingError("Unknown field in line '%s'" % line) | else: raise ParsingError("Unknown field in line '%s %s'" % (field, data)) | def Record2RORP(record_string): """Given record_string, return RORPath For speed reasons, write the RORPath data dictionary directly instead of calling rorpath functions. Profiling has shown this to be a time critical function. """ data_dict = {} for field, data in line_parsing_regexp.findall(record_string): if fiel... | 1b47cf8e32be8aa0da51ab1fe058270ca0c73144 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/1b47cf8e32be8aa0da51ab1fe058270ca0c73144/metadata.py |
assert dest_rp.isreg() dest_sig.setfile(Rdiff.get_signature(dest_rp)) | if dest_rp.isreg(): dest_sig.setfile(Rdiff.get_signature(dest_rp)) else: dest_sig = dest_rp.getRORPath() | def get_one_sig(cls, dest_base_rpath, index, src_rorp, dest_rorp): """Return a signature given source and destination rorps""" if (Globals.preserve_hardlinks and Hardlink.islinked(src_rorp or dest_rorp)): dest_sig = rpath.RORPath(index) dest_sig.flaglinked(Hardlink.get_link_index(dest_sig)) elif dest_rorp: dest_sig = d... | e4c6dcce85ad42231f80532e5e72742de00ed016 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/e4c6dcce85ad42231f80532e5e72742de00ed016/backup.py |
def get_rf(self, index): | def get_rf(self, index, mir_rorp = None): | def get_rf(self, index): """Get a RestoreFile for given index, or None""" while 1: if not self.rf_list: if not self.add_rfs(index): return None rf = self.rf_list[0] if rf.index == index: if Globals.process_uid != 0: self.perm_changer(index) return rf elif rf.index > index: # Try to add earlier indicies. But if first i... | e6698c92cb905f1cb657aec0ceca13ade2e8bb3c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/e6698c92cb905f1cb657aec0ceca13ade2e8bb3c/restore.py |
if not self.add_rfs(index): return None | if not self.add_rfs(index, mir_rorp): return None | def get_rf(self, index): """Get a RestoreFile for given index, or None""" while 1: if not self.rf_list: if not self.add_rfs(index): return None rf = self.rf_list[0] if rf.index == index: if Globals.process_uid != 0: self.perm_changer(index) return rf elif rf.index > index: # Try to add earlier indicies. But if first i... | e6698c92cb905f1cb657aec0ceca13ade2e8bb3c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/e6698c92cb905f1cb657aec0ceca13ade2e8bb3c/restore.py |
if Globals.process_uid != 0: self.perm_changer(index) | if Globals.process_uid != 0: self.perm_changer(index, mir_rorp) | def get_rf(self, index): """Get a RestoreFile for given index, or None""" while 1: if not self.rf_list: if not self.add_rfs(index): return None rf = self.rf_list[0] if rf.index == index: if Globals.process_uid != 0: self.perm_changer(index) return rf elif rf.index > index: # Try to add earlier indicies. But if first i... | e6698c92cb905f1cb657aec0ceca13ade2e8bb3c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/e6698c92cb905f1cb657aec0ceca13ade2e8bb3c/restore.py |
self.add_rfs(index)): return None | self.add_rfs(index, mir_rorp)): return None | def get_rf(self, index): """Get a RestoreFile for given index, or None""" while 1: if not self.rf_list: if not self.add_rfs(index): return None rf = self.rf_list[0] if rf.index == index: if Globals.process_uid != 0: self.perm_changer(index) return rf elif rf.index > index: # Try to add earlier indicies. But if first i... | e6698c92cb905f1cb657aec0ceca13ade2e8bb3c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/e6698c92cb905f1cb657aec0ceca13ade2e8bb3c/restore.py |
rf = longname.update_rf(self.get_rf(index), mir_rorp, | rf = longname.update_rf(self.get_rf(index, mir_rorp), mir_rorp, | def get_fp(self, index, mir_rorp): """Return the file object (for reading) of given index""" rf = longname.update_rf(self.get_rf(index), mir_rorp, self.root_rf.mirror_rp) if not rf: log.Log("Error: Unable to retrieve data for file %s!\nThe " "cause is probably data loss from the backup repository." % (index and "/".joi... | e6698c92cb905f1cb657aec0ceca13ade2e8bb3c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/e6698c92cb905f1cb657aec0ceca13ade2e8bb3c/restore.py |
def add_rfs(self, index): | def add_rfs(self, index, mir_rorp = None): | def add_rfs(self, index): """Given index, add the rfs in that same directory | e6698c92cb905f1cb657aec0ceca13ade2e8bb3c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/e6698c92cb905f1cb657aec0ceca13ade2e8bb3c/restore.py |
def __call__(self, index): | def __call__(self, index, mir_rorp = None): | def __call__(self, index): """Given rpath, change permissions up to and including index""" old_index = self.current_index self.current_index = index if not index or index <= old_index: return self.restore_old(index) self.add_new(old_index, index) | e6698c92cb905f1cb657aec0ceca13ade2e8bb3c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/e6698c92cb905f1cb657aec0ceca13ade2e8bb3c/restore.py |
assert (RPath(self.lc, self.mainprefix, ("sampledir",)).listdir() == ["1", "2", "3", "4"]) | dirlist = RPath(self.lc, self.mainprefix, ("sampledir",)).listdir() dirlist.sort() assert dirlist == ["1", "2", "3", "4"], dirlist | def testListdir(self): """Checking dir listings""" assert (RPath(self.lc, self.mainprefix, ("sampledir",)).listdir() == ["1", "2", "3", "4"]) | d5c39cd22ae5e2cff511ca4d4d0b4d17ea290f6c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/d5c39cd22ae5e2cff511ca4d4d0b4d17ea290f6c/rpathtest.py |
rf = self.rf_list.pop(0) if rf.index < index: continue elif rf.index == index: return rf self.rf_list.insert(0, rf) if not self.add_rfs(index): return None | rf = self.rf_list[0] if rf.index == index: return rf elif rf.index > index: if (index[:-1] == rf.index[:-1] or not self.add_rfs(index)): return None else: del self.rf_list[0] | def get_rf(self, index): """Return RestoreFile of given index, or None""" while 1: if not self.rf_list: if not self.add_rfs(index): return None rf = self.rf_list.pop(0) if rf.index < index: continue elif rf.index == index: return rf self.rf_list.insert(0, rf) if not self.add_rfs(index): return None | eacfbbb5720bc0f05164146cb64c6520fed5f595 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/eacfbbb5720bc0f05164146cb64c6520fed5f595/restore.py |
Log("Source may have carbonfile support, but support defaults to " "off.\n Use --carbonfile to enable.", 5) | log.Log("Source may have carbonfile support, but support " "defaults to off.\n Use --carbonfile to enable.", 5) | def set_carbonfile(self): self.update_triple(self.src_fsa.carbonfile, self.dest_fsa.carbonfile, ('carbonfile_active', 'carbonfile_write', 'carbonfile_conn')) if self.src_fsa.carbonfile and not Globals.carbonfile_active: Log("Source may have carbonfile support, but support defaults to " "off.\n Use --carbonfile to enab... | 5e1d50c457bca53a0ea2b3ac1de2c7abc816442b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/5e1d50c457bca53a0ea2b3ac1de2c7abc816442b/fs_abilities.py |
rp.conn.xattr.removexattr(rp.path, name) | try: rp.conn.xattr.removexattr(rp.path, name) except IOError, exc: if exc[0] == errno.EACCES: log.Log("Warning: unable to remove xattr %s from %s" % (name, rp.path), 7) continue else: raise | def clear_rp(self, rp): """Delete all the extended attributes in rpath""" for name in rp.conn.xattr.listxattr(rp.path): rp.conn.xattr.removexattr(rp.path, name) | b519ea3f3fe35249c4516098751d7b0e57e1c509 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/b519ea3f3fe35249c4516098751d7b0e57e1c509/eas_acls.py |
if not self.src_fsa.case_sensitive and self.dest_fsa.case_sensitive: | if self.src_fsa.case_sensitive and not self.dest_fsa.case_sensitive: | def get_ctq_from_fsas(self): """Determine chars_to_quote just from filesystems, no ctq file""" if not self.src_fsa.case_sensitive and self.dest_fsa.case_sensitive: if self.dest_fsa.extended_filenames: return "A-Z;" # Quote upper case and quoting char else: return "^a-z0-9_ -." # quote everything but basic chars | 8014229a0a90a51ada4bc9194ccb90e6301ca701 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/8014229a0a90a51ada4bc9194ccb90e6301ca701/fs_abilities.py |
except os.error: shutil.rmtree(self.path) | except os.error: if Globals.fsync_directories: self.fsync() self.conn.shutil.rmtree(self.path) | def delete(self): """Delete file at self.path. Recursively deletes directories.""" log.Log("Deleting %s" % self.path, 7) if self.isdir(): try: self.rmdir() except os.error: shutil.rmtree(self.path) else: self.conn.os.unlink(self.path) self.setdata() | b2e75777e1081c89ebe160332b55fbfc6508f36b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/b2e75777e1081c89ebe160332b55fbfc6508f36b/rpath.py |
elif dest_sig.isreg() and src_rp.isreg(): attach_diff(diff_rorp, src_rp, dest_sig) | def attach_diff(diff_rorp, src_rp, dest_sig): """Attach file of diff to diff_rorp, w/ error checking""" fileobj = robust.check_common_error( error_handler, Rdiff.get_delta_sigrp_hash, (dest_sig, src_rp)) if fileobj: diff_rorp.setfile(fileobj) diff_rorp.set_attached_filetype('diff') else: diff_rorp.zero() diff_rorp.set_... | 646dcef87611e3111ac52a612e7a0653b9433ca3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/646dcef87611e3111ac52a612e7a0653b9433ca3/backup.py | |
attach_snapshot(diff_rorp, src_rp) | if dest_sig.isreg(): attach_diff(diff_rorp, src_rp, dest_sig) else: attach_snapshot(diff_rorp, src_rp) else: | def attach_diff(diff_rorp, src_rp, dest_sig): """Attach file of diff to diff_rorp, w/ error checking""" fileobj = robust.check_common_error( error_handler, Rdiff.get_delta_sigrp_hash, (dest_sig, src_rp)) if fileobj: diff_rorp.setfile(fileobj) diff_rorp.set_attached_filetype('diff') else: diff_rorp.zero() diff_rorp.set_... | 646dcef87611e3111ac52a612e7a0653b9433ca3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/646dcef87611e3111ac52a612e7a0653b9433ca3/backup.py |
else: diff_rorp.set_attached_filetype('snapshot') | diff_rorp.set_attached_filetype('snapshot') | def attach_diff(diff_rorp, src_rp, dest_sig): """Attach file of diff to diff_rorp, w/ error checking""" fileobj = robust.check_common_error( error_handler, Rdiff.get_delta_sigrp_hash, (dest_sig, src_rp)) if fileobj: diff_rorp.setfile(fileobj) diff_rorp.set_attached_filetype('diff') else: diff_rorp.zero() diff_rorp.set_... | 646dcef87611e3111ac52a612e7a0653b9433ca3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/646dcef87611e3111ac52a612e7a0653b9433ca3/backup.py |
rp = subdir.append(filename) try: rp.touch() except IOError: | try: rp = subdir.append(filename) rp.touch() except (IOError, OSError): | def supports_unusual_chars(): """Test handling of several chars sometimes not supported""" for filename in [':', '\\', chr(175)]: rp = subdir.append(filename) try: rp.touch() except IOError: assert not rp.lstat() return 0 assert rp.lstat() rp.delete() return 1 | 7dd7b07ef6d00f170495d0c9a9ac5e363eb27e8e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/7dd7b07ef6d00f170495d0c9a9ac5e363eb27e8e/fs_abilities.py |
assert rp.lstat() rp.delete() | else: assert rp.lstat() rp.delete() | def supports_unusual_chars(): """Test handling of several chars sometimes not supported""" for filename in [':', '\\', chr(175)]: rp = subdir.append(filename) try: rp.touch() except IOError: assert not rp.lstat() return 0 assert rp.lstat() rp.delete() return 1 | 7dd7b07ef6d00f170495d0c9a9ac5e363eb27e8e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/7dd7b07ef6d00f170495d0c9a9ac5e363eb27e8e/fs_abilities.py |
rf = self.rf_list.pop(0) if rf.index < index: continue elif rf.index == index: return rf self.rf_list.insert(0, rf) if not self.add_rfs(index): return None | rf = self.rf_list[0] if rf.index == index: return rf elif rf.index > index: if (index[:-1] == rf.index[:-1] or not self.add_rfs(index)): return None else: del self.rf_list[0] | def get_rf(self, index): """Return RestoreFile of given index, or None""" while 1: if not self.rf_list: if not self.add_rfs(index): return None rf = self.rf_list.pop(0) if rf.index < index: continue elif rf.index == index: return rf self.rf_list.insert(0, rf) if not self.add_rfs(index): return None | f17ad6ac2f9c3b73c3c7212a64b31589360bcf54 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/f17ad6ac2f9c3b73c3c7212a64b31589360bcf54/restore.py |
def test_acl_quoting2(self): """This string used to segfault the quoting code, try now""" s = '\xd8\xab\xb1Wb\xae\xc5]\x8a\xbb\x15v*\xf4\x0f!\xf9>\xe2Y\x86\xbb\xab\xdbp\xb0\x84\x13k\x1d\xc2\xf1\xf5e\xa5U\x82\x9aUV\xa0\xf4\xdf4\xba\xfdX\x03\x82\x07s\xce\x9e\x8b\xb34\x04\x9f\x17 \xf4\x8f\xa6\xfa\x97\xab\xd8\xac\xda\x85\... | def test_acl_quoting(self): """Test the acl_quote and acl_unquote functions""" assert C.acl_quote('foo') == 'foo', C.acl_quote('foo') assert C.acl_quote('\n') == '\\012', C.acl_quote('\n') assert C.acl_unquote('\\012') == '\n' s = '\\\n\t\145\n\01==' assert C.acl_unquote(C.acl_quote(s)) == s | 87ea59184ea503de5efc5c3a2ee5e0664ba66d5e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/87ea59184ea503de5efc5c3a2ee5e0664ba66d5e/ctest.py | |
log.FatalError("Error '%s' reading mapping file '%s'" % | Log.FatalError("Error '%s' reading mapping file '%s'" % | def get_string_from_file(filename): if not filename: return None rp = rpath.RPath(Globals.local_connection, filename) try: return rp.get_data() except OSError, e: log.FatalError("Error '%s' reading mapping file '%s'" % (str(e), filename)) | 2798d44530db340111ff64c9375163c31f84aab0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/2798d44530db340111ff64c9375163c31f84aab0/Main.py |
datadir = self.li_getdatadir(rootrp, """Unable to open rdiff-backup-data dir. Try finding the increments first using --list-increments.""") | datadir = rootrp.append("rdiff-backup-data") if not datadir.lstat() or not datadir.isdir(): Log.FatalError("Unable to open rdiff-backup-data dir %s" % (datadir.path,)) | def RemoveOlderThan(self, rootrp): """Remove all increment files older than a certain time""" datadir = self.li_getdatadir(rootrp, """Unable to open rdiff-backup-data dir. | 18b35d40dca82f3b25cb4f2296b5b59af3ee43d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/18b35d40dca82f3b25cb4f2296b5b59af3ee43d5/main.py |
incobjs = filter(lambda x: x.time < time, Manage.get_incobjs(datadir)) incobjs_time = ", ".join(map(IncObj.pretty_time, incobjs)) if not incobjs: | itimes = [Time.stringtopretty(inc.getinctime()) for inc in Restore.get_inclist(datadir.append("increments")) if Time.stringtotime(inc.getinctime()) < time] if not itimes: | def RemoveOlderThan(self, rootrp): """Remove all increment files older than a certain time""" datadir = self.li_getdatadir(rootrp, """Unable to open rdiff-backup-data dir. | 18b35d40dca82f3b25cb4f2296b5b59af3ee43d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/18b35d40dca82f3b25cb4f2296b5b59af3ee43d5/main.py |
elif len(incobjs) > 1 and not self.force: Log.FatalError("Found %d relevant increments, dated %s.\n" "If you want to delete multiple increments in this way, " "use the --force." % (len(incobjs), incobjs_time)) Log("Deleting increment%sat %s" % (len(incobjs) == 1 and " " or "s ", incobjs_time), 3) | inc_pretty_time = "\n".join(itimes) if len(itimes) > 1 and not self.force: Log.FatalError("Found %d relevant increments, dated:\n%s" "\nIf you want to delete multiple increments in this way, " "use the --force." % (len(itimes), inc_pretty_time)) Log("Deleting increment%sat times:\n%s" % (len(itimes) == 1 and " " or "s... | def RemoveOlderThan(self, rootrp): """Remove all increment files older than a certain time""" datadir = self.li_getdatadir(rootrp, """Unable to open rdiff-backup-data dir. | 18b35d40dca82f3b25cb4f2296b5b59af3ee43d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/18b35d40dca82f3b25cb4f2296b5b59af3ee43d5/main.py |
log.Log.FatalError("""New quoting requirements! | if Globals.chars_to_quote is None: log.Log.FatalError("""New quoting requirements! | def compare_ctq_file(self, rbdir, suggested_ctq): """Compare ctq file with suggested result, return actual ctq""" ctq_rp = rbdir.append("chars_to_quote") if not ctq_rp.lstat(): if Globals.chars_to_quote is None: actual_ctq = suggested_ctq else: actual_ctq = Globals.chars_to_quote ctq_rp.write_string(actual_ctq) return ... | ab09b43df9a8f2075ac8a2435ce0d160ba72c513 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/ab09b43df9a8f2075ac8a2435ce0d160ba72c513/fs_abilities.py |
else: log.Log.FatalError("""New quoting requirements | elif Globals.chars_to_quote is None: log.Log.FatalError("""New quoting requirements | def write_new_chars(): """Replace old chars_to_quote file with new value""" if ctq_rp.lstat(): ctq_rp.delete() fp = ctq_rp.open("wb") fp.write(self.chars_to_quote) assert not fp.close() | 5dcd45bcfc42754c39f755e155b226c4ae000860 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/5dcd45bcfc42754c39f755e155b226c4ae000860/fs_abilities.py |
"/../rdiff-backup -v3 --no-compare-inode " | "/../rdiff-backup -v9 --no-compare-inode " | def reset_schema(self): self.rb_schema = (SourceDir + "/../rdiff-backup -v3 --no-compare-inode " "--remote-schema './chdir-wrapper2 %s' ") | e59c00b9121e246f39d1583be4c6f6ea5b500b1e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/e59c00b9121e246f39d1583be4c6f6ea5b500b1e/finaltest.py |
for sub_rf in rf.yield_sub_rfs(): yield sub_rf.get_attribs() | for sub_rf in rf.yield_sub_rfs(): for attribs in cls.get_rorp_iter_from_rf(sub_rf): yield attribs | def get_rorp_iter_from_rf(cls, rf): """Recursively yield mirror rorps from rf""" rorp = rf.get_attribs() yield rorp if rorp.isdir(): for sub_rf in rf.yield_sub_rfs(): yield sub_rf.get_attribs() | 162e440e281af7b77ec07b5ffe88ad690d2aeae3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/162e440e281af7b77ec07b5ffe88ad690d2aeae3/restore.py |
if time.daylight: utc_in_secs = time.mktime(timetuple) - time.altzone | if dst_in_effect: utc_in_secs = time.mktime(timetuple) - time.altzone | def stringtotime(timestring): """Return time in seconds from w3 timestring If there is an error parsing the string, or it doesn't look like a w3 datetime string, return None. """ try: date, daytime = timestring[:19].split("T") year, month, day = map(int, date.split("-")) hour, minute, second = map(int, daytime.split(... | a56f43b0d6bbaf821a12f0a4d7108b9e856b1472 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/a56f43b0d6bbaf821a12f0a4d7108b9e856b1472/Time.py |
if time.daylight: offset = -1 * time.altzone/60 else: offset = -1 * time.timezone/60 | if dst_in_effect: offset = -time.altzone/60 else: offset = -time.timezone/60 | def gettzd(): """Return w3's timezone identification string. Expresed as [+/-]hh:mm. For instance, PST is -08:00. Zone is coincides with what localtime(), etc., use. """ if time.daylight: offset = -1 * time.altzone/60 else: offset = -1 * time.timezone/60 if offset > 0: prefix = "+" elif offset < 0: prefix = "-" els... | a56f43b0d6bbaf821a12f0a4d7108b9e856b1472 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/a56f43b0d6bbaf821a12f0a4d7108b9e856b1472/Time.py |
elif ((key == 'uname' or key == 'gname') and not other.data.has_key(key)): pass | elif key == 'uname' or key == 'gname': other_name = other.data.get(key, None) if (other_name and other_name != "None" and other_name != self.data[key]): return None | def __eq__(self, other): """True iff the two rorpaths are equivalent""" if self.index != other.index: return None | e31c9faf8c5d8f3a22e0821c9d1da325a362b54e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/e31c9faf8c5d8f3a22e0821c9d1da325a362b54e/rpath.py |
if self.data[key] != other.data[key]: return None | if self.data[key] != other_val: return None | def __eq__(self, other): """True iff the two rorpaths are equivalent""" if self.index != other.index: return None | e31c9faf8c5d8f3a22e0821c9d1da325a362b54e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/e31c9faf8c5d8f3a22e0821c9d1da325a362b54e/rpath.py |
"rdiff-with --check-destination-dir option to revert directory " | "with --check-destination-dir option to revert directory " | def restore_check_backup_dir(mirror_root, src_rp = None, restore_as_of = 1): """Make sure backup dir root rpin is in consistent state""" if not restore_as_of and not src_rp.isincfile(): Log.FatalError("""File %s does not look like an increment file. | 88878c64a8dc1bce2e6b71451725ab35a3333685 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/88878c64a8dc1bce2e6b71451725ab35a3333685/Main.py |
collated, Globals.pipeline_max_length*4) | collated, Globals.pipeline_max_length*4, baserp) | def set_rorp_cache(cls, baserp, source_iter, for_increment): """Initialize cls.CCPP, the destination rorp cache | f453ac989bfb06aef10cb79e38881ac932f725b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/f453ac989bfb06aef10cb79e38881ac932f725b5/backup.py |
"""Cache a collated iter of (source_rorp, dest_rp) pairs | """Cache a collated iter of (source_rorp, dest_rorp) pairs | def patch_and_increment(cls, dest_rpath, source_diffiter, inc_rpath): """Patch dest_rpath with rorpiter of diffs and write increments""" ITR = rorpiter.IterTreeReducer(IncrementITRB, [dest_rpath, inc_rpath, cls.CCPP]) for diff in rorpiter.FillInIter(source_diffiter, dest_rpath): log.Log("Processing changed file " + dif... | f453ac989bfb06aef10cb79e38881ac932f725b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/f453ac989bfb06aef10cb79e38881ac932f725b5/backup.py |
def __init__(self, collated_iter, cache_size): | def __init__(self, collated_iter, cache_size, dest_root_rp): | def __init__(self, collated_iter, cache_size): """Initialize new CCWP.""" self.iter = collated_iter # generates (source_rorp, dest_rorp) pairs self.cache_size = cache_size self.statfileobj = statistics.init_statfileobj() if Globals.file_statistics: statistics.FileStats.init() metadata.OpenMetadata() | f453ac989bfb06aef10cb79e38881ac932f725b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/f453ac989bfb06aef10cb79e38881ac932f725b5/backup.py |
cmdlist = ['mknod', self.path, type, str(major), str(minor)] if self.conn.os.spawnvp(os.P_WAIT, 'mknod', cmdlist) != 0: raise RPathException("Error running %s" % cmdlist) if type == 'c': datatype = 'chr' elif type == 'b': datatype = 'blk' | if type == 'c': datatype = 'chr' mode = stat.S_IFCHR | 0600 elif type == 'b': datatype = 'blk' mode = stat.S_IFBLK | 0600 | def makedev(self, type, major, minor): """Make a special file with specified type, and major/minor nums""" cmdlist = ['mknod', self.path, type, str(major), str(minor)] if self.conn.os.spawnvp(os.P_WAIT, 'mknod', cmdlist) != 0: raise RPathException("Error running %s" % cmdlist) if type == 'c': datatype = 'chr' elif type... | 1faae540acbe40287d0c84734da3430a89ec35b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/1faae540acbe40287d0c84734da3430a89ec35b4/rpath.py |
assert conn.pow(2,3) == 8 assert conn.os.path.join("a", "b") == "a/b" version = conn.reval("lambda: Globals.version") | assert conn.Globals.get('current_time') is None assert type(conn.os.getuid()) is int version = conn.Globals.get('version') | def test_connection(conn_number): """Test connection. conn_number 0 is the local connection""" print "Testing server started by: ", __conn_remote_cmds[conn_number] conn = Globals.connections[conn_number] try: assert conn.pow(2,3) == 8 assert conn.os.path.join("a", "b") == "a/b" version = conn.reval("lambda: Globals.ve... | a5b72ab2b18c1f9e36f2d5fc6177308a3268eaae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/a5b72ab2b18c1f9e36f2d5fc6177308a3268eaae/SetConnections.py |
elif key == 'devloc' or key == 'nlink': pass | elif key == 'nlink': pass | def __eq__(self, other): """True iff the two rorpaths are equivalent""" if self.index != other.index: return None | 7612e55739b00816ddd1d71ef1a14cb28c1490e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/7612e55739b00816ddd1d71ef1a14cb28c1490e6/rpath.py |
elif (key == 'inode' and | elif ((key == 'inode' or key == 'devloc') and | def __eq__(self, other): """True iff the two rorpaths are equivalent""" if self.index != other.index: return None | 7612e55739b00816ddd1d71ef1a14cb28c1490e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/7612e55739b00816ddd1d71ef1a14cb28c1490e6/rpath.py |
"""Equal if all attributes and index are equal""" | """Equal if all attributes are equal""" | def __eq__(self, ea): """Equal if all attributes and index are equal""" assert isinstance(ea, ExtendedAttributes) return ea.index == self.index and ea.attr_dict == self.attr_dict | ed018f06a8deec3624aca62bffd5ef904557029d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/ed018f06a8deec3624aca62bffd5ef904557029d/eas_acls.py |
return ea.index == self.index and ea.attr_dict == self.attr_dict | return ea.attr_dict == self.attr_dict | def __eq__(self, ea): """Equal if all attributes and index are equal""" assert isinstance(ea, ExtendedAttributes) return ea.index == self.index and ea.attr_dict == self.attr_dict | ed018f06a8deec3624aca62bffd5ef904557029d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/ed018f06a8deec3624aca62bffd5ef904557029d/eas_acls.py |
if self.index != acl.index: return 0 | def __eq__(self, acl): """Compare self and other access control list | ed018f06a8deec3624aca62bffd5ef904557029d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/ed018f06a8deec3624aca62bffd5ef904557029d/eas_acls.py | |
if self.index != acl.index: print "index %s not equal to index %s" % (self.index, acl.index) return 0 | def eq_verbose(self, acl): """Returns same as __eq__ but print explanation if not equal""" if self.index != acl.index: print "index %s not equal to index %s" % (self.index, acl.index) return 0 if not self.cmp_entry_list(self.entry_list, acl.entry_list): print "ACL entries for %s compare differently" % (self.index,) ret... | ed018f06a8deec3624aca62bffd5ef904557029d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/ed018f06a8deec3624aca62bffd5ef904557029d/eas_acls.py | |
def ListAtTime(mirror_rp, inc_rp, time): """List the files in archive at the given time Output is a RORP Iterator with info in index. See ListChangedSince. """ assert mirror_rp.conn is Globals.local_connection, "Run locally only" MirrorStruct.set_mirror_and_rest_times(time) MirrorStruct.initialize_rf_cache(mirror_rp... | 81065bd1ac2a806c81fb61202de24f8cd88d6c28 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/81065bd1ac2a806c81fb61202de24f8cd88d6c28/restore.py | ||
So here we assume all rdiff-backup events were recorded in "increments" increments, and if it's in-between we pick the older one here. | So if restore_to_time is inbetween two increments, return the older one. | def get_rest_time(cls, restore_to_time): """Return older time, if restore_to_time is in between two inc times | 81065bd1ac2a806c81fb61202de24f8cd88d6c28 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/81065bd1ac2a806c81fb61202de24f8cd88d6c28/restore.py |
"""Return list of times of backups, including current mirror""" if not _mirror_time: return_list = [cls.get_mirror_time()] else: return_list = [_mirror_time] | """Return list of times of backups, including current mirror Take the total list of times from the increments.<time>.dir file and the mirror_metadata file. Sorted ascending. """ if not _mirror_time: d = {cls.get_mirror_time(): None} else: d = {_mirror_time: None} | def get_increment_times(cls, rp = None): """Return list of times of backups, including current mirror""" if not _mirror_time: return_list = [cls.get_mirror_time()] else: return_list = [_mirror_time] if not rp or not rp.index: rp = Globals.rbdir.append("increments") for inc in get_inclist(rp): return_list.append(inc.get... | 81065bd1ac2a806c81fb61202de24f8cd88d6c28 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/81065bd1ac2a806c81fb61202de24f8cd88d6c28/restore.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.