rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
re-inserted are alwyas appended to the header list.
re-inserted are always appended to the header list.
def values(self): """Return a list of all the message's header values.
bf7c52c233485b0d95c3a41cb5ae9b580c4469c8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bf7c52c233485b0d95c3a41cb5ae9b580c4469c8/Message.py
re-inserted are alwyas appended to the header list.
re-inserted are always appended to the header list.
def items(self): """Get all the message's header fields and values.
bf7c52c233485b0d95c3a41cb5ae9b580c4469c8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bf7c52c233485b0d95c3a41cb5ae9b580c4469c8/Message.py
print "File name %s contains a suspicious null byte!" % filename
def __init__(self, filename="NoName", date_time=(1980,1,1,0,0,0)): self.orig_filename = filename # Original file name in archive
9b1587836992c460d213b9bbc6f539516139bdf2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9b1587836992c460d213b9bbc6f539516139bdf2/zipfile.py
rx = re.compile('[ \t]*([^ \t]+)[ \t]+realm="([^"]*)"')
rx = re.compile('[ \t]*([^ \t]+)[ \t]+realm="([^"]*)"', re.I)
def find_user_password(self, realm, authuri): user, password = HTTPPasswordMgr.find_user_password(self,realm,authuri) if user is not None: return user, password return HTTPPasswordMgr.find_user_password(self, None, authuri)
853ddd5cb96981966b935ed75bf8af0cfd0bee24 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/853ddd5cb96981966b935ed75bf8af0cfd0bee24/urllib2.py
(to an older frame)."""
(to a newer frame)."""
def help_d(self): print """d(own)
34c4120731b498663e38edc4d975d4a8c3071da0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/34c4120731b498663e38edc4d975d4a8c3071da0/pdb.py
(to a newer frame)."""
(to an older frame)."""
def help_u(self): print """u(p)
34c4120731b498663e38edc4d975d4a8c3071da0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/34c4120731b498663e38edc4d975d4a8c3071da0/pdb.py
for i in range(3):
for count in range(3):
def test_trashcan(): # "trashcan" is a hack to prevent stack overflow when deallocating # very deeply nested tuples etc. It works in part by abusing the # type pointer and refcount fields, and that can yield horrible # problems when gc tries to traverse the structures. # If this test fails (as it does in 2.0, 2.1 and ...
d4ce758505d08e669a4752f79294c8aa19a96cf0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d4ce758505d08e669a4752f79294c8aa19a96cf0/test_gc.py
sectname = "formatter_%s" % form
sectname = "formatter_%s" % string.strip(form)
def _create_formatters(cp): """Create and return formatters""" flist = cp.get("formatters", "keys") if not len(flist): return {} flist = string.split(flist, ",") formatters = {} for form in flist: sectname = "formatter_%s" % form opts = cp.options(sectname) if "format" in opts: fs = cp.get(sectname, "format", 1) else: ...
66a17266206cb70bf07c2df93b3536d3c70a5121 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66a17266206cb70bf07c2df93b3536d3c70a5121/config.py
sectname = "handler_%s" % hand
sectname = "handler_%s" % string.strip(hand)
def _install_handlers(cp, formatters): """Install and return handlers""" hlist = cp.get("handlers", "keys") if not len(hlist): return {} hlist = string.split(hlist, ",") handlers = {} fixups = [] #for inter-handler references for hand in hlist: sectname = "handler_%s" % hand klass = cp.get(sectname, "class") opts = cp....
66a17266206cb70bf07c2df93b3536d3c70a5121 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66a17266206cb70bf07c2df93b3536d3c70a5121/config.py
log.addHandler(handlers[hand])
log.addHandler(handlers[string.strip(hand)])
def _install_loggers(cp, handlers): """Create and install loggers""" # configure the root first llist = cp.get("loggers", "keys") llist = string.split(llist, ",") llist.remove("root") sectname = "logger_root" root = logging.root log = root opts = cp.options(sectname) if "level" in opts: level = cp.get(sectname, "level...
66a17266206cb70bf07c2df93b3536d3c70a5121 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66a17266206cb70bf07c2df93b3536d3c70a5121/config.py
logger.addHandler(handlers[hand])
logger.addHandler(handlers[string.strip(hand)])
def _install_loggers(cp, handlers): """Create and install loggers""" # configure the root first llist = cp.get("loggers", "keys") llist = string.split(llist, ",") llist.remove("root") sectname = "logger_root" root = logging.root log = root opts = cp.options(sectname) if "level" in opts: level = cp.get(sectname, "level...
66a17266206cb70bf07c2df93b3536d3c70a5121 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66a17266206cb70bf07c2df93b3536d3c70a5121/config.py
self.assert_(reuse == 0, "Error performing getsockopt.")
self.failIf(reuse != 0, "initial mode is reuse")
def testGetSockOpt(self): """Testing getsockopt().""" # We know a socket should start without reuse==0 sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) reuse = sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR) self.assert_(reuse == 0, "Error performing getsockopt.")
733632ac1f61acc9b96ad316972a71b290e30db0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/733632ac1f61acc9b96ad316972a71b290e30db0/test_socket.py
self.assert_(reuse == 1, "Error performing setsockopt.")
self.failIf(reuse == 0, "failed to set reuse mode")
def testSetSockOpt(self): """Testing setsockopt().""" sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) reuse = sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR) self.assert_(reuse == 1, "Error performing setsockopt.")
733632ac1f61acc9b96ad316972a71b290e30db0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/733632ac1f61acc9b96ad316972a71b290e30db0/test_socket.py
def set(self, *args): """Set the fractional values of the slider position (upper and lower ends as value between 0 and 1).""" self.tk.call((self._w, 'set') + args)
256705bca7fb848e38d874d21d9a37a70bad4fbf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/256705bca7fb848e38d874d21d9a37a70bad4fbf/Tkinter.py
f_month -- full weekday names (14-item list; dummy value in [0], which
f_month -- full month names (13-item list; dummy value in [0], which
def _getlang(): # Figure out what the current language is set to. return locale.getlocale(locale.LC_TIME)
f5c96fb74d86e844af564acdc54ce3f1e70df56c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f5c96fb74d86e844af564acdc54ce3f1e70df56c/_strptime.py
a_month -- abbreviated weekday names (13-item list, dummy value in
a_month -- abbreviated month names (13-item list, dummy value in
def _getlang(): # Figure out what the current language is set to. return locale.getlocale(locale.LC_TIME)
f5c96fb74d86e844af564acdc54ce3f1e70df56c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f5c96fb74d86e844af564acdc54ce3f1e70df56c/_strptime.py
time.tzname = ("PDT", "PDT")
time.tzname = (tz_name, tz_name)
def test_bad_timezone(self): # Explicitly test possibility of bad timezone; # when time.tzname[0] == time.tzname[1] and time.daylight if sys.platform == "mac": return #MacOS9 has severely broken timezone support. try: original_tzname = time.tzname original_daylight = time.daylight time.tzname = ("PDT", "PDT") time.dayl...
c83124ab793a28c8995ff381d5867604c60bc07f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c83124ab793a28c8995ff381d5867604c60bc07f/test_strptime.py
tz_value = _strptime.strptime("PDT", "%Z")[8]
tz_value = _strptime.strptime(tz_name, "%Z")[8]
def test_bad_timezone(self): # Explicitly test possibility of bad timezone; # when time.tzname[0] == time.tzname[1] and time.daylight if sys.platform == "mac": return #MacOS9 has severely broken timezone support. try: original_tzname = time.tzname original_daylight = time.daylight time.tzname = ("PDT", "PDT") time.dayl...
c83124ab793a28c8995ff381d5867604c60bc07f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c83124ab793a28c8995ff381d5867604c60bc07f/test_strptime.py
super(TimeRE,self).__init__({
base = super(TimeRE, self) base.__init__({
def __init__(self, locale_time=LocaleTime()): """Init inst with non-locale regexes and store LocaleTime object.""" # XXX: should 0 be valid for: # day (d), julian day (j), month (m), and hour12 (I)? super(TimeRE,self).__init__({ # The " \d" option is to make %c from ANSI C work 'd': r"(?P<d>3[0-1]|[0-2]\d|\d| ...
5efc50d8afd31dc4cb0ef1b58899943eb0e4cb67 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5efc50d8afd31dc4cb0ef1b58899943eb0e4cb67/_strptime.py
'd': r"(?P<d>3[0-1]|[0-2]\d|\d| \d)",
'd': r"(?P<d>3[0-1]|[1-2]\d|0[1-9]|[1-9]| [1-9])",
def __init__(self, locale_time=LocaleTime()): """Init inst with non-locale regexes and store LocaleTime object.""" # XXX: should 0 be valid for: # day (d), julian day (j), month (m), and hour12 (I)? super(TimeRE,self).__init__({ # The " \d" option is to make %c from ANSI C work 'd': r"(?P<d>3[0-1]|[0-2]\d|\d| ...
5efc50d8afd31dc4cb0ef1b58899943eb0e4cb67 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5efc50d8afd31dc4cb0ef1b58899943eb0e4cb67/_strptime.py
'I': r"(?P<I>0\d|1[0-2]|\d)", 'j': r"(?P<j>(?:3[0-5]\d|36[0-6])|[0-2]\d\d|\d\d|\d)", 'm': r"(?P<m>0\d|1[0-2]|\d)",
'I': r"(?P<I>1[0-2]|0[1-9]|[1-9])", 'j': r"(?P<j>36[0-6]|3[0-5]\d|[1-2]\d\d|0[1-9]\d|00[1-9]|[1-9]\d|0[1-9]|[1-9])", 'm': r"(?P<m>1[0-2]|0[1-9]|[1-9])",
def __init__(self, locale_time=LocaleTime()): """Init inst with non-locale regexes and store LocaleTime object.""" # XXX: should 0 be valid for: # day (d), julian day (j), month (m), and hour12 (I)? super(TimeRE,self).__init__({ # The " \d" option is to make %c from ANSI C work 'd': r"(?P<d>3[0-1]|[0-2]\d|\d| ...
5efc50d8afd31dc4cb0ef1b58899943eb0e4cb67 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5efc50d8afd31dc4cb0ef1b58899943eb0e4cb67/_strptime.py
'W': r"(?P<W>5[0-3]|[0-4]\d|\d)",
def __init__(self, locale_time=LocaleTime()): """Init inst with non-locale regexes and store LocaleTime object.""" # XXX: should 0 be valid for: # day (d), julian day (j), month (m), and hour12 (I)? super(TimeRE,self).__init__({ # The " \d" option is to make %c from ANSI C work 'd': r"(?P<d>3[0-1]|[0-2]\d|\d| ...
5efc50d8afd31dc4cb0ef1b58899943eb0e4cb67 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5efc50d8afd31dc4cb0ef1b58899943eb0e4cb67/_strptime.py
a_gusi = ResLoader(fss, 'GU\267I', OVERRIDE_GUSI_ID, default=gusi_loader) a_path = StrListLoader(fss, 'STR
a_gusi = GusiLoader( ResLoader(fss, 'GU\267I', OVERRIDE_GUSI_ID, default=gusi_loader)) a_path = StrListLoader( ResLoader(fss, 'STR
def AppletOptions(file): fss = macfs.FSSpec(file) a_popt = PoptLoader(ResLoader(fss, 'Popt', OVERRIDE_POPT_ID, default=popt_loader)) a_dir = ResLoader(fss, 'alis', OVERRIDE_DIR_ID, default=dir) a_gusi = ResLoader(fss, 'GU\267I', OVERRIDE_GUSI_ID, default=gusi_loader) a_path = StrListLoader(fss, 'STR#', OVERRIDE_PATH_ID...
e86d2870c45d76b5550c2debfca808bfd557edb9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e86d2870c45d76b5550c2debfca808bfd557edb9/pythonprefs.py
for name in ('lib', 'purelib', 'platlib', 'scripts', 'data'):
for name in ('lib', 'purelib', 'platlib', 'scripts', 'data', 'headers'):
def finalize_options (self):
e2383a6c774e41357824db4ea1db0b06182fe672 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e2383a6c774e41357824db4ea1db0b06182fe672/install.py
host = [host] try: addr = socket.gethostbyname(host[0]) if addr != host:
rawHost, port = splitport(host) host = [rawHost] try: addr = socket.gethostbyname(rawHost) if addr != rawHost:
def proxy_bypass(host): try: import _winreg import re except ImportError: # Std modules, so should be around - but you never know! return 0 try: internetSettings = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, r'Software\Microsoft\Windows\CurrentVersion\Internet Settings') proxyEnable = _winreg.QueryValueEx(internetSettin...
1f63670a2a0e66c049c2cfe8a2ec62a663e5c754 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1f63670a2a0e66c049c2cfe8a2ec62a663e5c754/urllib.py
self.stack = get_stack(tb) self.text = get_exception()
self.stack = self.get_stack(tb) self.text = self.get_exception() def get_stack(self, tb): if tb is None: tb = sys.last_traceback stack = [] if tb and tb.tb_frame is None: tb = tb.tb_next while tb is not None: stack.append((tb.tb_frame, tb.tb_lineno)) tb = tb.tb_next return stack def get_exception(self): type = sys.la...
def __init__(self, flist=None, tb=None): self.flist = flist self.stack = get_stack(tb) self.text = get_exception()
5f7c4b34b91171da1755af9b6bf69eda07b811aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5f7c4b34b91171da1755af9b6bf69eda07b811aa/StackViewer.py
def GetText(self): frame, lineno = self.info try: modname = frame.f_globals["__name__"] except: modname = "?" code = frame.f_code filename = code.co_filename funcname = code.co_name sourceline = linecache.getline(filename, lineno) sourceline = sourceline.strip() if funcname in ("?", "", None): item = "%s, line %d: %s" ...
5f7c4b34b91171da1755af9b6bf69eda07b811aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5f7c4b34b91171da1755af9b6bf69eda07b811aa/StackViewer.py
def get_stack(t=None, f=None): if t is None: t = sys.last_traceback stack = [] if t and t.tb_frame is f: t = t.tb_next while f is not None: stack.append((f, f.f_lineno)) if f is self.botframe: break f = f.f_back stack.reverse() while t is not None: stack.append((t.tb_frame, t.tb_lineno)) t = t.tb_next return stack def...
def get_stack(t=None, f=None): if t is None: t = sys.last_traceback stack = [] if t and t.tb_frame is f: t = t.tb_next while f is not None: stack.append((f, f.f_lineno)) if f is self.botframe: break f = f.f_back stack.reverse() while t is not None: stack.append((t.tb_frame, t.tb_lineno)) t = t.tb_next return stack
5f7c4b34b91171da1755af9b6bf69eda07b811aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5f7c4b34b91171da1755af9b6bf69eda07b811aa/StackViewer.py
import traceback print "Exception in Tkinter callback"
import traceback, sys sys.stderr.write("Exception in Tkinter callback\n")
def report_callback_exception(self, exc, val, tb): import traceback print "Exception in Tkinter callback" traceback.print_exception(exc, val, tb)
da654505307c766169915e133cd03e78b240acaf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/da654505307c766169915e133cd03e78b240acaf/Tkinter.py
if not _default_root: _default_root = master
def _setup(self, master, cnf): if _support_default_root: global _default_root if not master: if not _default_root: _default_root = Tk() master = _default_root if not _default_root: _default_root = master self.master = master self.tk = master.tk name = None if cnf.has_key('name'): name = cnf['name'] del cnf['name'] if n...
da654505307c766169915e133cd03e78b240acaf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/da654505307c766169915e133cd03e78b240acaf/Tkinter.py
SetDialogItemText(h, string.joinfields(list, '\r'))
h.data = string.joinfields(list, '\r') d.SelectDialogItemText(TEXT_ITEM, 0, 32767) d.SelectDialogItemText(TEXT_ITEM, 0, 0)
def interact(list, pythondir, options, title): """Let the user interact with the dialog""" opythondir = pythondir try: # Try to go to the "correct" dir for GetDirectory os.chdir(pythondir.as_pathname()) except os.error: pass d = GetNewDialog(DIALOG_ID, -1) tp, h, rect = d.GetDialogItem(TITLE_ITEM) SetDialogItemText(h, ...
a918b8c4f64a90dc2fa298d5269f042891c20fd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a918b8c4f64a90dc2fa298d5269f042891c20fd3/EditPythonPrefs.py
tmp = string.splitfields(GetDialogItemText(h), '\r')
tmp = string.splitfields(h.data, '\r')
def interact(list, pythondir, options, title): """Let the user interact with the dialog""" opythondir = pythondir try: # Try to go to the "correct" dir for GetDirectory os.chdir(pythondir.as_pathname()) except os.error: pass d = GetNewDialog(DIALOG_ID, -1) tp, h, rect = d.GetDialogItem(TITLE_ITEM) SetDialogItemText(h, ...
a918b8c4f64a90dc2fa298d5269f042891c20fd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a918b8c4f64a90dc2fa298d5269f042891c20fd3/EditPythonPrefs.py
def handler1(): print "handler1"
One public function, register, is defined. """
def handler1(): print "handler1"
c19425d520527d93b82755cc8a9854388306515a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c19425d520527d93b82755cc8a9854388306515a/atexit.py
def handler2(*args, **kargs): print "handler2", args, kargs
_exithandlers = [] def _run_exitfuncs(): """run any registered exit functions
def handler2(*args, **kargs): print "handler2", args, kargs
c19425d520527d93b82755cc8a9854388306515a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c19425d520527d93b82755cc8a9854388306515a/atexit.py
_exithandlers = atexit._exithandlers atexit._exithandlers = []
_exithandlers is traversed in reverse order so functions are executed last in, first out. """ while _exithandlers: func, targs, kargs = _exithandlers[-1] apply(func, targs, kargs) _exithandlers.remove(_exithandlers[-1])
def handler2(*args, **kargs): print "handler2", args, kargs
c19425d520527d93b82755cc8a9854388306515a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c19425d520527d93b82755cc8a9854388306515a/atexit.py
atexit.register(handler1) atexit.register(handler2) atexit.register(handler2, 7, kw="abc")
def register(func, *targs, **kargs): """register a function to be executed upon normal program termination
def handler2(*args, **kargs): print "handler2", args, kargs
c19425d520527d93b82755cc8a9854388306515a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c19425d520527d93b82755cc8a9854388306515a/atexit.py
atexit._run_exitfuncs()
func - function to be called at exit targs - optional arguments to pass to func kargs - optional keyword arguments to pass to func """ _exithandlers.append((func, targs, kargs))
def handler2(*args, **kargs): print "handler2", args, kargs
c19425d520527d93b82755cc8a9854388306515a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c19425d520527d93b82755cc8a9854388306515a/atexit.py
atexit._exithandlers = _exithandlers
import sys try: x = sys.exitfunc except AttributeError: sys.exitfunc = _run_exitfuncs else: if x != _run_exitfuncs: register(x) del sys if __name__ == "__main__": def x1(): print "running x1" def x2(n): print "running x2(%s)" % `n` def x3(n, kwd=None): print "running x3(%s, kwd=%s)" % (`n`, `kwd`) register(x1) regi...
def handler2(*args, **kargs): print "handler2", args, kargs
c19425d520527d93b82755cc8a9854388306515a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c19425d520527d93b82755cc8a9854388306515a/atexit.py
try: _os.unlink(self._bakfile) except _os.error:
try: self._os.unlink(self._bakfile) except self._os.error:
def _commit(self): try: _os.unlink(self._bakfile) except _os.error: pass
d7472ec13a65c6c5ff00365b1477677d1fecbb3c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d7472ec13a65c6c5ff00365b1477677d1fecbb3c/dumbdbm.py
_os.rename(self._dirfile, self._bakfile) except _os.error:
self._os.rename(self._dirfile, self._bakfile) except self._os.error:
def _commit(self): try: _os.unlink(self._bakfile) except _os.error: pass
d7472ec13a65c6c5ff00365b1477677d1fecbb3c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d7472ec13a65c6c5ff00365b1477677d1fecbb3c/dumbdbm.py
f = _open(self._dirfile, 'w', self._mode)
f = self._open(self._dirfile, 'w', self._mode)
def _commit(self): try: _os.unlink(self._bakfile) except _os.error: pass
d7472ec13a65c6c5ff00365b1477677d1fecbb3c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d7472ec13a65c6c5ff00365b1477677d1fecbb3c/dumbdbm.py
def test_SEH(self): import sys if not hasattr(sys, "getobjects"):
import _ctypes if _ctypes.uses_seh(): def test_SEH(self):
def test_SEH(self): # Call functions with invalid arguments, and make sure that access violations # are trapped and raise an exception. # # Normally, in a debug build of the _ctypes extension # module, exceptions are not trapped, so we can only run # this test in a release build. import sys if not hasattr(sys, "getobje...
f780be4239817192a93c34b768f6565aee8c2130 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f780be4239817192a93c34b768f6565aee8c2130/test_win32.py
class Boolean: """Boolean-value wrapper. Use True or False to generate a "boolean" XML-RPC value. """ def __init__(self, value = 0): self.value = operator.truth(value) def encode(self, out): out.write("<value><boolean>%d</boolean></value>\n" % self.value) def __cmp__(self, other): if isinstance(other, Boolean): oth...
if _bool_is_builtin: boolean = Boolean = bool True, False = True, False else: class Boolean: """Boolean-value wrapper. Use True or False to generate a "boolean" XML-RPC value. """ def __init__(self, value = 0): self.value = operator.truth(value) def encode(self, out): out.write("<value><boolean>%d</boolean></value>...
def __repr__(self): return ( "<Fault %s: %s>" % (self.faultCode, repr(self.faultString)) )
9a7c96a2bca4342f70b05f5d1e00ad5be142bf24 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9a7c96a2bca4342f70b05f5d1e00ad5be142bf24/xmlrpclib.py
WRAPPERS = DateTime, Binary, Boolean
WRAPPERS = (DateTime, Binary) if not _bool_is_builtin: WRAPPERS = WRAPPERS + (Boolean,)
def _binary(data): # decode xml element contents into a Binary structure value = Binary() value.decode(data) return value
9a7c96a2bca4342f70b05f5d1e00ad5be142bf24 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9a7c96a2bca4342f70b05f5d1e00ad5be142bf24/xmlrpclib.py
"exclude=", "include=", "package=", "strip", "iconfile=")
"exclude=", "include=", "package=", "strip", "iconfile=", "lib=")
def main(builder=None): if builder is None: builder = AppBuilder(verbosity=1) shortopts = "b:n:r:f:e:m:c:p:lx:i:hvqa" longopts = ("builddir=", "name=", "resource=", "file=", "executable=", "mainprogram=", "creator=", "nib=", "plist=", "link", "link-exec", "help", "verbose", "quiet", "argv", "standalone", "exclude=", "...
15624d850b65a0be8e944e9f17849799e3e7ede5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/15624d850b65a0be8e944e9f17849799e3e7ede5/bundlebuilder.py
from distutils.ccompiler import new_compiler from distutils.sysconfig import customize_compiler
def build_extensions(self): from distutils.ccompiler import new_compiler from distutils.sysconfig import customize_compiler
5bbc7b9283c40996c198511f57211d4f77d6a12d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5bbc7b9283c40996c198511f57211d4f77d6a12d/setup.py
compiler = os.environ.get('CC') linker_so = os.environ.get('LDSHARED') args = {} if compiler is not None: args['compiler_so'] = compiler if linker_so is not None: args['linker_so'] = linker_so + ' -shared' self.compiler.set_executables(**args)
def build_extensions(self): from distutils.ccompiler import new_compiler from distutils.sysconfig import customize_compiler
5bbc7b9283c40996c198511f57211d4f77d6a12d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5bbc7b9283c40996c198511f57211d4f77d6a12d/setup.py
exts.append( Extension('unicodedata', ['unicodedata.c', 'unicodedatabase.c']) )
exts.append( Extension('unicodedata', ['unicodedata.c', 'unicodedatabase.c']) )
def detect_modules(self): # Ensure that /usr/local is always used if '/usr/local/lib' not in self.compiler.library_dirs: self.compiler.library_dirs.append('/usr/local/lib') if '/usr/local/include' not in self.compiler.include_dirs: self.compiler.include_dirs.append( '/usr/local/include' )
5bbc7b9283c40996c198511f57211d4f77d6a12d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5bbc7b9283c40996c198511f57211d4f77d6a12d/setup.py
def detect_modules(self): # Ensure that /usr/local is always used if '/usr/local/lib' not in self.compiler.library_dirs: self.compiler.library_dirs.append('/usr/local/lib') if '/usr/local/include' not in self.compiler.include_dirs: self.compiler.include_dirs.append( '/usr/local/include' )
5bbc7b9283c40996c198511f57211d4f77d6a12d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5bbc7b9283c40996c198511f57211d4f77d6a12d/setup.py
def detect_modules(self): # Ensure that /usr/local is always used if '/usr/local/lib' not in self.compiler.library_dirs: self.compiler.library_dirs.append('/usr/local/lib') if '/usr/local/include' not in self.compiler.include_dirs: self.compiler.include_dirs.append( '/usr/local/include' )
5bbc7b9283c40996c198511f57211d4f77d6a12d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5bbc7b9283c40996c198511f57211d4f77d6a12d/setup.py
def detect_modules(self): # Ensure that /usr/local is always used if '/usr/local/lib' not in self.compiler.library_dirs: self.compiler.library_dirs.append('/usr/local/lib') if '/usr/local/include' not in self.compiler.include_dirs: self.compiler.include_dirs.append( '/usr/local/include' )
5bbc7b9283c40996c198511f57211d4f77d6a12d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5bbc7b9283c40996c198511f57211d4f77d6a12d/setup.py
def detect_modules(self): # Ensure that /usr/local is always used if '/usr/local/lib' not in self.compiler.library_dirs: self.compiler.library_dirs.append('/usr/local/lib') if '/usr/local/include' not in self.compiler.include_dirs: self.compiler.include_dirs.append( '/usr/local/include' )
5bbc7b9283c40996c198511f57211d4f77d6a12d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5bbc7b9283c40996c198511f57211d4f77d6a12d/setup.py
def main(): setup(name = 'Python standard library', version = '%d.%d' % sys.version_info[:2], cmdclass = {'build_ext':PyBuildExt}, # The struct module is defined here, because build_ext won't be # called unless there's at least one extension module defined. ext_modules=[Extension('struct', ['structmodule.c'])] )
5bbc7b9283c40996c198511f57211d4f77d6a12d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5bbc7b9283c40996c198511f57211d4f77d6a12d/setup.py
raise ValueError, "CRC check failed"
raise IOError, "CRC check failed"
def _read_eof(self): # We've read to the end of the file, so we have to rewind in order # to reread the 8 bytes containing the CRC and the file size. # We check the that the computed CRC and size of the # uncompressed data matches the stored values. Note that the size # stored is the true file size mod 2**32. self.fil...
64edd6ac1ddb29f7817ee44e9b376b096ffa1d55 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/64edd6ac1ddb29f7817ee44e9b376b096ffa1d55/gzip.py
raise ValueError, "Incorrect length of data produced"
raise IOError, "Incorrect length of data produced"
def _read_eof(self): # We've read to the end of the file, so we have to rewind in order # to reread the 8 bytes containing the CRC and the file size. # We check the that the computed CRC and size of the # uncompressed data matches the stored values. Note that the size # stored is the true file size mod 2**32. self.fil...
64edd6ac1ddb29f7817ee44e9b376b096ffa1d55 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/64edd6ac1ddb29f7817ee44e9b376b096ffa1d55/gzip.py
if sys.platform[:4] != 'java': int(testme) long(testme) float(testme) oct(testme) hex(testme) else: print "__int__: ()" print "__long__: ()" print "__float__: ()" print "__oct__: ()" print "__hex__: ()"
int(testme) long(testme) float(testme) oct(testme) hex(testme)
def __%(method)s__(self, *args): print "__%(method)s__:", args
3a313e36555a3416799f3c049b8ebb41e9edeb8a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3a313e36555a3416799f3c049b8ebb41e9edeb8a/test_class.py
try: hash(C1()) except TypeError: pass else: raise TestFailed, "hash(C1()) should raise an exception"
check_exc("hash(C1())", TypeError)
def __cmp__(self, other): return 0
3a313e36555a3416799f3c049b8ebb41e9edeb8a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3a313e36555a3416799f3c049b8ebb41e9edeb8a/test_class.py
try: hash(C2()) except TypeError: pass else: raise TestFailed, "hash(C2()) should raise an exception"
check_exc("hash(C2())", TypeError)
def __eq__(self, other): return 1
3a313e36555a3416799f3c049b8ebb41e9edeb8a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3a313e36555a3416799f3c049b8ebb41e9edeb8a/test_class.py
args = ('wm', 'colormapwindows', self._w) + _flatten(wlist)
if len(wlist) > 1: wlist = (wlist,) args = ('wm', 'colormapwindows', self._w) + wlist
def wm_colormapwindows(self, *wlist): args = ('wm', 'colormapwindows', self._w) + _flatten(wlist) return map(self._nametowidget, self.tk.call(args))
8fa42af978f1494d0475f6ceb9af38923e024030 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8fa42af978f1494d0475f6ceb9af38923e024030/Tkinter.py
self.emit('PyObject_SetAttrString(result, "%s", value);' % a.name, 1)
self.emit('if (PyObject_SetAttrString(result, "%s", value) < 0)' % a.name, 1) self.emit('goto failed;', 2) self.emit('Py_DECREF(value);', 1)
def visitSum(self, sum, name): if is_simple(sum): self.simpleSum(sum, name) return self.func_begin(name) self.emit("switch (o->kind) {", 1) for i in range(len(sum.types)): t = sum.types[i] self.visitConstructor(t, i + 1, name) self.emit("}", 1) for a in sum.attributes: self.emit("value = ast2obj_%s(o->%s);" % (a.type, ...
03e5bc02c9744640f4d228ff7686c2392ab17812 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/03e5bc02c9744640f4d228ff7686c2392ab17812/asdl_c.py
if self._file: self.close()
self.close()
def __del__(self): if self._file: self.close()
cfc4178e843f5f2b0f190bacd222c0f72ab91e53 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cfc4178e843f5f2b0f190bacd222c0f72ab91e53/wave.py
self._ensure_header_written(0) if self._datalength != self._datawritten: self._patchheader() self._file.flush() self._file = None
if self._file: self._ensure_header_written(0) if self._datalength != self._datawritten: self._patchheader() self._file.flush() self._file = None if self._i_opened_the_file: self._i_opened_the_file.close() self._i_opened_the_file = None
def close(self): self._ensure_header_written(0) if self._datalength != self._datawritten: self._patchheader() self._file.flush() self._file = None
cfc4178e843f5f2b0f190bacd222c0f72ab91e53 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cfc4178e843f5f2b0f190bacd222c0f72ab91e53/wave.py
def _split(self, s, charset, firstline=False): # Split up a header safely for use with encode_chunks. BAW: this # appears to be a private convenience method. splittable = charset.to_splittable(s) encoded = charset.from_splittable(splittable) elen = charset.encoded_header_len(encoded)
5e3bcff651f77bd7504751a581b4db7d4b937cac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5e3bcff651f77bd7504751a581b4db7d4b937cac/Header.py
self.apply() self.cancel()
try: self.apply() finally: self.cancel()
def ok(self, event=None):
e350c840b389f645b25f00f1fa35f6ea1fec03b3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e350c840b389f645b25f00f1fa35f6ea1fec03b3/tkSimpleDialog.py
compileargs = r"-Wi [TARGETDIR]Lib\compileall.py -f -x badsyntax [TARGETDIR]Lib"
compileargs = r"-Wi [TARGETDIR]Lib\compileall.py -f -x bad_coding|badsyntax|site-packages [TARGETDIR]Lib"
def add_ui(db): x = y = 50 w = 370 h = 300 title = "[ProductName] Setup" # see "Dialog Style Bits" modal = 3 # visible | modal modeless = 1 # visible track_disk_space = 32 add_data(db, 'ActionText', uisample.ActionText) add_data(db, 'UIText', uisample.UIText) # Bitmaps if not os.path.exists(srcdir+r"\PC\pytho...
9fbc44cc34aa1521c4d7467d75f189e955e8f247 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9fbc44cc34aa1521c4d7467d75f189e955e8f247/msi.py
type, address = splittype(address) if not type:
import re if not re.match('^([^/:]+)://', address):
def getproxies_registry(): """Return a dictionary of scheme -> proxy server URL mappings.
64e5aa93919bb0ffd95a11a5da7bac64faaf9faf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/64e5aa93919bb0ffd95a11a5da7bac64faaf9faf/urllib.py
for dir in sys.path:
path = sys.path try: path = [os.path.dirname(__file__)] + path except NameError: pass for dir in path:
def get_qualified_path(name): """ return a more qualified path to name""" import sys import os for dir in sys.path: fullname = os.path.join(dir, name) if os.path.exists(fullname): return fullname return name
f1b0009a7807e18fad3e2e17c8cb3b4a4eb20b07 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f1b0009a7807e18fad3e2e17c8cb3b4a4eb20b07/test_imageop.py
assert gc.collect() == 1
if gc.collect() != 1: raise TestFailed
def test_list(): l = [] l.append(l) gc.collect() del l assert gc.collect() == 1
faae266e89d19f5dfea81db0771b6fa671e9b1ac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/faae266e89d19f5dfea81db0771b6fa671e9b1ac/test_gc.py
assert gc.collect() == 1
if gc.collect() != 1: raise TestFailed
def test_dict(): d = {} d[1] = d gc.collect() del d assert gc.collect() == 1
faae266e89d19f5dfea81db0771b6fa671e9b1ac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/faae266e89d19f5dfea81db0771b6fa671e9b1ac/test_gc.py
assert gc.collect() == 2
if gc.collect() != 2: raise TestFailed
def test_tuple(): # since tuples are immutable we close the loop with a list l = [] t = (l,) l.append(t) gc.collect() del t del l assert gc.collect() == 2
faae266e89d19f5dfea81db0771b6fa671e9b1ac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/faae266e89d19f5dfea81db0771b6fa671e9b1ac/test_gc.py
assert gc.collect() > 0
if gc.collect() == 0: raise TestFailed
def test_class(): class A: pass A.a = A gc.collect() del A assert gc.collect() > 0
faae266e89d19f5dfea81db0771b6fa671e9b1ac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/faae266e89d19f5dfea81db0771b6fa671e9b1ac/test_gc.py
assert gc.collect() > 0
if gc.collect() == 0: raise TestFailed
def test_instance(): class A: pass a = A() a.a = a gc.collect() del a assert gc.collect() > 0
faae266e89d19f5dfea81db0771b6fa671e9b1ac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/faae266e89d19f5dfea81db0771b6fa671e9b1ac/test_gc.py
assert gc.collect() > 0
if gc.collect() == 0: raise TestFailed
def __init__(self): self.init = self.__init__
faae266e89d19f5dfea81db0771b6fa671e9b1ac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/faae266e89d19f5dfea81db0771b6fa671e9b1ac/test_gc.py
gc.garbage[:] = []
def __del__(self): pass
faae266e89d19f5dfea81db0771b6fa671e9b1ac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/faae266e89d19f5dfea81db0771b6fa671e9b1ac/test_gc.py
assert gc.collect() > 0 assert id(gc.garbage[0]) == id_a
if gc.collect() == 0: raise TestFailed for obj in gc.garbage: if id(obj) == id_a: del obj.a break else: raise TestFailed gc.garbage.remove(obj)
def __del__(self): pass
faae266e89d19f5dfea81db0771b6fa671e9b1ac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/faae266e89d19f5dfea81db0771b6fa671e9b1ac/test_gc.py
assert gc.collect() == 2
if gc.collect() != 2: raise TestFailed def test_saveall(): debug = gc.get_debug() gc.set_debug(debug | gc.DEBUG_SAVEALL) l = [] l.append(l) id_l = id(l) del l gc.collect() try: for obj in gc.garbage: if id(obj) == id_l: del obj[:] break else: raise TestFailed gc.garbage.remove(obj) finally: gc.set_debug(debug)
exec("def f(): pass\n") in d
faae266e89d19f5dfea81db0771b6fa671e9b1ac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/faae266e89d19f5dfea81db0771b6fa671e9b1ac/test_gc.py
sys.stderr.write("*** %s\n" % s)
ewrite("*** %s\n" % s)
def para_msg(s): sys.stderr.write("*** %s\n" % s)
080c1b5af693afd471728e7fa66f744a61e75ed4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/080c1b5af693afd471728e7fa66f744a61e75ed4/docfixer.py
def find_all_elements_from_set(doc, gi_set, nodes=None): if nodes is None: nodes = []
def find_all_child_elements(doc, gi): nodes = [] for child in doc.childNodes: if child.nodeType == ELEMENT: if child.tagName == gi: nodes.append(child) return nodes def find_all_elements_from_set(doc, gi_set): return __find_all_elements_from_set(doc, gi_set, []) def __find_all_elements_from_set(doc, gi_set, nodes):
def find_all_elements_from_set(doc, gi_set, nodes=None): if nodes is None: nodes = [] if doc.nodeType == ELEMENT and doc.tagName in gi_set: nodes.append(doc) for child in doc.childNodes: if child.nodeType == ELEMENT: find_all_elements_from_set(child, gi_set, nodes) return nodes
080c1b5af693afd471728e7fa66f744a61e75ed4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/080c1b5af693afd471728e7fa66f744a61e75ed4/docfixer.py
find_all_elements_from_set(child, gi_set, nodes)
__find_all_elements_from_set(child, gi_set, nodes)
def find_all_elements_from_set(doc, gi_set, nodes=None): if nodes is None: nodes = [] if doc.nodeType == ELEMENT and doc.tagName in gi_set: nodes.append(doc) for child in doc.childNodes: if child.nodeType == ELEMENT: find_all_elements_from_set(child, gi_set, nodes) return nodes
080c1b5af693afd471728e7fa66f744a61e75ed4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/080c1b5af693afd471728e7fa66f744a61e75ed4/docfixer.py
def rewrite_descriptor(doc, descriptor): # # Do these things: # 1. Add an "index=noindex" attribute to the element if the tagName # ends in 'ni', removing the 'ni' from the name. # 2. Create a <signature> from the name attribute and <args>. # 3. Create additional <signature>s from <*line{,ni}> elements, # ...
080c1b5af693afd471728e7fa66f744a61e75ed4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/080c1b5af693afd471728e7fa66f744a61e75ed4/docfixer.py
descriptor.setAttribute("index", "noindex")
descriptor.setAttribute("index", "no")
def rewrite_descriptor(doc, descriptor): # # Do these things: # 1. Add an "index=noindex" attribute to the element if the tagName # ends in 'ni', removing the 'ni' from the name. # 2. Create a <signature> from the name attribute and <args>. # 3. Create additional <signature>s from <*line{,ni}> elements, # ...
080c1b5af693afd471728e7fa66f744a61e75ed4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/080c1b5af693afd471728e7fa66f744a61e75ed4/docfixer.py
sys.stderr.write( "module name in title doesn't match" " <declaremodule>; no <short-synopsis>\n")
ewrite("module name in title doesn't match" " <declaremodule/>; no <short-synopsis/>\n")
def create_module_info(doc, section): # Heavy. node = extract_first_element(section, "modulesynopsis") if node is None: return node._node.name = "synopsis" lastchild = node.childNodes[-1] if lastchild.nodeType == TEXT \ and lastchild.data[-1:] == ".": lastchild.data = lastchild.data[:-1] modauthor = extract_first_eleme...
080c1b5af693afd471728e7fa66f744a61e75ed4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/080c1b5af693afd471728e7fa66f744a61e75ed4/docfixer.py
sys.stderr.write( "Unexpected condition: <section> without <title>\n")
ewrite("Unexpected condition: <section/> without <title/>\n")
def create_module_info(doc, section): # Heavy. node = extract_first_element(section, "modulesynopsis") if node is None: return node._node.name = "synopsis" lastchild = node.childNodes[-1] if lastchild.nodeType == TEXT \ and lastchild.data[-1:] == ".": lastchild.data = lastchild.data[:-1] modauthor = extract_first_eleme...
080c1b5af693afd471728e7fa66f744a61e75ed4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/080c1b5af693afd471728e7fa66f744a61e75ed4/docfixer.py
def create_module_info(doc, section): # Heavy. node = extract_first_element(section, "modulesynopsis") if node is None: return node._node.name = "synopsis" lastchild = node.childNodes[-1] if lastchild.nodeType == TEXT \ and lastchild.data[-1:] == ".": lastchild.data = lastchild.data[:-1] modauthor = extract_first_eleme...
080c1b5af693afd471728e7fa66f744a61e75ed4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/080c1b5af693afd471728e7fa66f744a61e75ed4/docfixer.py
def cleanup_synopses(doc): for node in find_all_elements(doc, "section"):
def cleanup_synopses(doc, fragment): for node in find_all_elements(fragment, "section"):
def cleanup_synopses(doc): for node in find_all_elements(doc, "section"): create_module_info(doc, node)
080c1b5af693afd471728e7fa66f744a61e75ed4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/080c1b5af693afd471728e7fa66f744a61e75ed4/docfixer.py
"moduleauthor",
"moduleauthor", "indexterm",
def move_elements_by_name(doc, source, dest, name, sep=None): nodes = [] for child in source.childNodes: if child.nodeType == ELEMENT and child.tagName == name: nodes.append(child) for node in nodes: source.removeChild(node) dest.appendChild(node) if sep: dest.appendChild(doc.createTextNode(sep))
080c1b5af693afd471728e7fa66f744a61e75ed4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/080c1b5af693afd471728e7fa66f744a61e75ed4/docfixer.py
parent.insertBefore(para, parent.childNodes[start])
nextnode = parent.childNodes[start] if nextnode.nodeType == TEXT: if nextnode.data and nextnode.data[0] != "\n": nextnode.data = "\n" + nextnode.data else: newnode = doc.createTextNode("\n") parent.insertBefore(newnode, nextnode) nextnode = newnode start = start + 1 parent.insertBefore(para, nextnode)
def build_para(doc, parent, start, i): children = parent.childNodes after = start + 1 have_last = 0 BREAK_ELEMENTS = PARA_LEVEL_ELEMENTS + RECURSE_INTO_PARA_CONTAINERS # Collect all children until \n\n+ is found in a text node or a # member of BREAK_ELEMENTS is found. for j in range(start, i): after = j + 1 child = chi...
080c1b5af693afd471728e7fa66f744a61e75ed4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/080c1b5af693afd471728e7fa66f744a61e75ed4/docfixer.py
sys.stderr.write("--- fixup_refmodindexes_chunk(%s)\n" % container)
bwrite("--- fixup_refmodindexes_chunk(%s)\n" % container)
def fixup_refmodindexes_chunk(container): # node is probably a <para>; let's see how often it isn't: if container.tagName != PARA_ELEMENT: sys.stderr.write("--- fixup_refmodindexes_chunk(%s)\n" % container) module_entries = find_all_elements(container, "module") if not module_entries: return index_entries = find_all_el...
080c1b5af693afd471728e7fa66f744a61e75ed4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/080c1b5af693afd471728e7fa66f744a61e75ed4/docfixer.py
sys.stderr.write( "--- unexpected number of children for %s node:\n" % entry.tagName) sys.stderr.write(entry.toxml() + "\n")
bwrite("--- unexpected number of children for %s node:\n" % entry.tagName) ewrite(entry.toxml() + "\n")
def fixup_refmodindexes_chunk(container): # node is probably a <para>; let's see how often it isn't: if container.tagName != PARA_ELEMENT: sys.stderr.write("--- fixup_refmodindexes_chunk(%s)\n" % container) module_entries = find_all_elements(container, "module") if not module_entries: return index_entries = find_all_el...
080c1b5af693afd471728e7fa66f744a61e75ed4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/080c1b5af693afd471728e7fa66f744a61e75ed4/docfixer.py
node.setAttribute("index", "index")
node.setAttribute("index", "yes")
def fixup_refmodindexes_chunk(container): # node is probably a <para>; let's see how often it isn't: if container.tagName != PARA_ELEMENT: sys.stderr.write("--- fixup_refmodindexes_chunk(%s)\n" % container) module_entries = find_all_elements(container, "module") if not module_entries: return index_entries = find_all_el...
080c1b5af693afd471728e7fa66f744a61e75ed4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/080c1b5af693afd471728e7fa66f744a61e75ed4/docfixer.py
entries = find_all_elements(container, "bifuncindex") function_entries = find_all_elements(container, "function")
entries = find_all_child_elements(container, "bifuncindex") function_entries = find_all_child_elements(container, "function")
def fixup_bifuncindexes_chunk(container): removes = [] entries = find_all_elements(container, "bifuncindex") function_entries = find_all_elements(container, "function") for entry in entries: function_name = entry.getAttribute("name") found = 0 for func_entry in function_entries: t2 = func_entry.childNodes[0].data if t2...
080c1b5af693afd471728e7fa66f744a61e75ed4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/080c1b5af693afd471728e7fa66f744a61e75ed4/docfixer.py
func_entry.setAttribute("index", "index")
func_entry.setAttribute("index", "yes")
def fixup_bifuncindexes_chunk(container): removes = [] entries = find_all_elements(container, "bifuncindex") function_entries = find_all_elements(container, "function") for entry in entries: function_name = entry.getAttribute("name") found = 0 for func_entry in function_entries: t2 = func_entry.childNodes[0].data if t2...
080c1b5af693afd471728e7fa66f744a61e75ed4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/080c1b5af693afd471728e7fa66f744a61e75ed4/docfixer.py
found = 1
def fixup_bifuncindexes_chunk(container): removes = [] entries = find_all_elements(container, "bifuncindex") function_entries = find_all_elements(container, "function") for entry in entries: function_name = entry.getAttribute("name") found = 0 for func_entry in function_entries: t2 = func_entry.childNodes[0].data if t2...
080c1b5af693afd471728e7fa66f744a61e75ed4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/080c1b5af693afd471728e7fa66f744a61e75ed4/docfixer.py
cleanup_trailing_parens(doc, ["function", "method", "cfunction"]) cleanup_synopses(doc)
cleanup_trailing_parens(fragment, ["function", "method", "cfunction"]) cleanup_synopses(doc, fragment)
def convert(ifp, ofp): p = esistools.ExtendedEsisBuilder() p.feed(ifp.read()) doc = p.document fragment = p.fragment normalize(fragment) simplify(doc, fragment) handle_labels(doc, fragment) handle_appendix(doc, fragment) fixup_trailing_whitespace(doc, { "abstract": "\n", "title": "", "chapter": "\n\n", "section": "\n\n...
080c1b5af693afd471728e7fa66f744a61e75ed4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/080c1b5af693afd471728e7fa66f744a61e75ed4/docfixer.py
_tryorder = ["galeon", "skipstone", "mozilla", "netscape",
_tryorder = ["galeon", "skipstone", "mozilla-firefox", "mozilla-firebird", "mozilla", "netscape",
def open_new(self, url): self.open(url)
9a2a1cb031f9149ca6bfaf7b43ae0955d16db9b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9a2a1cb031f9149ca6bfaf7b43ae0955d16db9b1/webbrowser.py
if _iscommand("mozilla"): register("mozilla", None, Netscape("mozilla")) if _iscommand("netscape"): register("netscape", None, Netscape("netscape"))
for browser in ("mozilla-firefox", "mozilla-firebird", "mozilla", "netscape"): if _iscommand(browser): register(browser, None, Netscape(browser))
def open_new(self, url): self.open(url)
9a2a1cb031f9149ca6bfaf7b43ae0955d16db9b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9a2a1cb031f9149ca6bfaf7b43ae0955d16db9b1/webbrowser.py
try: port = int(host[i+1:]) except ValueError, msg: raise socket.error, str(msg)
port = int(host[i+1:])
def _set_hostport(self, host, port): if port is None: i = host.find(':') if i >= 0: try: port = int(host[i+1:]) except ValueError, msg: raise socket.error, str(msg) host = host[:i] else: port = self.default_port self.host = host self.port = port
fd97a919ffc075e5704cfd834986bada0f243165 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fd97a919ffc075e5704cfd834986bada0f243165/httplib.py
self.rfile = self.connection.makefile('rb')
self.rfile = self.connection.makefile('rb', 0)
def setup(self):
d804bab721208a8691b554443c8cbf1a8ebb6c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d804bab721208a8691b554443c8cbf1a8ebb6c2d/SocketServer.py
if self.libraries is None: self.libraries = [] if self.library_dirs is None: self.library_dirs = [] if self.rpath is None: self.rpath = [] if os.name == 'nt': self.library_dirs.append (os.path.join(sys.exec_prefix, 'libs')) if self.debug: self.build_temp = os.path.join (self.build_temp, "Debug") else: self.build_...
def finalize_options (self): from distutils import sysconfig
842296480e80873de5f5042da42533044a9586dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/842296480e80873de5f5042da42533044a9586dd/build_ext.py
if self.libraries is None: self.libraries = [] if self.library_dirs is None: self.library_dirs = [] if self.rpath is None: self.rpath = []
def run (self):
842296480e80873de5f5042da42533044a9586dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/842296480e80873de5f5042da42533044a9586dd/build_ext.py