rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
print "Will rollover at %d, %d seconds from now" % (self.rolloverAt, self.rolloverAt - currentTime)
def __init__(self, filename, when='h', interval=1, backupCount=0): BaseRotatingHandler.__init__(self, filename, 'a') self.when = string.upper(when) self.backupCount = backupCount # Calculate the real rollover interval, which is just the number of # seconds between rollovers. Also set the filename suffix used when # a ...
5e9e9e19f7fae86e5d234a5cd8386bc6e34a36ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5e9e9e19f7fae86e5d234a5cd8386bc6e34a36ab/handlers.py
print "No need to rollover: %d, %d" % (t, self.rolloverAt)
def shouldRollover(self, record): """ Determine if rollover should occur
5e9e9e19f7fae86e5d234a5cd8386bc6e34a36ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5e9e9e19f7fae86e5d234a5cd8386bc6e34a36ab/handlers.py
print "%s -> %s" % (self.baseFilename, dfn)
def doRollover(self): """ do a rollover; in this case, a date/time stamp is appended to the filename when the rollover happens. However, you want the file to be named for the start of the interval, not the current time. If there is a backup count, then we have to get a list of matching filenames, sort them and remove...
5e9e9e19f7fae86e5d234a5cd8386bc6e34a36ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5e9e9e19f7fae86e5d234a5cd8386bc6e34a36ab/handlers.py
__version__ = "
__version__ = "
def testMultiply(self): self.assertEquals((0 * 10), 0) self.assertEquals((5 * 8), 40)
397b45d4bacc057884c8ba18f83ef15d9bfb6149 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/397b45d4bacc057884c8ba18f83ef15d9bfb6149/unittest.py
Note that decimal places (from zero) is usually not the same
Note that decimal places (from zero) are usually not the same
def failUnlessAlmostEqual(self, first, second, places=7, msg=None): """Fail if the two objects are unequal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero.
397b45d4bacc057884c8ba18f83ef15d9bfb6149 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/397b45d4bacc057884c8ba18f83ef15d9bfb6149/unittest.py
import unittest
def loadTestsFromName(self, name, module=None): """Return a suite of all tests cases given a string specifier.
397b45d4bacc057884c8ba18f83ef15d9bfb6149 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/397b45d4bacc057884c8ba18f83ef15d9bfb6149/unittest.py
issubclass(obj, unittest.TestCase)):
issubclass(obj, TestCase)):
def loadTestsFromName(self, name, module=None): """Return a suite of all tests cases given a string specifier.
397b45d4bacc057884c8ba18f83ef15d9bfb6149 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/397b45d4bacc057884c8ba18f83ef15d9bfb6149/unittest.py
elif isinstance(obj, unittest.TestSuite):
elif isinstance(obj, TestSuite):
def loadTestsFromName(self, name, module=None): """Return a suite of all tests cases given a string specifier.
397b45d4bacc057884c8ba18f83ef15d9bfb6149 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/397b45d4bacc057884c8ba18f83ef15d9bfb6149/unittest.py
if not isinstance(test, (unittest.TestCase, unittest.TestSuite)):
if not isinstance(test, (TestCase, TestSuite)):
def loadTestsFromName(self, name, module=None): """Return a suite of all tests cases given a string specifier.
397b45d4bacc057884c8ba18f83ef15d9bfb6149 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/397b45d4bacc057884c8ba18f83ef15d9bfb6149/unittest.py
timeTaken = float(stopTime - startTime)
timeTaken = stopTime - startTime
def run(self, test): "Run the given test case or test suite." result = self._makeResult() startTime = time.time() test(result) stopTime = time.time() timeTaken = float(stopTime - startTime) result.printErrors() self.stream.writeln(result.separator2) run = result.testsRun self.stream.writeln("Ran %d test%s in %.3fs" % (...
397b45d4bacc057884c8ba18f83ef15d9bfb6149 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/397b45d4bacc057884c8ba18f83ef15d9bfb6149/unittest.py
vsbase = r"Software\Microsoft\VisualStudio\%s.0" % version
vsbase = r"Software\Microsoft\VisualStudio\%0.1f" % version
def load_macros(self, version): vsbase = r"Software\Microsoft\VisualStudio\%s.0" % version self.set_macro("VCInstallDir", vsbase + r"\Setup\VC", "productdir") self.set_macro("VSInstallDir", vsbase + r"\Setup\VS", "productdir") net = r"Software\Microsoft\.NETFramework" self.set_macro("FrameworkDir", net, "installroot") ...
e9a92aa03ac91c307a90db8eefff22cea1b97399 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e9a92aa03ac91c307a90db8eefff22cea1b97399/msvccompiler.py
self.set_macro("FrameworkSDKDir", net, "sdkinstallroot")
if version > 7.0: self.set_macro("FrameworkSDKDir", net, "sdkinstallrootv1.1") else: self.set_macro("FrameworkSDKDir", net, "sdkinstallroot")
def load_macros(self, version): vsbase = r"Software\Microsoft\VisualStudio\%s.0" % version self.set_macro("VCInstallDir", vsbase + r"\Setup\VC", "productdir") self.set_macro("VSInstallDir", vsbase + r"\Setup\VS", "productdir") net = r"Software\Microsoft\.NETFramework" self.set_macro("FrameworkDir", net, "installroot") ...
e9a92aa03ac91c307a90db8eefff22cea1b97399 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e9a92aa03ac91c307a90db8eefff22cea1b97399/msvccompiler.py
n = int(s[:-2]) if n == 12: return 6 elif n == 13: return 7
majorVersion = int(s[:-2]) - 6 minorVersion = int(s[2:3]) / 10.0 if majorVersion == 6: minorVersion = 0 if majorVersion >= 6: return majorVersion + minorVersion
def get_build_version(): """Return the version of MSVC that was used to build Python. For Python 2.3 and up, the version number is included in sys.version. For earlier versions, assume the compiler is MSVC 6. """ prefix = "MSC v." i = string.find(sys.version, prefix) if i == -1: return 6 i = i + len(prefix) s, rest ...
e9a92aa03ac91c307a90db8eefff22cea1b97399 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e9a92aa03ac91c307a90db8eefff22cea1b97399/msvccompiler.py
if self.__version == 7:
if self.__version >= 7:
def __init__ (self, verbose=0, dry_run=0, force=0): CCompiler.__init__ (self, verbose, dry_run, force) self.__version = get_build_version() if self.__version == 7: self.__root = r"Software\Microsoft\VisualStudio" self.__macros = MacroExpander(self.__version) else: self.__root = r"Software\Microsoft\Devstudio" self.__pa...
e9a92aa03ac91c307a90db8eefff22cea1b97399 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e9a92aa03ac91c307a90db8eefff22cea1b97399/msvccompiler.py
if self.__version == 7: key = (r"%s\7.0\VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directories" % (self.__root,))
if self.__version >= 7: key = (r"%s\%0.1f\VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directories" % (self.__root, self.__version))
def get_msvc_paths(self, path, platform='x86'): """Get a list of devstudio directories (include, lib or path).
e9a92aa03ac91c307a90db8eefff22cea1b97399 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e9a92aa03ac91c307a90db8eefff22cea1b97399/msvccompiler.py
if self.__version == 7:
if self.__version >= 7:
def get_msvc_paths(self, path, platform='x86'): """Get a list of devstudio directories (include, lib or path).
e9a92aa03ac91c307a90db8eefff22cea1b97399 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e9a92aa03ac91c307a90db8eefff22cea1b97399/msvccompiler.py
def send(self, str): """Send `str' to the server.""" if self.sock is None: if self.auto_open: self.connect() else: raise NotConnected()
8531b1b28de5356f1154e13704d499121ea72af8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8531b1b28de5356f1154e13704d499121ea72af8/httplib.py
str = '%s %s %s\r\n' % (method, url, self._http_vsn_str) try: self.send(str) except socket.error, v: if v[0] != 32 or not self.auto_open: raise self.send(str)
str = '%s %s %s' % (method, url, self._http_vsn_str) self._output(str)
def putrequest(self, method, url, skip_host=0): """Send a request to the server.
8531b1b28de5356f1154e13704d499121ea72af8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8531b1b28de5356f1154e13704d499121ea72af8/httplib.py
str = '%s: %s\r\n' % (header, value) self.send(str)
str = '%s: %s' % (header, value) self._output(str)
def putheader(self, header, value): """Send a request header line to the server.
8531b1b28de5356f1154e13704d499121ea72af8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8531b1b28de5356f1154e13704d499121ea72af8/httplib.py
self.send('\r\n')
self._send_output()
def endheaders(self): """Indicate that the last header line has been sent to the server."""
8531b1b28de5356f1154e13704d499121ea72af8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8531b1b28de5356f1154e13704d499121ea72af8/httplib.py
return
def test(): """Test this module. A hodge podge of tests collected here, because they have too many external dependencies for the regular test suite. """ import sys import getopt opts, args = getopt.getopt(sys.argv[1:], 'd') dl = 0 for o, a in opts: if o == '-d': dl = dl + 1 host = 'www.python.org' selector = '/' if a...
8531b1b28de5356f1154e13704d499121ea72af8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8531b1b28de5356f1154e13704d499121ea72af8/httplib.py
install = self.find_peer ('install') inputs = install.get_inputs () outputs = install.get_outputs () assert (len (inputs) == len (outputs))
def run (self):
ba0506b3492a13f5c8cec7598bf2b5f9735ac7b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ba0506b3492a13f5c8cec7598bf2b5f9735ac7b2/bdist_dumb.py
self.strip_base_dirs (outputs, install)
install = self.distribution.find_command_obj('install') install.root = self.bdist_dir
def run (self):
ba0506b3492a13f5c8cec7598bf2b5f9735ac7b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ba0506b3492a13f5c8cec7598bf2b5f9735ac7b2/bdist_dumb.py
build_base = self.get_peer_option ('build', 'build_base') output_dir = os.path.join (build_base, "bdist") self.make_install_tree (output_dir, inputs, outputs)
self.announce ("installing to %s" % self.bdist_dir) install.ensure_ready() install.run()
def run (self):
ba0506b3492a13f5c8cec7598bf2b5f9735ac7b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ba0506b3492a13f5c8cec7598bf2b5f9735ac7b2/bdist_dumb.py
print "output_dir = %s" % output_dir
print "self.bdist_dir = %s" % self.bdist_dir
def run (self):
ba0506b3492a13f5c8cec7598bf2b5f9735ac7b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ba0506b3492a13f5c8cec7598bf2b5f9735ac7b2/bdist_dumb.py
root_dir=output_dir)
root_dir=self.bdist_dir)
def run (self):
ba0506b3492a13f5c8cec7598bf2b5f9735ac7b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ba0506b3492a13f5c8cec7598bf2b5f9735ac7b2/bdist_dumb.py
remove_tree (output_dir, self.verbose, self.dry_run)
remove_tree (self.bdist_dir, self.verbose, self.dry_run)
def run (self):
ba0506b3492a13f5c8cec7598bf2b5f9735ac7b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ba0506b3492a13f5c8cec7598bf2b5f9735ac7b2/bdist_dumb.py
def strip_base_dirs (self, outputs, install_cmd): base = install_cmd.install_base + os.sep platbase = install_cmd.install_platbase + os.sep b_len = len (base) pb_len = len (platbase) for i in range (len (outputs)): if outputs[i][0:b_len] == base: outputs[i] = outputs[i][b_len:] elif outputs[i][0:pb_len] == pla...
def run (self):
ba0506b3492a13f5c8cec7598bf2b5f9735ac7b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ba0506b3492a13f5c8cec7598bf2b5f9735ac7b2/bdist_dumb.py
lexer.whitepace = ' \t'
lexer.whitespace = ' \t'
# Look for a machine, default, or macdef top-level keyword
366a1df7f1a940a77d2d3b8ac6425fe7353f43c6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/366a1df7f1a940a77d2d3b8ac6425fe7353f43c6/netrc.py
if not line or line == '\012' and tt == '\012': lexer.whitepace = ' \t\r\n'
if not line or line == '\012': lexer.whitespace = ' \t\r\n'
# Look for a machine, default, or macdef top-level keyword
366a1df7f1a940a77d2d3b8ac6425fe7353f43c6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/366a1df7f1a940a77d2d3b8ac6425fe7353f43c6/netrc.py
tt = line
# Look for a machine, default, or macdef top-level keyword
366a1df7f1a940a77d2d3b8ac6425fe7353f43c6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/366a1df7f1a940a77d2d3b8ac6425fe7353f43c6/netrc.py
if toplevel == 'machine': login = account = password = None self.hosts[entryname] = {}
login = account = password = None self.hosts[entryname] = {}
# Look for a machine, default, or macdef top-level keyword
366a1df7f1a940a77d2d3b8ac6425fe7353f43c6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/366a1df7f1a940a77d2d3b8ac6425fe7353f43c6/netrc.py
if tt=='' or tt == 'machine' or tt == 'default' or tt == 'macdef': if toplevel == 'macdef': break elif login and password:
if (tt=='' or tt == 'machine' or tt == 'default' or tt =='macdef'): if login and password:
# Look for a machine, default, or macdef top-level keyword
366a1df7f1a940a77d2d3b8ac6425fe7353f43c6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/366a1df7f1a940a77d2d3b8ac6425fe7353f43c6/netrc.py
def testNtoH(self): for func in socket.htonl, socket.ntohl: for i in (0, 1, ~0xffff, 2L): self.assertEqual(i, func(func(i))) biglong = 2**32L - 1 swapped = func(biglong) self.assert_(swapped == biglong or swapped == -1) self.assertRaises(OverflowError, func, 2L**34)
def testNtoHL(self): sizes = {socket.htonl: 32, socket.ntohl: 32, socket.htons: 16, socket.ntohs: 16} for func, size in sizes.items(): mask = (1L<<size) - 1 for i in (0, 1, 0xffff, ~0xffff, 2, 0x01234567, 0x76543210): self.assertEqual(i & mask, func(func(i&mask)) & mask) swapped = func(mask) self.assertEqual(swapped...
def testNtoH(self): for func in socket.htonl, socket.ntohl: for i in (0, 1, ~0xffff, 2L): self.assertEqual(i, func(func(i)))
a2627afe370dc6607be45d5b4cf7f73077507441 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a2627afe370dc6607be45d5b4cf7f73077507441/test_socket.py
root.add_file("PC/py.ico") root.add_file("PC/pyc.ico")
def add_files(db): cab = CAB("python") tmpfiles = [] # Add all executables, icons, text files into the TARGETDIR component root = PyDirectory(db, cab, None, srcdir, "TARGETDIR", "SourceDir") default_feature.set_current() if not msilib.Win64: root.add_file("PCBuild/w9xpopen.exe") root.add_file("PC/py.ico") root.add_file...
1319bb1c2e357ce6792543fc74a5cdd42762cafd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1319bb1c2e357ce6792543fc74a5cdd42762cafd/msi.py
r'[TARGETDIR]py.ico', "REGISTRY.def"),
r'[DLLs]py.ico', "REGISTRY.def"),
# File extensions, associated with the REGISTRY.def component
1319bb1c2e357ce6792543fc74a5cdd42762cafd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1319bb1c2e357ce6792543fc74a5cdd42762cafd/msi.py
r'[TARGETDIR]py.ico', "REGISTRY.def"),
r'[DLLs]py.ico', "REGISTRY.def"),
# File extensions, associated with the REGISTRY.def component
1319bb1c2e357ce6792543fc74a5cdd42762cafd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1319bb1c2e357ce6792543fc74a5cdd42762cafd/msi.py
r'[TARGETDIR]pyc.ico', "REGISTRY.def"),
r'[DLLs]pyc.ico', "REGISTRY.def"),
# File extensions, associated with the REGISTRY.def component
1319bb1c2e357ce6792543fc74a5cdd42762cafd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1319bb1c2e357ce6792543fc74a5cdd42762cafd/msi.py
try: class C(object, Classic): pass except TypeError: pass else: verify(0, "inheritance from object and Classic should be illegal")
def errors(): if verbose: print "Testing errors..." try: class C(list, dict): pass except TypeError: pass else: verify(0, "inheritance from both list and dict should be illegal") try: class C(object, None): pass except TypeError: pass else: verify(0, "inheritance from non-type should be illegal") class Classic: pass ...
a91e9646e0f916498e812de467f8ac50574e22b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a91e9646e0f916498e812de467f8ac50574e22b1/test_descr.py
def makefile(self, mode, bufsize=None): if mode != 'r' and mode != 'rb': raise httplib.UnimplementedFileMode() return StringIO.StringIO(self.text)
ba60319a78ed6be5a57d5288e0e131c4bc6c8cf8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ba60319a78ed6be5a57d5288e0e131c4bc6c8cf8/test_httplib.py
body = "HTTP/1.1 200 Ok\r\n\r\nText" sock = FakeSocket(body) resp = httplib.HTTPResponse(sock, 1) resp.begin() print resp.read() resp.close()
import sys
def makefile(self, mode, bufsize=None): if mode != 'r' and mode != 'rb': raise httplib.UnimplementedFileMode() return StringIO.StringIO(self.text)
ba60319a78ed6be5a57d5288e0e131c4bc6c8cf8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ba60319a78ed6be5a57d5288e0e131c4bc6c8cf8/test_httplib.py
body = "HTTP/1.1 400.100 Not Ok\r\n\r\nText" sock = FakeSocket(body) resp = httplib.HTTPResponse(sock, 1) try:
def test(): buf = StringIO.StringIO() _stdout = sys.stdout try: sys.stdout = buf _test() finally: sys.stdout = _stdout s = buf.getvalue() for line in s.split("\n"): print line.strip() def _test(): body = "HTTP/1.1 200 Ok\r\n\r\nText" sock = FakeSocket(body) resp = httplib.HTTPResponse(sock, 1)
def makefile(self, mode, bufsize=None): if mode != 'r' and mode != 'rb': raise httplib.UnimplementedFileMode() return StringIO.StringIO(self.text)
ba60319a78ed6be5a57d5288e0e131c4bc6c8cf8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ba60319a78ed6be5a57d5288e0e131c4bc6c8cf8/test_httplib.py
except httplib.BadStatusLine: print "BadStatusLine raised as expected" else: print "Expect BadStatusLine"
print resp.read() resp.close()
def makefile(self, mode, bufsize=None): if mode != 'r' and mode != 'rb': raise httplib.UnimplementedFileMode() return StringIO.StringIO(self.text)
ba60319a78ed6be5a57d5288e0e131c4bc6c8cf8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ba60319a78ed6be5a57d5288e0e131c4bc6c8cf8/test_httplib.py
body = "HTTP/1.1 400.100 Not Ok\r\n\r\nText" sock = FakeSocket(body) resp = httplib.HTTPResponse(sock, 1) try: resp.begin() except httplib.BadStatusLine: print "BadStatusLine raised as expected" else: print "Expect BadStatusLine"
def makefile(self, mode, bufsize=None): if mode != 'r' and mode != 'rb': raise httplib.UnimplementedFileMode() return StringIO.StringIO(self.text)
ba60319a78ed6be5a57d5288e0e131c4bc6c8cf8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ba60319a78ed6be5a57d5288e0e131c4bc6c8cf8/test_httplib.py
for hp in ("www.python.org:abc", "www.python.org:"): try: h = httplib.HTTP(hp) except httplib.InvalidURL: print "InvalidURL raised as expected" else: print "Expect InvalidURL"
def makefile(self, mode, bufsize=None): if mode != 'r' and mode != 'rb': raise httplib.UnimplementedFileMode() return StringIO.StringIO(self.text)
ba60319a78ed6be5a57d5288e0e131c4bc6c8cf8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ba60319a78ed6be5a57d5288e0e131c4bc6c8cf8/test_httplib.py
text = ('HTTP/1.1 200 OK\r\n' 'Set-Cookie: Customer="WILE_E_COYOTE"; Version="1"; Path="/acme"\r\n' 'Set-Cookie: Part_Number="Rocket_Launcher_0001"; Version="1";' ' Path="/acme"\r\n' '\r\n' 'No body\r\n') hdr = ('Customer="WILE_E_COYOTE"; Version="1"; Path="/acme"' ', ' 'Part_Number="Rocket_Launcher_0001"; Version="1"...
for hp in ("www.python.org:abc", "www.python.org:"): try: h = httplib.HTTP(hp) except httplib.InvalidURL: print "InvalidURL raised as expected" else: print "Expect InvalidURL" text = ('HTTP/1.1 200 OK\r\n' 'Set-Cookie: Customer="WILE_E_COYOTE"; Version="1"; Path="/acme"\r\n' 'Set-Cookie: Part_Number="Rocket_Launcher_...
def makefile(self, mode, bufsize=None): if mode != 'r' and mode != 'rb': raise httplib.UnimplementedFileMode() return StringIO.StringIO(self.text)
ba60319a78ed6be5a57d5288e0e131c4bc6c8cf8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ba60319a78ed6be5a57d5288e0e131c4bc6c8cf8/test_httplib.py
self._note("%s.acquire(%s): initial succes", self, blocking)
self._note("%s.acquire(%s): initial success", self, blocking)
def acquire(self, blocking=1): me = currentThread() if self.__owner is me: self.__count = self.__count + 1 if __debug__: self._note("%s.acquire(%s): recursive success", self, blocking) return 1 rc = self.__block.acquire(blocking) if rc: self.__owner = me self.__count = 1 if __debug__: self._note("%s.acquire(%s): initia...
90cece7f8930cbfe5b87a61a1a67cfd670639c63 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/90cece7f8930cbfe5b87a61a1a67cfd670639c63/threading.py
return strftime(self.format, (item,)*9).capitalize()
return strftime(self.format, (item,)*8+(0,)).capitalize()
def __getitem__(self, item): if isinstance(item, int): if item < 0: item += self.len if not 0 <= item < self.len: raise IndexError, "out of range" return strftime(self.format, (item,)*9).capitalize() elif isinstance(item, type(slice(0))): return [self[e] for e in range(self.len)].__getslice__(item.start, item.stop)
e8c6a3eef66950a1dea7bf0c17961e170aab94f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e8c6a3eef66950a1dea7bf0c17961e170aab94f9/calendar.py
pat = re.compile(r'^\s*def\s')
pat = re.compile(r'^(\s*def\s)|(.*\slambda(:|\s))')
def findsource(object): """Return the entire source file and starting line number for an object. The argument may be a module, class, method, function, traceback, frame, or code object. The source code is returned as a list of all the lines in the file and the line number indexes a line in that list. An IOError is r...
2d375f78a570dc627daf61df9d12473633055cdf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2d375f78a570dc627daf61df9d12473633055cdf/inspect.py
if not installDir: installDir = DEFAULT_INSTALLDIR
def __init__(self, flavorOrder=None, downloadDir=None, buildDir=None, installDir=None, pimpDatabase=None): if not flavorOrder: flavorOrder = DEFAULT_FLAVORORDER if not downloadDir: downloadDir = DEFAULT_DOWNLOADDIR if not buildDir: buildDir = DEFAULT_BUILDDIR if not installDir: installDir = DEFAULT_INSTALLDIR if not pi...
6fde1cef4aa2498f965f95c2d467f4b57face862 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6fde1cef4aa2498f965f95c2d467f4b57face862/pimp.py
return rv
return rv
def check(self): """Check that the preferences make sense: directories exist and are writable, the install directory is on sys.path, etc.""" rv = "" RWX_OK = os.R_OK|os.W_OK|os.X_OK if not os.path.exists(self.downloadDir): rv += "Warning: Download directory \"%s\" does not exist\n" % self.downloadDir elif not os.acces...
6fde1cef4aa2498f965f95c2d467f4b57face862 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6fde1cef4aa2498f965f95c2d467f4b57face862/pimp.py
def _cmd(self, output, dir, *cmditems): """Internal routine to run a shell command in a given directory.""" cmd = ("cd \"%s\"; " % dir) + " ".join(cmditems) if output: output.write("+ %s\n" % cmd) if NO_EXECUTE: return 0 child = popen2.Popen4(cmd) child.tochild.close() while 1: line = child.fromchild.readline() if not...
def _cmd(self, output, dir, *cmditems): """Internal routine to run a shell command in a given directory.""" cmd = ("cd \"%s\"; " % dir) + " ".join(cmditems) if output: output.write("+ %s\n" % cmd) if NO_EXECUTE: return 0 child = popen2.Popen4(cmd) child.tochild.close() while 1: line = child.fromchild.readline() if not...
6fde1cef4aa2498f965f95c2d467f4b57face862 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6fde1cef4aa2498f965f95c2d467f4b57face862/pimp.py
if self._cmd(output, self._db.preferences.downloadDir,
if _cmd(output, self._db.preferences.downloadDir,
def downloadPackageOnly(self, output=None): """Download a single package, if needed. An MD5 signature is used to determine whether download is needed, and to test that we actually downloaded what we expected. If output is given it is a file-like object that will receive a log of what happens. If anything unforeseen h...
6fde1cef4aa2498f965f95c2d467f4b57face862 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6fde1cef4aa2498f965f95c2d467f4b57face862/pimp.py
for ext, cmd in ARCHIVE_FORMATS:
for ext, unpackerClass, arg in ARCHIVE_FORMATS:
def unpackPackageOnly(self, output=None): """Unpack a downloaded package archive.""" filename = os.path.split(self.archiveFilename)[1] for ext, cmd in ARCHIVE_FORMATS: if filename[-len(ext):] == ext: break else: return "unknown extension for archive file: %s" % filename self.basename = filename[:-len(ext)] cmd = cmd %...
6fde1cef4aa2498f965f95c2d467f4b57face862 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6fde1cef4aa2498f965f95c2d467f4b57face862/pimp.py
cmd = cmd % self.archiveFilename if self._cmd(output, self._db.preferences.buildDir, cmd): return "unpack command failed"
unpacker = unpackerClass(arg, dir=self._db.preferences.buildDir) rv = unpacker.unpack(self.archiveFilename, output=output) if rv: return rv
def unpackPackageOnly(self, output=None): """Unpack a downloaded package archive.""" filename = os.path.split(self.archiveFilename)[1] for ext, cmd in ARCHIVE_FORMATS: if filename[-len(ext):] == ext: break else: return "unknown extension for archive file: %s" % filename self.basename = filename[:-len(ext)] cmd = cmd %...
6fde1cef4aa2498f965f95c2d467f4b57face862 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6fde1cef4aa2498f965f95c2d467f4b57face862/pimp.py
print 'PimpPackage_binary installPackageOnly'
def installPackageOnly(self, output=None): """Install a single source package. If output is given it should be a file-like object and it will receive a log of what happened.""" print 'PimpPackage_binary installPackageOnly' msgs = [] if self._dict.has_key('Pre-install-command'): msg.append("%s: Pre-install-command ign...
6fde1cef4aa2498f965f95c2d467f4b57face862 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6fde1cef4aa2498f965f95c2d467f4b57face862/pimp.py
msgs = []
if self._dict.has_key('Install-command'): return "%s: Binary package cannot have Install-command" % self.fullname()
def installPackageOnly(self, output=None): """Install a single source package. If output is given it should be a file-like object and it will receive a log of what happened.""" print 'PimpPackage_binary installPackageOnly' msgs = [] if self._dict.has_key('Pre-install-command'): msg.append("%s: Pre-install-command ign...
6fde1cef4aa2498f965f95c2d467f4b57face862 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6fde1cef4aa2498f965f95c2d467f4b57face862/pimp.py
msg.append("%s: Pre-install-command ignored" % self.fullname()) if self._dict.has_key('Install-command'): msgs.append("%s: Install-command ignored" % self.fullname()) if self._dict.has_key('Post-install-command'): msgs.append("%s: Post-install-command ignored" % self.fullname())
if _cmd(output, self._buildDirname, self._dict['Pre-install-command']): return "pre-install %s: running \"%s\" failed" % \ (self.fullname(), self._dict['Pre-install-command'])
def installPackageOnly(self, output=None): """Install a single source package. If output is given it should be a file-like object and it will receive a log of what happened.""" print 'PimpPackage_binary installPackageOnly' msgs = [] if self._dict.has_key('Pre-install-command'): msg.append("%s: Pre-install-command ign...
6fde1cef4aa2498f965f95c2d467f4b57face862 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6fde1cef4aa2498f965f95c2d467f4b57face862/pimp.py
for ext, cmd in ARCHIVE_FORMATS:
for ext, unpackerClass, arg in ARCHIVE_FORMATS:
def installPackageOnly(self, output=None): """Install a single source package. If output is given it should be a file-like object and it will receive a log of what happened.""" print 'PimpPackage_binary installPackageOnly' msgs = [] if self._dict.has_key('Pre-install-command'): msg.append("%s: Pre-install-command ign...
6fde1cef4aa2498f965f95c2d467f4b57face862 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6fde1cef4aa2498f965f95c2d467f4b57face862/pimp.py
return "unknown extension for archive file: %s" % filename cmd = cmd % self.archiveFilename if self._cmd(output, "/", cmd): return "unpack command failed"
return "%s: unknown extension for archive file: %s" % (self.fullname(), filename) self.basename = filename[:-len(ext)] install_renames = [] for k, newloc in self._db.preferences.installLocations: if not newloc: continue if k == "--install-lib": oldloc = DEFAULT_INSTALLDIR else: return "%s: Don't know installLocation %...
def installPackageOnly(self, output=None): """Install a single source package. If output is given it should be a file-like object and it will receive a log of what happened.""" print 'PimpPackage_binary installPackageOnly' msgs = [] if self._dict.has_key('Pre-install-command'): msg.append("%s: Pre-install-command ign...
6fde1cef4aa2498f965f95c2d467f4b57face862 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6fde1cef4aa2498f965f95c2d467f4b57face862/pimp.py
if self._cmd(output, self._buildDirname, self._dict['Post-install-command']): return "post-install %s: running \"%s\" failed" % \
if _cmd(output, self._buildDirname, self._dict['Post-install-command']): return "%s: post-install: running \"%s\" failed" % \
def installPackageOnly(self, output=None): """Install a single source package. If output is given it should be a file-like object and it will receive a log of what happened.""" print 'PimpPackage_binary installPackageOnly' msgs = [] if self._dict.has_key('Pre-install-command'): msg.append("%s: Pre-install-command ign...
6fde1cef4aa2498f965f95c2d467f4b57face862 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6fde1cef4aa2498f965f95c2d467f4b57face862/pimp.py
if self._cmd(output, self._buildDirname, self._dict['Pre-install-command']):
if _cmd(output, self._buildDirname, self._dict['Pre-install-command']):
def installPackageOnly(self, output=None): """Install a single source package. If output is given it should be a file-like object and it will receive a log of what happened.""" if self._dict.has_key('Pre-install-command'): if self._cmd(output, self._buildDirname, self._dict['Pre-install-command']): return "pre-instal...
6fde1cef4aa2498f965f95c2d467f4b57face862 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6fde1cef4aa2498f965f95c2d467f4b57face862/pimp.py
installcmd = '"%s" setup.py install' % sys.executable if self._cmd(output, self._buildDirname, installcmd):
extra_args = "" for k, v in self._db.preferences.installLocations: if not v: if not unwanted_install_dir: unwanted_install_dir = tempfile.mkdtemp() v = unwanted_install_dir extra_args = extra_args + " %s \"%s\"" % (k, v) installcmd = '"%s" setup.py install %s' % (sys.executable, extra_args) if _cmd(output, self._buil...
def installPackageOnly(self, output=None): """Install a single source package. If output is given it should be a file-like object and it will receive a log of what happened.""" if self._dict.has_key('Pre-install-command'): if self._cmd(output, self._buildDirname, self._dict['Pre-install-command']): return "pre-instal...
6fde1cef4aa2498f965f95c2d467f4b57face862 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6fde1cef4aa2498f965f95c2d467f4b57face862/pimp.py
if self._cmd(output, self._buildDirname, self._dict['Post-install-command']):
if _cmd(output, self._buildDirname, self._dict['Post-install-command']):
def installPackageOnly(self, output=None): """Install a single source package. If output is given it should be a file-like object and it will receive a log of what happened.""" if self._dict.has_key('Pre-install-command'): if self._cmd(output, self._buildDirname, self._dict['Pre-install-command']): return "pre-instal...
6fde1cef4aa2498f965f95c2d467f4b57face862 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6fde1cef4aa2498f965f95c2d467f4b57face862/pimp.py
def _run(mode, verbose, force, args):
def _run(mode, verbose, force, args, prefargs):
def _run(mode, verbose, force, args): """Engine for the main program""" prefs = PimpPreferences() prefs.check() db = PimpDatabase(prefs) db.appendURL(prefs.pimpDatabase) if mode == 'dump': db.dump(sys.stdout) elif mode =='list': if not args: args = db.listnames() print "%-20.20s\t%s" % ("Package", "Description") prin...
6fde1cef4aa2498f965f95c2d467f4b57face862 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6fde1cef4aa2498f965f95c2d467f4b57face862/pimp.py
prefs = PimpPreferences() prefs.check()
prefs = PimpPreferences(**prefargs) rv = prefs.check() if rv: sys.stdout.write(rv)
def _run(mode, verbose, force, args): """Engine for the main program""" prefs = PimpPreferences() prefs.check() db = PimpDatabase(prefs) db.appendURL(prefs.pimpDatabase) if mode == 'dump': db.dump(sys.stdout) elif mode =='list': if not args: args = db.listnames() print "%-20.20s\t%s" % ("Package", "Description") prin...
6fde1cef4aa2498f965f95c2d467f4b57face862 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6fde1cef4aa2498f965f95c2d467f4b57face862/pimp.py
print "\tDownload URL:\t", pkg.downloadURL()
try: print "\tDownload URL:\t", pkg.downloadURL() except KeyError: pass
def _run(mode, verbose, force, args): """Engine for the main program""" prefs = PimpPreferences() prefs.check() db = PimpDatabase(prefs) db.appendURL(prefs.pimpDatabase) if mode == 'dump': db.dump(sys.stdout) elif mode =='list': if not args: args = db.listnames() print "%-20.20s\t%s" % ("Package", "Description") prin...
6fde1cef4aa2498f965f95c2d467f4b57face862 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6fde1cef4aa2498f965f95c2d467f4b57face862/pimp.py
print "Usage: pimp [-v] -s [package ...] List installed status" print " pimp [-v] -l [package ...] Show package information" print " pimp [-vf] -i package ... Install packages" print " pimp -d Dump database to stdout"
print "Usage: pimp [options] -s [package ...] List installed status" print " pimp [options] -l [package ...] Show package information" print " pimp [options] -i package ... Install packages" print " pimp -d Dump database to stdout"
def _help(): print "Usage: pimp [-v] -s [package ...] List installed status" print " pimp [-v] -l [package ...] Show package information" print " pimp [-vf] -i package ... Install packages" print " pimp -d Dump database to stdout" print "Options:" print " -v Verbose" pri...
6fde1cef4aa2498f965f95c2d467f4b57face862 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6fde1cef4aa2498f965f95c2d467f4b57face862/pimp.py
print " -v Verbose" print " -f Force installation"
print " -v Verbose" print " -f Force installation" print " -D dir Set destination directory (default: site-packages)"
def _help(): print "Usage: pimp [-v] -s [package ...] List installed status" print " pimp [-v] -l [package ...] Show package information" print " pimp [-vf] -i package ... Install packages" print " pimp -d Dump database to stdout" print "Options:" print " -v Verbose" pri...
6fde1cef4aa2498f965f95c2d467f4b57face862 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6fde1cef4aa2498f965f95c2d467f4b57face862/pimp.py
opts, args = getopt.getopt(sys.argv[1:], "slifvd")
opts, args = getopt.getopt(sys.argv[1:], "slifvdD:")
def _help(): print "Usage: pimp [-v] -s [package ...] List installed status" print " pimp [-v] -l [package ...] Show package information" print " pimp [-vf] -i package ... Install packages" print " pimp -d Dump database to stdout" print "Options:" print " -v Verbose" pri...
6fde1cef4aa2498f965f95c2d467f4b57face862 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6fde1cef4aa2498f965f95c2d467f4b57face862/pimp.py
_run(mode, verbose, force, args)
_run(mode, verbose, force, args, prefargs)
def _help(): print "Usage: pimp [-v] -s [package ...] List installed status" print " pimp [-v] -l [package ...] Show package information" print " pimp [-vf] -i package ... Install packages" print " pimp -d Dump database to stdout" print "Options:" print " -v Verbose" pri...
6fde1cef4aa2498f965f95c2d467f4b57face862 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6fde1cef4aa2498f965f95c2d467f4b57face862/pimp.py
args = args + to
if to[0] == '-to': to = to[1:] args = args + ('-to',) + tuple(to)
def put(self, data, to=None): args = (self.name, 'put', data) if to: args = args + to apply(self.tk.call, args)
b5323999d261d3f864c9c7da78e3c88640ee411a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b5323999d261d3f864c9c7da78e3c88640ee411a/Tkinter.py
def compare_generic_iter(make_it,match):
def compare_generic_iter(test, make_it, match):
def compare_generic_iter(make_it,match): """Utility to compare a generic 2.1/2.2+ iterator with an iterable If running under Python 2.2+, this tests the iterator using iter()/next(), as well as __getitem__. 'make_it' must be a function returning a fresh iterator to be tested (since this may test the iterator twice)."...
06524b61d05c604543e6d3603dee11425ccff637 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/06524b61d05c604543e6d3603dee11425ccff637/test_wsgiref.py
assert it[n]==item
test.assertEqual(it[n], item)
def compare_generic_iter(make_it,match): """Utility to compare a generic 2.1/2.2+ iterator with an iterable If running under Python 2.2+, this tests the iterator using iter()/next(), as well as __getitem__. 'make_it' must be a function returning a fresh iterator to be tested (since this may test the iterator twice)."...
06524b61d05c604543e6d3603dee11425ccff637 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/06524b61d05c604543e6d3603dee11425ccff637/test_wsgiref.py
assert iter(it) is it
test.assert_(iter(it) is it)
def compare_generic_iter(make_it,match): """Utility to compare a generic 2.1/2.2+ iterator with an iterable If running under Python 2.2+, this tests the iterator using iter()/next(), as well as __getitem__. 'make_it' must be a function returning a fresh iterator to be tested (since this may test the iterator twice)."...
06524b61d05c604543e6d3603dee11425ccff637 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/06524b61d05c604543e6d3603dee11425ccff637/test_wsgiref.py
assert it.next()==item try: it.next() except StopIteration: pass else: raise AssertionError("Too many items from .next()",it)
test.assertEqual(it.next(), item) test.assertRaises(StopIteration, it.next)
def compare_generic_iter(make_it,match): """Utility to compare a generic 2.1/2.2+ iterator with an iterable If running under Python 2.2+, this tests the iterator using iter()/next(), as well as __getitem__. 'make_it' must be a function returning a fresh iterator to be tested (since this may test the iterator twice)."...
06524b61d05c604543e6d3603dee11425ccff637 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/06524b61d05c604543e6d3603dee11425ccff637/test_wsgiref.py
compare_generic_iter(make_it,match)
compare_generic_iter(self, make_it, match)
def make_it(text=text,size=size): return util.FileWrapper(StringIO(text),size)
06524b61d05c604543e6d3603dee11425ccff637 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/06524b61d05c604543e6d3603dee11425ccff637/test_wsgiref.py
assert h.environ.has_key(key)
self.assert_(h.environ.has_key(key))
def testCGIEnviron(self): h = BaseCGIHandler(None,None,None,{}) h.setup_environ() for key in 'wsgi.url_scheme', 'wsgi.input', 'wsgi.errors': assert h.environ.has_key(key)
06524b61d05c604543e6d3603dee11425ccff637 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/06524b61d05c604543e6d3603dee11425ccff637/test_wsgiref.py
test('isupper', u'\u1FFc', 0)
if sys.platform[:4] != 'java': test('isupper', u'\u1FFc', 0)
def test_fixup(s): s2 = u'\ud800\udc01' test_lecmp(s, s2) s2 = u'\ud900\udc01' test_lecmp(s, s2) s2 = u'\uda00\udc01' test_lecmp(s, s2) s2 = u'\udb00\udc01' test_lecmp(s, s2) s2 = u'\ud800\udd01' test_lecmp(s, s2) s2 = u'\ud900\udd01' test_lecmp(s, s2) s2 = u'\uda00\udd01' test_lecmp(s, s2) s2 = u'\udb00\udd01' test_le...
ef0a032883cadeb0dba7a6ff84025f7133b75b31 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ef0a032883cadeb0dba7a6ff84025f7133b75b31/test_unicode.py
value = u"%r, %r" % (u"abc", "abc") if value != u"u'abc', 'abc'": print '*** formatting failed for "%s"' % 'u"%r, %r" % (u"abc", "abc")'
if sys.platform[:4] != 'java': value = u"%r, %r" % (u"abc", "abc") if value != u"u'abc', 'abc'": print '*** formatting failed for "%s"' % 'u"%r, %r" % (u"abc", "abc")'
def test_fixup(s): s2 = u'\ud800\udc01' test_lecmp(s, s2) s2 = u'\ud900\udc01' test_lecmp(s, s2) s2 = u'\uda00\udc01' test_lecmp(s, s2) s2 = u'\udb00\udc01' test_lecmp(s, s2) s2 = u'\ud800\udd01' test_lecmp(s, s2) s2 = u'\ud900\udd01' test_lecmp(s, s2) s2 = u'\uda00\udd01' test_lecmp(s, s2) s2 = u'\udb00\udd01' test_le...
ef0a032883cadeb0dba7a6ff84025f7133b75b31 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ef0a032883cadeb0dba7a6ff84025f7133b75b31/test_unicode.py
value = u"%(x)s, %()s" % {'x':u"abc", u''.encode('utf-8'):"def"}
if sys.platform[:4] != 'java': value = u"%(x)s, %()s" % {'x':u"abc", u''.encode('utf-8'):"def"} else: value = u"%(x)s, %()s" % {'x':u"abc", u'':"def"}
def test_fixup(s): s2 = u'\ud800\udc01' test_lecmp(s, s2) s2 = u'\ud900\udc01' test_lecmp(s, s2) s2 = u'\uda00\udc01' test_lecmp(s, s2) s2 = u'\udb00\udc01' test_lecmp(s, s2) s2 = u'\ud800\udd01' test_lecmp(s, s2) s2 = u'\ud900\udd01' test_lecmp(s, s2) s2 = u'\uda00\udd01' test_lecmp(s, s2) s2 = u'\udb00\udd01' test_le...
ef0a032883cadeb0dba7a6ff84025f7133b75b31 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ef0a032883cadeb0dba7a6ff84025f7133b75b31/test_unicode.py
capability_name = _capability_names[ch]
capability_name = _capability_names.get(ch) if capability_name is None: return 0
def has_key(ch): if type(ch) == type( '' ): ch = ord(ch) # Figure out the correct capability name for the keycode. capability_name = _capability_names[ch] #Check the current terminal description for that capability; #if present, return true, else return false. if _curses.tigetstr( capability_name ): return 1 else: re...
0ec5288d09e2ac3652c8a88f644417629ed1e759 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ec5288d09e2ac3652c8a88f644417629ed1e759/has_key.py
(objects, output_dir) = self._fix_link_args (objects, output_dir, takes_libs=0)
(objects, output_dir) = self._fix_object_args (objects, output_dir)
def create_static_lib (self, objects, output_libname, output_dir=None, debug=0):
e21dabe2e0f93aef55bf6a5352527f4874a31489 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e21dabe2e0f93aef55bf6a5352527f4874a31489/unixccompiler.py
(objects, output_dir, libraries, library_dirs) = \ self._fix_link_args (objects, output_dir, takes_libs=1, libraries=libraries, library_dirs=library_dirs)
(objects, output_dir) = self._fix_object_args (objects, output_dir) (libraries, library_dirs, runtime_library_dirs) = \ self._fix_lib_args (libraries, library_dirs, runtime_library_dirs)
def link_shared_object (self, objects, output_filename, output_dir=None, libraries=None, library_dirs=None, debug=0, extra_preargs=None, extra_postargs=None):
e21dabe2e0f93aef55bf6a5352527f4874a31489 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e21dabe2e0f93aef55bf6a5352527f4874a31489/unixccompiler.py
library_dirs, self.runtime_library_dirs,
library_dirs, runtime_library_dirs,
def link_shared_object (self, objects, output_filename, output_dir=None, libraries=None, library_dirs=None, debug=0, extra_preargs=None, extra_postargs=None):
e21dabe2e0f93aef55bf6a5352527f4874a31489 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e21dabe2e0f93aef55bf6a5352527f4874a31489/unixccompiler.py
(objects, output_dir, libraries, library_dirs) = \ self._fix_link_args (objects, output_dir, takes_libs=1, libraries=libraries, library_dirs=library_dirs)
(objects, output_dir) = self._fix_object_args (objects, output_dir) (libraries, library_dirs, runtime_library_dirs) = \ self._fix_lib_args (libraries, library_dirs, runtime_library_dirs)
def link_executable (self, objects, output_progname, output_dir=None, libraries=None, library_dirs=None, debug=0, extra_preargs=None, extra_postargs=None): (objects, output_dir, libraries, library_dirs) = \ self._fix_link_args (objects, output_dir, takes_libs=1, libraries=libraries, library_dirs=library_dirs)
e21dabe2e0f93aef55bf6a5352527f4874a31489 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e21dabe2e0f93aef55bf6a5352527f4874a31489/unixccompiler.py
library_dirs, self.runtime_library_dirs,
library_dirs, runtime_library_dirs,
def link_executable (self, objects, output_progname, output_dir=None, libraries=None, library_dirs=None, debug=0, extra_preargs=None, extra_postargs=None): (objects, output_dir, libraries, library_dirs) = \ self._fix_link_args (objects, output_dir, takes_libs=1, libraries=libraries, library_dirs=library_dirs)
e21dabe2e0f93aef55bf6a5352527f4874a31489 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e21dabe2e0f93aef55bf6a5352527f4874a31489/unixccompiler.py
assert len(a) == 1
vereq(len(a), 1)
def __init__(self, *a, **kw): if a: assert len(a) == 1 self.state = a[0] if kw: for k, v in kw.items(): self[v] = k
90c45142d7c8b018d099a832af8c856ef4d9f8c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/90c45142d7c8b018d099a832af8c856ef4d9f8c9/test_descr.py
assert isinstance(key, type(0))
verify(isinstance(key, type(0)))
def __setitem__(self, key, value): assert isinstance(key, type(0)) dict.__setitem__(self, key, value)
90c45142d7c8b018d099a832af8c856ef4d9f8c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/90c45142d7c8b018d099a832af8c856ef4d9f8c9/test_descr.py
assert x.__class__ == a.__class__ assert sorteditems(x.__dict__) == sorteditems(a.__dict__) assert y.__class__ == b.__class__ assert sorteditems(y.__dict__) == sorteditems(b.__dict__) assert `x` == `a` assert `y` == `b`
vereq(x.__class__, a.__class__) vereq(sorteditems(x.__dict__), sorteditems(a.__dict__)) vereq(y.__class__, b.__class__) vereq(sorteditems(y.__dict__), sorteditems(b.__dict__)) vereq(`x`, `a`) vereq(`y`, `b`)
def __repr__(self): return "C2(%r, %r)<%r>" % (self.a, self.b, int(self))
90c45142d7c8b018d099a832af8c856ef4d9f8c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/90c45142d7c8b018d099a832af8c856ef4d9f8c9/test_descr.py
assert x.__class__ == a.__class__ assert sorteditems(x.__dict__) == sorteditems(a.__dict__) assert y.__class__ == b.__class__ assert sorteditems(y.__dict__) == sorteditems(b.__dict__) assert `x` == `a` assert `y` == `b`
vereq(x.__class__, a.__class__) vereq(sorteditems(x.__dict__), sorteditems(a.__dict__)) vereq(y.__class__, b.__class__) vereq(sorteditems(y.__dict__), sorteditems(b.__dict__)) vereq(`x`, `a`) vereq(`y`, `b`)
def __repr__(self): return "C2(%r, %r)<%r>" % (self.a, self.b, int(self))
90c45142d7c8b018d099a832af8c856ef4d9f8c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/90c45142d7c8b018d099a832af8c856ef4d9f8c9/test_descr.py
t = _translations.setdefault(key, class_(open(mofile, 'rb')))
t = _translations.get(key) if t is None: t = _translations.setdefault(key, class_(open(mofile, 'rb')))
def translation(domain, localedir=None, languages=None, class_=None): if class_ is None: class_ = GNUTranslations mofile = find(domain, localedir, languages) if mofile is None: raise IOError(ENOENT, 'No translation file found for domain', domain) key = os.path.abspath(mofile) # TBD: do we need to worry about the file p...
293b03f73f5ad48719a0f07fb45857182dfb1d51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/293b03f73f5ad48719a0f07fb45857182dfb1d51/gettext.py
"""Lock file f using lockf, flock, and dot locking."""
"""Lock file f using lockf and dot locking."""
def _lock_file(f, dotlock=True): """Lock file f using lockf, flock, and dot locking.""" dotlock_done = False try: if fcntl: try: fcntl.lockf(f, fcntl.LOCK_EX | fcntl.LOCK_NB) except IOError, e: if e.errno == errno.EAGAIN: raise ExternalClashError('lockf: lock unavailable: %s' % f.name) else: raise try: fcntl.flock(f, f...
557325930ce81804a1dd9c6f0e3babb8673afdd5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/557325930ce81804a1dd9c6f0e3babb8673afdd5/mailbox.py
f.name) else: raise try: fcntl.flock(f, fcntl.LOCK_EX | fcntl.LOCK_NB) except IOError, e: if e.errno == errno.EWOULDBLOCK: raise ExternalClashError('flock: lock unavailable: %s' %
def _lock_file(f, dotlock=True): """Lock file f using lockf, flock, and dot locking.""" dotlock_done = False try: if fcntl: try: fcntl.lockf(f, fcntl.LOCK_EX | fcntl.LOCK_NB) except IOError, e: if e.errno == errno.EAGAIN: raise ExternalClashError('lockf: lock unavailable: %s' % f.name) else: raise try: fcntl.flock(f, f...
557325930ce81804a1dd9c6f0e3babb8673afdd5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/557325930ce81804a1dd9c6f0e3babb8673afdd5/mailbox.py
fcntl.flock(f, fcntl.LOCK_UN)
def _lock_file(f, dotlock=True): """Lock file f using lockf, flock, and dot locking.""" dotlock_done = False try: if fcntl: try: fcntl.lockf(f, fcntl.LOCK_EX | fcntl.LOCK_NB) except IOError, e: if e.errno == errno.EAGAIN: raise ExternalClashError('lockf: lock unavailable: %s' % f.name) else: raise try: fcntl.flock(f, f...
557325930ce81804a1dd9c6f0e3babb8673afdd5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/557325930ce81804a1dd9c6f0e3babb8673afdd5/mailbox.py
"""Unlock file f using lockf, flock, and dot locking."""
"""Unlock file f using lockf and dot locking."""
def _unlock_file(f): """Unlock file f using lockf, flock, and dot locking.""" if fcntl: fcntl.lockf(f, fcntl.LOCK_UN) fcntl.flock(f, fcntl.LOCK_UN) if os.path.exists(f.name + '.lock'): os.remove(f.name + '.lock')
557325930ce81804a1dd9c6f0e3babb8673afdd5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/557325930ce81804a1dd9c6f0e3babb8673afdd5/mailbox.py
fcntl.flock(f, fcntl.LOCK_UN)
def _unlock_file(f): """Unlock file f using lockf, flock, and dot locking.""" if fcntl: fcntl.lockf(f, fcntl.LOCK_UN) fcntl.flock(f, fcntl.LOCK_UN) if os.path.exists(f.name + '.lock'): os.remove(f.name + '.lock')
557325930ce81804a1dd9c6f0e3babb8673afdd5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/557325930ce81804a1dd9c6f0e3babb8673afdd5/mailbox.py
self._name = 'PY_VAR' + `_varnum`
self._name = 'PY_VAR' + repr(_varnum)
def __init__(self, master=None, value=None, name=None): """Construct a variable
426f4a1c65e59a9b06b42cd37fbe310f46afcee0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/426f4a1c65e59a9b06b42cd37fbe310f46afcee0/Tkinter.py
eq(folders, map(normF, ['deep', 'deep/f1', 'deep/f2', 'deep/f2/f3', 'inbox', 'wide']))
tfolders = map(normF, ['deep', 'deep/f1', 'deep/f2', 'deep/f2/f3', 'inbox', 'wide']) tfolders.sort() eq(folders, tfolders)
def test_listfolders(self): mh = getMH() eq = self.assertEquals
dbc363ce353ebd59f04778b045b89442bd59912a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dbc363ce353ebd59f04778b045b89442bd59912a/test_mhlib.py
self.todo[url].append(origin)
if origin not in self.todo[url]: self.todo[url].append(origin)
def newtodolink(self, url, origin): if self.todo.has_key(url): self.todo[url].append(origin) self.note(3, " Seen todo link %s", url) else: self.todo[url] = [origin] self.note(3, " New todo link %s", url)
dbd5c3e63b639484709f02be311512048f7946e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dbd5c3e63b639484709f02be311512048f7946e6/webchecker.py