bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def execute_http_request (action, args, db, options): """Executes a raw HTTP command (GET, PUT, POST, DELETE or HEAD) as specified on the command line.""" method = action.upper() if method not in HTTP_METHODS: raise UnrecognizedHTTPMethodError, ('Only supported HTTP methods are' '%s and %s' % (' '.join (HTTP_METHODS[:-...
def execute_http_request(action, args, db, options): """Executes a raw HTTP command (GET, PUT, POST, DELETE or HEAD) as specified on the command line.""" method = action.upper() if method not in HTTP_METHODS: raise UnrecognizedHTTPMethodError, ('Only supported HTTP methods are' '%s and %s' % (' '.join (HTTP_METHODS[:-1...
471,900
def execute_http_request (action, args, db, options): """Executes a raw HTTP command (GET, PUT, POST, DELETE or HEAD) as specified on the command line.""" method = action.upper() if method not in HTTP_METHODS: raise UnrecognizedHTTPMethodError, ('Only supported HTTP methods are' '%s and %s' % (' '.join (HTTP_METHODS[:-...
def execute_http_request (action, args, db, options): """Executes a raw HTTP command (GET, PUT, POST, DELETE or HEAD) as specified on the command line.""" method = action.upper() if method not in HTTP_METHODS: raise UnrecognizedHTTPMethodError, ('Only supported HTTP methods are' '%s and %s' % (' '.join (HTTP_METHODS[:-...
471,901
def execute_http_request (action, args, db, options): """Executes a raw HTTP command (GET, PUT, POST, DELETE or HEAD) as specified on the command line.""" method = action.upper() if method not in HTTP_METHODS: raise UnrecognizedHTTPMethodError, ('Only supported HTTP methods are' '%s and %s' % (' '.join (HTTP_METHODS[:-...
def execute_http_request (action, args, db, options): """Executes a raw HTTP command (GET, PUT, POST, DELETE or HEAD) as specified on the command line.""" method = action.upper() if method not in HTTP_METHODS: raise UnrecognizedHTTPMethodError, ('Only supported HTTP methods are' '%s and %s' % (' '.join (HTTP_METHODS[:-...
471,902
def execute_command_line (action, args, options, parser): db = FluidDB(host=options.hostname, debug=options.debug) ids_from_queries = chain(*imap(lambda q: get_ids_or_fail(q, db), options.query)) ids = chain(options.id, ids_from_queries) objs = [O({'mode': 'about', 'specifier': a}) for a in options.about] + \ [O({'mo...
def execute_command_line (action, args, options, parser): db = FluidDB(host=options.hostname, debug=options.debug) ids_from_queries = chain(*imap(lambda q: get_ids_or_fail(q, db), options.query)) ids = chain(options.id, ids_from_queries) objs = [O({'mode': 'about', 'specifier': a}) for a in options.about] + \ [O({'mo...
471,903
def choose_host (): if 'options' in globals(): host = options.hostname if options.verbose: print "Chosen %s as host" % host return host else: return FLUIDDB_PATH
def choose_host(): if 'options' in globals(): host = options.hostname if options.verbose: print "Chosen %s as host" % host return host else: return FLUIDDB_PATH
471,904
def choose_debug_mode (): return options.debug if 'options' in globals () else False
def choose_debug_mode (): return options.debug if 'options' in globals () else False
471,905
def choose_http_timeout (): return (options.timeout if 'options' in globals() else HTTP_TIMEOUT)
def choose_http_timeout (): return (options.timeout if 'options' in globals() else HTTP_TIMEOUT)
471,906
def setUp (self): self.db.set_connection_from_global () self.db.set_debug_timeout (5.0) self.dadgadID = id ('DADGAD', self.db.host)
def setUp (self): self.db.set_connection_from_global () self.db.set_debug_timeout (5.0) self.dadgadID = id ('DADGAD', self.db.host)
471,907
def testCreateObject (self): db = self.db o = db.create_object ('DADGAD') self.assertEqual (o.id, self.dadgadID) self.assertEqual (o.URI, object_uri (self.dadgadID))
def testCreateObject (self): db = self.db o = db.create_object ('DADGAD') self.assertEqual (o.id, self.dadgadID) self.assertEqual (o.URI, object_uri (self.dadgadID))
471,908
def testCreateObjectNoAbout (self): db = self.db o = db.create_object () self.assertEqual (type (o) != types.IntType, True)
def testCreateObjectNoAbout (self): db = self.db o = db.create_object () self.assertEqual (type (o) != types.IntType, True)
471,909
def testCreateTag (self): db = self.db o = db.delete_abstract_tag ('testrating') # doesn't really matter if this works or not
def testCreateTag (self): db = self.db o = db.delete_abstract_tag('testrating') # doesn't really matter if this works or not
471,910
def testCreateTag (self): db = self.db o = db.delete_abstract_tag ('testrating') # doesn't really matter if this works or not
def testCreateTag (self): db = self.db o = db.delete_abstract_tag ('testrating') # doesn't really matter if this works or not
471,911
def testCreateTag (self): db = self.db o = db.delete_abstract_tag ('testrating') # doesn't really matter if this works or not
def testCreateTag (self): db = self.db o = db.delete_abstract_tag ('testrating') # doesn't really matter if this works or not
471,912
def testSetTagByID (self): db = self.db user = db.credentials.username o = db.delete_abstract_tag ('testrating') o = db.create_abstract_tag ('testrating', "%s's testrating (0-10; more is better)" % self.user) o = db.tag_object_by_id (self.dadgadID, '/%s/testrating' % user, 5) self.assertEqual (o, 0) _status, v = db.get...
def testSetTagByID(self): db = self.db user = db.credentials.username o = db.delete_abstract_tag ('testrating') o = db.create_abstract_tag ('testrating', "%s's testrating (0-10; more is better)" % self.user) o = db.tag_object_by_id (self.dadgadID, '/%s/testrating' % user, 5) self.assertEqual (o, 0) _status, v = db.get_...
471,913
def testSetTagByID (self): db = self.db user = db.credentials.username o = db.delete_abstract_tag ('testrating') o = db.create_abstract_tag ('testrating', "%s's testrating (0-10; more is better)" % self.user) o = db.tag_object_by_id (self.dadgadID, '/%s/testrating' % user, 5) self.assertEqual (o, 0) _status, v = db.get...
def testSetTagByID (self): db = self.db user = db.credentials.username o = db.delete_abstract_tag('testrating') o = db.create_abstract_tag('testrating', "%s's testrating (0-10; more is better)" % self.user) o = db.tag_object_by_id (self.dadgadID, '/%s/testrating' % user, 5) self.assertEqual (o, 0) _status, v = db.get_t...
471,914
def testSetTagByID (self): db = self.db user = db.credentials.username o = db.delete_abstract_tag ('testrating') o = db.create_abstract_tag ('testrating', "%s's testrating (0-10; more is better)" % self.user) o = db.tag_object_by_id (self.dadgadID, '/%s/testrating' % user, 5) self.assertEqual (o, 0) _status, v = db.get...
def testSetTagByID (self): db = self.db user = db.credentials.username o = db.delete_abstract_tag ('testrating') o = db.create_abstract_tag ('testrating', "%s's testrating (0-10; more is better)" % self.user) o = db.tag_object_by_id (self.dadgadID, '/%s/testrating' % user, 5) self.assertEqual (o, 0) _status, v = db.get...
471,915
def testSetTagByAbout (self): db = self.db user = db.credentials.username o = db.delete_abstract_tag ('testrating') o = db.tag_object_by_about ('DADGAD', '/%s/testrating' % user, 'five') self.assertEqual (o, 0) _status, v = db.get_tag_value_by_about ('DADGAD', 'testrating') self.assertEqual (v, 'five')
def testSetTagByAbout (self): db = self.db user = db.credentials.username o = db.delete_abstract_tag ('testrating') o = db.tag_object_by_about ('DADGAD', '/%s/testrating' % user, 'five') self.assertEqual (o, 0) _status, v = db.get_tag_value_by_about ('DADGAD', 'testrating') self.assertEqual (v, 'five')
471,916
def testDeleteNonExistentTag (self): db = self.db o = db.delete_abstract_tag ('testrating') o = db.delete_abstract_tag ('testrating') # definitely doesn't exist
def testDeleteNonExistentTag (self): db = self.db o = db.delete_abstract_tag ('testrating') o = db.delete_abstract_tag ('testrating') # definitely doesn't exist
471,917
def testSetNonExistentTag (self): db = self.db o = db.delete_abstract_tag ('testrating') o = db.tag_object_by_id (self.dadgadID, 'testrating', 5) self.assertEqual (o, 0) status, v = db.get_tag_value_by_id (self.dadgadID, 'testrating') self.assertEqual (v, 5)
def testSetNonExistentTag (self): db = self.db o = db.delete_abstract_tag ('testrating') o = db.tag_object_by_id (self.dadgadID, 'testrating', 5) self.assertEqual (o, 0) status, v = db.get_tag_value_by_id (self.dadgadID, 'testrating') self.assertEqual (v, 5)
471,918
def testUntagObjectByID (self): db = self.db
def testUntagObjectByID (self): db = self.db
471,919
def testUntagObjectByID (self): db = self.db
def testUntagObjectByID (self): db = self.db
471,920
def testUntagObjectByID (self): db = self.db
def testUntagObjectByID (self): db = self.db
471,921
def testUntagObjectByID (self): db = self.db
def testUntagObjectByID (self): db = self.db
471,922
def testUntagObjectByAbout (self): db = self.db
def testUntagObjectByAbout (self): db = self.db
471,923
def testUntagObjectByAbout (self): db = self.db
def testUntagObjectByAbout (self): db = self.db
471,924
def testAddValuelessTag (self): db = self.db o = db.delete_abstract_tag ('testconvtag') o = db.create_abstract_tag ('testconvtag', "a conventional (valueless) tag") o = db.tag_object_by_id (self.dadgadID, 'testconvtag') self.assertEqual (o, 0) status, v = db.get_tag_value_by_id (self.dadgadID, 'testconvtag') self.asser...
def testAddValuelessTag (self): db = self.db o = db.delete_abstract_tag('testconvtag') o = db.create_abstract_tag('testconvtag', "a conventional (valueless) tag") o = db.tag_object_by_id (self.dadgadID, 'testconvtag') self.assertEqual (o, 0) status, v = db.get_tag_value_by_id (self.dadgadID, 'testconvtag') self.assertE...
471,925
def testAddValuelessTag (self): db = self.db o = db.delete_abstract_tag ('testconvtag') o = db.create_abstract_tag ('testconvtag', "a conventional (valueless) tag") o = db.tag_object_by_id (self.dadgadID, 'testconvtag') self.assertEqual (o, 0) status, v = db.get_tag_value_by_id (self.dadgadID, 'testconvtag') self.asser...
def testAddValuelessTag (self): db = self.db o = db.delete_abstract_tag ('testconvtag') o = db.create_abstract_tag ('testconvtag', "a conventional (valueless) tag") o = db.tag_object_by_id (self.dadgadID, 'testconvtag') self.assertEqual (o, 0) status, v = db.get_tag_value_by_id (self.dadgadID, 'testconvtag') self.asser...
471,926
def setUp (self): self.db.set_connection_from_global () self.db.set_debug_timeout (5.0) self.dadgadID = id ('DADGAD', self.db.host)
def setUp (self): self.db.set_connection_from_global () self.db.set_debug_timeout (5.0) self.dadgadID = id ('DADGAD', self.db.host)
471,927
def testFullTagPath (self): db = self.db user = db.credentials.username self.assertEqual (db.full_tag_path ('rating'), '/tags/%s/rating' % user) self.assertEqual (db.full_tag_path ('/%s/rating' % user), '/tags/%s/rating' % user) self.assertEqual (db.full_tag_path ('/tags/%s/rating' % user), '/tags/%s/rating' % user) se...
def testFullTagPath (self): db = self.db user = db.credentials.username self.assertEqual(db.full_tag_path('rating'), '/tags/%s/rating' % user) self.assertEqual (db.full_tag_path ('/%s/rating' % user), '/tags/%s/rating' % user) self.assertEqual (db.full_tag_path ('/tags/%s/rating' % user), '/tags/%s/rating' % user) self...
471,928
def testFullTagPath (self): db = self.db user = db.credentials.username self.assertEqual (db.full_tag_path ('rating'), '/tags/%s/rating' % user) self.assertEqual (db.full_tag_path ('/%s/rating' % user), '/tags/%s/rating' % user) self.assertEqual (db.full_tag_path ('/tags/%s/rating' % user), '/tags/%s/rating' % user) se...
def testFullTagPath (self): db = self.db user = db.credentials.username self.assertEqual (db.full_tag_path ('rating'), '/tags/%s/rating' % user) self.assertEqual(db.full_tag_path('/%s/rating' % user), '/tags/%s/rating' % user) self.assertEqual (db.full_tag_path ('/tags/%s/rating' % user), '/tags/%s/rating' % user) self...
471,929
def testFullTagPath (self): db = self.db user = db.credentials.username self.assertEqual (db.full_tag_path ('rating'), '/tags/%s/rating' % user) self.assertEqual (db.full_tag_path ('/%s/rating' % user), '/tags/%s/rating' % user) self.assertEqual (db.full_tag_path ('/tags/%s/rating' % user), '/tags/%s/rating' % user) se...
def testFullTagPath (self): db = self.db user = db.credentials.username self.assertEqual (db.full_tag_path ('rating'), '/tags/%s/rating' % user) self.assertEqual (db.full_tag_path ('/%s/rating' % user), '/tags/%s/rating' % user) self.assertEqual(db.full_tag_path('/tags/%s/rating' % user), '/tags/%s/rating' % user) self...
471,930
def testFullTagPath (self): db = self.db user = db.credentials.username self.assertEqual (db.full_tag_path ('rating'), '/tags/%s/rating' % user) self.assertEqual (db.full_tag_path ('/%s/rating' % user), '/tags/%s/rating' % user) self.assertEqual (db.full_tag_path ('/tags/%s/rating' % user), '/tags/%s/rating' % user) se...
def testFullTagPath (self): db = self.db user = db.credentials.username self.assertEqual (db.full_tag_path ('rating'), '/tags/%s/rating' % user) self.assertEqual (db.full_tag_path ('/%s/rating' % user), '/tags/%s/rating' % user) self.assertEqual (db.full_tag_path ('/tags/%s/rating' % user), '/tags/%s/rating' % user) se...
471,931
def testFullTagPath (self): db = self.db user = db.credentials.username self.assertEqual (db.full_tag_path ('rating'), '/tags/%s/rating' % user) self.assertEqual (db.full_tag_path ('/%s/rating' % user), '/tags/%s/rating' % user) self.assertEqual (db.full_tag_path ('/tags/%s/rating' % user), '/tags/%s/rating' % user) se...
def testFullTagPath (self): db = self.db user = db.credentials.username self.assertEqual (db.full_tag_path ('rating'), '/tags/%s/rating' % user) self.assertEqual (db.full_tag_path ('/%s/rating' % user), '/tags/%s/rating' % user) self.assertEqual (db.full_tag_path ('/tags/%s/rating' % user), '/tags/%s/rating' % user) se...
471,932
def testFullTagPath (self): db = self.db user = db.credentials.username self.assertEqual (db.full_tag_path ('rating'), '/tags/%s/rating' % user) self.assertEqual (db.full_tag_path ('/%s/rating' % user), '/tags/%s/rating' % user) self.assertEqual (db.full_tag_path ('/tags/%s/rating' % user), '/tags/%s/rating' % user) se...
def testFullTagPath (self): db = self.db user = db.credentials.username self.assertEqual (db.full_tag_path ('rating'), '/tags/%s/rating' % user) self.assertEqual (db.full_tag_path ('/%s/rating' % user), '/tags/%s/rating' % user) self.assertEqual (db.full_tag_path ('/tags/%s/rating' % user), '/tags/%s/rating' % user) se...
471,933
def testAbsTagPath (self): db = self.db user = db.credentials.username self.assertEqual (db.abs_tag_path ('rating'), '/%s/rating' % user) self.assertEqual (db.abs_tag_path ('/%s/rating' % user), '/%s/rating' % user) self.assertEqual (db.abs_tag_path ('/tags/%s/rating' % user), '/%s/rating' % user) self.assertEqual (db....
def testAbsTagPath(self): db = self.db user = db.credentials.username self.assertEqual (db.abs_tag_path ('rating'), '/%s/rating' % user) self.assertEqual (db.abs_tag_path ('/%s/rating' % user), '/%s/rating' % user) self.assertEqual (db.abs_tag_path ('/tags/%s/rating' % user), '/%s/rating' % user) self.assertEqual (db.a...
471,934
def testAbsTagPath (self): db = self.db user = db.credentials.username self.assertEqual (db.abs_tag_path ('rating'), '/%s/rating' % user) self.assertEqual (db.abs_tag_path ('/%s/rating' % user), '/%s/rating' % user) self.assertEqual (db.abs_tag_path ('/tags/%s/rating' % user), '/%s/rating' % user) self.assertEqual (db....
def testAbsTagPath (self): db = self.db user = db.credentials.username self.assertEqual(db.abs_tag_path('rating'), '/%s/rating' % user) self.assertEqual(db.abs_tag_path('/%s/rating' % user), '/%s/rating' % user) self.assertEqual (db.abs_tag_path ('/tags/%s/rating' % user), '/%s/rating' % user) self.assertEqual (db.abs_...
471,935
def testAbsTagPath (self): db = self.db user = db.credentials.username self.assertEqual (db.abs_tag_path ('rating'), '/%s/rating' % user) self.assertEqual (db.abs_tag_path ('/%s/rating' % user), '/%s/rating' % user) self.assertEqual (db.abs_tag_path ('/tags/%s/rating' % user), '/%s/rating' % user) self.assertEqual (db....
def testAbsTagPath (self): db = self.db user = db.credentials.username self.assertEqual (db.abs_tag_path ('rating'), '/%s/rating' % user) self.assertEqual (db.abs_tag_path ('/%s/rating' % user), '/%s/rating' % user) self.assertEqual(db.abs_tag_path('/tags/%s/rating' % user), '/%s/rating' % user) self.assertEqual (db.ab...
471,936
def testAbsTagPath (self): db = self.db user = db.credentials.username self.assertEqual (db.abs_tag_path ('rating'), '/%s/rating' % user) self.assertEqual (db.abs_tag_path ('/%s/rating' % user), '/%s/rating' % user) self.assertEqual (db.abs_tag_path ('/tags/%s/rating' % user), '/%s/rating' % user) self.assertEqual (db....
def testAbsTagPath (self): db = self.db user = db.credentials.username self.assertEqual (db.abs_tag_path ('rating'), '/%s/rating' % user) self.assertEqual (db.abs_tag_path ('/%s/rating' % user), '/%s/rating' % user) self.assertEqual (db.abs_tag_path ('/tags/%s/rating' % user), '/%s/rating' % user) self.assertEqual(db.a...
471,937
def testAbsTagPath (self): db = self.db user = db.credentials.username self.assertEqual (db.abs_tag_path ('rating'), '/%s/rating' % user) self.assertEqual (db.abs_tag_path ('/%s/rating' % user), '/%s/rating' % user) self.assertEqual (db.abs_tag_path ('/tags/%s/rating' % user), '/%s/rating' % user) self.assertEqual (db....
def testAbsTagPath (self): db = self.db user = db.credentials.username self.assertEqual (db.abs_tag_path ('rating'), '/%s/rating' % user) self.assertEqual (db.abs_tag_path ('/%s/rating' % user), '/%s/rating' % user) self.assertEqual (db.abs_tag_path ('/tags/%s/rating' % user), '/%s/rating' % user) self.assertEqual (db....
471,938
def testAbsTagPath (self): db = self.db user = db.credentials.username self.assertEqual (db.abs_tag_path ('rating'), '/%s/rating' % user) self.assertEqual (db.abs_tag_path ('/%s/rating' % user), '/%s/rating' % user) self.assertEqual (db.abs_tag_path ('/tags/%s/rating' % user), '/%s/rating' % user) self.assertEqual (db....
def testAbsTagPath (self): db = self.db user = db.credentials.username self.assertEqual (db.abs_tag_path ('rating'), '/%s/rating' % user) self.assertEqual (db.abs_tag_path ('/%s/rating' % user), '/%s/rating' % user) self.assertEqual (db.abs_tag_path ('/tags/%s/rating' % user), '/%s/rating' % user) self.assertEqual (db....
471,939
def testTagPathSplit (self): db = self.db
def testTagPathSplit(self): db = self.db
471,940
def testTagPathSplit (self): db = self.db
def testTagPathSplit (self): db = self.db
471,941
def testTypedValueInterpretation (self): corrects = { 'TRUE' : (True, types.BooleanType), 'tRuE' : (True, types.BooleanType), 't' : (True, types.BooleanType), 'T' : (True, types.BooleanType), 'f' : (False, types.BooleanType), 'false' : (False, types.BooleanType), '1' : (1, types.IntType), '+1' : (1, types.IntType), '-1...
def testTypedValueInterpretation (self): corrects = { 'TRUE' : (True, types.BooleanType), 'tRuE' : (True, types.BooleanType), 't' : (True, types.BooleanType), 'T' : (True, types.BooleanType), 'f' : (False, types.BooleanType), 'false' : (False, types.BooleanType), '1' : (1, types.IntType), '+1' : (1, types.IntType), '-1...
471,942
def __init__ (self): self.buffer = []
def __init__(self): self.buffer = []
471,943
def write (self, msg): self.buffer.append (msg)
def write (self, msg): self.buffer.append (msg)
471,944
def specify_DADGAD (mode, host): if mode == 'about': return ('-a', 'DADGAD') elif mode == 'id': return ('-i', id ('DADGAD', host)) elif mode == 'query': return ('-q', 'fluiddb/about="DADGAD"') else: raise ModeError, 'Bad mode'
def specify_DADGAD(mode, host): if mode == 'about': return ('-a', 'DADGAD') elif mode == 'id': return ('-i', id ('DADGAD', host)) elif mode == 'query': return ('-q', 'fluiddb/about="DADGAD"') else: raise ModeError, 'Bad mode'
471,945
def specify_DADGAD (mode, host): if mode == 'about': return ('-a', 'DADGAD') elif mode == 'id': return ('-i', id ('DADGAD', host)) elif mode == 'query': return ('-q', 'fluiddb/about="DADGAD"') else: raise ModeError, 'Bad mode'
def specify_DADGAD (mode, host): if mode == 'about': return ('-a', 'DADGAD') elif mode == 'id': return ('-i', id ('DADGAD', host)) elif mode == 'query': return ('-q', 'fluiddb/about="DADGAD"') else: raise ModeError, 'Bad mode'
471,946
def setUp (self): self.db.set_connection_from_global () self.db.set_debug_timeout (5.0) self.dadgadID = id ('DADGAD', self.db.host) self.stdout = sys.stdout self.stderr = sys.stderr self.stealOutput ()
def setUp(self): self.db.set_connection_from_global() self.db.set_debug_timeout(5.0) self.dadgadID = id('DADGAD', self.db.host) self.stdout = sys.stdout self.stderr = sys.stderr self.stealOutput ()
471,947
def setUp (self): self.db.set_connection_from_global () self.db.set_debug_timeout (5.0) self.dadgadID = id ('DADGAD', self.db.host) self.stdout = sys.stdout self.stderr = sys.stderr self.stealOutput ()
def setUp (self): self.db.set_connection_from_global () self.db.set_debug_timeout (5.0) self.dadgadID = id ('DADGAD', self.db.host) self.stdout = sys.stdout self.stderr = sys.stderr self.stealOutput ()
471,948
def reset (self): sys.stdout = self.stdout sys.stderr = self.stderr
def reset(self): sys.stdout = self.stdout sys.stderr = self.stderr
471,949
def Print (self, msg): self.stdout.write (str (msg) + '\n')
def Print (self, msg): self.stdout.write (str (msg) + '\n')
471,950
def testOutputManipulation (self): print 'one' sys.stderr.write ('two') self.reset () self.assertEqual (self.out.buffer, ['one', '\n']) self.assertEqual (self.err.buffer, ['two'])
def testOutputManipulation (self): print 'one' sys.stderr.write ('two') self.reset () self.assertEqual (self.out.buffer, ['one', '\n']) self.assertEqual (self.err.buffer, ['two'])
471,951
def tagTest (self, mode, verbose=True): self.stealOutput () (flag, spec) = specify_DADGAD (mode, self.db.host) description = describe_by_mode (spec, mode) flags = ['-v', flag] if verbose else [flag] hostname = ['--hostname', choose_host()] args = ['tag'] + flags + [spec, 'rating=10'] + hostname execute_command_line(*pa...
def tagTest (self, mode, verbose=True): self.stealOutput () (flag, spec) = specify_DADGAD (mode, self.db.host) description = describe_by_mode (spec, mode) flags = ['-v', flag] if verbose else [flag] hostname = ['--hostname', choose_host()] args = ['tag'] + flags + [spec, 'rating=10'] + hostname execute_command_line(*pa...
471,952
def tagTest (self, mode, verbose=True): self.stealOutput () (flag, spec) = specify_DADGAD (mode, self.db.host) description = describe_by_mode (spec, mode) flags = ['-v', flag] if verbose else [flag] hostname = ['--hostname', choose_host()] args = ['tag'] + flags + [spec, 'rating=10'] + hostname execute_command_line(*pa...
def tagTest (self, mode, verbose=True): self.stealOutput () (flag, spec) = specify_DADGAD (mode, self.db.host) description = describe_by_mode (spec, mode) flags = ['-v', flag] if verbose else [flag] hostname = ['--hostname', choose_host()] args = ['tag'] + flags + [spec, 'rating=10'] + hostname execute_command_line(*pa...
471,953
def untagTest (self, mode, verbose=True): self.stealOutput () (flag, spec) = specify_DADGAD (mode, self.db.host) description = describe_by_mode (spec, mode) flags = ['-v', flag] if verbose else [flag] hostname = ['--hostname', choose_host()] args = ['untag'] + flags + [spec, 'rating'] + hostname execute_command_line(*p...
def untagTest (self, mode, verbose=True): self.stealOutput () (flag, spec) = specify_DADGAD (mode, self.db.host) description = describe_by_mode (spec, mode) flags = ['-v', flag] if verbose else [flag] hostname = ['--hostname', choose_host()] args = ['untag'] + flags + [spec, 'rating'] + hostname execute_command_line(*p...
471,954
def untagTest (self, mode, verbose=True): self.stealOutput () (flag, spec) = specify_DADGAD (mode, self.db.host) description = describe_by_mode (spec, mode) flags = ['-v', flag] if verbose else [flag] hostname = ['--hostname', choose_host()] args = ['untag'] + flags + [spec, 'rating'] + hostname execute_command_line(*p...
def untagTest (self, mode, verbose=True): self.stealOutput () (flag, spec) = specify_DADGAD (mode, self.db.host) description = describe_by_mode (spec, mode) flags = ['-v', flag] if verbose else [flag] hostname = ['--hostname', choose_host()] args = ['untag'] + flags + [spec, 'rating'] + hostname execute_command_line(*p...
471,955
def showTaggedSuccessTest (self, mode): self.stealOutput () (flag, spec) = specify_DADGAD (mode, self.db.host) description = describe_by_mode (spec, mode) hostname = ['--hostname', choose_host()] args = ['show', '-v', flag, spec, 'rating', '/fluiddb/about'] + hostname execute_command_line(*parse_args(args)) self.reset ...
def showTaggedSuccessTest (self, mode): self.stealOutput () (flag, spec) = specify_DADGAD (mode, self.db.host) description = describe_by_mode (spec, mode) hostname = ['--hostname', choose_host()] args = ['show', '-v', flag, spec, 'rating', '/fluiddb/about'] + hostname execute_command_line(*parse_args(args)) self.reset(...
471,956
def showTaggedSuccessTest (self, mode): self.stealOutput () (flag, spec) = specify_DADGAD (mode, self.db.host) description = describe_by_mode (spec, mode) hostname = ['--hostname', choose_host()] args = ['show', '-v', flag, spec, 'rating', '/fluiddb/about'] + hostname execute_command_line(*parse_args(args)) self.reset ...
def showTaggedSuccessTest (self, mode): self.stealOutput () (flag, spec) = specify_DADGAD (mode, self.db.host) description = describe_by_mode (spec, mode) hostname = ['--hostname', choose_host()] args = ['show', '-v', flag, spec, 'rating', '/fluiddb/about'] + hostname execute_command_line(*parse_args(args)) self.reset ...
471,957
def showUntagSuccessTest (self, mode): self.stealOutput () (flag, spec) = specify_DADGAD (mode, self.db.host) description = describe_by_mode (spec, mode) hostname = ['--hostname', choose_host()] args = ['show', '-v', flag, spec, 'rating', '/fluiddb/about'] + hostname execute_command_line(*parse_args(args)) self.reset (...
def showUntagSuccessTest (self, mode): self.stealOutput () (flag, spec) = specify_DADGAD (mode, self.db.host) description = describe_by_mode (spec, mode) hostname = ['--hostname', choose_host()] args = ['show', '-v', flag, spec, 'rating', '/fluiddb/about'] + hostname execute_command_line(*parse_args(args)) self.reset()...
471,958
def showUntagSuccessTest (self, mode): self.stealOutput () (flag, spec) = specify_DADGAD (mode, self.db.host) description = describe_by_mode (spec, mode) hostname = ['--hostname', choose_host()] args = ['show', '-v', flag, spec, 'rating', '/fluiddb/about'] + hostname execute_command_line(*parse_args(args)) self.reset (...
def showUntagSuccessTest (self, mode): self.stealOutput () (flag, spec) = specify_DADGAD (mode, self.db.host) description = describe_by_mode (spec, mode) hostname = ['--hostname', choose_host()] args = ['show', '-v', flag, spec, 'rating', '/fluiddb/about'] + hostname execute_command_line(*parse_args(args)) self.reset (...
471,959
def showUntagSuccessTest (self, mode): self.stealOutput () (flag, spec) = specify_DADGAD (mode, self.db.host) description = describe_by_mode (spec, mode) hostname = ['--hostname', choose_host()] args = ['show', '-v', flag, spec, 'rating', '/fluiddb/about'] + hostname execute_command_line(*parse_args(args)) self.reset (...
def showUntagSuccessTest (self, mode): self.stealOutput () (flag, spec) = specify_DADGAD (mode, self.db.host) description = describe_by_mode (spec, mode) hostname = ['--hostname', choose_host()] args = ['show', '-v', flag, spec, 'rating', '/fluiddb/about'] + hostname execute_command_line(*parse_args(args)) self.reset (...
471,960
def showUntagSuccessTest (self, mode): self.stealOutput () (flag, spec) = specify_DADGAD (mode, self.db.host) description = describe_by_mode (spec, mode) hostname = ['--hostname', choose_host()] args = ['show', '-v', flag, spec, 'rating', '/fluiddb/about'] + hostname execute_command_line(*parse_args(args)) self.reset (...
def showUntagSuccessTest (self, mode): self.stealOutput () (flag, spec) = specify_DADGAD (mode, self.db.host) description = describe_by_mode (spec, mode) hostname = ['--hostname', choose_host()] args = ['show', '-v', flag, spec, 'rating', '/fluiddb/about'] + hostname execute_command_line(*parse_args(args)) self.reset (...
471,961
def frag_ranking(): global db_conn print """\ <a name="#3"><h2>Frag-based ranking</h2></a> <ol>\
def frag_ranking(): global db_conn print """\ <a name="#3"><h2>Frag-based ranking</h2></a> <ol>\
471,962
def fdratio_ranking(): global db_conn print """\ <a name="#4"><h2>Frag/death ratio-based ranking</h2></a> <ol>\
def fdratio_ranking(): global db_conn print """\ <a name="#4"><h2>Frag/death ratio-based ranking</h2></a> <ol>\
471,963
def main(): global db_conn if (len(sys.argv) < 2): sys.exit(1) create_db() if os.path.isdir(sys.argv[1]): for logrpath in os.listdir(sys.argv[1]): logfpath = ''.join([sys.argv[1], '/', logrpath]) parse_log(logfpath) else: parse_log(sys.argv[1]) print """\
def main(): global db_conn if (len(sys.argv) < 2): sys.exit(1) create_db() if os.path.isdir(sys.argv[1]): for logrpath in os.listdir(sys.argv[1]): logfpath = ''.join([sys.argv[1], '/', logrpath]) parse_log(logfpath) else: parse_log(sys.argv[1]) print """\
471,964
def main(): global db_conn if (len(sys.argv) < 2): sys.exit(1) create_db() if os.path.isdir(sys.argv[1]): for logrpath in os.listdir(sys.argv[1]): logfpath = ''.join([sys.argv[1], '/', logrpath]) parse_log(logfpath) else: parse_log(sys.argv[1]) print """\
def main(): global db_conn if (len(sys.argv) < 2): sys.exit(1) create_db() if os.path.isdir(sys.argv[1]): for logrpath in os.listdir(sys.argv[1]): logfpath = ''.join([sys.argv[1], '/', logrpath]) parse_log(logfpath) else: parse_log(sys.argv[1]) print """\
471,965
def fdratio_ranking(): global db_conn print """\ <a name="#4"><h2>Frag/death ratio-based ranking</h2></a> <ol>\
def fdratio_ranking(): global db_conn print """\ <a name="#4"><h2>Frag/death ratio-based ranking</h2></a> <ol>\
471,966
def presence_ranking(): global db_conn print """\ <a name="5"><h2>Presence-based ranking</h2></a> <ol>\
def presence_ranking(): global db_conn print """\ <a name="5"><h2>Presence-based ranking</h2></a> <ol>\
471,967
def main(): global db_conn if (len(sys.argv) < 2): sys.exit(1) create_db() if os.path.isdir(sys.argv[1]): for logrpath in os.listdir(sys.argv[1]): logfpath = ''.join([sys.argv[1], '/', logrpath]) parse_log(logfpath) else: parse_log(sys.argv[1]) print """\
def main(): global db_conn if (len(sys.argv) < 2): sys.exit(1) create_db() if os.path.isdir(sys.argv[1]): for logrpath in os.listdir(sys.argv[1]): logfpath = ''.join([sys.argv[1], '/', logrpath]) parse_log(logfpath) else: parse_log(sys.argv[1]) print """\
471,968
def parse_log(logpath): global db_conn idd = {} logf = open(logpath, 'r') while 1: logline = logf.readline() if (not logline): break m = frag_prog.match(logline) if (m): # Update the frags table db_conn.execute( '''insert into frags values (?, ?, ?)''', (m.group(1), m.group(2), m.group(3))) continue m = playerjoins...
def parse_log(logpath): global db_conn idd = {} logf = open(logpath, 'r') while 1: logline = logf.readline() if (not logline): break m = frag_prog.match(logline) if (m): # Update the frags table db_conn.execute( '''insert into frags values (?, ?, ?)''', (m.group(1), m.group(2), m.group(3))) continue m = playerjoins...
471,969
def getContent(self): """Open content as a stream for reading. See DAVResource.getContent() """ assert not self.isCollection mime = self.getContentType() if mime.startswith("text"): return file(self._filePath, "r", BUFFER_SIZE) return file(self._filePath, "rb", BUFFER_SIZE)
def getContent(self): """Open content as a stream for reading. See DAVResource.getContent() """ assert not self.isCollection return file(self._filePath, "rb", BUFFER_SIZE)
471,970
def copy(self, source, destination, body=None, depth='infinity', overwrite=True, headers=None): """Copy DAV resource""" # Set all proper headers if headers is None: headers = {'Destination':destination} else: headers['Destination'] = self._url.geturl() + destination if overwrite is False: headers['Overwrite'] = 'F' hea...
defcopy(self,source,destination,body=None,depth='infinity',overwrite=True,headers=None):"""CopyDAVresource"""#SetallproperheadersifheadersisNone:headers={'Destination':destination}else:headers['Destination']=self._url.geturl()+destinationifoverwriteisFalse:headers['Overwrite']='F'headers['Depth']=depthself._request('CO...
471,971
def copy_collection(self, source, destination, depth='infinity', overwrite=True, headers=None): """Copy DAV collection""" body = '<?xml version="1.0" encoding="utf-8" ?><d:propertybehavior xmlns:d="DAV:"><d:keepalive>*</d:keepalive></d:propertybehavior>' # Add proper headers if headers is None: headers = {} headers['C...
def copy_collection(self, source, destination, depth='infinity', overwrite=True, headers=None): """Copy DAV collection. Note: support for the 'propertybehavior' request body for COPY and MOVE has been removed with RFC4918 """ body = '<?xml version="1.0" encoding="utf-8" ?><d:propertybehavior xmlns:d="DAV:"><d:keepaliv...
471,972
def move_collection(self, source, destination, depth='infinity', overwrite=True, headers=None): """Move DAV collection and copy all properties""" body = '<?xml version="1.0" encoding="utf-8" ?><d:propertybehavior xmlns:d="DAV:"><d:keepalive>*</d:keepalive></d:propertybehavior>' # Add proper headers if headers is None:...
def move_collection(self, source, destination, depth='infinity', overwrite=True, headers=None): """Move DAV collection and copy all properties. Note: support for the 'propertybehavior' request body for COPY and MOVE has been removed with RFC4918 """ body = '<?xml version="1.0" encoding="utf-8" ?><d:propertybehavior xm...
471,973
def proppatch(self, path, set_props=None, remove_props=None, namespace='DAV:', headers=None): """Patch properties on a DAV resource. If namespace is not specified the DAV namespace is used for all properties""" root = ElementTree.Element('{DAV:}propertyupdate') if set_props is not None: prop_set = ElementTree.SubEleme...
def proppatch(self, path, set_props=None, remove_props=None, namespace='DAV:', headers=None): """Patch properties on a DAV resource. If namespace is not specified the DAV namespace is used for all properties""" root = ElementTree.Element('{DAV:}propertyupdate') if set_props is not None: prop_set = ElementTree.SubEleme...
471,974
def proppatch(self, path, set_props=None, remove_props=None, namespace='DAV:', headers=None): """Patch properties on a DAV resource. If namespace is not specified the DAV namespace is used for all properties""" root = ElementTree.Element('{DAV:}propertyupdate') if set_props is not None: prop_set = ElementTree.SubEleme...
def proppatch(self, path, set_props=None, remove_props=None, namespace='DAV:', headers=None): """Patch properties on a DAV resource. If namespace is not specified the DAV namespace is used for all properties""" root = ElementTree.Element('{DAV:}propertyupdate') if set_props is not None: prop_set = ElementTree.SubEleme...
471,975
def refresh(self, locktoken, timeout=None): """Set new timeout for lock, if existing and valid.""" if timeout is None: timeout = LockManager.LOCK_TIME_OUT_DEFAULT self._lock.acquireWrite() try: lock = self.getLock(locktoken) _logger.debug("refresh %s" % _lockString(lock)) if lock: lock["timeout"] = time.time() + timeou...
def refresh(self, locktoken, timeout=None): """Set new timeout for lock, if existing and valid.""" if timeout is None: timeout = LockManager.LOCK_TIME_OUT_DEFAULT self._lock.acquireWrite() try: lock = self.getLock(locktoken) _logger.debug("refresh %s" % _lockString(lock)) if lock: if timeout < 0: lock["timeout"] = -1 e...
471,976
def getIndirectUrlLockList(self, url, username=None): """Return a list of valid lockDicts, that protect <url> directly or indirectly. If a username is given, only locks owned by this principal are returned. Side effect: expired locks for this url and all parents are purged. """ self._lock.acquireRead() try: lockList =...
defgetIndirectUrlLockList(self,url,username=None):"""ReturnalistofvalidlockDicts,thatprotect<url>directlyorindirectly.Ifausernameisgiven,onlylocksownedbythisprincipalarereturned.Sideeffect:expiredlocksforthisurlandallparentsarepurged."""self._lock.acquireRead()try:lockList=[]u=urlwhileu:#TODO:check,ifexpiredll=self.get...
471,977
def runWSGIApp (self, application, scriptName, pathInfo, query): logging.info ("Running application with SCRIPT_NAME %s PATH_INFO %s" % (scriptName, pathInfo)) if self.command == "PUT": pass # breakpoint env = {"wsgi.version": (1, 0), "wsgi.url_scheme": "http", "wsgi.input": self.rfile, "wsgi.errors": sys.stderr, "ws...
def runWSGIApp (self, application, scriptName, pathInfo, query): logging.info ("Running application with SCRIPT_NAME %s PATH_INFO %s" % (scriptName, pathInfo)) if self.command == "PUT": pass # breakpoint env = {"wsgi.version": (1, 0), "wsgi.url_scheme": "http", "wsgi.input": self.rfile, "wsgi.errors": sys.stderr, "ws...
471,978
def runWSGIApp (self, application, scriptName, pathInfo, query): logging.info ("Running application with SCRIPT_NAME %s PATH_INFO %s" % (scriptName, pathInfo)) if self.command == "PUT": pass # breakpoint env = {"wsgi.version": (1, 0), "wsgi.url_scheme": "http", "wsgi.input": self.rfile, "wsgi.errors": sys.stderr, "ws...
def runWSGIApp (self, application, scriptName, pathInfo, query): logging.info ("Running application with SCRIPT_NAME %s PATH_INFO %s" % (scriptName, pathInfo)) if self.command == "PUT": pass # breakpoint env = {"wsgi.version": (1, 0), "wsgi.url_scheme": "http", "wsgi.input": self.rfile, "wsgi.errors": sys.stderr, "ws...
471,979
def do_SHUTDOWN (self): """Send 200 OK response, and set server.stop to True. http://code.activestate.com/recipes/336012/ """ print "got SHUTDOWN" self.send_response(200) self.end_headers() self.server.stop = True
def do_SHUTDOWN (self): """Send 200 OK response, and set server.stop to True. http://code.activestate.com/recipes/336012/ """ print "got SHUTDOWN" self.send_response(200) self.end_headers() self.server.stop = True
471,980
def runWSGIApp (self, application, scriptName, pathInfo, query): logging.info ("Running application with SCRIPT_NAME %s PATH_INFO %s" % (scriptName, pathInfo)) if self.command == "PUT": pass # breakpoint env = {"wsgi.version": (1, 0), "wsgi.url_scheme": "http", "wsgi.input": self.rfile, "wsgi.errors": sys.stderr, "ws...
defrunWSGIApp(self,application,scriptName,pathInfo,query):logging.info("RunningapplicationwithSCRIPT_NAME%sPATH_INFO%s"%(scriptName,pathInfo))ifself.command=="PUT":pass#breakpointenv={"wsgi.version":(1,0),"wsgi.url_scheme":"http","wsgi.input":self.rfile,"wsgi.errors":sys.stderr,"wsgi.multithread":1,"wsgi.multiprocess":...
471,981
def runWSGIApp (self, application, scriptName, pathInfo, query): logging.info ("Running application with SCRIPT_NAME %s PATH_INFO %s" % (scriptName, pathInfo)) if self.command == "PUT": pass # breakpoint env = {"wsgi.version": (1, 0), "wsgi.url_scheme": "http", "wsgi.input": self.rfile, "wsgi.errors": sys.stderr, "ws...
defrunWSGIApp(self,application,scriptName,pathInfo,query):logging.info("RunningapplicationwithSCRIPT_NAME%sPATH_INFO%s"%(scriptName,pathInfo))ifself.command=="PUT":pass#breakpointenv={"wsgi.version":(1,0),"wsgi.url_scheme":"http","wsgi.input":self.rfile,"wsgi.errors":sys.stderr,"wsgi.multithread":1,"wsgi.multiprocess":...
471,982
def stop_serve_forever(self): """Stop serve_forever_stoppable().""" assert hasattr(self, "stop"), "serve_forever_stoppable() must be called" (host, port) = self.server_address
def stop_serve_forever(self): """Stop serve_forever_stoppable().""" assert hasattr(self, "stop_request"), "serve_forever_stoppable() must be called before" assert not self.stop_request, "stop_serve_forever() must only be called once" self.stop_request = True time.sleep(.01) if self.stopped: return def _shutdownHan...
471,983
def stop_serve_forever(self): """Stop serve_forever_stoppable().""" assert hasattr(self, "stop"), "serve_forever_stoppable() must be called" (host, port) = self.server_address
def stop_serve_forever(self): """Stop serve_forever_stoppable().""" assert hasattr(self, "stop"), "serve_forever_stoppable() must be called" (host, port) = self.server_address
471,984
def stop_serve_forever(self): """Stop serve_forever_stoppable().""" assert hasattr(self, "stop"), "serve_forever_stoppable() must be called" (host, port) = self.server_address
def stop_serve_forever(self): """Stop serve_forever_stoppable().""" assert hasattr(self, "stop"), "serve_forever_stoppable() must be called" (host, port) = self.server_address
471,985
def serve_forever_stoppable(self): """Handle one request at a time until stop_serve_forever(). http://code.activestate.com/recipes/336012/ """ self.stop = False while not self.stop: self.handle_request() print "serve_forever_stoppable received stop request"
def serve_forever_stoppable(self): """Handle one request at a time until stop_serve_forever(). http://code.activestate.com/recipes/336012/ """ self.stop_request = False self.stopped = False while not self.stop_request: self.handle_request() print "serve_forever_stoppable received stop request"
471,986
def serve_forever_stoppable(self): """Handle one request at a time until stop_serve_forever(). http://code.activestate.com/recipes/336012/ """ self.stop = False while not self.stop: self.handle_request() print "serve_forever_stoppable received stop request"
def serve_forever_stoppable(self): """Handle one request at a time until stop_serve_forever(). http://code.activestate.com/recipes/336012/ """ self.stop = False while not self.stop: self.handle_request() print "serve_forever_stoppable received stop request"
471,987
def doPUT(self, environ, start_response): """ @see: http://www.webdav.org/specs/rfc4918.html#METHOD_PUT """ path = environ["PATH_INFO"] provider = self._davProvider res = provider.getResourceInst(path, environ) parentRes = provider.getResourceInst(util.getUriParent(path), environ) isnewfile = res is None
def doPUT(self, environ, start_response): """ @see: http://www.webdav.org/specs/rfc4918.html#METHOD_PUT """ path = environ["PATH_INFO"] provider = self._davProvider res = provider.getResourceInst(path, environ) parentRes = provider.getResourceInst(util.getUriParent(path), environ) isnewfile = res is None
471,988
def doPUT(self, environ, start_response): """ @see: http://www.webdav.org/specs/rfc4918.html#METHOD_PUT """ path = environ["PATH_INFO"] provider = self._davProvider res = provider.getResourceInst(path, environ) parentRes = provider.getResourceInst(util.getUriParent(path), environ) isnewfile = res is None
def doPUT(self, environ, start_response): """ @see: http://www.webdav.org/specs/rfc4918.html#METHOD_PUT """ path = environ["PATH_INFO"] provider = self._davProvider res = provider.getResourceInst(path, environ) parentRes = provider.getResourceInst(util.getUriParent(path), environ) isnewfile = res is None
471,989
def doPUT(self, environ, start_response): """ @see: http://www.webdav.org/specs/rfc4918.html#METHOD_PUT """ path = environ["PATH_INFO"] provider = self._davProvider res = provider.getResourceInst(path, environ) parentRes = provider.getResourceInst(util.getUriParent(path), environ) isnewfile = res is None
def doPUT(self, environ, start_response): """ @see: http://www.webdav.org/specs/rfc4918.html#METHOD_PUT """ path = environ["PATH_INFO"] provider = self._davProvider res = provider.getResourceInst(path, environ) parentRes = provider.getResourceInst(util.getUriParent(path), environ) isnewfile = res is None
471,990
def doPUT(self, environ, start_response): """ @see: http://www.webdav.org/specs/rfc4918.html#METHOD_PUT """ path = environ["PATH_INFO"] provider = self._davProvider res = provider.getResourceInst(path, environ) parentRes = provider.getResourceInst(util.getUriParent(path), environ) isnewfile = res is None
def doPUT(self, environ, start_response): """ @see: http://www.webdav.org/specs/rfc4918.html#METHOD_PUT """ path = environ["PATH_INFO"] provider = self._davProvider res = provider.getResourceInst(path, environ) parentRes = provider.getResourceInst(util.getUriParent(path), environ) isnewfile = res is None
471,991
def proppatch(self, path, set_props=None, remove_props=None, namespace='DAV:', headers=None): """Patch properties on a DAV resource. If namespace is not specified the DAV namespace is used for all properties""" root = ElementTree.Element('{DAV:}propertyupdate') if set_props is not None: prop_set = ElementTree.SubEleme...
def body = StringIO.StringIO() tree.write(body) body = body.getvalue() print body proppatch(self, body = StringIO.StringIO() tree.write(body) body = body.getvalue() print body path, body = StringIO.StringIO() tree.write(body) body = body.getvalue() print body set_props=None, body = StringIO.StringIO() tree.write(bod...
471,992
def set_lock(self, path, owner, locktype='exclusive', lockscope='write', depth=None, headers=None): """Set a lock on a dav resource""" root = ElementTree.Element('{DAV:}lockinfo') object_to_etree(root, {'locktype':locktype, 'lockscope':lockscope, 'owner':{'href':owner}}, namespace='DAV:') tree = ElementTree.ElementTree...
def set_lock(self, path, owner, locktype='write', lockscope='exclusive', depth=None, headers=None): """Set a lock on a dav resource""" root = ElementTree.Element('{DAV:}lockinfo') object_to_etree(root, {'locktype':locktype, 'lockscope':lockscope, 'owner':{'href':owner}}, namespace='DAV:') tree = ElementTree.ElementTree...
471,993
def set_lock(self, path, owner, locktype='exclusive', lockscope='write', depth=None, headers=None): """Set a lock on a dav resource""" root = ElementTree.Element('{DAV:}lockinfo') object_to_etree(root, {'locktype':locktype, 'lockscope':lockscope, 'owner':{'href':owner}}, namespace='DAV:') tree = ElementTree.ElementTree...
def set_lock(self, path, owner, locktype='exclusive', lockscope='write', depth=None, headers=None): """Set a lock on a dav resource""" root = ElementTree.Element('{DAV:}lockinfo') object_to_etree(root, {'locktype':locktype, 'lockscope':lockscope, 'owner':{'href':owner}}, namespace='DAV:') tree = ElementTree.ElementTree...
471,994
def unlock(self, path, token, headers=None): """Unlock DAV resource with token""" if headers is None: headers = {} headers['Lock-Tocken'] = '<%s>' % token self._request('UNLOCK', path, body=None, headers=headers)
def unlock(self, path, token, headers=None): """Unlock DAV resource with token""" if headers is None: headers = {} headers['Lock-Token'] = '<%s>' % token self._request('UNLOCK', path, body=None, headers=headers)
471,995
def unlock(self, path, token, headers=None): """Unlock DAV resource with token""" if headers is None: headers = {} headers['Lock-Tocken'] = '<%s>' % token self._request('UNLOCK', path, body=None, headers=headers)
def unlock(self, path, token, headers=None): """Unlock DAV resource with token""" if headers is None: headers = {} headers['Lock-Tocken'] = '<%s>' % token self._request('UNLOCK', path, body=None, headers=headers)
471,996
def doPUT(self, environ, start_response): """ @see: http://www.webdav.org/specs/rfc4918.html#METHOD_PUT """ path = environ["PATH_INFO"] provider = self._davProvider res = provider.getResourceInst(path, environ) parentRes = provider.getResourceInst(util.getUriParent(path), environ) isnewfile = res is None
def doPUT(self, environ, start_response): """ @see: http://www.webdav.org/specs/rfc4918.html#METHOD_PUT """ path = environ["PATH_INFO"] provider = self._davProvider res = provider.getResourceInst(path, environ) parentRes = provider.getResourceInst(util.getUriParent(path), environ) isnewfile = res is None
471,997
def _checkWritePermission(self, res, depth, environ): """Check, if write access is allowed, otherwise raise DAVError.""" lockMan = self._davProvider.lockManager if lockMan is None or res is None: return True
def _checkWritePermission(self, res, depth, environ): """Raise DAVError(HTTP_LOCKED), if res is locked. If depth=='infinity', we also raise when child resources are locked. """ lockMan = self._davProvider.lockManager if lockMan is None or res is None: return True
471,998
def doPROPPATCH(self, environ, start_response): """Handle PROPPATCH request to set or remove a property. @see http://www.webdav.org/specs/rfc4918.html#METHOD_PROPPATCH """ path = environ["PATH_INFO"] res = self._davProvider.getResourceInst(path, environ)
defdoPROPPATCH(self,environ,start_response):"""HandlePROPPATCHrequesttosetorremoveaproperty.@seehttp://www.webdav.org/specs/rfc4918.html#METHOD_PROPPATCH"""path=environ["PATH_INFO"]res=self._davProvider.getResourceInst(path,environ)
471,999