bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def convert(cvsroot, target=SVNROOT, log_fname_base=DATAFILE, start_pass=1, verbose=0): "Convert a CVS repository to an SVN repository." # prepare the operation context ctx = _ctx() ctx.cvsroot = cvsroot ctx.target = target ctx.log_fname_base = log_fname_base ctx.verbose = verbose times = [ None ] * len(_passes) for ...
def convert(pool, cvsroot, target=SVNROOT, log_fname_base=DATAFILE, start_pass=1, verbose=0): "Convert a CVS repository to an SVN repository." # prepare the operation context ctx = _ctx() ctx.cvsroot = cvsroot ctx.target = target ctx.log_fname_base = log_fname_base ctx.verbose = verbose times = [ None ] * len(_passes...
27,800
def usage(): print 'USAGE: %s [-p pass] repository-path' % sys.argv[0] sys.exit(1)
def usage(): print 'USAGE: %s [-v] [-p pass] repository-path' % sys.argv[0] sys.exit(1)
27,801
def main(): opts, args = getopt.getopt(sys.argv[1:], 'p:v') if len(args) != 1: usage() verbose = 0 start_pass = 1 for opt, value in opts: if opt == '-p': start_pass = int(value) if start_pass < 1 or start_pass > len(_passes): print 'ERROR: illegal value (%d) for starting pass. ' \ 'must be 1 through %d.' % (start_pass,...
def main(): opts, args = getopt.getopt(sys.argv[1:], 'p:v') if len(args) != 1: usage() verbose = 0 start_pass = 1 for opt, value in opts: if opt == '-p': start_pass = int(value) if start_pass < 1 or start_pass > len(_passes): print 'ERROR: illegal value (%d) for starting pass. ' \ 'must be 1 through %d.' % (start_pass,...
27,802
def diff_pure_repository_update_a_file(sbox): "pure repository diff update a file" if sbox.build(): return 1 wc_dir = sbox.wc_dir was_cwd = os.getcwd() os.chdir(wc_dir) update_a_file() svntest.main.run_svn(None, 'ci') os.chdir(was_cwd) url = os.path.join(svntest.main.test_area_url, svntest.main.general_repo_dir, sbo...
def diff_pure_repository_update_a_file(sbox): "pure repository diff update a file" if sbox.build(): return 1 wc_dir = sbox.wc_dir was_cwd = os.getcwd() os.chdir(wc_dir) update_a_file() svntest.main.run_svn(None, 'ci') os.chdir(was_cwd) url = svntest.main.test_area_url + '/' + svntest.main.current_repo_dir diff_outp...
27,803
def main(fname, oname=None, skip_depends=0): parser = ConfigParser.ConfigParser(_cfg_defaults) parser.read(fname) if oname is None: oname = os.path.splitext(os.path.basename(fname))[0] + '-outputs.mk' ofile = open(oname, 'w') ofile.write('# DO NOT EDIT -- AUTOMATICALLY GENERATED\n\n') errors = 0 targets = { } instal...
def main(fname, oname=None, skip_depends=0): parser = ConfigParser.ConfigParser(_cfg_defaults) parser.read(fname) if oname is None: oname = os.path.splitext(os.path.basename(fname))[0] + '-outputs.mk' ofile = open(oname, 'w') ofile.write('# DO NOT EDIT -- AUTOMATICALLY GENERATED\n\n') errors = 0 targets = { } instal...
27,804
def get_standard_status_list(wc_dir): "Return a status list reflecting local mods made by next routine." status_list = svntest.actions.get_virginal_status_list(wc_dir, '1') ### todo: use status-hash below instead. # `.' status_list[0][3]['status'] = '_M' # A/B/lambda, A/D status_list[5][3]['status'] = 'M ' status_...
def get_standard_status_list(wc_dir): "Return a status list reflecting local mods made by next routine." status_list = svntest.actions.get_virginal_status_list(wc_dir, '1') ### todo: use status-hash below instead. # `.' status_list[0][3]['status'] = '_M' # A/B/lambda, A/D status_list[5][3]['status'] = 'M ' status_...
27,805
def get_standard_status_list(wc_dir): "Return a status list reflecting local mods made by next routine." status_list = svntest.actions.get_virginal_status_list(wc_dir, '1') ### todo: use status-hash below instead. # `.' status_list[0][3]['status'] = '_M' # A/B/lambda, A/D status_list[5][3]['status'] = 'M ' status_...
def get_standard_status_list(wc_dir): "Return a status list reflecting local mods made by next routine." status_list = svntest.actions.get_virginal_status_list(wc_dir, '1') ### todo: use status-hash below instead. # `.' status_list[0][3]['status'] = '_M' # A/B/lambda, A/D status_list[5][3]['status'] = 'M ' status_...
27,806
def main(fname, oname=None, skip_depends=0): parser = ConfigParser.ConfigParser(_cfg_defaults) parser.read(fname) if oname is None: oname = os.path.splitext(os.path.basename(fname))[0] + '-outputs.mk' ofile = open(oname, 'w') ofile.write('# DO NOT EDIT -- AUTOMATICALLY GENERATED\n\n') errors = 0 targets = { } groups...
def main(fname, oname=None, skip_depends=0): parser = ConfigParser.ConfigParser(_cfg_defaults) parser.read(fname) if oname is None: oname = os.path.splitext(os.path.basename(fname))[0] + '-outputs.mk' ofile = open(oname, 'w') ofile.write('# DO NOT EDIT -- AUTOMATICALLY GENERATED\n\n') errors = 0 targets = { } groups...
27,807
def commit_deleted_edited(): "commit files that have been deleted, but also edited" # Bootstrap: make independent repo and working copy. sbox = sandbox(commit_deleted_edited) wc_dir = os.path.join(svntest.main.general_wc_dir, sbox) if svntest.actions.make_repo_and_wc(sbox): return 1 # Make some convenient paths. io...
def commit_deleted_edited(): "commit files that have been deleted, but also edited" # Bootstrap: make independent repo and working copy. sbox = sandbox(commit_deleted_edited) wc_dir = os.path.join(svntest.main.general_wc_dir, sbox) if svntest.actions.make_repo_and_wc(sbox): return 1 # Make some convenient paths. io...
27,808
def write(self): errors = 0 for target in self.target_names: target_ob = self.targets[target]
def write(self): errors = 0 for target in self.target_names: target_ob = self.targets[target]
27,809
def write(self): errors = 0 for target in self.target_names: target_ob = self.targets[target]
def write(self): errors = 0 for target in self.target_names: target_ob = self.targets[target]
27,810
def commit_multiple_targets(): "commit multiple targets" wc_dir = os.path.join (general_wc_dir, 'commit_multiple_targets') if make_repo_and_wc('commit_multiple_targets'): return 1 # This test will commit three targets: psi, B, and pi. In that order. # Make local mods to many files. AB_path = os.path.join(wc_dir, ...
def commit_multiple_targets(): "commit multiple targets" wc_dir = os.path.join (general_wc_dir, 'commit_multiple_targets') if make_repo_and_wc('commit_multiple_targets'): return 1 # This test will commit three targets: psi, B, and pi. In that order. # Make local mods to many files. AB_path = os.path.join(wc_dir, ...
27,811
def update_ignores_added(): "ensure update is not reporting additions" sbox = sandbox(update_ignores_added) wc_dir = os.path.join (svntest.main.general_wc_dir, sbox) if svntest.actions.make_repo_and_wc(sbox): return 1 # Create a new file, 'zeta', and schedule it for addition. zeta_path = os.path.join(wc_dir, 'A', 'B...
def update_ignores_added(): "ensure update is not munging additions or replacements" sbox = sandbox(update_ignores_added) wc_dir = os.path.join (svntest.main.general_wc_dir, sbox) if svntest.actions.make_repo_and_wc(sbox): return 1 # Create a new file, 'zeta', and schedule it for addition. zeta_path = os.path.join(w...
27,812
def update_ignores_added(): "ensure update is not reporting additions" sbox = sandbox(update_ignores_added) wc_dir = os.path.join (svntest.main.general_wc_dir, sbox) if svntest.actions.make_repo_and_wc(sbox): return 1 # Create a new file, 'zeta', and schedule it for addition. zeta_path = os.path.join(wc_dir, 'A', 'B...
def gamma_path = os.path.join(wc_dir, 'A', 'D', 'gamma') svntest.main.run_svn(None, 'delete', gamma_path) svntest.main.file_append(gamma_path, "\nThis is a new 'gamma' now.") svntest.main.run_svn(None, 'add', gamma_path) update_ignores_added(): gamma_path = os.path.join(wc_dir, 'A', 'D', 'gamma') svntest.main.run_...
27,813
def update_ignores_added(): "ensure update is not reporting additions" sbox = sandbox(update_ignores_added) wc_dir = os.path.join (svntest.main.general_wc_dir, sbox) if svntest.actions.make_repo_and_wc(sbox): return 1 # Create a new file, 'zeta', and schedule it for addition. zeta_path = os.path.join(wc_dir, 'A', 'B...
def update_ignores_added(): "ensure update is not reporting additions" sbox = sandbox(update_ignores_added) wc_dir = os.path.join (svntest.main.general_wc_dir, sbox) if svntest.actions.make_repo_and_wc(sbox): return 1 # Create a new file, 'zeta', and schedule it for addition. zeta_path = os.path.join(wc_dir, 'A', 'B...
27,814
def update_ignores_added(): "ensure update is not reporting additions" sbox = sandbox(update_ignores_added) wc_dir = os.path.join (svntest.main.general_wc_dir, sbox) if svntest.actions.make_repo_and_wc(sbox): return 1 # Create a new file, 'zeta', and schedule it for addition. zeta_path = os.path.join(wc_dir, 'A', 'B...
def update_ignores_added(): "ensure update is not reporting additions" sbox = sandbox(update_ignores_added) wc_dir = os.path.join (svntest.main.general_wc_dir, sbox) if svntest.actions.make_repo_and_wc(sbox): return 1 # Create a new file, 'zeta', and schedule it for addition. zeta_path = os.path.join(wc_dir, 'A', 'B...
27,815
def update_ignores_added(): "ensure update is not reporting additions" sbox = sandbox(update_ignores_added) wc_dir = os.path.join (svntest.main.general_wc_dir, sbox) if svntest.actions.make_repo_and_wc(sbox): return 1 # Create a new file, 'zeta', and schedule it for addition. zeta_path = os.path.join(wc_dir, 'A', 'B...
def update_ignores_added(): "ensure update is not reporting additions" sbox = sandbox(update_ignores_added) wc_dir = os.path.join (svntest.main.general_wc_dir, sbox) if svntest.actions.make_repo_and_wc(sbox): return 1 # Create a new file, 'zeta', and schedule it for addition. zeta_path = os.path.join(wc_dir, 'A', 'B...
27,816
def commit_in_dir_scheduled_for_addition(sbox): "commit a file inside dir scheduled for addition" if sbox.build(): return 1 wc_dir = sbox.wc_dir A_path = os.path.join(wc_dir, 'A') Z_path = os.path.join(wc_dir, 'Z') mu_path = os.path.join(wc_dir, 'Z', 'mu') svntest.main.run_svn(None, 'move', A_path, Z_path) out, er...
def commit_in_dir_scheduled_for_addition(sbox): "commit a file inside dir scheduled for addition" if sbox.build(): return 1 wc_dir = sbox.wc_dir A_path = os.path.join(wc_dir, 'A') Z_path = os.path.join(wc_dir, 'Z') mu_path = os.path.join(wc_dir, 'Z', 'mu') svntest.main.run_svn(None, 'move', A_path, Z_path) out, er...
27,817
def get_standard_status_list(wc_dir): "Return a status list reflecting the local mods made by make_standard_slew_of_changes()." status_list = svntest.actions.get_virginal_status_list(wc_dir, '1') ### todo: use status-hash below instead. # `.' status_list[0][3]['status'] = '_M' # A/B/lambda, A/D status_list[5][3]['...
def get_standard_status_list(wc_dir): """Return a status list reflecting the local mods made by make_standard_slew_of_changes().""" status_list = svntest.actions.get_virginal_status_list(wc_dir, '1') ### todo: use status-hash below instead. # `.' status_list[0][3]['status'] = '_M' # A/B/lambda, A/D status_list[5][...
27,818
def main(fname, oname=None, skip_depends=0): parser = ConfigParser.ConfigParser(_cfg_defaults) parser.read(fname) if oname is None: oname = os.path.splitext(os.path.basename(fname))[0] + '-outputs.mk' ofile = open(oname, 'w') ofile.write('# DO NOT EDIT -- AUTOMATICALLY GENERATED\n\n') errors = 0 targets = { } groups...
def main(fname, oname=None, skip_depends=0): parser = ConfigParser.ConfigParser(_cfg_defaults) parser.read(fname) if oname is None: oname = os.path.splitext(os.path.basename(fname))[0] + '-outputs.mk' ofile = open(oname, 'w') ofile.write('# DO NOT EDIT -- AUTOMATICALLY GENERATED\n\n') errors = 0 targets = { } groups...
27,819
def __init__(self, name, path, install, type): self.name = name self.deps = [ ] # dependencies (list of other Target objects) self.path = path self.type = type
def __init__(self, name, path, install, type): self.name = name self.deps = [ ] # dependencies (list of other Target objects) self.path = path self.type = type
27,820
def run_one_test(n, test_list): "Run the Nth client test in TEST_LIST, return the result." if (n < 1) or (n > len(test_list) - 1): print "There is no test", `n` + ".\n" return 1 # Run the test. error = test_list[n]() if error: print "FAIL:", else: print "PASS:", print sys.argv[0], n, ":", test_list[n].__doc__ return e...
def run_one_test(n, test_list): "Run the Nth client test in TEST_LIST, return the result." if (n < 1) or (n > len(test_list) - 1): print "There is no test", `n` + ".\n" return 1 # Run the test. error = test_list[n]() if error: print "FAIL:", else: print "PASS:", print sys.argv[0], n, ":", test_list[n].__doc__ return e...
27,821
def run_tests(test_list): "Main routine to run all tests in TEST_LIST." testnum = 0 # Parse commandline arg, list tests or run one test if (len(sys.argv) > 1): if (sys.argv[1] == 'list'): print "Test # Test Description" print "------ ----------------" n = 1 for x in test_list[1:]: print " ", n, " ", x.__d...
def run_tests(test_list): "Main routine to run all tests in TEST_LIST." testnum = 0 # Parse commandline arg, list tests or run one test if (len(sys.argv) > 1): if (sys.argv[1] == 'list'): print "Test # Test Description" print "------ ----------------" n = 1 for x in test_list[1:]: print " ", n, " ", x.__d...
27,822
def run_tests(test_list): "Main routine to run all tests in TEST_LIST." testnum = 0 # Parse commandline arg, list tests or run one test if (len(sys.argv) > 1): if (sys.argv[1] == 'list'): print "Test # Test Description" print "------ ----------------" n = 1 for x in test_list[1:]: print " ", n, " ", x.__d...
def run_tests(test_list): "Main routine to run all tests in TEST_LIST." testnum = 0 # Parse commandline arg, list tests or run one test if (len(sys.argv) > 1): if (sys.argv[1] == 'list'): print "Test # Test Description" print "------ ----------------" n = 1 for x in test_list[1:]: print " ", n, " ", x.__d...
27,823
def commit_props(): "commit properties" # Bootstrap sbox = sandbox(commit_props) wc_dir = os.path.join (svntest.main.general_wc_dir, sbox) if svntest.actions.make_repo_and_wc(sbox): return 1 # Add a property to a file and a directory mu_path = os.path.join(wc_dir, 'A', 'mu') H_path = os.path.join(wc_dir, 'A', 'D', '...
def commit_props(): "commit properties" # Bootstrap sbox = sandbox(commit_props) wc_dir = os.path.join (svntest.main.general_wc_dir, sbox) if svntest.actions.make_repo_and_wc(sbox): return 1 # Add a property to a file and a directory mu_path = os.path.join(wc_dir, 'A', 'mu') H_path = os.path.join(wc_dir, 'A', 'D', '...
27,824
def update_props(): "receive properties via update" # Bootstrap sbox = sandbox(update_props) wc_dir = os.path.join (svntest.main.general_wc_dir, sbox) if svntest.actions.make_repo_and_wc(sbox): return 1 # Make a backup copy of the working copy wc_backup = wc_dir + 'backup' svntest.actions.duplicate_dir(wc_dir, wc_ba...
def update_props(): "receive properties via update" # Bootstrap sbox = sandbox(update_props) wc_dir = os.path.join (svntest.main.general_wc_dir, sbox) if svntest.actions.make_repo_and_wc(sbox): return 1 # Make a backup copy of the working copy wc_backup = wc_dir + 'backup' svntest.actions.duplicate_dir(wc_dir, wc_ba...
27,825
def update_props(): "receive properties via update" # Bootstrap sbox = sandbox(update_props) wc_dir = os.path.join (svntest.main.general_wc_dir, sbox) if svntest.actions.make_repo_and_wc(sbox): return 1 # Make a backup copy of the working copy wc_backup = wc_dir + 'backup' svntest.actions.duplicate_dir(wc_dir, wc_ba...
def update_props(): "receive properties via update" # Bootstrap sbox = sandbox(update_props) wc_dir = os.path.join (svntest.main.general_wc_dir, sbox) if svntest.actions.make_repo_and_wc(sbox): return 1 # Make a backup copy of the working copy wc_backup = wc_dir + 'backup' svntest.actions.duplicate_dir(wc_dir, wc_ba...
27,826
def update_props(): "receive properties via update" # Bootstrap sbox = sandbox(update_props) wc_dir = os.path.join (svntest.main.general_wc_dir, sbox) if svntest.actions.make_repo_and_wc(sbox): return 1 # Make a backup copy of the working copy wc_backup = wc_dir + 'backup' svntest.actions.duplicate_dir(wc_dir, wc_ba...
def update_props(): "receive properties via update" # Bootstrap sbox = sandbox(update_props) wc_dir = os.path.join (svntest.main.general_wc_dir, sbox) if svntest.actions.make_repo_and_wc(sbox): return 1 # Make a backup copy of the working copy wc_backup = wc_dir + 'backup' svntest.actions.duplicate_dir(wc_dir, wc_ba...
27,827
def main(fname, oname=None, skip_depends=0): parser = ConfigParser.ConfigParser(_cfg_defaults) parser.read(fname) if oname is None: oname = os.path.splitext(os.path.basename(fname))[0] + '-outputs.mk' ofile = open(oname, 'w') ofile.write('# DO NOT EDIT -- AUTOMATICALLY GENERATED\n\n') errors = 0 targets = { } groups...
def main(fname, oname=None, skip_depends=0): parser = ConfigParser.ConfigParser(_cfg_defaults) parser.read(fname) if oname is None: oname = os.path.splitext(os.path.basename(fname))[0] + '-outputs.mk' ofile = open(oname, 'w') ofile.write('# DO NOT EDIT -- AUTOMATICALLY GENERATED\n\n') errors = 0 targets = { } groups...
27,828
def diff_pure_repository_update_a_file(sbox): "pure repository diff update a file" if sbox.build(): return 1 wc_dir = sbox.wc_dir was_cwd = os.getcwd() os.chdir(wc_dir) # rev 2 update_a_file() svntest.main.run_svn(None, 'ci', '-m', '"log msg"') # rev 3 add_a_file_in_a_subdir() svntest.main.run_svn(None, 'ci', '-m',...
def diff_pure_repository_update_a_file(sbox): "pure repository diff update a file" if sbox.build(): return 1 wc_dir = sbox.wc_dir was_cwd = os.getcwd() os.chdir(wc_dir) # rev 2 update_a_file() svntest.main.run_svn(None, 'ci', '-m', '"log msg"') # rev 3 add_a_file_in_a_subdir() svntest.main.run_svn(None, 'ci', '-m',...
27,829
def update_binary_file_2(): "update to an old revision of a binary files" sbox = sandbox(update_binary_file_2) wc_dir = os.path.join (svntest.main.general_wc_dir, sbox) if svntest.actions.make_repo_and_wc(sbox): return 1 # Suck up contents of a test .png file. fp = open("theta.png") theta_contents = fp.read() fp.clo...
def update_binary_file_2(): "update to an old revision of a binary files" sbox = sandbox(update_binary_file_2) wc_dir = os.path.join (svntest.main.general_wc_dir, sbox) if svntest.actions.make_repo_and_wc(sbox): return 1 # Suck up contents of a test .png file. fp = open("theta.png") theta_contents = fp.read() fp.clo...
27,830
def diff_pure_repository_update_a_file(sbox): "pure repository diff update a file" if sbox.build(): return 1 wc_dir = sbox.wc_dir was_cwd = os.getcwd() os.chdir(wc_dir) update_a_file() svntest.main.run_svn(None, 'ci') os.chdir(was_cwd) url = svntest.main.test_area_url + '/' + svntest.main.current_repo_dir diff_outp...
def diff_pure_repository_update_a_file(sbox): "pure repository diff update a file" if sbox.build(): return 1 wc_dir = sbox.wc_dir was_cwd = os.getcwd() os.chdir(wc_dir) update_a_file() svntest.main.run_svn(None, 'ci') os.chdir(was_cwd) url = svntest.main.test_area_url + '/' + svntest.main.current_repo_dir diff_outp...
27,831
def build_tree_from_status(lines): "Return a tree derived by parsing the output LINES from 'st'." root = SVNTreeNode(root_node_name) rm = re.compile ('^.+\:.+(\d+)') lastline = string.strip(lines.pop()) match = rm.search(lastline) if match and match.groups(): repos_rev = match.group(1) else: repos_rev = '?' rm = re.c...
def build_tree_from_status(lines): "Return a tree derived by parsing the output LINES from 'st'." root = SVNTreeNode(root_node_name) rm = re.compile ('^.+\:.+(\d+)') lastline = string.strip(lines.pop()) match = rm.search(lastline) if match and match.groups(): repos_rev = match.group(1) else: repos_rev = '?' rm = re.c...
27,832
def build_tree_from_status(lines): "Return a tree derived by parsing the output LINES from 'st'." root = SVNTreeNode(root_node_name) rm = re.compile ('^.+\:.+(\d+)') lastline = string.strip(lines.pop()) match = rm.search(lastline) if match and match.groups(): repos_rev = match.group(1) else: repos_rev = '?' rm = re.c...
def build_tree_from_status(lines): "Return a tree derived by parsing the output LINES from 'st'." root = SVNTreeNode(root_node_name) rm = re.compile ('^.+\:.+(\d+)') lastline = string.strip(lines.pop()) match = rm.search(lastline) if match and match.groups(): repos_rev = match.group(1) else: repos_rev = '?' rm = re.c...
27,833
def update_props(): "receive properties via update" # Bootstrap sbox = sandbox(update_props) wc_dir = os.path.join (svntest.main.general_wc_dir, sbox) if svntest.actions.make_repo_and_wc(sbox): return 1 # Make a backup copy of the working copy wc_backup = wc_dir + 'backup' svntest.actions.duplicate_dir(wc_dir, wc_ba...
def update_props(): "receive properties via update" # Bootstrap sbox = sandbox(update_props) wc_dir = os.path.join (svntest.main.general_wc_dir, sbox) if svntest.actions.make_repo_and_wc(sbox): return 1 # Make a backup copy of the working copy wc_backup = wc_dir + 'backup' svntest.actions.duplicate_dir(wc_dir, wc_ba...
27,834
def update_props(): "receive properties via update" # Bootstrap sbox = sandbox(update_props) wc_dir = os.path.join (svntest.main.general_wc_dir, sbox) if svntest.actions.make_repo_and_wc(sbox): return 1 # Make a backup copy of the working copy wc_backup = wc_dir + 'backup' svntest.actions.duplicate_dir(wc_dir, wc_ba...
def update_props(): "receive properties via update" # Bootstrap sbox = sandbox(update_props) wc_dir = os.path.join (svntest.main.general_wc_dir, sbox) if svntest.actions.make_repo_and_wc(sbox): return 1 # Make a backup copy of the working copy wc_backup = wc_dir + 'backup' svntest.actions.duplicate_dir(wc_dir, wc_ba...
27,835
def update_props(): "receive properties via update" # Bootstrap sbox = sandbox(update_props) wc_dir = os.path.join (svntest.main.general_wc_dir, sbox) if svntest.actions.make_repo_and_wc(sbox): return 1 # Make a backup copy of the working copy wc_backup = wc_dir + 'backup' svntest.actions.duplicate_dir(wc_dir, wc_ba...
def update_props(): "receive properties via update" # Bootstrap sbox = sandbox(update_props) wc_dir = os.path.join (svntest.main.general_wc_dir, sbox) if svntest.actions.make_repo_and_wc(sbox): return 1 # Make a backup copy of the working copy wc_backup = wc_dir + 'backup' svntest.actions.duplicate_dir(wc_dir, wc_ba...
27,836
def update_props(): "receive properties via update" # Bootstrap sbox = sandbox(update_props) wc_dir = os.path.join (svntest.main.general_wc_dir, sbox) if svntest.actions.make_repo_and_wc(sbox): return 1 # Make a backup copy of the working copy wc_backup = wc_dir + 'backup' svntest.actions.duplicate_dir(wc_dir, wc_ba...
def update_props(): "receive properties via update" # Bootstrap sbox = sandbox(update_props) wc_dir = os.path.join (svntest.main.general_wc_dir, sbox) if svntest.actions.make_repo_and_wc(sbox): return 1 # Make a backup copy of the working copy wc_backup = wc_dir + 'backup' svntest.actions.duplicate_dir(wc_dir, wc_ba...
27,837
def commit_unversioned_thing(sbox): "committing unversioned object produces error" if sbox.build(): return 1 wc_dir = sbox.wc_dir # Create an unversioned file in the wc. svntest.main.file_append(os.path.join(wc_dir, 'blorg'), "nothing to see") # Commit a non-existent file and *expect* failure: return svntest.action...
def commit_unversioned_thing(sbox): "committing unversioned object produces error" if sbox.build(): return 1 wc_dir = sbox.wc_dir # Create an unversioned file in the wc. svntest.main.file_append(os.path.join(wc_dir, 'blorg'), "nothing to see") # Commit a non-existent file and *expect* failure: return svntest.action...
27,838
def make_vardict(_group): vars = {} _cur = libweb100.web100_var_head(_group) while _cur != None: var = Web100Var(_cur, _group) vars[str(var)] = var _cur = libweb100.web100_var_next(_cur) return vars
def make_vardict(_group): vars = {} _cur = libweb100.web100_var_head(_group) while _cur != None: var = Web100Var(_cur, _group) vars[str(var)] = var _cur = libweb100.web100_var_next(_cur) return vars
27,839
def __init__(self, host=None): if (host != None): raise error("Remote agents not supported.") _agent = libweb100.web100_attach(libweb100.WEB100_AGENT_TYPE_LOCAL, None) if _agent == None: libweb100_err() self._agent = _agent self._tune_group = libweb100.web100_group_find(_agent, "tune") if self._tune_group == None: lib...
def __init__(self, host=None): if (host != None): raise error("Remote agents not supported.") _agent = libweb100.web100_attach(libweb100.WEB100_AGENT_TYPE_LOCAL, None) if _agent == None: libweb100_err() self._agent = _agent self._tune_group = libweb100.web100_group_find(_agent, "tune") if self._tune_group == None: lib...
27,840
def __del__(self): try: libweb100.delete_bufp(self.bufp) except: pass
def __del__(self): libweb100.delete_bufp(self.bufp)
27,841
def write(self, name, val): """Write a value to a single variable.""" try: var = self.agent.write_vars[name] except KeyError: raise error("No writable variable '%s' found."%name) var.valtobuf(val, self.agent.bufp) if libweb100.web100_raw_write(var._var, self._connection, self.agent.bufp) != \ libweb100.WEB100_ERR_SUCC...
def write(self, name, val): """Write a value to a single variable.""" try: var = self.agent.write_vars[name] except KeyError: raise error("No writable variable '%s' found."%name) buf = var.valtobuf(val, self.agent.bufp) if libweb100.web100_raw_write(var._var, self._connection, buf) != \ libweb100.WEB100_ERR_SUCCESS: l...
27,842
def write(self, name, val): """Write a value to a single variable.""" try: var = self.agent.write_vars[name] except KeyError: raise error("No writable variable '%s' found."%name) var.valtobuf(val, self.agent.bufp) if libweb100.web100_raw_write(var._var, self._connection, self.agent.bufp) != \ libweb100.WEB100_ERR_SUCC...
def write(self, name, val): """Write a value to a single variable.""" try: var = self.agent.write_vars[name] except KeyError: raise error("No writable variable '%s' found."%name) var.valtobuf(val, self.agent.bufp) if libweb100.web100_raw_write(var._var, self._connection, self.agent.bufp) != \ libweb100.WEB100_ERR_SUCC...
27,843
def val(self, bufp): if self._type == libweb100.WEB100_TYPE_INET_PORT_NUMBER or\ self._type == libweb100.WEB100_TYPE_UNSIGNED16: return libweb100.u16p_value(libweb100.bufp_to_u16p(bufp)) elif self._type == libweb100.WEB100_TYPE_INTEGER or \ self._type == libweb100.WEB100_TYPE_INTEGER32: return libweb100.s32p_value(libw...
def val(self, bufp): if self._type == libweb100.WEB100_TYPE_INET_PORT_NUMBER or\ self._type == libweb100.WEB100_TYPE_UNSIGNED16: return libweb100.u16p_value(libweb100.bufp_to_u16p(bufp)) elif self._type == libweb100.WEB100_TYPE_INTEGER or \ self._type == libweb100.WEB100_TYPE_INTEGER32: return libweb100.s32p_value(libw...
27,844
def val(self, bufp): if self._type == libweb100.WEB100_TYPE_INET_PORT_NUMBER or\ self._type == libweb100.WEB100_TYPE_UNSIGNED16: return libweb100.u16p_value(libweb100.bufp_to_u16p(bufp)) elif self._type == libweb100.WEB100_TYPE_INTEGER or \ self._type == libweb100.WEB100_TYPE_INTEGER32: return libweb100.s32p_value(libw...
def val(self, bufp): if self._type == libweb100.WEB100_TYPE_INET_PORT_NUMBER or\ self._type == libweb100.WEB100_TYPE_UNSIGNED16: return libweb100.u16p_value(libweb100.bufp_to_u16p(bufp)) elif self._type == libweb100.WEB100_TYPE_INTEGER or \ self._type == libweb100.WEB100_TYPE_INTEGER32: return libweb100.s32p_value(libw...
27,845
def main(): from twisted.internet import reactor from ConfigParser import SafeConfigParser # Read the configuration file configFile = '/etc/pybal/pybal.conf' config = SafeConfigParser() config.read(configFile) services = {} for section in config.sections(): cfgtuple = ( config.get(section, 'protocol'), config.get(s...
def main(): from twisted.internet import reactor from ConfigParser import SafeConfigParser # Read the configuration file configFile = '/etc/pybal/pybal.conf' config = SafeConfigParser() config.read(configFile) services = {} for section in config.sections(): cfgtuple = ( config.get(section, 'protocol'), config.get(s...
27,846
def gen_hmac(secret, ip): epoch_mins = (long)(time()/60) s = hmac.HMAC(secret, digestmod = MD5) s.update(socket.inet_aton(socket.gethostbyname(ip))) s.update(struct.pack("i", epoch_mins)) # "i" is for integer print s.hexdigest()
def gen_hmac(secret, ip): epoch_mins = (long)(time()/60) s = hmac.HMAC(secret, digestmod = SHA256) s.update(socket.inet_aton(socket.gethostbyname(ip))) s.update(struct.pack("i", epoch_mins)) # "i" is for integer print s.hexdigest()
27,847
def parseUse(inFile): """Parses the use statements in inFile The parsing stops at the first non use statement. Returns something like: ([{'module':'module1','only':['el1',el2=>el3']},...], '! comment1\\n!comment2...\\n', 'last line (the line that stopped the parsing)') """ useStartRe=re.compile( r" *(?P<use>use[^&!]*)(...
def parseUse(inFile): """Parses the use statements in inFile The parsing stops at the first non use statement. Returns something like: ([{'module':'module1','only':['el1',el2=>el3']},...], '! comment1\\n!comment2...\\n', 'last line (the line that stopped the parsing)') """ useStartRe=re.compile( r" *(?P<use>use[^&!]*)(...
27,848
def writeUseLong(modules,outFile): for m in modules: if m.has_key('only'): outFile.write(" USE "+m['module']+","+ string.rjust('ONLY: ',38-len(m['module']))) if m['only']: outFile.write(m['only'][0]) for i in range(1,len(m['only'])): outFile.write(",&\n"+string.ljust("",45)+m['only'][i]) elif m.has_key('renames'): out...
def writeUseLong(modules,outFile): for m in modules: if m.has_key('only'): outFile.write(" USE "+m['module']+","+ string.rjust('ONLY: ',38-len(m['module']))) if m['only']: outFile.write(m['only'][0]) for i in range(1,len(m['only'])): outFile.write(",&\n"+string.ljust("",45)+m['only'][i]) else: outFile.write(" USE "+m...
27,849
def writeUseShort(modules,file): """Writes a declaration in a compact way""" for m in modules: uLine=[] if m.has_key('only'): uLine.append(" USE "+m['module']+", ONLY: ") for k in m['only'][:-1]: uLine.append(k+", ") uLine.append(m['only'][-1]) elif m.has_key('renames') and m['renames']: uLine.append(" USE "+m['modul...
def writeUseShort(modules,file): """Writes a declaration in a compact way""" for m in modules: uLine=[] if m.has_key('only'): uLine.append(" USE "+m['module']+", ONLY: ") for k in m['only'][:-1]: uLine.append(k+", ") uLine.append(m['only'][-1]) elif m.has_key('renames') and m['renames']: uLine.append(" USE "+m['modul...
27,850
def writeInCols(dLine,indentCol,maxCol,indentAtt,file): """writes out the strings (trying not to cut them) in dLine up to maxCol indenting each newline with indentCol. The '&' of the continuation line is at maxCol. indentAtt is the actual intent, and the new indent is returned""" strRe=re.compile(r"('[^'\n]*'|\"[^\"\n]...
def writeInCols(dLine,indentCol,maxCol,indentAtt,file): """writes out the strings (trying not to cut them) in dLine up to maxCol indenting each newline with indentCol. The '&' of the continuation line is at maxCol. indentAtt is the actual intent, and the new indent is returned""" strRe=re.compile(r"('[^'\n]*'|\"[^\"\n]...
27,851
def prettfyInplace(fileName,bkDir="preprettify",normalize_use=1, upcase_keywords=1, interfaces_dir=None, replace=None,logFile=sys.stdout): """Same as prettify, but inplace, replaces only if needed""" if not os.path.exists(bkDir): os.mkdir(bkDir) if not os.path.isdir(bkDir): raise Error("bk-dir must be a directory, was ...
def prettfyInplace(fileName,bkDir="preprettify",normalize_use=1, upcase_keywords=1, interfaces_dir=None, replace=None,logFile=sys.stdout): """Same as prettify, but inplace, replaces only if needed""" if not os.path.exists(bkDir): os.mkdir(bkDir) if not os.path.isdir(bkDir): raise Error("bk-dir must be a directory, was ...
27,852
def cleanDeclarations(routine,logFile=sys.stdout): """cleans up the declaration part of the given parsed routine removes unused variables""" global rVar commentToRemoveRe=re.compile(r" *! *(?:interface|arguments|parameters|locals?|\** *local +variables *\**|\** *local +parameters *\**) *$",re.IGNORECASE) nullifyRe=re.c...
def cleanDeclarations(routine,logFile=sys.stdout): """cleans up the declaration part of the given parsed routine removes unused variables""" global rVar commentToRemoveRe=re.compile(r" *! *(?:interface|arguments|parameters|locals?|\** *local +variables *\**|\** *local +parameters *\**) *$",re.IGNORECASE) nullifyRe=re.c...
27,853
def cons_conv(oldInput,oldSect,newInput,new_sect,conv): del new_sect.auto_g new_sect.pre_comments=oldSect.pre_comments new_sect.post_comments=oldSect.post_comments consTypes={'g3x3':{'atoms':[3,4,5],'distances':[6,7,8],'molecule':[2]}, 'g4x6':{'atoms':[3,4,5,6],'distances':[7,8,9,10,11],'molecule':[2]}, 'dist':{'atoms'...
def cons_conv(oldInput,oldSect,newInput,new_sect,conv): del new_sect.auto_g new_sect.pre_comments=oldSect.pre_comments new_sect.post_comments=oldSect.post_comments consTypes={'g3x3':{'atoms':[3,4,5],'distances':[6,7,8],'molecule':[2]}, 'g4x6':{'atoms':[3,4,5,6],'distances':[7,8,9,10,11,12],'molecule':[2]}, 'dist':{'ato...
27,854
def ff_conv(oldInput,oldSect,newInput,new_sect,conv): del new_sect.auto_g new_sect.pre_comments=oldSect.pre_comments new_sect.post_comments=oldSect.post_comments l_nr=0 nl=len(oldSect.raw_lines) while 1: if l_nr>=nl: break line=oldSect.raw_lines[l_nr] ll=line.strip().lower() if ll=="charges": while 1: l_nr+=1 if l_nr>=...
def ff_conv(oldInput,oldSect,newInput,new_sect,conv): del new_sect.auto_g new_sect.pre_comments=oldSect.pre_comments new_sect.post_comments=oldSect.post_comments l_nr=0 nl=len(oldSect.raw_lines) while 1: if l_nr>=nl: break line=oldSect.raw_lines[l_nr] ll=line.strip().lower() if ll=="charges": while 1: l_nr+=1 if l_nr>=...
27,855
def ff_conv(oldInput,oldSect,newInput,new_sect,conv): del new_sect.auto_g new_sect.pre_comments=oldSect.pre_comments new_sect.post_comments=oldSect.post_comments l_nr=0 nl=len(oldSect.raw_lines) while 1: if l_nr>=nl: break line=oldSect.raw_lines[l_nr] ll=line.strip().lower() if ll=="charges": while 1: l_nr+=1 if l_nr>=...
def ff_conv(oldInput,oldSect,newInput,new_sect,conv): del new_sect.auto_g new_sect.pre_comments=oldSect.pre_comments new_sect.post_comments=oldSect.post_comments l_nr=0 nl=len(oldSect.raw_lines) while 1: if l_nr>=nl: break line=oldSect.raw_lines[l_nr] ll=line.strip().lower() if ll=="charges": while 1: l_nr+=1 if l_nr>=...
27,856
def ff_conv(oldInput,oldSect,newInput,new_sect,conv): del new_sect.auto_g new_sect.pre_comments=oldSect.pre_comments new_sect.post_comments=oldSect.post_comments l_nr=0 nl=len(oldSect.raw_lines) while 1: if l_nr>=nl: break line=oldSect.raw_lines[l_nr] ll=line.strip().lower() if ll=="charges": while 1: l_nr+=1 if l_nr>=...
def ff_conv(oldInput,oldSect,newInput,new_sect,conv): del new_sect.auto_g new_sect.pre_comments=oldSect.pre_comments new_sect.post_comments=oldSect.post_comments l_nr=0 nl=len(oldSect.raw_lines) while 1: if l_nr>=nl: break line=oldSect.raw_lines[l_nr] ll=line.strip().lower() if ll=="charges": while 1: l_nr+=1 if l_nr>=...
27,857
def diffEpsilon(str1, str2,incomparable_val=1): """retuns the difference between two strings, parsing numbers and confronting them.""" import re nrRe=re.compile("[-+]?[0-9]*\\.?[0-9]+([eEdD][-+]?[0-9]+)?") tokens1=str1.split() tokens2=str2.split() distance=0.0 if len(tokens1)!=len(tokens2): return incomparable_val i=0 ...
def diffEpsilon(str1, str2,incomparable_val=1): """retuns the difference between two strings, parsing numbers and confronting them.""" import re nrRe=re.compile("[-+]?[0-9]*\\.?[0-9]+([eEdD][-+]?[0-9]+)?$") tokens1=str1.split() tokens2=str2.split() distance=0.0 if len(tokens1)!=len(tokens2): return incomparable_val i=0...
27,858
def eekMexLogging(): # ------------------------------------------------------------ # Base Logging Setup # ------------------------------------------------------------ logging.basicConfig(level=logging.INFO, format='%(asctime)s %(name)-2s %(module)-10s %(levelname)-4s %(message)s', filename='eekmex.log', filemode='a'...
def eekMexLogging(): # ------------------------------------------------------------ # Base Logging Setup # ------------------------------------------------------------ logging.basicConfig(level=logging.INFO, format='%(asctime)s %(name)-2s %(module)-10s %(levelname)-4s %(message)s', filename='eekmex.log', filemode='a'...
27,859
def eekMexLogging(): # ------------------------------------------------------------ # Base Logging Setup # ------------------------------------------------------------ logging.basicConfig(level=logging.INFO, format='%(asctime)s %(name)-2s %(module)-10s %(levelname)-4s %(message)s', filename='eekmex.log', filemode='a'...
def eekMexLogging(): # ------------------------------------------------------------ # Base Logging Setup # ------------------------------------------------------------ logging.basicConfig(level=logging.INFO, format='%(asctime)s %(name)-2s %(module)-10s %(levelname)-4s %(message)s', filename='eekmex.log', filemode='a'...
27,860
def process(self): """ Each new request begins processing here """ log.debug("Request: " + self.method + " " + self.uri); # Clean up URL self.uri = self.simplify_path(self.uri)
def process(self): """ Each new request begins processing here """ log.debug("Request: " + self.method + " " + self.uri); # Clean up URL self.uri = self.simplify_path(self.uri)
27,861
def load(self): """ Regenerates the fake configuration and load the packages server. """ if not self.loaded: shutil.rmtree(self.status_dir+'/apt/lists/') os.makedirs(self.status_dir+'/apt/lists/partial') sources = open(self.status_dir+'/'+'apt/etc/sources.list', 'w') for file in self.packages.keys(): # we should probab...
def load(self): """ Regenerates the fake configuration and load the packages server. """ if not self.loaded: shutil.rmtree(self.status_dir+'/apt/lists/') os.makedirs(self.status_dir+'/apt/lists/partial') sources = open(self.status_dir+'/'+'apt/etc/sources.list', 'w') for file in self.packages.keys(): # we should probab...
27,862
def compare(a, b): return apt_pkg.VersionCompare(a[0], b[0])
defdef import_directory(factory, dir, recursive=0): """ Import all files in a given directory into the cache This is used by apt-proxy-import to import new files into the cache """ if not os.path.exists(dir): log.err('Directory ' + dir + ' does not exist', 'import') return if recursive: log.debug("Importing packages f...
27,863
def import_debs(factory, dir): if not os.path.exists(dir): os.makedirs(dir) for file in os.listdir(dir): if file[-4:]!='.deb': log.msg("IGNORING:"+ file, 'import') continue log.msg("considering:"+ dir+'/'+file, 'import') paths = get_mirror_path(factory, dir+'/'+file) if paths: if len(paths) != 1: log.msg("WARNING: mult...
def import_file(factory, dir, file): """ Import a .deb into cache from given filename """ if file[-4:]!='.deb': log.msg("Ignoring (unknown file type):"+ file, 'import') return log.debug("considering: " + dir + '/' + file, 'import') paths = get_mirror_path(factory, dir+'/'+file) if paths: if len(paths) != 1: log.debug...
27,864
def import_debs(factory, dir): if not os.path.exists(dir): os.makedirs(dir) for file in os.listdir(dir): if file[-4:]!='.deb': log.msg("IGNORING:"+ file, 'import') continue log.msg("considering:"+ dir+'/'+file, 'import') paths = get_mirror_path(factory, dir+'/'+file) if paths: if len(paths) != 1: log.msg("WARNING: mult...
def import_debs(factory, dir): if not os.path.exists(dir): os.makedirs(dir) for file in os.listdir(dir): if file[-4:]!='.deb': log.msg("IGNORING:"+ file, 'import') continue log.msg("considering:"+ dir+'/'+file, 'import') paths = get_mirror_path(factory, dir+'/'+file) if paths: if len(paths) != 1: log.msg("WARNING: mult...
27,865
def open_shelve(filename): from bsddb3 import db,dbshelve log.debug('Opening database ' + filename)
def open_shelve(filename): from bsddb3 import db,dbshelve log.debug('Opening database ' + filename)
27,866
def open_shelve(filename): from bsddb3 import db,dbshelve log.debug('Opening database ' + filename)
def open_shelve(filename): from bsddb3 import db,dbshelve log.debug('Opening database ' + filename)
27,867
def open_shelve(filename): from bsddb3 import db,dbshelve log.debug('Opening database ' + filename)
def open_shelve(filename): from bsddb3 import db,dbshelve log.debug('Opening database ' + filename)
27,868
def open_shelve(filename): from bsddb3 import db,dbshelve log.debug('Opening database ' + filename)
def open_shelve(filename): from bsddb3 import db,dbshelve log.debug('Opening database ' + filename)
27,869
def open_shelve(filename): from bsddb3 import db,dbshelve log.debug('Opening database ' + filename)
def open_shelve(filename): from bsddb3 import db,dbshelve log.debug('Opening database ' + filename)
27,870
def process(self): """ Each new request begins processing here """ log.debug("Request: " + self.method + " " + self.uri); # Clean up URL self.uri = self.simplify_path(self.uri)
def process(self): """ Each new request begins processing here """ log.debug("Request: " + self.method + " " + self.uri); # Clean up URL self.uri = self.simplify_path(self.uri)
27,871
def open_shelve(filename): from bsddb3 import db,dbshelve,DBInvalidArgError log.debug('Opening database ' + filename)
def open_shelve(filename): from bsddb3 import db,dbshelve log.debug('Opening database ' + filename)
27,872
def open_shelve(filename): from bsddb3 import db,dbshelve,DBInvalidArgError log.debug('Opening database ' + filename)
def open_shelve(filename): from bsddb3 import db,dbshelve,DBInvalidArgError log.debug('Opening database ' + filename)
27,873
def aptEnd(self): """ Called by subclasses when aptDataEnd does too much things.
def aptEnd(self): """ Called by subclasses when aptDataEnd does too much things.
27,874
def __init__(self, request): self.factory = request.factory self.deferred = defer.Deferred() # Deferred that passes status back self.path = request.local_file
def __init__(self, request): self.factory = request.factory self.deferred = defer.Deferred() # Deferred that passes status back self.path = request.local_file
27,875
def remove_request(self, request): """ Request should NOT be served through this Fetcher, the client probably closed the connection. If this is our last request, we may also close the connection with the server depending on the configuration.
def remove_request(self, request): """ Request should NOT be served through this Fetcher, the client probably closed the connection. If this is our last request, we may also close the connection with the server depending on the configuration.
27,876
def remove_request(self, request): """ Request should NOT be served through this Fetcher, the client probably closed the connection. If this is our last request, we may also close the connection with the server depending on the configuration.
def remove_request(self, request): """ Request should NOT be served through this Fetcher, the client probably closed the connection. If this is our last request, we may also close the connection with the server depending on the configuration.
27,877
def activate(self, request): log.debug(str(request.backend) + request.uri, 'fetcher_activate') self.local_file = request.local_file self.local_mtime = request.local_mtime self.factory = request.factory self.request = request request.content.read()
def activate(self, request): log.debug(str(request.backend) + request.uri, 'Fetcher.activate') self.local_file = request.local_file self.local_mtime = request.local_mtime self.factory = request.factory self.request = request request.content.read()
27,878
def apDataEnd(self, data, saveData=True): """ Called by subclasses when the data transfer is over.
def apDataEnd(self, data, saveData=True): """ Called by subclasses when the data transfer is over.
27,879
def apDataEnd(self, data, saveData=True): """ Called by subclasses when the data transfer is over.
def apDataEnd(self, data, saveData=True): """ Called by subclasses when the data transfer is over.
27,880
def apDataEnd(self, data, saveData=True): """ Called by subclasses when the data transfer is over.
def apDataEnd(self, data, saveData=True): """ Called by subclasses when the data transfer is over.
27,881
def apEnd(self): """ Called by subclasses when apDataEnd does too many things.
def apEnd(self): """ Called by subclasses when apDataEnd does too many things.
27,882
def apEnd(self): """ Called by subclasses when apDataEnd does too many things.
def apEnd(self): """ Called by subclasses when apDataEnd does too many things.
27,883
def apEnd(self): """ Called by subclasses when apDataEnd does too many things.
def apEnd(self): """ Called by subclasses when apDataEnd does too many things.
27,884
def apEnd(self): """ Called by subclasses when apDataEnd does too many things.
def apEnd(self): """ Called by subclasses when apDataEnd does too many things.
27,885
def apEndTransfer(self, fetcher_class): """ Remove this Fetcher and transfer all it's requests to a new instance of 'fetcher_class'. """ #Consider something like this: #req = dummyFetcher.fix_ref_request() #fetcher = fetcher_class() #dummyFetcher.transfer_requests(fetcher) #dummyFetcher.apEnd() #fetcher.activate(req)
def apEndTransfer(self, fetcher_class): """ Remove this Fetcher and transfer all it's requests to a new instance of 'fetcher_class'. """ #Consider something like this: #req = dummyFetcher.fix_ref_request() #fetcher = fetcher_class() #dummyFetcher.transfer_requests(fetcher) #dummyFetcher.apEnd() #fetcher.activate(req)
27,886
def connectionFailed(self, reason=None): """ Tell our requests that the connection with the server failed. """ msg = '[%s] Connection Failed: %s/%s'%( self.request.backend.base, self.request.backendServer.path, self.request.backend_uri)
def connectionFailed(self, reason=None): """ Tell our requests that the connection with the server failed. """ msg = '[%s] Connection Failed: %s/%s'%( self.request.backend.base, self.request.backendServer.path, self.request.backend_uri)
27,887
def connectionFailed(self, reason=None): """ Tell our requests that the connection with the server failed. """ msg = '[%s] Connection Failed: %s/%s'%( self.request.backend.base, self.request.backendServer.path, self.request.backend_uri)
def connectionFailed(self, reason=None): """ Tell our requests that the connection with the server failed. """ msg = '[%s] Connection Failed: %s/%s'%( self.request.backend.base, self.request.backendServer.path, self.request.backend_uri)
27,888
def start_transfer(self, request): self.if_modified(request) if len(self.requests) == 0: #we had a single request and didn't have to send it self.apEnd() return
def start_transfer(self, request): self.if_modified(request) if len(self.requests) == 0: #we had a single request and didn't have to send it self.apEnd() return
27,889
def open_shelve(filename): from bsddb3 import db,dbshelve
def open_shelve(dbname): from bsddb3 import db,dbshelve
27,890
def open_shelve(filename): from bsddb3 import db,dbshelve
def open_shelve(filename): from bsddb3 import db,dbshelve
27,891
def open_shelve(filename): from bsddb3 import db,dbshelve
def open_shelve(filename): from bsddb3 import db,dbshelve
27,892
def open_shelve(filename): from bsddb3 import db,dbshelve
def open_shelve(filename): from bsddb3 import db,dbshelve
27,893
def open_shelve(filename): from bsddb3 import db,dbshelve
def open_shelve(filename): from bsddb3 import db,dbshelve
27,894
def host_transfer_done(self): """ Called by our LoopbackRequest when the real Fetcher calls finish() on it.
def host_transfer_done(self): """ Called by our LoopbackRequest when the real Fetcher calls finish() on it.
27,895
def insert_request(self, request): if not request.serve_if_cached: request.finish() return Fetcher.insert_request(self, request) self.if_modified(request) file = open(self.local_file,'rb') fcntl.lockf(file.fileno(), fcntl.LOCK_SH)
def insert_request(self, request): if not request.serve_if_cached: request.finish() return Fetcher.insert_request(self, request) self.if_modified(request) file = open(self.local_file,'rb') fcntl.lockf(file.fileno(), fcntl.LOCK_SH)
27,896
def activate(self, request): Fetcher.activate(self, request) if not request.apFetcher: return self.factory.file_served(request.uri)
def activate(self, request): Fetcher.activate(self, request) if not request.apFetcher: return self.factory.file_served(request.uri)
27,897
def check (self, name): "Returns true if name is of this filetype" if self.regex.search(name): return 1 else: return 0
def check (self, name): "Returns true if name is of this filetype" if self.regex.search(name): return 1 else: return 0
27,898
def open_shelve(filename): from bsddb3 import db,dbshelve log.debug('Opening database ' + filename)
def open_shelve(filename): from bsddb3 import db,dbshelve log.debug('Opening database ' + filename)
27,899