bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
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) | 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) | 32,400 |
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() | def__init__(self,capability,name=None,config=None):self._client=Noneself._msgbuf=Noneself._exit_status=_prelude.PRELUDE_CLIENT_EXIT_STATUS_FAILUREifnotname:name=sys.argv[0]self._client=_prelude.prelude_client_new(capability)ifnotself._client:raiseClientError() | 32,401 |
def set_success(self): self._exit_status = _prelude.PRELUDE_CLIENT_EXIST_STATUS_SUCCESS | def set_success(self): self._exit_status = _prelude.PRELUDE_CLIENT_EXIST_STATUS_SUCCESS | 32,402 |
def set_failure(self): self._exit_status = _prelude.PRELUDE_CLIENT_EXIST_STATUS_FAILURE | def set_failure(self): self._exit_status = _prelude.PRELUDE_CLIENT_EXIT_STATUS_FAILURE | 32,403 |
def __del__(self): #print "Client.__del__" if self._msgbuf: _prelude.prelude_msgbuf_close(self._msgbuf) #self._msgbuf = None | def __del__(self): #print "Client.__del__"if self._msgbuf: _prelude.prelude_msgbuf_close(self._msgbuf) #self._msgbuf = None | 32,404 |
def __del__(self): #print "Client.__del__" if self._msgbuf: _prelude.prelude_msgbuf_close(self._msgbuf) #self._msgbuf = None | def __del__(self): #print "Client.__del__" if self._msgbuf: _prelude.prelude_msgbuf_close(self._msgbuf) #self._msgbuf = None | 32,405 |
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 ... | 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 ... | 32,406 |
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... | 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... | 32,407 |
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 | def maintainence_price(addMarkup = True): "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 | 32,408 |
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 | def maintainence_price(): "Calculate the price of maintainence" price = float(maintainenceCost[1]) / float(maintainenceCost[0]) price = price if addMarkup: price = addPercent(price, markup) return price | 32,409 |
def cmdITIME(self, source, name): """Synonym, of BEAT See: BEAT """ | def cmdITIME(self, source): """Synonym, of BEAT See: BEAT """ | 32,410 |
def onMESSAGE(self, source, target, message): | def onMESSAGE(self, source, target, message): | 32,411 |
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... | def doHOST(self, source, target, host): if re.search('[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+', host): if source[0] == target: msg = "Hostname: %s" + name else: msg = "%s, Hostname: %s" % (source[0], name) else: if source[0] == target: msg = 'IP: ' + socket.gethostbyname(host) else: msg = source[0] + ', IP: ' + socket.gethostby... | 32,412 |
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... | 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: %s" % name else: msg = "%s, IP: %s" % (source... | 32,413 |
def sighndl(sig, stack): win.show() | defwin.show() sighndl(sig,win.show() stack):win.show() win.show() | 32,414 |
def query(self, query, callback): """execute a query and call callback on all the results, in the correct order. | def query(self, query, callback): """execute a query and call callback on all the results, in the correct order. | 32,415 |
def query(self, query, callback): """execute a query and call callback on all the results, in the correct order. | def query(self, query, callback): """execute a query and call callback on all the results, in the correct order. | 32,416 |
def __parse_results(self, cursor, callback, sofar=None): """Call callback on all the results, in the correct order. | def __parse_results(self, cursor, callback, sofar=None): """Call callback on all the results, in the correct order. | 32,417 |
def testListdir(self): """Checking dir listings""" assert (RPath(self.lc, self.mainprefix, ("sampledir",)).listdir() == ["1", "2", "3", "4"]) | def testListdir(self): """Checking dir listings""" assert (RPath(self.lc, self.mainprefix, ("sampledir",)).listdir() == ["1", "2", "3", "4"]) | 32,418 |
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 ... | 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 ... | 32,419 |
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... | 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 rf.meta... | 32,420 |
def set_extended_filenames(self, subdir): """Set self.extended_filenames by trying to write a path""" assert not self.read_only | def set_extended_filenames(self, subdir): """Set self.extended_filenames by trying to write a path""" assert not self.read_only | 32,421 |
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 ... | 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 ... | 32,422 |
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 ... | 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 ... | 32,423 |
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... | 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... | 32,424 |
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... | 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... | 32,425 |
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... | 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... | 32,426 |
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... | 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... | 32,427 |
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... | 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... | 32,428 |
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 | 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 | 32,429 |
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 | 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 | 32,430 |
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... | 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... | 32,431 |
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... | 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... | 32,432 |
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... | 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... | 32,433 |
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 | 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 | 32,434 |
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) | def update_bool_global(attr, bool): """If bool is not None, update Globals.attr accordingly""" if Globals.get(attr) is None: SetConnections.UpdateGlobal(attr, bool) | 32,435 |
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) | 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) | 32,436 |
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... | 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... | 32,437 |
def attach_files(cls, src_iter, mirror_rp, inc_rp, compare_time): """Attach data to all the files that need checking | def attach_files(cls, src_iter, mirror_rp, inc_rp, compare_time): """Attach data to all the files that need checking | 32,438 |
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()):... | 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." % (mir_rorp.get_indexpath(),), 2) return 0 elif (src_rp.getsize() == mir_rorp.getsize() and hash.compute_sha1(src_rp) == mi... | 32,439 |
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... | 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... | 32,440 |
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... | 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... | 32,441 |
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... | def carbonfile_get(rpath): """Return carbonfile value for local rpath""" from Carbon.File import FSSpec import MacOS try: fsobj = FSSpec(rpath.path) finderinfo = fsobj.FSpGetFInfo() cfile = {'creator': finderinfo.Creator, 'type': finderinfo.Type, 'location': finderinfo.Location, 'flags': finderinfo.Flags} return cfile ... | 32,442 |
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... | 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... | 32,443 |
def get_rest_time(cls, restore_to_time): """Return older time, if restore_to_time is in between two inc times | def get_rest_time(cls, restore_to_time): """Return older time, if restore_to_time is in between two inc times | 32,444 |
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... | 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... | 32,445 |
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 | 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 | 32,446 |
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... | 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... | 32,447 |
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) | def text_to_entrytuple(self, text): """Return entrytuple given text like 'user:foo:r--'""" typetext, qualifier, permtext = text.split(':') if qualifier: try: uid = int(qualifier) except ValueError: namepair = (None, qualifier) else: namepair = (uid, None) | 32,448 |
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. | 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" % rpin.path) if not rpin.isincfile(): Log.FatalError("""File %s does not look like an increment file. | 32,449 |
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. | 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. | 32,450 |
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... | 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... | 32,451 |
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... | 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... | 32,452 |
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... | def get_rf(self, index, mir_rorp = None): """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... | 32,453 |
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... | 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, mir_rorp): 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 ... | 32,454 |
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... | 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, mir_rorp) return rf elif rf.index > index: # Try to add earlier indicies. But ... | 32,455 |
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... | 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... | 32,456 |
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... | 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), 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 a... | 32,457 |
def add_rfs(self, index): """Given index, add the rfs in that same directory | def add_rfs(self, index, mir_rorp = None): """Given index, add the rfs in that same directory | 32,458 |
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) | def __call__(self, index, mir_rorp = None): """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) | 32,459 |
def testListdir(self): """Checking dir listings""" assert (RPath(self.lc, self.mainprefix, ("sampledir",)).listdir() == ["1", "2", "3", "4"]) | def testListdir(self): """Checking dir listings""" assert (RPath(self.lc, self.mainprefix, ("sampledir",)).listdir() == ["1", "2", "3", "4"]) | 32,460 |
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 | 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 | 32,461 |
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... | 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... | 32,462 |
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) | 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) | 32,463 |
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 | def get_ctq_from_fsas(self): """Determine chars_to_quote just from filesystems, no ctq file""" if self.src_fsa.case_sensitive and not 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 | 32,464 |
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() | 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: if Globals.fsync_directories: self.fsync() self.conn.shutil.rmtree(self.path) else: self.conn.os.unlink(self.path) self.setdata() | 32,465 |
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_... | 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_... | 32,466 |
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_... | 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_... | 32,467 |
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_... | 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_... | 32,468 |
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 | def supports_unusual_chars(): """Test handling of several chars sometimes not supported""" for filename in [':', '\\', chr(175)]: try: rp = subdir.append(filename) rp.touch() except (IOError, OSError): assert not rp.lstat() return 0 assert rp.lstat() rp.delete() return 1 | 32,469 |
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 | 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 else: assert rp.lstat() rp.delete() return 1 | 32,470 |
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 | 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 | 32,471 |
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 | def 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\x... | 32,472 |
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)) | 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)) | 32,473 |
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. | 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. | 32,474 |
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. | 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. | 32,475 |
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. | 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. | 32,476 |
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 ... | 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 ... | 32,477 |
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() | 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() | 32,478 |
def reset_schema(self): self.rb_schema = (SourceDir + "/../rdiff-backup -v3 --no-compare-inode " "--remote-schema './chdir-wrapper2 %s' ") | def reset_schema(self): self.rb_schema = (SourceDir + "/../rdiff-backup -v9 --no-compare-inode " "--remote-schema './chdir-wrapper2 %s' ") | 32,479 |
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() | 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() | 32,480 |
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(... | 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(... | 32,481 |
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... | 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 dst_in_effect: offset = -time.altzone/60 else: offset = -time.timezone/60 if offset > 0: prefix = "+" elif offset < 0: prefix = "-" else: retur... | 32,482 |
def __eq__(self, other): """True iff the two rorpaths are equivalent""" if self.index != other.index: return None | def __eq__(self, other): """True iff the two rorpaths are equivalent""" if self.index != other.index: return None | 32,483 |
def __eq__(self, other): """True iff the two rorpaths are equivalent""" if self.index != other.index: return None | def __eq__(self, other): """True iff the two rorpaths are equivalent""" if self.index != other.index: return None | 32,484 |
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. | 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. | 32,485 |
def set_rorp_cache(cls, baserp, source_iter, for_increment): """Initialize cls.CCPP, the destination rorp cache | def set_rorp_cache(cls, baserp, source_iter, for_increment): """Initialize cls.CCPP, the destination rorp cache | 32,486 |
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... | 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... | 32,487 |
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() | def __init__(self, collated_iter, cache_size, dest_root_rp): """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() | 32,488 |
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... | def makedev(self, type, major, minor): """Make a special file with specified type, and major/minor nums""" if type == 'c': datatype = 'chr' mode = stat.S_IFCHR | 0600 elif type == 'b': datatype = 'blk' mode = stat.S_IFBLK | 0600 else: raise RPathException self.setdata() | 32,489 |
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... | 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.Globals.get('current_time') is None assert type(conn.os.getuid()) is int version = conn.Globals.ge... | 32,490 |
def __eq__(self, other): """True iff the two rorpaths are equivalent""" if self.index != other.index: return None | def __eq__(self, other): """True iff the two rorpaths are equivalent""" if self.index != other.index: return None | 32,491 |
def __eq__(self, other): """True iff the two rorpaths are equivalent""" if self.index != other.index: return None | def __eq__(self, other): """True iff the two rorpaths are equivalent""" if self.index != other.index: return None | 32,492 |
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 | def __eq__(self, ea): """Equal if all attributes are equal""" assert isinstance(ea, ExtendedAttributes) return ea.index == self.index and ea.attr_dict == self.attr_dict | 32,493 |
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 | 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 | 32,494 |
def __eq__(self, acl): """Compare self and other access control list | def __eq__(self, acl): """Compare self and other access control list | 32,495 |
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... | def eq_verbose(self, acl): """Returns same as __eq__ but print explanation if not equal""" if not self.cmp_entry_list(self.entry_list, acl.entry_list): print "ACL entries for %s compare differently" % (self.index,) return 0 if not self.cmp_entry_list(self.default_entry_list, acl.default_entry_list): print "Default ACL ... | 32,496 |
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... | defListAtTime(mirror_rp,inc_rp,time):"""ListthefilesinarchiveatthegiventimeOutputisaRORPIteratorwithinfoinindex.SeeListChangedSince."""assertmirror_rp.connisGlobals.local_connection,"Runlocallyonly"MirrorStruct.set_mirror_and_rest_times(time)MirrorStruct.initialize_rf_cache(mirror_rp,inc_rp)old_iter=MirrorStruct.get_mi... | 32,497 |
def get_rest_time(cls, restore_to_time): """Return older time, if restore_to_time is in between two inc times | def get_rest_time(cls, restore_to_time): """Return older time, if restore_to_time is in between two inc times | 32,498 |
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... | def get_increment_times(cls, rp = None): """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} if not rp o... | 32,499 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.