rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
if h < 0: h=t32-h
if h < 0: h=t32+h
def u64(v, unpack=struct.unpack): h, v = unpack(">ii", v) if v < 0: v=t32-v if h: if h < 0: h=t32-h v=h*t32+v return v
28ab567c0c7426ce62c85a6ba9a3cae2bc71a843 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/28ab567c0c7426ce62c85a6ba9a3cae2bc71a843/utils.py
if v < t32: h=0
if v < t32: h = 0
def p64(v, pack=struct.pack): """Pack an integer or long into a 8-byte string""" if v < t32: h=0 else: h=v/t32 v=v%t32 return pack(">II", h, v)
d7e74949b1ea5d1b8435e08bdeb37dc29469660d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/d7e74949b1ea5d1b8435e08bdeb37dc29469660d/utils.py
h=v/t32 v=v%t32
h, v = divmod(v, t32)
def p64(v, pack=struct.pack): """Pack an integer or long into a 8-byte string""" if v < t32: h=0 else: h=v/t32 v=v%t32 return pack(">II", h, v)
d7e74949b1ea5d1b8435e08bdeb37dc29469660d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/d7e74949b1ea5d1b8435e08bdeb37dc29469660d/utils.py
if v < 0: v=t32+v
if v < 0: v = t32 + v
def u64(v, unpack=struct.unpack): """Unpack an 8-byte string into a 64-bit (or long) integer""" h, v = unpack(">ii", v) if v < 0: v=t32+v if h: if h < 0: h=t32+h v=h*t32+v return v
d7e74949b1ea5d1b8435e08bdeb37dc29469660d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/d7e74949b1ea5d1b8435e08bdeb37dc29469660d/utils.py
if h < 0: h=t32+h v=h*t32+v
if h < 0: h = t32 + h v = (h << 32) + v
def u64(v, unpack=struct.unpack): """Unpack an 8-byte string into a 64-bit (or long) integer""" h, v = unpack(">ii", v) if v < 0: v=t32+v if h: if h < 0: h=t32+h v=h*t32+v return v
d7e74949b1ea5d1b8435e08bdeb37dc29469660d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/d7e74949b1ea5d1b8435e08bdeb37dc29469660d/utils.py
v=h*t32+v
v = (h << 32) + v
def U64(v, unpack=struct.unpack): """Same as u64 but always returns a long.""" h, v = unpack(">II", v) if h: v=h*t32+v return v
d7e74949b1ea5d1b8435e08bdeb37dc29469660d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/d7e74949b1ea5d1b8435e08bdeb37dc29469660d/utils.py
def log(msg, level=zLOG.INFO): zLOG.LOG("ZEC", level, msg)
def log(msg, level=zLOG.INFO): zLOG.LOG("ZEC", level, msg)
18c6f729fe9eb1dc56bff0cb3204d846147e59cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/18c6f729fe9eb1dc56bff0cb3204d846147e59cb/ClientCache.py
def __init__(self, storage='1', size=20000000, client=None, var=None): # Arguments: # storage -- storage name (used in persistent cache file names only) # size -- size limit in bytes of both files together # client -- if not None, use a persistent cache file and use this name # var -- directory where to create persiste...
18c6f729fe9eb1dc56bff0cb3204d846147e59cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/18c6f729fe9eb1dc56bff0cb3204d846147e59cb/ClientCache.py
log("%s: storage=%r, size=%r; file[%r]=%r" % (self.__class__.__name__, storage, size, current, p[current])) self._limit = size / 2
self.log("%s: storage=%r, size=%r; file[%r]=%r" % (self.__class__.__name__, storage, size, current, p[current]))
def __init__(self, storage='1', size=20000000, client=None, var=None): # Arguments: # storage -- storage name (used in persistent cache file names only) # size -- size limit in bytes of both files together # client -- if not None, use a persistent cache file and use this name # var -- directory where to create persiste...
18c6f729fe9eb1dc56bff0cb3204d846147e59cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/18c6f729fe9eb1dc56bff0cb3204d846147e59cb/ClientCache.py
read_index(index, serial, f[not current], not current) self._pos = read_index(index, serial, f[current], current)
self.read_index(serial, not current) self._pos = self.read_index(serial, current)
def open(self): # Two tasks: # - Set self._index, self._get, and self._pos. # - Read and validate both cache files, returning a list of # serials to be used by verify(). # This may be called more than once (by the cache verification code). self._acquire() try: self._index = index = {} self._get = index.get serial = {...
18c6f729fe9eb1dc56bff0cb3204d846147e59cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/18c6f729fe9eb1dc56bff0cb3204d846147e59cb/ClientCache.py
log("invalidate: short record for oid %16x " "at position %d in cache file %d" % (U64(oid), ap, p < 0))
self.log("invalidate: short record for oid %16x " "at position %d in cache file %d" % (U64(oid), ap, p < 0))
def invalidate(self, oid, version): self._acquire() try: p = self._get(oid, None) if p is None: self._trace(0x10, oid, version) return None f = self._f[p < 0] ap = abs(p) f.seek(ap) h = f.read(27) if len(h) != 27: log("invalidate: short record for oid %16x " "at position %d in cache file %d" % (U64(oid), ap, p < 0)) de...
18c6f729fe9eb1dc56bff0cb3204d846147e59cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/18c6f729fe9eb1dc56bff0cb3204d846147e59cb/ClientCache.py
log("invalidate: oid mismatch: expected %16x read %16x " "at position %d in cache file %d" % (U64(oid), U64(h[:8]), ap, p < 0))
self.log("invalidate: oid mismatch: expected %16x read %16x " "at position %d in cache file %d" % (U64(oid), U64(h[:8]), ap, p < 0))
def invalidate(self, oid, version): self._acquire() try: p = self._get(oid, None) if p is None: self._trace(0x10, oid, version) return None f = self._f[p < 0] ap = abs(p) f.seek(ap) h = f.read(27) if len(h) != 27: log("invalidate: short record for oid %16x " "at position %d in cache file %d" % (U64(oid), ap, p < 0)) de...
18c6f729fe9eb1dc56bff0cb3204d846147e59cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/18c6f729fe9eb1dc56bff0cb3204d846147e59cb/ClientCache.py
log("load: bad record for oid %16x " "at position %d in cache file %d" % (U64(oid), ap, p < 0))
self.log("load: bad record for oid %16x " "at position %d in cache file %d" % (U64(oid), ap, p < 0))
def load(self, oid, version): self._acquire() try: p = self._get(oid, None) if p is None: self._trace(0x20, oid, version) return None f = self._f[p < 0] ap = abs(p) seek = f.seek read = f.read seek(ap) h = read(27) if len(h)==27 and h[8] in 'nv' and h[:8]==oid: tlen, vlen, dlen = unpack(">iHi", h[9:19]) else: tlen = -1...
18c6f729fe9eb1dc56bff0cb3204d846147e59cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/18c6f729fe9eb1dc56bff0cb3204d846147e59cb/ClientCache.py
log("modifiedInVersion: bad record for oid %16x " "at position %d in cache file %d" % (U64(oid), ap, p < 0))
self.log("modifiedInVersion: bad record for oid %16x " "at position %d in cache file %d" % (U64(oid), ap, p < 0))
def modifiedInVersion(self, oid): # This should return: # - The version from the record for oid, if there is one. # - '', if there is no version in the record and its status is 'v'. # - None, if we don't know: no valid record or status is 'n'. self._acquire() try: p = self._get(oid, None) if p is None: self._trace(0x40...
18c6f729fe9eb1dc56bff0cb3204d846147e59cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/18c6f729fe9eb1dc56bff0cb3204d846147e59cb/ClientCache.py
log("flipping cache files. new current = %d" % current)
self.log("flipping cache files. new current = %d" % current)
def checkSize(self, size): # Make sure we aren't going to exceed the target size. # If we are, then flip the cache. self._acquire() try: if self._pos + size > self._limit: current = not self._current self._current = current self._trace(0x70) log("flipping cache files. new current = %d" % current) # Delete the half of ...
18c6f729fe9eb1dc56bff0cb3204d846147e59cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/18c6f729fe9eb1dc56bff0cb3204d846147e59cb/ClientCache.py
log("cannot write tracefile %s (%s)" % (tfn, msg)) else: log("opened tracefile %s" % tfn)
self.log("cannot write tracefile %s (%s)" % (tfn, msg)) else: self.log("opened tracefile %s" % tfn)
def _setup_trace(self): # See if cache tracing is requested through $ZEO_CACHE_TRACE. # If not, or if we can't write to the trace file, # disable tracing by setting self._trace to a dummy function. self._tracefile = None tfn = os.environ.get("ZEO_CACHE_TRACE") if tfn: try: self._tracefile = open(tfn, "ab") self._trace(...
18c6f729fe9eb1dc56bff0cb3204d846147e59cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/18c6f729fe9eb1dc56bff0cb3204d846147e59cb/ClientCache.py
def read_index(index, serial, f, fileindex): seek = f.seek read = f.read pos = 4 count = 0 while 1:
def read_index(self, serial, fileindex): index = self._index f = self._f[fileindex] seek = f.seek read = f.read pos = 4 count = 0 while 1: f.seek(pos) h = read(27) if len(h) != 27: if h: self.rilog("truncated header", pos, fileindex) break if h[8] in 'vni': tlen, vlen, dlen = unpack(">iHi", h[9:19]) else: tlen = -1 ...
def read_index(index, serial, f, fileindex): seek = f.seek read = f.read pos = 4 count = 0 while 1: f.seek(pos) h = read(27) if len(h) != 27: # An empty read is expected, anything else is suspect if h: rilog("truncated header", pos, fileindex) break if h[8] in 'vni': tlen, vlen, dlen = unpack(">iHi", h[9:19]) else: t...
18c6f729fe9eb1dc56bff0cb3204d846147e59cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/18c6f729fe9eb1dc56bff0cb3204d846147e59cb/ClientCache.py
h = read(27) if len(h) != 27: if h: rilog("truncated header", pos, fileindex) break if h[8] in 'vni': tlen, vlen, dlen = unpack(">iHi", h[9:19]) else: tlen = -1 if tlen <= 0 or vlen < 0 or dlen < 0 or vlen + dlen > tlen: rilog("invalid header data", pos, fileindex) break oid = h[:8] if h[8] == 'v' and vlen: seek(dl...
try: f.truncate() except: pass if count: self.log("read_index: cache file %d has %d records and %d bytes" % (fileindex, count, pos)) return pos def rilog(self, msg, pos, fileindex): self.log("read_index: %s at position %d in cache file %d" % (msg, pos, fileindex)) def log(self, msg, level=zLOG.INFO): zLOG.LOG("ZEC...
def read_index(index, serial, f, fileindex): seek = f.seek read = f.read pos = 4 count = 0 while 1: f.seek(pos) h = read(27) if len(h) != 27: # An empty read is expected, anything else is suspect if h: rilog("truncated header", pos, fileindex) break if h[8] in 'vni': tlen, vlen, dlen = unpack(">iHi", h[9:19]) else: t...
18c6f729fe9eb1dc56bff0cb3204d846147e59cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/18c6f729fe9eb1dc56bff0cb3204d846147e59cb/ClientCache.py
cs = ClientStorage(addr, storage=storage, debug=1, wait=1)
cs = ClientStorage(addr, storage=storage, wait=1, read_only=1)
def check_server(addr, storage, write): if ZEO_VERSION == 2: cs = ClientStorage(addr, storage=storage, debug=1, wait=1) else: cs = ClientStorage(addr, storage=storage, debug=1, wait_for_server_on_startup=1) # _startup() is an artifact of the way ZEO 1.0 works. The # ClientStorage doesn't get fully initialized until re...
556a793f6d1fc764ba57c27042ccefb189c0225d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/556a793f6d1fc764ba57c27042ccefb189c0225d/zeoup.py
def testEmptyFirstBucketReportedByGuido(self):
def XXXtestEmptyFirstBucketReportedByGuido(self):
def testEmptyFirstBucketReportedByGuido(self): b = self.t for i in xrange(29972): # reduce to 29971 and it works b[i] = i for i in xrange(30): # reduce to 29 and it works del b[i] b[i+40000] = i
d27d3a6d0225a9361dffce8a5a6d8c151389b287 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/d27d3a6d0225a9361dffce8a5a6d8c151389b287/testBTrees.py
if not self._oids: self._oids = self._server.new_oids() self._oids.reverse() oid = self._oids.pop() self._oid_lock.release() return oid
try: if not self._oids: self._oids = self._server.new_oids() self._oids.reverse() return self._oids.pop() finally: self._oid_lock.release()
def new_oid(self, last=None): if self._is_read_only: raise POSException.ReadOnlyError() # avoid multiple oid requests to server at the same time self._oid_lock.acquire() if not self._oids: self._oids = self._server.new_oids() self._oids.reverse() oid = self._oids.pop() self._oid_lock.release() return oid
e665b885a307a437fa77dc8ae383c1c0fbf8e88d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e665b885a307a437fa77dc8ae383c1c0fbf8e88d/ClientStorage.py
0
False
def __getattr__(self, name): """Get attributes that can't be gotten the usual way
cce3c72e4dd89a22de5db2fcf0875be7431c0fca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/cce3c72e4dd89a22de5db2fcf0875be7431c0fca/test_overriding_attrs.py
try: del self._keys
try: del self._v_keys
def __setitem__(self, key, v):
37130a76c083481cb70c3b12bc9f8d849e2452a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/37130a76c083481cb70c3b12bc9f8d849e2452a5/Persistence.py
try: del self._keys
try: del self._v_keys
def __delitem__(self, key):
37130a76c083481cb70c3b12bc9f8d849e2452a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/37130a76c083481cb70c3b12bc9f8d849e2452a5/Persistence.py
try: return self._keys
try: return self._v_keys
def keys(self):
37130a76c083481cb70c3b12bc9f8d849e2452a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/37130a76c083481cb70c3b12bc9f8d849e2452a5/Persistence.py
keys=self._keys=filter(
keys=self._v_keys=filter(
def keys(self):
37130a76c083481cb70c3b12bc9f8d849e2452a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/37130a76c083481cb70c3b12bc9f8d849e2452a5/Persistence.py
if hasattr(self,'_keys'): del self._keys
if hasattr(self,'_v_keys'): del self._v_keys
def clear(self):
37130a76c083481cb70c3b12bc9f8d849e2452a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/37130a76c083481cb70c3b12bc9f8d849e2452a5/Persistence.py
another. `other' must have an .iterator() method.
another. `other` must have an .iterator() method.
def copyTransactionsFrom(self, other, verbose=0): """Copy transactions from another storage.
65df37866a84d3f5048116931d5872c773f2956a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/65df37866a84d3f5048116931d5872c773f2956a/BaseStorage.py
opts, args = getopt.getopt(args, 'zd:n:Ds:M')
opts, args = getopt.getopt(args, 'zd:n:Ds:L')
def main(args): opts, args = getopt.getopt(args, 'zd:n:Ds:M') z=s=None data=sys.argv[0] nrep=5 minimize=0 for o, v in opts: if o=='-n': nrep=string.atoi(v) elif o=='-d': data=v elif o=='-s': s=v elif o=='-z': global zlib import zlib z=compress elif o=='-M': minimize=1 elif o=='-D': global debug os.environ['STUPID_LOG_...
f945ce2b2819d3d7fe5d9f284fc13516ed151986 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/f945ce2b2819d3d7fe5d9f284fc13516ed151986/speed.py
return '<Connection at %08x%s>' % (id(self),ver)
return '<Connection at %08x%s>' % (id(self), ver)
def __repr__(self): if self._version: ver = ' (in version %s)' % `self._version` else: ver = '' return '<Connection at %08x%s>' % (id(self),ver)
8f44f0fa4dea8b55bb647630f9a0187d2cf2b3c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/8f44f0fa4dea8b55bb647630f9a0187d2cf2b3c9/Connection.py
self._cache.invalidate(object._p_oid)
if object._p_oid is not None: self._cache.invalidate(object._p_oid)
def abort(self, object, transaction): """Abort the object in the transaction.
8f44f0fa4dea8b55bb647630f9a0187d2cf2b3c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/8f44f0fa4dea8b55bb647630f9a0187d2cf2b3c9/Connection.py
self._invalidated[oid]=1
assert oid is not None self._invalidated[oid] = 1
def invalidate(self, oid): """Invalidate a particular oid
8f44f0fa4dea8b55bb647630f9a0187d2cf2b3c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/8f44f0fa4dea8b55bb647630f9a0187d2cf2b3c9/Connection.py
oid=object._p_oid
oid = object._p_oid
def setstate(self, object): oid=object._p_oid
8f44f0fa4dea8b55bb647630f9a0187d2cf2b3c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/8f44f0fa4dea8b55bb647630f9a0187d2cf2b3c9/Connection.py
msg = "Shouldn't load state for %s when the connection is closed" % `oid` LOG('ZODB',ERROR, msg)
msg = ("Shouldn't load state for %s " "when the connection is closed" % `oid`) LOG('ZODB', ERROR, msg)
def setstate(self, object): oid=object._p_oid
8f44f0fa4dea8b55bb647630f9a0187d2cf2b3c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/8f44f0fa4dea8b55bb647630f9a0187d2cf2b3c9/Connection.py
invalid=self._invalid
invalid = self._invalid
def setstate(self, object): oid=object._p_oid
8f44f0fa4dea8b55bb647630f9a0187d2cf2b3c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/8f44f0fa4dea8b55bb647630f9a0187d2cf2b3c9/Connection.py
invalid=1
invalid = 1
def setstate(self, object): oid=object._p_oid
8f44f0fa4dea8b55bb647630f9a0187d2cf2b3c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/8f44f0fa4dea8b55bb647630f9a0187d2cf2b3c9/Connection.py
invalid=0 file=StringIO(p) unpickler=Unpickler(file) unpickler.persistent_load=self._persistent_load
invalid = 0 file = StringIO(p) unpickler = Unpickler(file) unpickler.persistent_load = self._persistent_load
def setstate(self, object): oid=object._p_oid
8f44f0fa4dea8b55bb647630f9a0187d2cf2b3c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/8f44f0fa4dea8b55bb647630f9a0187d2cf2b3c9/Connection.py
d=object.__dict__ for k,v in state.items(): d[k]=v object._p_serial=serial
d = object.__dict__ for k, v in state.items(): d[k] = v object._p_serial = serial
def setstate(self, object): oid=object._p_oid
8f44f0fa4dea8b55bb647630f9a0187d2cf2b3c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/8f44f0fa4dea8b55bb647630f9a0187d2cf2b3c9/Connection.py
try: del self._invalidated[oid] except KeyError: pass
try: del self._invalidated[oid] except KeyError: pass
def setstate(self, object): oid=object._p_oid
8f44f0fa4dea8b55bb647630f9a0187d2cf2b3c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/8f44f0fa4dea8b55bb647630f9a0187d2cf2b3c9/Connection.py
def _handle_serial(self, store_return, oid=None, change=1): """Handle the returns from store() and tpc_vote() calls."""
8f44f0fa4dea8b55bb647630f9a0187d2cf2b3c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/8f44f0fa4dea8b55bb647630f9a0187d2cf2b3c9/Connection.py
def tpc_finish(self, transaction):
8f44f0fa4dea8b55bb647630f9a0187d2cf2b3c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/8f44f0fa4dea8b55bb647630f9a0187d2cf2b3c9/Connection.py
invalidate=self._db.invalidate
def _invalidate_invalidating(self): invalidate=self._db.invalidate for oid in self._invalidating: invalidate(oid, self) self._db.finish_invalidation()
8f44f0fa4dea8b55bb647630f9a0187d2cf2b3c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/8f44f0fa4dea8b55bb647630f9a0187d2cf2b3c9/Connection.py
invalidate(oid, self)
assert oid is not None self._db.invalidate(oid, self)
def _invalidate_invalidating(self): invalidate=self._db.invalidate for oid in self._invalidating: invalidate(oid, self) self._db.finish_invalidation()
8f44f0fa4dea8b55bb647630f9a0187d2cf2b3c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/8f44f0fa4dea8b55bb647630f9a0187d2cf2b3c9/Connection.py
def getDebugInfo(self): return self._debug_info def setDebugInfo(self, *args): self._debug_info=self._debug_info+args
def getDebugInfo(self): return self._debug_info def setDebugInfo(self, *args): self._debug_info = self._debug_info + args
def getDebugInfo(self): return self._debug_info
8f44f0fa4dea8b55bb647630f9a0187d2cf2b3c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/8f44f0fa4dea8b55bb647630f9a0187d2cf2b3c9/Connection.py
res = (self._load_count, self._store_count)
res = self._load_count, self._store_count
def getTransferCounts(self, clear=0): """Returns the number of objects loaded and stored.
8f44f0fa4dea8b55bb647630f9a0187d2cf2b3c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/8f44f0fa4dea8b55bb647630f9a0187d2cf2b3c9/Connection.py
def setCacheDeactivateAfter(self, v): self._cache_deactivate_after=v def setCacheSize(self, v): self._cache_size=v
def setCacheDeactivateAfter(self, v): self._cache_deactivate_after=v for c in self._pools[0][''][1]: c._cache.cache_age=v def setCacheSize(self, v): self._cache_size=v for c in self._pools[0][''][1]: c._cache.cache_size=v
def setCacheDeactivateAfter(self, v): self._cache_deactivate_after=v
cce3284db070a268bbc6e5c48cad91734762d81a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/cce3284db070a268bbc6e5c48cad91734762d81a/DB.py
def setVersionCacheSize(self, v): self._version_cache_size=v
for ver in self._pools[0].keys(): if ver: for c in self._pools[0][ver][1]: c._cache.cache_age=v def setVersionCacheSize(self, v): self._version_cache_size=v for ver in self._pools[0].keys(): if v: for c in self._pools[0][ver][1]: c._cache.cache_size=v
def setVersionCacheSize(self, v): self._version_cache_size=v
cce3284db070a268bbc6e5c48cad91734762d81a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/cce3284db070a268bbc6e5c48cad91734762d81a/DB.py
__traceback_info__=oid
__traceback_info__ = (oid, p)
def __getitem__(self, oid, tt=type(()), ct=type(HelperClass)): cache=self._cache if cache.has_key(oid): return cache[oid]
cefe54e871aa7332bdb312bf50772e1786f2c1fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/cefe54e871aa7332bdb312bf50772e1786f2c1fb/Connection.py
object = unpickler.load()
try: object = unpickler.load() except: raise "Could not load oid %s, pickled data in traceback info may\ contain clues" % (oid)
def __getitem__(self, oid, tt=type(()), ct=type(HelperClass)): cache=self._cache if cache.has_key(oid): return cache[oid]
cefe54e871aa7332bdb312bf50772e1786f2c1fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/cefe54e871aa7332bdb312bf50772e1786f2c1fb/Connection.py
current=not current
current=not self._current
def checkSize(self, size): # Make sure we aren't going to exceed the target size. # If we are, then flip the cache. if self._pos+size > self._limit: current=not current self._current=current self._f[current]=open(self._p[current],'w+b') self._f[current].write(magic) self._pos=pos=4
516b5076fb20745e1661108d649bf82ab5670ecc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/516b5076fb20745e1661108d649bf82ab5670ecc/ClientCache.py
unpickler.load() state = unpickler.load()
try: unpickler.load() state = unpickler.load() except: t, v =sys.exc_info()[:2] raise
def setstate(self,object): # Note, we no longer mess with the object's state # flag, _p_changed. This is the object's job. oid=object._p_oid invalid=self._invalid if invalid(oid) or invalid(None): raise ConflictError, oid p, serial = self._storage.load(oid, self._version) file=StringIO(p) unpickler=Unpickler(file) unp...
f6a4756fbb5522e2996db29cc68484b3bd39226f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/f6a4756fbb5522e2996db29cc68484b3bd39226f/Connection.py
unless = self.failUnless
require = self.assert_
def checkTimeoutProvokingConflicts(self): eq = self.assertEqual raises = self.assertRaises unless = self.failUnless self._storage = storage = self.openClientStorage() # Assert that the zeo cache is empty unless(not list(storage._cache.contents())) # Create the object oid = storage.new_oid() obj = MinPO(7) # We need to ...
4659d8eb20fb53ceb449f9082c96342b24dfed27 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/4659d8eb20fb53ceb449f9082c96342b24dfed27/ConnectionTests.py
unless(not list(storage._cache.contents()))
require(not list(storage._cache.contents()))
def checkTimeoutProvokingConflicts(self): eq = self.assertEqual raises = self.assertRaises unless = self.failUnless self._storage = storage = self.openClientStorage() # Assert that the zeo cache is empty unless(not list(storage._cache.contents())) # Create the object oid = storage.new_oid() obj = MinPO(7) # We need to ...
4659d8eb20fb53ceb449f9082c96342b24dfed27 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/4659d8eb20fb53ceb449f9082c96342b24dfed27/ConnectionTests.py
def checkTimeoutProvokingConflicts(self): eq = self.assertEqual raises = self.assertRaises unless = self.failUnless self._storage = storage = self.openClientStorage() # Assert that the zeo cache is empty unless(not list(storage._cache.contents())) # Create the object oid = storage.new_oid() obj = MinPO(7) # We need to ...
4659d8eb20fb53ceb449f9082c96342b24dfed27 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/4659d8eb20fb53ceb449f9082c96342b24dfed27/ConnectionTests.py
time.sleep(3)
deadline = time.time() + 60 while time.time() < deadline: if storage.is_connected(): time.sleep(self.timeout / 1.8) storage.sync() else: break
def checkTimeoutProvokingConflicts(self): eq = self.assertEqual raises = self.assertRaises unless = self.failUnless self._storage = storage = self.openClientStorage() # Assert that the zeo cache is empty unless(not list(storage._cache.contents())) # Create the object oid = storage.new_oid() obj = MinPO(7) # We need to ...
4659d8eb20fb53ceb449f9082c96342b24dfed27 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/4659d8eb20fb53ceb449f9082c96342b24dfed27/ConnectionTests.py
unless(not storage.is_connected())
require(not storage.is_connected())
def checkTimeoutProvokingConflicts(self): eq = self.assertEqual raises = self.assertRaises unless = self.failUnless self._storage = storage = self.openClientStorage() # Assert that the zeo cache is empty unless(not list(storage._cache.contents())) # Create the object oid = storage.new_oid() obj = MinPO(7) # We need to ...
4659d8eb20fb53ceb449f9082c96342b24dfed27 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/4659d8eb20fb53ceb449f9082c96342b24dfed27/ConnectionTests.py
unless(storage.is_connected())
require(storage.is_connected())
def checkTimeoutProvokingConflicts(self): eq = self.assertEqual raises = self.assertRaises unless = self.failUnless self._storage = storage = self.openClientStorage() # Assert that the zeo cache is empty unless(not list(storage._cache.contents())) # Create the object oid = storage.new_oid() obj = MinPO(7) # We need to ...
4659d8eb20fb53ceb449f9082c96342b24dfed27 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/4659d8eb20fb53ceb449f9082c96342b24dfed27/ConnectionTests.py
def checkTimeoutProvokingConflicts(self): eq = self.assertEqual raises = self.assertRaises unless = self.failUnless self._storage = storage = self.openClientStorage() # Assert that the zeo cache is empty unless(not list(storage._cache.contents())) # Create the object oid = storage.new_oid() obj = MinPO(7) # We need to ...
4659d8eb20fb53ceb449f9082c96342b24dfed27 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/4659d8eb20fb53ceb449f9082c96342b24dfed27/ConnectionTests.py
def checkTimeoutProvokingConflicts(self): eq = self.assertEqual raises = self.assertRaises unless = self.failUnless self._storage = storage = self.openClientStorage() # Assert that the zeo cache is empty unless(not list(storage._cache.contents())) # Create the object oid = storage.new_oid() obj = MinPO(7) # We need to ...
4659d8eb20fb53ceb449f9082c96342b24dfed27 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/4659d8eb20fb53ceb449f9082c96342b24dfed27/ConnectionTests.py
def checkTimeoutProvokingConflicts(self): eq = self.assertEqual raises = self.assertRaises unless = self.failUnless self._storage = storage = self.openClientStorage() # Assert that the zeo cache is empty unless(not list(storage._cache.contents())) # Create the object oid = storage.new_oid() obj = MinPO(7) # We need to ...
4659d8eb20fb53ceb449f9082c96342b24dfed27 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/4659d8eb20fb53ceb449f9082c96342b24dfed27/ConnectionTests.py
def checkTimeoutProvokingConflicts(self): eq = self.assertEqual raises = self.assertRaises unless = self.failUnless self._storage = storage = self.openClientStorage() # Assert that the zeo cache is empty unless(not list(storage._cache.contents())) # Create the object oid = storage.new_oid() obj = MinPO(7) # We need to ...
4659d8eb20fb53ceb449f9082c96342b24dfed27 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/4659d8eb20fb53ceb449f9082c96342b24dfed27/ConnectionTests.py
def checkTimeoutProvokingConflicts(self): eq = self.assertEqual raises = self.assertRaises unless = self.failUnless self._storage = storage = self.openClientStorage() # Assert that the zeo cache is empty unless(not list(storage._cache.contents())) # Create the object oid = storage.new_oid() obj = MinPO(7) # We need to ...
4659d8eb20fb53ceb449f9082c96342b24dfed27 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/4659d8eb20fb53ceb449f9082c96342b24dfed27/ConnectionTests.py
def checkTimeoutProvokingConflicts(self): eq = self.assertEqual raises = self.assertRaises unless = self.failUnless self._storage = storage = self.openClientStorage() # Assert that the zeo cache is empty unless(not list(storage._cache.contents())) # Create the object oid = storage.new_oid() obj = MinPO(7) # We need to ...
4659d8eb20fb53ceb449f9082c96342b24dfed27 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/4659d8eb20fb53ceb449f9082c96342b24dfed27/ConnectionTests.py
if j is None: continue i=id(j) if not jars.has_key(i): jars[i]=j if subtransaction: subj[i]=j j.tpc_begin(self, subtransaction) else: j.tpc_begin(self) j.commit(o,self)
if j is not None: i=id(j) if not jars.has_key(i): jars[i]=j if subtransaction: subj[i]=j j.tpc_begin(self, subtransaction) else: j.tpc_begin(self) j.commit(o,self)
def commit(self, subtransaction=None): 'Finalize the transaction'
f6b665bb43c12dce05ecac9859e13781c2e76659 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/f6b665bb43c12dce05ecac9859e13781c2e76659/Transaction.py
line = f.readline() while line != "------\n":
line = f.readline().strip() while line != "------":
def verifyEntry(self, f, time=None, subsys=None, severity=None, summary=None, detail=None, error=None): # skip to the beginning of next entry line = f.readline() while line != "------\n": if not line: self.fail("can't find entry in log file") line = f.readline() line = f.readline().strip() _time, rest = line.split(" "...
0b70a63bb11ec7470ed9211e2dfca57cc51203c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/0b70a63bb11ec7470ed9211e2dfca57cc51203c9/testzLog.py
line = f.readline()
line = f.readline().strip()
def verifyEntry(self, f, time=None, subsys=None, severity=None, summary=None, detail=None, error=None): # skip to the beginning of next entry line = f.readline() while line != "------\n": if not line: self.fail("can't find entry in log file") line = f.readline() line = f.readline().strip() _time, rest = line.split(" "...
0b70a63bb11ec7470ed9211e2dfca57cc51203c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/0b70a63bb11ec7470ed9211e2dfca57cc51203c9/testzLog.py
last = "%s: %s\n" % (error[0], error[1])
last = "%s: %s" % (error[0], error[1])
def verifyEntry(self, f, time=None, subsys=None, severity=None, summary=None, detail=None, error=None): # skip to the beginning of next entry line = f.readline() while line != "------\n": if not line: self.fail("can't find entry in log file") line = f.readline() line = f.readline().strip() _time, rest = line.split(" "...
0b70a63bb11ec7470ed9211e2dfca57cc51203c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/0b70a63bb11ec7470ed9211e2dfca57cc51203c9/testzLog.py
line = f.readline()
line = f.readline().strip()
def verifyEntry(self, f, time=None, subsys=None, severity=None, summary=None, detail=None, error=None): # skip to the beginning of next entry line = f.readline() while line != "------\n": if not line: self.fail("can't find entry in log file") line = f.readline() line = f.readline().strip() _time, rest = line.split(" "...
0b70a63bb11ec7470ed9211e2dfca57cc51203c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/0b70a63bb11ec7470ed9211e2dfca57cc51203c9/testzLog.py
if line == "------\n":
if line == "------":
def verifyEntry(self, f, time=None, subsys=None, severity=None, summary=None, detail=None, error=None): # skip to the beginning of next entry line = f.readline() while line != "------\n": if not line: self.fail("can't find entry in log file") line = f.readline() line = f.readline().strip() _time, rest = line.split(" "...
0b70a63bb11ec7470ed9211e2dfca57cc51203c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/0b70a63bb11ec7470ed9211e2dfca57cc51203c9/testzLog.py
i=i+22+vlen+dlen
i=i+14+vlen+dlen
def tpc_finish(self, transaction, f=None): self._lock_acquire() try: if transaction is not self._transaction: return if f is not None: f()
bd1e5a99ea27a969ebb0e73bd6dde8cc5b891bf2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/bd1e5a99ea27a969ebb0e73bd6dde8cc5b891bf2/ClientStorage.py
l=allocate_lock() self._a=l.acquire self._r=l.release self._pools={},[] self._temps=[] self._pool_size=pool_size self._cache_size=cache_size self._cache_deactivate_after=cache_deactivate_after self._version_pool_size=version_pool_size self._version_cache_size=version_cache_size self._version_cache_deactivate_after=...
def __init__(self, storage, pool_size=7, cache_size=400, cache_deactivate_after=60, version_pool_size=3, version_cache_size=100, version_cache_deactivate_after=10, ): """Create an object database.
7d0a92de638e15c1ee62d04a8e74d8914b4f8dfd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/7d0a92de638e15c1ee62d04a8e74d8914b4f8dfd/DB.py
cs = ClientStorage(addr, storage=storage,
cs = ClientStorage(addr, storage=storage, debug=1,
def check_server(addr, storage): cs = ClientStorage(addr, storage=storage, wait_for_server_on_startup=0) # _startup() is an artifact of the way ZEO 1.0 works. The # ClientStorage doesn't get fully initialized until registerDB() # is called. The only thing we care about, though, is that # registerDB() calls _startup()...
5718e5f8ab0d4f3eff35cd0c7426042366e9c7fa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/5718e5f8ab0d4f3eff35cd0c7426042366e9c7fa/zeoup.py
cache.checkSize(size)
cache.checkSize(0)
def load(self, oid, version, _stuff=None): self._lock_acquire() try: cache=self._cache p = cache.load(oid, version) if p: return p p, s, v, pv, sv = self._call('zeoLoad', oid) cache.checkSize(size) cache.store(oid, p, s, v, pv, sv) if not v or not version or version != v: if s: return p, s raise KeyError, oid # no non-...
05a6ce7e6ebd5c02608b9043b06a1af4fe010bf0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/05a6ce7e6ebd5c02608b9043b06a1af4fe010bf0/ClientStorage.py
print "newargs", repr(newargs)
def serialize(self, obj): # We don't use __class__ here, because obj could be a persistent proxy. # We don't want to be folled by proxies. klass = type(obj)
26ece502e64f921c5f8437dd28d0cbdd00c6b230 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/26ece502e64f921c5f8437dd28d0cbdd00c6b230/serialize.py
cmd = "%s %s" % (sys.executable, ZEO.start.__file__) if cmd[-1] == "c": cmd = cmd[:-1]
def removefs(base): """Remove all files created by FileStorage with path base.""" for ext in '', '.old', '.tmp', '.lock', '.index', '.pack': path = base + ext try: os.remove(path) except os.error, err: if err[0] != errno.ENOENT: raise
af6684f5113439ca6168551fb6389f0877cc8a9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/af6684f5113439ca6168551fb6389f0877cc8a9b/testStart.py
self.env = Environment(self.cmd)
def setUp(self): self.pids = {} self.env = Environment(self.cmd)
af6684f5113439ca6168551fb6389f0877cc8a9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/af6684f5113439ca6168551fb6389f0877cc8a9b/testStart.py
buf1 = open(logfile1).read()
for i in range(10): try: buf1 = open(logfile1).read() except IOError, e: if e.errno != errno.ENOENT: raise time.sleep(1) else: break
def testLogRestart(self): port = 9090 logfile1 = tempfile.mktemp(suffix="log") logfile2 = tempfile.mktemp(suffix="log") os.environ["EVENT_LOG_FILE"] = logfile1
af6684f5113439ca6168551fb6389f0877cc8a9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/af6684f5113439ca6168551fb6389f0877cc8a9b/testStart.py
t=self.t t.update([(1,1),(5,5),(9,9)]) self.assertEqual(list(t.keys(-6,-4)),[], list(t.keys(-6,-4))) self.assertEqual(list(t.keys(2,4)),[], list(t.keys(2,4))) self.assertEqual(list(t.keys(6,8)),[], list(t.keys(6,8))) self.assertEqual(list(t.keys(10,12)),[], list(t.keys(10,12)))
t = self.t t.update([(1,1), (5,5), (9,9)]) self.assertEqual(list(t.keys(-6,-4)), [], list(t.keys(-6,-4))) self.assertEqual(list(t.keys(2,4)), [], list(t.keys(2,4))) self.assertEqual(list(t.keys(6,8)), [], list(t.keys(6,8))) self.assertEqual(list(t.keys(10,12)), [], list(t.keys(10,12))) self.assertEqual(list(t.keys(9, 1...
def testEmptyRangeSearches(self): t=self.t t.update([(1,1),(5,5),(9,9)]) self.assertEqual(list(t.keys(-6,-4)),[], list(t.keys(-6,-4))) self.assertEqual(list(t.keys(2,4)),[], list(t.keys(2,4))) self.assertEqual(list(t.keys(6,8)),[], list(t.keys(6,8))) self.assertEqual(list(t.keys(10,12)),[], list(t.keys(10,12)))
90a7d5e264ce24fe29400d7fd7322ed3c033aedf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/90a7d5e264ce24fe29400d7fd7322ed3c033aedf/testBTrees.py
t=self.t t.update([1,5,9]) self.assertEqual(list(t.keys(-6,-4)),[], list(t.keys(-6,-4))) self.assertEqual(list(t.keys(2,4)),[], list(t.keys(2,4))) self.assertEqual(list(t.keys(6,8)),[], list(t.keys(6,8))) self.assertEqual(list(t.keys(10,12)),[], list(t.keys(10,12)))
t = self.t t.update([1, 5, 9]) self.assertEqual(list(t.keys(-6,-4)), [], list(t.keys(-6,-4))) self.assertEqual(list(t.keys(2,4)), [], list(t.keys(2,4))) self.assertEqual(list(t.keys(6,8)), [], list(t.keys(6,8))) self.assertEqual(list(t.keys(10,12)), [], list(t.keys(10,12))) self.assertEqual(list(t.keys(9,1)), [], list(...
def testEmptyRangeSearches(self): t=self.t t.update([1,5,9]) self.assertEqual(list(t.keys(-6,-4)),[], list(t.keys(-6,-4))) self.assertEqual(list(t.keys(2,4)),[], list(t.keys(2,4))) self.assertEqual(list(t.keys(6,8)),[], list(t.keys(6,8))) self.assertEqual(list(t.keys(10,12)),[], list(t.keys(10,12)))
90a7d5e264ce24fe29400d7fd7322ed3c033aedf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/90a7d5e264ce24fe29400d7fd7322ed3c033aedf/testBTrees.py
class ConnectionTests(StorageTestBase.StorageTestBase):
class ConnectionTests(StorageTestBase):
def invalidate(self, *args): pass
3cd508c395275293f366cb0b9dcf0fa90db32808 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/3cd508c395275293f366cb0b9dcf0fa90db32808/ConnectionTests.py
__super_tearDown = StorageTestBase.StorageTestBase.tearDown
__super_setUp = StorageTestBase.setUp __super_tearDown = StorageTestBase.tearDown
def invalidate(self, *args): pass
3cd508c395275293f366cb0b9dcf0fa90db32808 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/3cd508c395275293f366cb0b9dcf0fa90db32808/ConnectionTests.py
"""Start a ZEO server using a Unix domain socket The ZEO server uses the storage object returned by the getStorage() method.
"""Test setup for connection tests. This starts only one server; a test may start more servers by calling self._newAddr() and then self.startServer(index=i) for i in 1, 2, ...
def setUp(self): """Start a ZEO server using a Unix domain socket
3cd508c395275293f366cb0b9dcf0fa90db32808 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/3cd508c395275293f366cb0b9dcf0fa90db32808/ConnectionTests.py
read_only=0, read_only_fallback=0): base = ClientStorage(self.addr, client=cache, cache_size=cache_size, wait=wait, min_disconnect_poll=0.1, read_only=read_only, read_only_fallback=read_only_fallback) storage = base
read_only=0, read_only_fallback=0, addr=None): if addr is None: addr = self.addr storage = ClientStorage(addr, client=cache, cache_size=cache_size, wait=wait, min_disconnect_poll=0.1, read_only=read_only, read_only_fallback=read_only_fallback)
def openClientStorage(self, cache='', cache_size=200000, wait=1, read_only=0, read_only_fallback=0): base = ClientStorage(self.addr, client=cache, cache_size=cache_size, wait=wait, min_disconnect_poll=0.1, read_only=read_only, read_only_fallback=read_only_fallback) storage = base storage.registerDB(DummyDB(), None) ret...
3cd508c395275293f366cb0b9dcf0fa90db32808 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/3cd508c395275293f366cb0b9dcf0fa90db32808/ConnectionTests.py
select.error, thread.error, socket.error):
select.error, threading.ThreadError, socket.error):
def checkReconnectSwitch(self): # A fallback client initially connects to a read-only server, # then discovers a read-write server and switches to that
3cd508c395275293f366cb0b9dcf0fa90db32808 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/3cd508c395275293f366cb0b9dcf0fa90db32808/ConnectionTests.py
except (Disconnected, select.error, thread.error, socket.error):
except (Disconnected, select.error, threading.ThreadError, socket.error):
def checkReconnection(self): # Check that the client reconnects when a server restarts.
3cd508c395275293f366cb0b9dcf0fa90db32808 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/3cd508c395275293f366cb0b9dcf0fa90db32808/ConnectionTests.py
self._reader = ConnectionObjectReader(self, self._cache, self._db._classFactory)
def _setDB(self, odb): """Begin a new transaction.
00df8ddb2f0ffbd0c7851f816907bd6c2dd2d4ac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/00df8ddb2f0ffbd0c7851f816907bd6c2dd2d4ac/Connection.py
os.environ["EVENT_LOG_FILE"] = logfile1
os.environ["STUPID_LOG_FILE"] = logfile1
def testLogRestart(self): port = 9090 logfile1 = tempfile.mktemp(suffix="log") logfile2 = tempfile.mktemp(suffix="log") os.environ["EVENT_LOG_FILE"] = logfile1
7b10d3209d559e3cd9a61fbf21399fb4d3105346 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/7b10d3209d559e3cd9a61fbf21399fb4d3105346/testStart.py
if e.errno != errno.ENOENT: raise
if e.errno != errno.ENOENT: raise
def testLogRestart(self): port = 9090 logfile1 = tempfile.mktemp(suffix="log") logfile2 = tempfile.mktemp(suffix="log") os.environ["EVENT_LOG_FILE"] = logfile1
7b10d3209d559e3cd9a61fbf21399fb4d3105346 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/7b10d3209d559e3cd9a61fbf21399fb4d3105346/testStart.py
_CONNECT_OK = (0, errno.WSAEISCONN)
_CONNECT_OK = (0, errno.WSAEISCONN, errno.WSAEINVAL)
def notify_closed(self): self.connected = 0 self.connection = None self.client.notifyDisconnected() if not self.closed: self.connect()
a55666701792933dbb53c9afe235a02a52b1f0d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/a55666701792933dbb53c9afe235a02a52b1f0d5/client.py
self._db=self._storage=self._tmp=self.new_oid=None
self._db=self._storage=self._tmp=self.new_oid=self._opened=None self._debug_info=()
def close(self): self._incrgc() db=self._db self._db=self._storage=self._tmp=self.new_oid=None db._closeConnection(self)
a2ccfe682ea4437462606a5a717ac50675f30fa6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/a2ccfe682ea4437462606a5a717ac50675f30fa6/Connection.py
def set_uid(uid):
def set_uid(arg):
def set_uid(uid): """Try to set uid and gid based on -u argument. This will only work if this script is run by root. """ try: import pwd except ImportError: LOG('ZEO Server', INFO, ("Can't set uid to %s." "pwd module is not available." % uid)) return try: gid = None try: UID = int(UID) except: # conversion could raise...
3378c28d5e3dfbc3c53e6a2b96b066c4ea964887 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/3378c28d5e3dfbc3c53e6a2b96b066c4ea964887/start.py
UID = int(UID)
arg = int(arg)
def set_uid(uid): """Try to set uid and gid based on -u argument. This will only work if this script is run by root. """ try: import pwd except ImportError: LOG('ZEO Server', INFO, ("Can't set uid to %s." "pwd module is not available." % uid)) return try: gid = None try: UID = int(UID) except: # conversion could raise...
3378c28d5e3dfbc3c53e6a2b96b066c4ea964887 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/3378c28d5e3dfbc3c53e6a2b96b066c4ea964887/start.py
uid = pwd.getpwnam(UID)[2] gid = pwd.getpwnam(UID)[3]
uid = pwd.getpwnam(arg)[2] gid = pwd.getpwnam(arg)[3]
def set_uid(uid): """Try to set uid and gid based on -u argument. This will only work if this script is run by root. """ try: import pwd except ImportError: LOG('ZEO Server', INFO, ("Can't set uid to %s." "pwd module is not available." % uid)) return try: gid = None try: UID = int(UID) except: # conversion could raise...
3378c28d5e3dfbc3c53e6a2b96b066c4ea964887 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/3378c28d5e3dfbc3c53e6a2b96b066c4ea964887/start.py
uid = pwd.getpwuid(UID)[2] gid = pwd.getpwuid(UID)[3]
uid = pwd.getpwuid(arg)[2] gid = pwd.getpwuid(arg)[3]
def set_uid(uid): """Try to set uid and gid based on -u argument. This will only work if this script is run by root. """ try: import pwd except ImportError: LOG('ZEO Server', INFO, ("Can't set uid to %s." "pwd module is not available." % uid)) return try: gid = None try: UID = int(UID) except: # conversion could raise...
3378c28d5e3dfbc3c53e6a2b96b066c4ea964887 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/3378c28d5e3dfbc3c53e6a2b96b066c4ea964887/start.py
LOG('ZEO Server', ERROR, ("can't find UID %s" % UID))
LOG('ZEO Server', ERROR, ("can't find uid %s" % arg))
def set_uid(uid): """Try to set uid and gid based on -u argument. This will only work if this script is run by root. """ try: import pwd except ImportError: LOG('ZEO Server', INFO, ("Can't set uid to %s." "pwd module is not available." % uid)) return try: gid = None try: UID = int(UID) except: # conversion could raise...
3378c28d5e3dfbc3c53e6a2b96b066c4ea964887 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/3378c28d5e3dfbc3c53e6a2b96b066c4ea964887/start.py
set_uid(uid)
set_uid(UID)
def main(argv): me = argv[0] sys.path.insert(0, directory(me, 2)) global LOG, INFO, ERROR from zLOG import LOG, INFO, ERROR, PANIC # XXX hack for profiling support global unix, storages, zeo_pid, asyncore args = [] last = '' for a in argv[1:]: if (a[:1] != '-' and a.find('=') > 0 and last != '-S'): # lame, sorry a =...
3378c28d5e3dfbc3c53e6a2b96b066c4ea964887 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/3378c28d5e3dfbc3c53e6a2b96b066c4ea964887/start.py
def __init__(self, file_name, create=0, read_only=0, stop=None):
def __init__(self, file_name, create=0, read_only=0, stop=None, quota=None):
def __init__(self, file_name, create=0, read_only=0, stop=None):
87bee8b0fb95aebc3396958c67c3f4c465c4e4e3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/87bee8b0fb95aebc3396958c67c3f4c465c4e4e3/FileStorage.py
write(pack( ">8s" "8s" "c" "H" "H" "H" ,id, stl, 'c', len(user), len(desc), len(ext), )) if user: write(user) if desc: write(desc) if ext: write(ext) cp(tfile, file, dlen) write(stl) file.seek(pos+16) write(' ') file.flush()
try: write(pack( ">8s" "8s" "c" "H" "H" "H" ,id, stl, 'c', len(user), len(desc), len(ext), )) if user: write(user) if desc: write(desc) if ext: write(ext) cp(tfile, file, dlen) write(stl) file.seek(pos+16) write(' ') file.flush() except: file.truncate(pos)
def _finish(self, tid, u, d, e): file=self._file write=file.write tfile=self._tfile dlen=tfile.tell() tfile.seek(0) id=self._serial user, desc, ext = self._ude
87bee8b0fb95aebc3396958c67c3f4c465c4e4e3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/87bee8b0fb95aebc3396958c67c3f4c465c4e4e3/FileStorage.py
try: i=0 while 1: if os.path.exists('%s.tr%s' % (name, i)): i=i+1 else: o=open('%s.tr%s' % (name, i),'wb') seek(pos) cp(file, o, file_size-pos) o.close() break except: error("couldn\'t write truncated data for %s", name) raise POSException.StorageSystemError, ( "Couldn't save truncated data") seek(pos) file.truncate()...
_truncate(file, name, pos)
def read_index(file, name, index, vindex, tindex, stop='\377'*8): index_get=index.get vndexpos=vindex.get tappend=tindex.append read=file.read seek=file.seek seek(0,2) file_size=file.tell() seek(0) if file_size: if file_size < 4: raise FileStorageFormatError, file.name if read(4) != packed_version: raise FileStorageFo...
87bee8b0fb95aebc3396958c67c3f4c465c4e4e3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/87bee8b0fb95aebc3396958c67c3f4c465c4e4e3/FileStorage.py
if ul > tl or dl > tl or el > tl: panic('%s has invalid transaction header at %s', name, pos)
if ul > tl or dl > tl or el > tl or tl < (23+ul+dl+el): seek(-8, 2) rtl=u64(read(8)) if file_size - rtl < pos or rtl < 23: nearPanic('%s has invalid transaction header at %s', name, pos) warn("It appears that there is invalid data at the end of the " "file, possibly due to a system crash. %s truncated " "to rec...
def read_index(file, name, index, vindex, tindex, stop='\377'*8): index_get=index.get vndexpos=vindex.get tappend=tindex.append read=file.read seek=file.seek seek(0,2) file_size=file.tell() seek(0) if file_size: if file_size < 4: raise FileStorageFormatError, file.name if read(4) != packed_version: raise FileStorageFo...
87bee8b0fb95aebc3396958c67c3f4c465c4e4e3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/87bee8b0fb95aebc3396958c67c3f4c465c4e4e3/FileStorage.py