bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def run (self):
def run (self):
9,500
def run (self):
def run (self):
9,501
def find_all_modules (self): """Compute the list of all modules that will be built, whether they are specified one-module-at-a-time ('self.py_modules') or by whole packages ('self.packages'). Return a list of tuples (package, module, module_file), just like 'find_modules()' and 'find_package_modules()' do."""
def find_all_modules (self): """Compute the list of all modules that will be built, whether they are specified one-module-at-a-time ('self.py_modules') or by whole packages ('self.packages'). Return a list of tuples (package, module, module_file), just like 'find_modules()' and 'find_package_modules()' do."""
9,502
def connect(self, host='localhost', port = 0): """Connect to a host on a given port.
def connect(self, host='localhost', port = 0): """Connect to a host on a given port.
9,503
def connect(self, host='localhost', port = 0): """Connect to a host on a given port.
def connect(self, host='localhost', port = 0): """Connect to a host on a given port.
9,504
def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
9,505
def configure_ctypes(self, ext): (srcdir,) = sysconfig.get_config_vars('srcdir') ffi_builddir = os.path.join(self.build_temp, 'libffi') ffi_srcdir = os.path.abspath(os.path.join(srcdir, 'Modules', '_ctypes', 'libffi')) ffi_configfile = os.path.join(ffi_builddir, 'fficonfig.py')
def configure_ctypes(self, ext): (srcdir,) = sysconfig.get_config_vars('srcdir') ffi_builddir = os.path.join(self.build_temp, 'libffi') ffi_srcdir = os.path.abspath(os.path.join(srcdir, 'Modules', '_ctypes', 'libffi')) ffi_configfile = os.path.join(ffi_builddir, 'fficonfig.py')
9,506
def detect_ctypes(self): include_dirs = [] extra_compile_args = [] sources = ['_ctypes/_ctypes.c', '_ctypes/callbacks.c', '_ctypes/callproc.c', '_ctypes/stgdict.c', '_ctypes/cfield.c', '_ctypes/malloc_closure.c'] depends = ['_ctypes/ctypes.h']
def detect_ctypes(self, inc_dirs, lib_dirs): self.use_system_libffi = False include_dirs = [] extra_compile_args = [] sources = ['_ctypes/_ctypes.c', '_ctypes/callbacks.c', '_ctypes/callproc.c', '_ctypes/stgdict.c', '_ctypes/cfield.c', '_ctypes/malloc_closure.c'] depends = ['_ctypes/ctypes.h']
9,507
def checkJoin(relurl, expected): global errors result = urlparse.urljoin(RFC1808_BASE, relurl) print "%-13s = %r" % (relurl, result) if result != expected: errors += 1 print "urljoin(%r, %r)" % (RFC1808_BASE, relurl) print ("expected %r,\n" " got %r") % (expected, result)
def test_RFC1808(self): self.checkJoin(RFC1808_BASE, 'g:h', 'g:h') self.checkJoin(RFC1808_BASE, 'g', 'http://a/b/c/g') self.checkJoin(RFC1808_BASE, './g', 'http://a/b/c/g') self.checkJoin(RFC1808_BASE, 'g/', 'http://a/b/c/g/') self.checkJoin(RFC1808_BASE, '/g', 'http://a/g') self.checkJoin(RFC1808_BASE, '//g', 'http://g') self.checkJoin(RFC1808_BASE, '?y', 'http://a/b/c/d;p?y') self.checkJoin(RFC1808_BASE, 'g?y', 'http://a/b/c/g?y') self.checkJoin(RFC1808_BASE, 'g?y/./x', 'http://a/b/c/g?y/./x') self.checkJoin(RFC1808_BASE, ' self.checkJoin(RFC1808_BASE, 'g self.checkJoin(RFC1808_BASE, 'g self.checkJoin(RFC1808_BASE, 'g?y self.checkJoin(RFC1808_BASE, ';x', 'http://a/b/c/d;x') self.checkJoin(RFC1808_BASE, 'g;x', 'http://a/b/c/g;x') self.checkJoin(RFC1808_BASE, 'g;x?y self.checkJoin(RFC1808_BASE, '.', 'http://a/b/c/') self.checkJoin(RFC1808_BASE, './', 'http://a/b/c/') self.checkJoin(RFC1808_BASE, '..', 'http://a/b/') self.checkJoin(RFC1808_BASE, '../', 'http://a/b/') self.checkJoin(RFC1808_BASE, '../g', 'http://a/b/g') self.checkJoin(RFC1808_BASE, '../..', 'http://a/') self.checkJoin(RFC1808_BASE, '../../', 'http://a/') self.checkJoin(RFC1808_BASE, '../../g', 'http://a/g')
9,508
def checkJoin(relurl, expected): global errors result = urlparse.urljoin(RFC1808_BASE, relurl) print "%-13s = %r" % (relurl, result) if result != expected: errors += 1 print "urljoin(%r, %r)" % (RFC1808_BASE, relurl) print ("expected %r,\n" " got %r") % (expected, result)
def checkJoin(relurl, expected): global errors result = urlparse.urljoin(RFC1808_BASE, relurl) print "%-13s = %r" % (relurl, result) if result != expected: errors += 1 print "urljoin(%r, %r)" % (RFC1808_BASE, relurl) print ("expected %r,\n" " got %r") % (expected, result)
9,509
def checkJoin(relurl, expected): global errors result = urlparse.urljoin(RFC1808_BASE, relurl) print "%-13s = %r" % (relurl, result) if result != expected: errors += 1 print "urljoin(%r, %r)" % (RFC1808_BASE, relurl) print ("expected %r,\n" " got %r") % (expected, result)
def checkJoin(relurl, expected): global errors result = urlparse.urljoin(RFC1808_BASE, relurl) print "%-13s = %r" % (relurl, result) if result != expected: errors += 1 print "urljoin(%r, %r)" % (RFC1808_BASE, relurl) print ("expected %r,\n" " got %r") % (expected, result)
9,510
def checkJoin(relurl, expected): global errors result = urlparse.urljoin(RFC1808_BASE, relurl) print "%-13s = %r" % (relurl, result) if result != expected: errors += 1 print "urljoin(%r, %r)" % (RFC1808_BASE, relurl) print ("expected %r,\n" " got %r") % (expected, result)
def checkJoin(relurl, expected): global errors result = urlparse.urljoin(RFC1808_BASE, relurl) print "%-13s = %r" % (relurl, result) if result != expected: errors += 1 print "urljoin(%r, %r)" % (RFC1808_BASE, relurl) print ("expected %r,\n" " got %r") % (expected, result)
9,511
def checkJoin(relurl, expected): global errors result = urlparse.urljoin(RFC1808_BASE, relurl) print "%-13s = %r" % (relurl, result) if result != expected: errors += 1 print "urljoin(%r, %r)" % (RFC1808_BASE, relurl) print ("expected %r,\n" " got %r") % (expected, result)
def checkJoin(relurl, expected): global errors result = urlparse.urljoin(RFC1808_BASE, relurl) print "%-13s = %r" % (relurl, result) if result != expected: errors += 1 print "urljoin(%r, %r)" % (RFC1808_BASE, relurl) print ("expected %r,\n" " got %r") % (expected, result)
9,512
def checkJoin(relurl, expected): global errors result = urlparse.urljoin(RFC1808_BASE, relurl) print "%-13s = %r" % (relurl, result) if result != expected: errors += 1 print "urljoin(%r, %r)" % (RFC1808_BASE, relurl) print ("expected %r,\n" " got %r") % (expected, result)
def checkJoin(relurl, expected): global errors result = urlparse.urljoin(RFC1808_BASE, relurl) print "%-13s = %r" % (relurl, result) if result != expected: errors += 1 print "urljoin(%r, %r)" % (RFC1808_BASE, relurl) print ("expected %r,\n" " got %r") % (expected, result)
9,513
def __init__(self,parent,title): Toplevel.__init__(self, parent) self.configure(borderwidth=5) self.geometry("+%d+%d" % (parent.winfo_rootx()+30, parent.winfo_rooty()+30)) #elguavas - config placeholders til config stuff completed self.bg="#555555" self.fg="#ffffff" #no ugly bold default font on *nix font=tkFont.Font(self,Label().cget('font')) if os.name=='posix': font.config(weight=NORMAL) self.textFont=font self.CreateWidgets() self.resizable(height=FALSE,width=FALSE) self.title(title) self.transient(parent) self.grab_set() self.protocol("WM_DELETE_WINDOW", self.Ok) self.parent = parent self.buttonOk.focus_set() #key bindings for this dialog self.bind('<Alt-c>',self.CreditsButtonBinding) #credits button #self.bind('<Alt-l>',self.LicenseButtonBinding) #license button self.bind('<Alt-r>',self.LicenseButtonBinding) #readme button self.bind('<Return>',self.Ok) #dismiss dialog self.bind('<Escape>',self.Ok) #dismiss dialog self.wait_window()
def __init__(self,parent,title): Toplevel.__init__(self, parent) self.configure(borderwidth=5) self.geometry("+%d+%d" % (parent.winfo_rootx()+30, parent.winfo_rooty()+30)) #elguavas - config placeholders til config stuff completed self.bg="#555555" self.fg="#ffffff" #no ugly bold default font on *nix font=tkFont.Font(self,Label().cget('font')) if os.name=='posix': font.config(weight=NORMAL) self.textFont=font self.CreateWidgets() self.resizable(height=FALSE,width=FALSE) self.title(title) self.transient(parent) self.grab_set() self.protocol("WM_DELETE_WINDOW", self.Ok) self.parent = parent self.buttonOk.focus_set() #key bindings for this dialog self.bind('<Alt-c>',self.CreditsButtonBinding) #credits button #self.bind('<Alt-l>',self.LicenseButtonBinding) #license button self.bind('<Alt-r>',self.LicenseButtonBinding) #readme button self.bind('<Return>',self.Ok) #dismiss dialog self.bind('<Escape>',self.Ok) #dismiss dialog self.wait_window()
9,514
def __init__(self,parent,title): Toplevel.__init__(self, parent) self.configure(borderwidth=5) self.geometry("+%d+%d" % (parent.winfo_rootx()+30, parent.winfo_rooty()+30)) #elguavas - config placeholders til config stuff completed self.bg="#555555" self.fg="#ffffff" #no ugly bold default font on *nix font=tkFont.Font(self,Label().cget('font')) if os.name=='posix': font.config(weight=NORMAL) self.textFont=font self.CreateWidgets() self.resizable(height=FALSE,width=FALSE) self.title(title) self.transient(parent) self.grab_set() self.protocol("WM_DELETE_WINDOW", self.Ok) self.parent = parent self.buttonOk.focus_set() #key bindings for this dialog self.bind('<Alt-c>',self.CreditsButtonBinding) #credits button #self.bind('<Alt-l>',self.LicenseButtonBinding) #license button self.bind('<Alt-r>',self.LicenseButtonBinding) #readme button self.bind('<Return>',self.Ok) #dismiss dialog self.bind('<Escape>',self.Ok) #dismiss dialog self.wait_window()
def __init__(self,parent,title): Toplevel.__init__(self, parent) self.configure(borderwidth=5) self.geometry("+%d+%d" % (parent.winfo_rootx()+30, parent.winfo_rooty()+30)) #elguavas - config placeholders til config stuff completed self.bg="#555555" self.fg="#ffffff" #no ugly bold default font on *nix font=tkFont.Font(self,Label(self).cget('font')) if os.name=='posix': font.config(weight=NORMAL) self.textFont=font self.CreateWidgets() self.resizable(height=FALSE,width=FALSE) self.title(title) self.transient(parent) self.grab_set() self.protocol("WM_DELETE_WINDOW", self.Ok) self.parent = parent self.buttonOk.focus_set() #key bindings for this dialog self.bind('<Alt-c>',self.CreditsButtonBinding) #credits button #self.bind('<Alt-l>',self.LicenseButtonBinding) #license button self.bind('<Alt-r>',self.LicenseButtonBinding) #readme button self.bind('<Return>',self.Ok) #dismiss dialog self.bind('<Escape>',self.Ok) #dismiss dialog self.wait_window()
9,515
def __init__(self,parent,title): Toplevel.__init__(self, parent) self.configure(borderwidth=5) self.geometry("+%d+%d" % (parent.winfo_rootx()+30, parent.winfo_rooty()+30)) #elguavas - config placeholders til config stuff completed self.bg="#555555" self.fg="#ffffff" #no ugly bold default font on *nix font=tkFont.Font(self,Label().cget('font')) if os.name=='posix': font.config(weight=NORMAL) self.textFont=font self.CreateWidgets() self.resizable(height=FALSE,width=FALSE) self.title(title) self.transient(parent) self.grab_set() self.protocol("WM_DELETE_WINDOW", self.Ok) self.parent = parent self.buttonOk.focus_set() #key bindings for this dialog self.bind('<Alt-c>',self.CreditsButtonBinding) #credits button #self.bind('<Alt-l>',self.LicenseButtonBinding) #license button self.bind('<Alt-r>',self.LicenseButtonBinding) #readme button self.bind('<Return>',self.Ok) #dismiss dialog self.bind('<Escape>',self.Ok) #dismiss dialog self.wait_window()
def __init__(self,parent,title): Toplevel.__init__(self, parent) self.configure(borderwidth=5) self.geometry("+%d+%d" % (parent.winfo_rootx()+30, parent.winfo_rooty()+30)) #elguavas - config placeholders til config stuff completed self.bg="#555555" self.fg="#ffffff" #no ugly bold default font on *nix font=tkFont.Font(self,Label().cget('font')) if os.name=='posix': font.config(weight=NORMAL) self.textFont=font self.CreateWidgets() self.resizable(height=FALSE,width=FALSE) self.title(title) self.transient(parent) self.grab_set() self.protocol("WM_DELETE_WINDOW", self.Ok) self.parent = parent self.buttonOk.focus_set() #key bindings for this dialog self.bind('<Alt-c>',self.CreditsButtonBinding) #credits button #self.bind('<Alt-l>',self.LicenseButtonBinding) #license buttonself.bind('<Alt-l>',self.LicenseButtonBinding) #readme button self.bind('<Return>',self.Ok) #dismiss dialog self.bind('<Escape>',self.Ok) #dismiss dialog self.wait_window()
9,516
def __init__(self, host = '', port = IMAP4_PORT): self.host = host self.port = port self.debug = Debug self.state = 'LOGOUT' self.literal = None # A literal argument to a command self.tagged_commands = {} # Tagged commands awaiting response self.untagged_responses = {} # {typ: [data, ...], ...} self.continuation_response = '' # Last continuation response self.tagnum = 0
def __init__(self, host = '', port = IMAP4_PORT): self.host = host self.port = port self.debug = Debug self.state = 'LOGOUT' self.literal = None # A literal argument to a command self.tagged_commands = {} # Tagged commands awaiting response self.untagged_responses = {} # {typ: [data, ...], ...} self.continuation_response = '' # Last continuation response self.tagnum = 0
9,517
def __init__(self, host = '', port = IMAP4_PORT): self.host = host self.port = port self.debug = Debug self.state = 'LOGOUT' self.literal = None # A literal argument to a command self.tagged_commands = {} # Tagged commands awaiting response self.untagged_responses = {} # {typ: [data, ...], ...} self.continuation_response = '' # Last continuation response self.tagnum = 0
def__init__(self,host='',port=IMAP4_PORT):self.host=hostself.port=portself.debug=Debugself.state='LOGOUT'self.literal=None #Aliteralargumenttoacommandself.tagged_commands={} #Taggedcommandsawaitingresponseself.untagged_responses={} #{typ:[data,...],...}self.continuation_response='' #Lastcontinuationresponseself.tagnum=0
9,518
def __init__(self, host = '', port = IMAP4_PORT): self.host = host self.port = port self.debug = Debug self.state = 'LOGOUT' self.literal = None # A literal argument to a command self.tagged_commands = {} # Tagged commands awaiting response self.untagged_responses = {} # {typ: [data, ...], ...} self.continuation_response = '' # Last continuation response self.tagnum = 0
def __init__(self, host = '', port = IMAP4_PORT): self.host = host self.port = port self.debug = Debug self.state = 'LOGOUT' self.literal = None # A literal argument to a command self.tagged_commands = {} # Tagged commands awaiting response self.untagged_responses = {} # {typ: [data, ...], ...} self.continuation_response = '' # Last continuation response self.tagnum = 0
9,519
def login(self, user, password): """Identify client using plaintext password.
def login(self, user, password): """Identify client using plaintext password.
9,520
def noop(self): """Send NOOP command.
def noop(self): """Send NOOP command.
9,521
def select(self, mailbox='INBOX', readonly=None): """Select a mailbox.
def select(self, mailbox='INBOX', readonly=None): """Select a mailbox.
9,522
def _append_untagged(self, typ, dat):
def _append_untagged(self, typ, dat):
9,523
def _command(self, name, *args):
def _command(self, name, *args):
9,524
def _command(self, name, *args):
def _command(self, name, *args):
9,525
def _command(self, name, *args):
def _command(self, name, *args):
9,526
def _command_complete(self, name, tag): try: typ, data = self._get_tagged_response(tag) except self.abort, val: raise self.abort('command: %s => %s' % (name, val)) except self.error, val: raise self.error('command: %s => %s' % (name, val)) if self.untagged_responses.has_key('BYE') and name != 'LOGOUT': raise self.abort(self.untagged_responses['BYE'][-1]) if typ == 'BAD': raise self.error('%s command error: %s %s' % (name, typ, data)) return typ, data
def _command_complete(self, name, tag): try: typ, data = self._get_tagged_response(tag) except self.abort, val: raise self.abort('command: %s => %s' % (name, val)) except self.error, val: raise self.error('command: %s => %s' % (name, val)) self._check_bye() if typ == 'BAD': raise self.error('%s command error: %s %s' % (name, typ, data)) return typ, data
9,527
def _get_response(self):
def _get_response(self):
9,528
def _get_response(self):
def _get_response(self):
9,529
def _get_line(self):
def _get_line(self):
9,530
def _match(self, cre, s):
def _match(self, cre, s):
9,531
def _untagged_response(self, typ, dat, name):
def _untagged_response(self, typ, dat, name):
9,532
def Time2Internaldate(date_time): """Convert 'date_time' to IMAP4 INTERNALDATE representation. Return string in form: '"DD-Mmm-YYYY HH:MM:SS +HHMM"' """ dttype = type(date_time) if dttype is type(1): tt = time.localtime(date_time) elif dttype is type(()): tt = date_time elif dttype is type(""): return date_time # Assume in correct format else: raise ValueError dt = time.strftime("%d-%b-%Y %H:%M:%S", tt) if dt[0] == '0': dt = ' ' + dt[1:] if time.daylight and tt[-1]: zone = -time.altzone else: zone = -time.timezone return '"' + dt + " %+02d%02d" % divmod(zone/60, 60) + '"'
def Time2Internaldate(date_time): """Convert 'date_time' to IMAP4 INTERNALDATE representation. Return string in form: '"DD-Mmm-YYYY HH:MM:SS +HHMM"' """ dttype = type(date_time) if dttype is type(1) or dttype is type(1.1): tt = time.localtime(date_time) elif dttype is type(()): tt = date_time elif dttype is type(""): return date_time # Assume in correct format else: raise ValueError dt = time.strftime("%d-%b-%Y %H:%M:%S", tt) if dt[0] == '0': dt = ' ' + dt[1:] if time.daylight and tt[-1]: zone = -time.altzone else: zone = -time.timezone return '"' + dt + " %+02d%02d" % divmod(zone/60, 60) + '"'
9,533
def _mesg(s):
def _mesg(s):
9,534
def _dump_ur(dict): # Dump untagged responses (in `dict'). l = dict.items() if not l: return t = '\n\t\t' j = string.join l = map(lambda x,j=j:'%s: "%s"' % (x[0], x[1][0] and j(x[1], '" "') or ''), l) _mesg('untagged responses dump:%s%s' % (t, j(l, t)))
def _dump_ur(dict): # Dump untagged responses (in `dict'). l = dict.items() if not l: return t = '\n\t\t' j = string.join l = map(lambda x,j=j:'%s: "%s"' % (x[0], x[1][0] and j(x[1], '" "') or ''), l) _mesg('untagged responses dump:%s%s' % (t, j(l, t)))
9,535
def run(cmd, args): typ, dat = apply(eval('M.%s' % cmd), args) _mesg(' %s %s\n => %s %s' % (cmd, args, typ, dat)) return dat
def run(cmd, args): typ, dat = apply(eval('M.%s' % cmd), args) _mesg('%s => %s %s' % (cmd, typ, dat)) return dat
9,536
def run(cmd, args): typ, dat = apply(eval('M.%s' % cmd), args) _mesg(' %s %s\n => %s %s' % (cmd, args, typ, dat)) return dat
def run(cmd, args): typ, dat = apply(eval('M.%s' % cmd), args) _mesg(' %s %s\n => %s %s' % (cmd, args, typ, dat)) return dat
9,537
def _init_posix(): """Initialize the module as appropriate for POSIX systems.""" g = {} # load the installed Makefile: try: filename = get_makefile_filename() parse_makefile(filename, g) except IOError, msg: my_msg = "invalid Python installation: unable to open %s" % filename if hasattr(msg, "strerror"): my_msg = my_msg + " (%s)" % msg.strerror raise DistutilsPlatformError(my_msg) # On AIX, there are wrong paths to the linker scripts in the Makefile # -- these paths are relative to the Python source, but when installed # the scripts are in another directory. if python_build: g['LDSHARED'] = g['BLDSHARED'] global _config_vars _config_vars = g
def elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) _init_posix(): elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) """Initialize elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) the elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) module elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) as elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) appropriate elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) for elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) POSIX elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) systems.""" elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) g elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) = elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) {} elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) # elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) load elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) the elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) installed elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) Makefile: elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) try: elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) filename elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) = elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) get_makefile_filename() elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) parse_makefile(filename, elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) g) elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) except elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) IOError, elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) msg: elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) my_msg elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) = elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) "invalid elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) Python elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) installation: elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) unable elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) to elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) open elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) %s" elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) % elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) filename elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) if elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) hasattr(msg, elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) "strerror"): elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) my_msg elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) = elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) my_msg elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) + elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) " elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) (%s)" elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) % elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) msg.strerror elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) raise elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) DistutilsPlatformError(my_msg) elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) # elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) On elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) AIX, elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) there elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) are elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) wrong elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) paths elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) to elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) the elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) linker elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) scripts elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) in elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) the elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) Makefile elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) # elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) -- elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) these elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) paths elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) are elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) relative elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) to elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) the elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) Python elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) source, elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) but elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) when elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) installed elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) # elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) the elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) scripts elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) are elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) in elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) another elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) directory. elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) if elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) python_build: elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) g['LDSHARED'] elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) = elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) g['BLDSHARED'] elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) global elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) _config_vars elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) _config_vars elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) = elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) g elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3])) elif sys.version < '2.1': if sys.platform == 'aix4': python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) elif sys.platform == 'beos': python_lib = get_python_lib(standard_lib=1) linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) linkerscript = os.path.join(python_lib, 'config', linkerscript_name) g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % (linkerscript, PREFIX, sys.version[0:3]))
9,538
def handle(self, info=None): info = info or sys.exc_info() self.file.write(reset())
def handle(self, info=None): info = info or sys.exc_info() self.file.write(reset())
9,539
def b(): 'my docstring' pass
def b(): 'my docstring' pass
9,540
def b(): 'my docstring' pass
def b(): 'my docstring' pass
9,541
def b(): 'my docstring' pass
def b(): 'my docstring' pass
9,542
def b(): 'my docstring' pass
def b(): 'my docstring' pass
9,543
def b(): 'my docstring' pass
def b(): 'my docstring' pass
9,544
def b(): 'my docstring' pass
def b(): 'my docstring' pass
9,545
def b(): 'my docstring' pass
def b(): 'my docstring' pass
9,546
def b(): 'my docstring' pass
def b(): 'my docstring' pass
9,547
def b(): 'my docstring' pass
def b(): 'my docstring' pass
9,548
def b(): 'my docstring' pass
def b(): 'my docstring' pass
9,549
def b(): 'my docstring' pass
def b(): 'my docstring' pass
9,550
def another(): pass
def another(): pass
9,551
def temp(): print 1
def temp(): print 1
9,552
def __init__(self, host = '', port = IMAP4_PORT): self.debug = Debug self.state = 'LOGOUT' self.literal = None # A literal argument to a command self.tagged_commands = {} # Tagged commands awaiting response self.untagged_responses = {} # {typ: [data, ...], ...} self.continuation_response = '' # Last continuation response self.is_readonly = None # READ-ONLY desired state self.tagnum = 0
def __init__(self, host = '', port = IMAP4_PORT): self.debug = Debug self.state = 'LOGOUT' self.literal = None # A literal argument to a command self.tagged_commands = {} # Tagged commands awaiting response self.untagged_responses = {} # {typ: [data, ...], ...} self.continuation_response = '' # Last continuation response self.is_readonly = None # READ-ONLY desired state self.tagnum = 0
9,553
def makefile(self, mode, bufsize=None): """Return a readable file-like object with data from socket.
def makefile(self, mode, bufsize=None): """Return a readable file-like object with data from socket.
9,554
def makefile(self, mode, bufsize=None): """Return a readable file-like object with data from socket.
def makefile(self, mode, bufsize=None): """Return a readable file-like object with data from socket.
9,555
def makefile(self, mode, bufsize=None): """Return a readable file-like object with data from socket.
def makefile(self, mode, bufsize=None): """Return a readable file-like object with data from socket.
9,556
def test_limitations(self): # Try nasty case that overflows the straightforward recursive # implementation of repeated groups. self.assertEqual(re.match('(x)*', 50000*'x').span(), (0, 50000))
def test_limitations(self): # Try nasty case that overflows the straightforward recursive # implementation of repeated groups. self.assertEqual(re.match('(x)*', 50000*'x').span(), (0, 50000))
9,557
def mkdirs(dst): """Make directories leading to 'dst' if they don't exist yet""" if dst == '' or os.path.exists(dst): return head, tail = os.path.split(dst) if not ':' in head: head = head + ':' mkdirs(head) os.mkdir(dst, 0777)
def mkdirs(dst): """Make directories leading to 'dst' if they don't exist yet""" if dst == '' or os.path.exists(dst): return head, tail = os.path.split(dst) if os.sep == ':' and not ':' in head: head = head + ':' mkdirs(head) os.mkdir(dst, 0777)
9,558
def test_main(): test_support.run_unittest( TemporaryFileTests, StatAttributeTests, EnvironTests, WalkTests )
def test_main(): test_support.run_unittest( TemporaryFileTests, StatAttributeTests, EnvironTests, WalkTests, MakedirTests, )
9,559
def retrieve(self, url, filename=None, reporthook=None, data=None): """retrieve(url) returns (filename, None) for a local object or (tempfilename, headers) for a remote object.""" url = unwrap(toBytes(url)) if self.tempcache and url in self.tempcache: return self.tempcache[url] type, url1 = splittype(url) if filename is None and (not type or type == 'file'): try: fp = self.open_local_file(url1) hdrs = fp.info() del fp return url2pathname(splithost(url1)[1]), hdrs except IOError, msg: pass fp = self.open(url, data) headers = fp.info() if filename: tfp = open(filename, 'wb') else: import tempfile garbage, path = splittype(url) garbage, path = splithost(path or "") path, garbage = splitquery(path or "") path, garbage = splitattr(path or "") suffix = os.path.splitext(path)[1] (fd, filename) = tempfile.mkstemp(suffix) self.__tempfiles.append(filename) tfp = os.fdopen(fd, 'wb') result = filename, headers if self.tempcache is not None: self.tempcache[url] = result bs = 1024*8 size = -1 blocknum = 1 if reporthook: if "content-length" in headers: size = int(headers["Content-Length"]) reporthook(0, bs, size) block = fp.read(bs) if reporthook: reporthook(1, bs, size) while block: tfp.write(block) block = fp.read(bs) blocknum = blocknum + 1 if reporthook: reporthook(blocknum, bs, size) fp.close() tfp.close() del fp del tfp return result
def retrieve(self, url, filename=None, reporthook=None, data=None): """retrieve(url) returns (filename, headers) for a local object or (tempfilename, headers) for a remote object.""" url = unwrap(toBytes(url)) if self.tempcache and url in self.tempcache: return self.tempcache[url] type, url1 = splittype(url) if filename is None and (not type or type == 'file'): try: fp = self.open_local_file(url1) hdrs = fp.info() del fp return url2pathname(splithost(url1)[1]), hdrs except IOError, msg: pass fp = self.open(url, data) headers = fp.info() if filename: tfp = open(filename, 'wb') else: import tempfile garbage, path = splittype(url) garbage, path = splithost(path or "") path, garbage = splitquery(path or "") path, garbage = splitattr(path or "") suffix = os.path.splitext(path)[1] (fd, filename) = tempfile.mkstemp(suffix) self.__tempfiles.append(filename) tfp = os.fdopen(fd, 'wb') result = filename, headers if self.tempcache is not None: self.tempcache[url] = result bs = 1024*8 size = -1 blocknum = 1 if reporthook: if "content-length" in headers: size = int(headers["Content-Length"]) reporthook(0, bs, size) block = fp.read(bs) if reporthook: reporthook(1, bs, size) while block: tfp.write(block) block = fp.read(bs) blocknum = blocknum + 1 if reporthook: reporthook(blocknum, bs, size) fp.close() tfp.close() del fp del tfp return result
9,560
>>> def f(x):
>>> def f(x):
9,561
def _find_tests(module, prefix=None): if prefix is None: prefix = module.__name__ mdict = module.__dict__ tests = [] # Get the module-level doctest (if any). _get_doctest(prefix, module, tests, '', lineno="1 (or above)") # Recursively search the module __dict__ for doctests. if prefix: prefix += "." _extract_doctests(mdict.items(), module, mdict, tests, prefix) return tests
def _find_tests(module, prefix=None): if prefix is None: prefix = module.__name__ mdict = module.__dict__ tests = [] # Get the module-level doctest (if any). _get_doctest(prefix, module, tests, '', lineno="1 (or above)") # Recursively search the module __dict__ for doctests. if prefix: prefix += "." _extract_doctests(mdict.items(), module, mdict, tests, prefix) return tests
9,562
def DocTestSuite(module=None): """Convert doctest tests for a module to a unittest TestSuite. The returned TestSuite is to be run by the unittest framework, and runs each doctest in the module. If any of the doctests fail, then the synthesized unit test fails, and an error is raised showing the name of the file containing the test and a (sometimes approximate) line number. The optional module argument provides the module to be tested. It can be a module object or a (possibly dotted) module name. If not specified, the module calling DocTestSuite() is used. Example (although note that unittest supplies many ways to use the TestSuite returned; see the unittest docs): import unittest import doctest import my_module_with_doctests suite = doctest.DocTestSuite(my_module_with_doctests) runner = unittest.TextTestRunner() runner.run(suite) """ import unittest module = _normalize_module(module) tests = _find_tests(module) if not tests: raise ValueError(module, "has no tests") tests.sort() suite = unittest.TestSuite() tester = Tester(module) for name, doc, filename, lineno in tests: if not filename: filename = module.__file__ if filename.endswith(".pyc"): filename = filename[:-1] elif filename.endswith(".pyo"): filename = filename[:-1] def runit(name=name, doc=doc, filename=filename, lineno=lineno): _utest(tester, name, doc, filename, lineno) suite.addTest(unittest.FunctionTestCase( runit, description="doctest of " + name)) return suite
def DocTestSuite(module=None): """Convert doctest tests for a module to a unittest TestSuite. The returned TestSuite is to be run by the unittest framework, and runs each doctest in the module. If any of the doctests fail, then the synthesized unit test fails, and an error is raised showing the name of the file containing the test and a (sometimes approximate) line number. The optional module argument provides the module to be tested. It can be a module object or a (possibly dotted) module name. If not specified, the module calling DocTestSuite() is used. Example (although note that unittest supplies many ways to use the TestSuite returned; see the unittest docs): import unittest import doctest import my_module_with_doctests suite = doctest.DocTestSuite(my_module_with_doctests) runner = unittest.TextTestRunner() runner.run(suite) """ def __init__(self, tester, name, doc, filename, lineno, setUp=None, tearDown=None): unittest.TestCase.__init__(self) (self.__tester, self.__name, self.__doc, self.__filename, self.__lineno, self.__setUp, self.__tearDown ) = tester, name, doc, filename, lineno, setUp, tearDown def setUp(self): if self.__setUp is not None: self.__setUp() def tearDown(self): if self.__tearDown is not None: self.__tearDown() def runTest(self): old = sys.stdout new = StringIO() try: sys.stdout = new failures, tries = self.__tester.runstring(self.__doc, self.__name) finally: sys.stdout = old if failures: lname = '.'.join(self.__name.split('.')[-1:]) lineno = self.__lineno or "0 (don't know line no)" raise self.failureException( 'Failed doctest test for %s\n' ' File "%s", line %s, in %s\n\n%s' % (self.__name, self.__filename, lineno, lname, new.getvalue()) ) def id(self): return self.__name def __repr__(self): name = self.__name.split('.') return "%s (%s)" % (name[-1], '.'.join(name[:-1])) __str__ = __repr__ def shortDescription(self): return "Doctest: " + self.__name def DocTestSuite(module=None, setUp=lambda: None, tearDown=lambda: None, ): """Convert doctest tests for a mudule to a unittest test suite This tests convers each documentation string in a module that contains doctest tests to a unittest test case. If any of the tests in a doc string fail, then the test case fails. An error is raised showing the name of the file containing the test and a (sometimes approximate) line number. A module argument provides the module to be tested. The argument can be either a module or a module name. If no argument is given, the calling module is used. """ module = _normalizeModule(module) tests = _findTests(module) if not tests: raise ValueError(module, "has no tests") tests.sort() suite = unittest.TestSuite() tester = Tester(module) for name, doc, filename, lineno in tests: if not filename: filename = module.__file__ if filename.endswith(".pyc"): filename = filename[:-1] elif filename.endswith(".pyo"): filename = filename[:-1] def runit(name=name, doc=doc, filename=filename, lineno=lineno): _utest(tester, name, doc, filename, lineno) suite.addTest(unittest.FunctionTestCase( runit, description="doctest of " + name)) return suite
9,563
def runit(name=name, doc=doc, filename=filename, lineno=lineno): _utest(tester, name, doc, filename, lineno)
def runit(name=name, doc=doc, filename=filename, lineno=lineno): _utest(tester, name, doc, filename, lineno)
9,564
def runit(name=name, doc=doc, filename=filename, lineno=lineno): _utest(tester, name, doc, filename, lineno)
defdef _normalizeModule(module): if module is None: module = sys._getframe(2).f_globals['__name__'] module = sys.modules[module] elif isinstance(module, (str, unicode)): module = __import__(module, globals(), locals(), ["*"]) return module def _doc(name, object, tests, prefix, filename='', lineno=''): doc = getattr(object, '__doc__', '') if doc and doc.find('>>>') >= 0: tests.append((prefix+name, doc, filename, lineno)) def _findTests(module, prefix=None): if prefix is None: prefix = module.__name__ dict = module.__dict__ tests = [] _doc(prefix, module, tests, '', lineno="1 (or below)") prefix = prefix and (prefix + ".") _find(dict.items(), module, dict, tests, prefix) return tests def _find(items, module, dict, tests, prefix, minlineno=0): for name, object in items: if not hasattr(object, '__name__'): continue if hasattr(object, 'func_globals'): if object.func_globals is not dict: continue code = getattr(object, 'func_code', None) filename = getattr(code, 'co_filename', '') lineno = getattr(code, 'co_firstlineno', -1) + 1 if minlineno: minlineno = min(lineno, minlineno) else: minlineno = lineno _doc(name, object, tests, prefix, filename, lineno) elif hasattr(object, "__module__"): if object.__module__ != module.__name__: continue if not (hasattr(object, '__dict__') and hasattr(object, '__bases__')): continue lineno = _find(object.__dict__.items(), module, dict, tests, prefix+name+".") _doc(name, object, tests, prefix, lineno="%s (or above)" % (lineno-3)) return minlineno runit(name=name,def _normalizeModule(module): if module is None: module = sys._getframe(2).f_globals['__name__'] module = sys.modules[module] elif isinstance(module, (str, unicode)): module = __import__(module, globals(), locals(), ["*"]) return module def _doc(name, object, tests, prefix, filename='', lineno=''): doc = getattr(object, '__doc__', '') if doc and doc.find('>>>') >= 0: tests.append((prefix+name, doc, filename, lineno)) def _findTests(module, prefix=None): if prefix is None: prefix = module.__name__ dict = module.__dict__ tests = [] _doc(prefix, module, tests, '', lineno="1 (or below)") prefix = prefix and (prefix + ".") _find(dict.items(), module, dict, tests, prefix) return tests def _find(items, module, dict, tests, prefix, minlineno=0): for name, object in items: if not hasattr(object, '__name__'): continue if hasattr(object, 'func_globals'): if object.func_globals is not dict: continue code = getattr(object, 'func_code', None) filename = getattr(code, 'co_filename', '') lineno = getattr(code, 'co_firstlineno', -1) + 1 if minlineno: minlineno = min(lineno, minlineno) else: minlineno = lineno _doc(name, object, tests, prefix, filename, lineno) elif hasattr(object, "__module__"): if object.__module__ != module.__name__: continue if not (hasattr(object, '__dict__') and hasattr(object, '__bases__')): continue lineno = _find(object.__dict__.items(), module, dict, tests, prefix+name+".") _doc(name, object, tests, prefix, lineno="%s (or above)" % (lineno-3)) return minlineno doc=doc,def _normalizeModule(module): if module is None: module = sys._getframe(2).f_globals['__name__'] module = sys.modules[module] elif isinstance(module, (str, unicode)): module = __import__(module, globals(), locals(), ["*"]) return module def _doc(name, object, tests, prefix, filename='', lineno=''): doc = getattr(object, '__doc__', '') if doc and doc.find('>>>') >= 0: tests.append((prefix+name, doc, filename, lineno)) def _findTests(module, prefix=None): if prefix is None: prefix = module.__name__ dict = module.__dict__ tests = [] _doc(prefix, module, tests, '', lineno="1 (or below)") prefix = prefix and (prefix + ".") _find(dict.items(), module, dict, tests, prefix) return tests def _find(items, module, dict, tests, prefix, minlineno=0): for name, object in items: if not hasattr(object, '__name__'): continue if hasattr(object, 'func_globals'): if object.func_globals is not dict: continue code = getattr(object, 'func_code', None) filename = getattr(code, 'co_filename', '') lineno = getattr(code, 'co_firstlineno', -1) + 1 if minlineno: minlineno = min(lineno, minlineno) else: minlineno = lineno _doc(name, object, tests, prefix, filename, lineno) elif hasattr(object, "__module__"): if object.__module__ != module.__name__: continue if not (hasattr(object, '__dict__') and hasattr(object, '__bases__')): continue lineno = _find(object.__dict__.items(), module, dict, tests, prefix+name+".") _doc(name, object, tests, prefix, lineno="%s (or above)" % (lineno-3)) return minlineno filename=filename,def _normalizeModule(module): if module is None: module = sys._getframe(2).f_globals['__name__'] module = sys.modules[module] elif isinstance(module, (str, unicode)): module = __import__(module, globals(), locals(), ["*"]) return module def _doc(name, object, tests, prefix, filename='', lineno=''): doc = getattr(object, '__doc__', '') if doc and doc.find('>>>') >= 0: tests.append((prefix+name, doc, filename, lineno)) def _findTests(module, prefix=None): if prefix is None: prefix = module.__name__ dict = module.__dict__ tests = [] _doc(prefix, module, tests, '', lineno="1 (or below)") prefix = prefix and (prefix + ".") _find(dict.items(), module, dict, tests, prefix) return tests def _find(items, module, dict, tests, prefix, minlineno=0): for name, object in items: if not hasattr(object, '__name__'): continue if hasattr(object, 'func_globals'): if object.func_globals is not dict: continue code = getattr(object, 'func_code', None) filename = getattr(code, 'co_filename', '') lineno = getattr(code, 'co_firstlineno', -1) + 1 if minlineno: minlineno = min(lineno, minlineno) else: minlineno = lineno _doc(name, object, tests, prefix, filename, lineno) elif hasattr(object, "__module__"): if object.__module__ != module.__name__: continue if not (hasattr(object, '__dict__') and hasattr(object, '__bases__')): continue lineno = _find(object.__dict__.items(), module, dict, tests, prefix+name+".") _doc(name, object, tests, prefix, lineno="%s (or above)" % (lineno-3)) return minlineno lineno=lineno):def _normalizeModule(module): if module is None: module = sys._getframe(2).f_globals['__name__'] module = sys.modules[module] elif isinstance(module, (str, unicode)): module = __import__(module, globals(), locals(), ["*"]) return module def _doc(name, object, tests, prefix, filename='', lineno=''): doc = getattr(object, '__doc__', '') if doc and doc.find('>>>') >= 0: tests.append((prefix+name, doc, filename, lineno)) def _findTests(module, prefix=None): if prefix is None: prefix = module.__name__ dict = module.__dict__ tests = [] _doc(prefix, module, tests, '', lineno="1 (or below)") prefix = prefix and (prefix + ".") _find(dict.items(), module, dict, tests, prefix) return tests def _find(items, module, dict, tests, prefix, minlineno=0): for name, object in items: if not hasattr(object, '__name__'): continue if hasattr(object, 'func_globals'): if object.func_globals is not dict: continue code = getattr(object, 'func_code', None) filename = getattr(code, 'co_filename', '') lineno = getattr(code, 'co_firstlineno', -1) + 1 if minlineno: minlineno = min(lineno, minlineno) else: minlineno = lineno _doc(name, object, tests, prefix, filename, lineno) elif hasattr(object, "__module__"): if object.__module__ != module.__name__: continue if not (hasattr(object, '__dict__') and hasattr(object, '__bases__')): continue lineno = _find(object.__dict__.items(), module, dict, tests, prefix+name+".") _doc(name, object, tests, prefix, lineno="%s (or above)" % (lineno-3)) return minlineno _utest(tester,def _normalizeModule(module): if module is None: module = sys._getframe(2).f_globals['__name__'] module = sys.modules[module] elif isinstance(module, (str, unicode)): module = __import__(module, globals(), locals(), ["*"]) return module def _doc(name, object, tests, prefix, filename='', lineno=''): doc = getattr(object, '__doc__', '') if doc and doc.find('>>>') >= 0: tests.append((prefix+name, doc, filename, lineno)) def _findTests(module, prefix=None): if prefix is None: prefix = module.__name__ dict = module.__dict__ tests = [] _doc(prefix, module, tests, '', lineno="1 (or below)") prefix = prefix and (prefix + ".") _find(dict.items(), module, dict, tests, prefix) return tests def _find(items, module, dict, tests, prefix, minlineno=0): for name, object in items: if not hasattr(object, '__name__'): continue if hasattr(object, 'func_globals'): if object.func_globals is not dict: continue code = getattr(object, 'func_code', None) filename = getattr(code, 'co_filename', '') lineno = getattr(code, 'co_firstlineno', -1) + 1 if minlineno: minlineno = min(lineno, minlineno) else: minlineno = lineno _doc(name, object, tests, prefix, filename, lineno) elif hasattr(object, "__module__"): if object.__module__ != module.__name__: continue if not (hasattr(object, '__dict__') and hasattr(object, '__bases__')): continue lineno = _find(object.__dict__.items(), module, dict, tests, prefix+name+".") _doc(name, object, tests, prefix, lineno="%s (or above)" % (lineno-3)) return minlineno name,def _normalizeModule(module): if module is None: module = sys._getframe(2).f_globals['__name__'] module = sys.modules[module] elif isinstance(module, (str, unicode)): module = __import__(module, globals(), locals(), ["*"]) return module def _doc(name, object, tests, prefix, filename='', lineno=''): doc = getattr(object, '__doc__', '') if doc and doc.find('>>>') >= 0: tests.append((prefix+name, doc, filename, lineno)) def _findTests(module, prefix=None): if prefix is None: prefix = module.__name__ dict = module.__dict__ tests = [] _doc(prefix, module, tests, '', lineno="1 (or below)") prefix = prefix and (prefix + ".") _find(dict.items(), module, dict, tests, prefix) return tests def _find(items, module, dict, tests, prefix, minlineno=0): for name, object in items: if not hasattr(object, '__name__'): continue if hasattr(object, 'func_globals'): if object.func_globals is not dict: continue code = getattr(object, 'func_code', None) filename = getattr(code, 'co_filename', '') lineno = getattr(code, 'co_firstlineno', -1) + 1 if minlineno: minlineno = min(lineno, minlineno) else: minlineno = lineno _doc(name, object, tests, prefix, filename, lineno) elif hasattr(object, "__module__"): if object.__module__ != module.__name__: continue if not (hasattr(object, '__dict__') and hasattr(object, '__bases__')): continue lineno = _find(object.__dict__.items(), module, dict, tests, prefix+name+".") _doc(name, object, tests, prefix, lineno="%s (or above)" % (lineno-3)) return minlineno doc,def _normalizeModule(module): if module is None: module = sys._getframe(2).f_globals['__name__'] module = sys.modules[module] elif isinstance(module, (str, unicode)): module = __import__(module, globals(), locals(), ["*"]) return module def _doc(name, object, tests, prefix, filename='', lineno=''): doc = getattr(object, '__doc__', '') if doc and doc.find('>>>') >= 0: tests.append((prefix+name, doc, filename, lineno)) def _findTests(module, prefix=None): if prefix is None: prefix = module.__name__ dict = module.__dict__ tests = [] _doc(prefix, module, tests, '', lineno="1 (or below)") prefix = prefix and (prefix + ".") _find(dict.items(), module, dict, tests, prefix) return tests def _find(items, module, dict, tests, prefix, minlineno=0): for name, object in items: if not hasattr(object, '__name__'): continue if hasattr(object, 'func_globals'): if object.func_globals is not dict: continue code = getattr(object, 'func_code', None) filename = getattr(code, 'co_filename', '') lineno = getattr(code, 'co_firstlineno', -1) + 1 if minlineno: minlineno = min(lineno, minlineno) else: minlineno = lineno _doc(name, object, tests, prefix, filename, lineno) elif hasattr(object, "__module__"): if object.__module__ != module.__name__: continue if not (hasattr(object, '__dict__') and hasattr(object, '__bases__')): continue lineno = _find(object.__dict__.items(), module, dict, tests, prefix+name+".") _doc(name, object, tests, prefix, lineno="%s (or above)" % (lineno-3)) return minlineno filename,def _normalizeModule(module): if module is None: module = sys._getframe(2).f_globals['__name__'] module = sys.modules[module] elif isinstance(module, (str, unicode)): module = __import__(module, globals(), locals(), ["*"]) return module def _doc(name, object, tests, prefix, filename='', lineno=''): doc = getattr(object, '__doc__', '') if doc and doc.find('>>>') >= 0: tests.append((prefix+name, doc, filename, lineno)) def _findTests(module, prefix=None): if prefix is None: prefix = module.__name__ dict = module.__dict__ tests = [] _doc(prefix, module, tests, '', lineno="1 (or below)") prefix = prefix and (prefix + ".") _find(dict.items(), module, dict, tests, prefix) return tests def _find(items, module, dict, tests, prefix, minlineno=0): for name, object in items: if not hasattr(object, '__name__'): continue if hasattr(object, 'func_globals'): if object.func_globals is not dict: continue code = getattr(object, 'func_code', None) filename = getattr(code, 'co_filename', '') lineno = getattr(code, 'co_firstlineno', -1) + 1 if minlineno: minlineno = min(lineno, minlineno) else: minlineno = lineno _doc(name, object, tests, prefix, filename, lineno) elif hasattr(object, "__module__"): if object.__module__ != module.__name__: continue if not (hasattr(object, '__dict__') and hasattr(object, '__bases__')): continue lineno = _find(object.__dict__.items(), module, dict, tests, prefix+name+".") _doc(name, object, tests, prefix, lineno="%s (or above)" % (lineno-3)) return minlineno lineno)
9,565
def _expect(expect): # Return the expected output (if any), formatted as a Python # comment block. if expect: expect = "\n# ".join(expect.split("\n")) expect = "\n# Expect:\n# %s" % expect return expect
def _expect(expect): # Return the expected output (if any), formatted as a Python # comment block. if expect: expect = "\n# ".join(expect.split("\n")) expect = "\n# Expect:\n# %s" % expect return expect
9,566
def testsource(module, name): """Extract the doctest examples from a docstring. Provide the module (or dotted name of the module) containing the tests to be extracted, and the name (within the module) of the object with the docstring containing the tests to be extracted. The doctest examples are returned as a string containing Python code. The expected output blocks in the examples are converted to Python comments. """ module = _normalize_module(module) tests = _find_tests(module, "") test = [doc for (tname, doc, dummy, dummy) in tests if tname == name] if not test: raise ValueError(name, "not found in tests") test = test[0] examples = [source + _expect(expect) for source, expect, dummy in _extract_examples(test)] return '\n'.join(examples)
def testsource(module, name): """Extract the test sources from a doctest test docstring as a script Provide the module (or dotted name of the module) containing the tests to be extracted, and the name (within the module) of the object with the docstring containing the tests to be extracted. The doctest examples are returned as a string containing Python code. The expected output blocks in the examples are converted to Python comments. """ module = _normalize_module(module) tests = _find_tests(module, "") test = [doc for (tname, doc, dummy, dummy) in tests if tname == name] if not test: raise ValueError(name, "not found in tests") test = test[0] examples = [source + _expect(expect) for source, expect, dummy in _extract_examples(test)] return '\n'.join(examples)
9,567
def testsource(module, name): """Extract the doctest examples from a docstring. Provide the module (or dotted name of the module) containing the tests to be extracted, and the name (within the module) of the object with the docstring containing the tests to be extracted. The doctest examples are returned as a string containing Python code. The expected output blocks in the examples are converted to Python comments. """ module = _normalize_module(module) tests = _find_tests(module, "") test = [doc for (tname, doc, dummy, dummy) in tests if tname == name] if not test: raise ValueError(name, "not found in tests") test = test[0] examples = [source + _expect(expect) for source, expect, dummy in _extract_examples(test)] return '\n'.join(examples)
def testsource(module, name): """Extract the doctest examples from a docstring. Provide the module (or dotted name of the module) containing the test to be debugged and the name (within the module) of the object with the doc string with tests to be debugged. """ module = _normalize_module(module) tests = _find_tests(module, "") test = [doc for (tname, doc, dummy, dummy) in tests if tname == name] if not test: raise ValueError(name, "not found in tests") test = test[0] examples = [source + _expect(expect) for source, expect, dummy in _extract_examples(test)] return '\n'.join(examples)
9,568
def testsource(module, name): """Extract the doctest examples from a docstring. Provide the module (or dotted name of the module) containing the tests to be extracted, and the name (within the module) of the object with the docstring containing the tests to be extracted. The doctest examples are returned as a string containing Python code. The expected output blocks in the examples are converted to Python comments. """ module = _normalize_module(module) tests = _find_tests(module, "") test = [doc for (tname, doc, dummy, dummy) in tests if tname == name] if not test: raise ValueError(name, "not found in tests") test = test[0] examples = [source + _expect(expect) for source, expect, dummy in _extract_examples(test)] return '\n'.join(examples)
def testsource(module, name): """Extract the doctest examples from a docstring. Provide the module (or dotted name of the module) containing the tests to be extracted, and the name (within the module) of the object with the docstring containing the tests to be extracted. The doctest examples are returned as a string containing Python code. The expected output blocks in the examples are converted to Python comments. """ module = _normalizeModule(module) tests = _findTests(module, "") test = [doc for (tname, doc, f, l) in tests if tname == name] if not test: raise ValueError(name, "not found in tests") test = test[0] examples = [source + _expect(expect) for source, expect, dummy in _extract_examples(test)] return '\n'.join(examples)
9,569
def testsource(module, name): """Extract the doctest examples from a docstring. Provide the module (or dotted name of the module) containing the tests to be extracted, and the name (within the module) of the object with the docstring containing the tests to be extracted. The doctest examples are returned as a string containing Python code. The expected output blocks in the examples are converted to Python comments. """ module = _normalize_module(module) tests = _find_tests(module, "") test = [doc for (tname, doc, dummy, dummy) in tests if tname == name] if not test: raise ValueError(name, "not found in tests") test = test[0] examples = [source + _expect(expect) for source, expect, dummy in _extract_examples(test)] return '\n'.join(examples)
def testsource(module, name): """Extract the doctest examples from a docstring. Provide the module (or dotted name of the module) containing the tests to be extracted, and the name (within the module) of the object with the docstring containing the tests to be extracted. The doctest examples are returned as a string containing Python code. The expected output blocks in the examples are converted to Python comments. """ module = _normalize_module(module) tests = _find_tests(module, "") test = [doc for (tname, doc, dummy, dummy) in tests if tname == name] if not test: raise ValueError(name, "not found in tests") test = test[0] examples = [source + _expect(expect) for source, expect, dummy in _extract_examples(test)] return '\n'.join(examples)
9,570
def debug(module, name): """Debug a single docstring containing doctests. Provide the module (or dotted name of the module) containing the docstring to be debugged, and the name (within the module) of the object with the docstring to be debugged. The doctest examples are extracted (see function testsource()), and written to a temp file. The Python debugger (pdb) is then invoked on that file. """ import os import pdb import tempfile module = _normalize_module(module) testsrc = testsource(module, name) srcfilename = tempfile.mktemp("doctestdebug.py") f = file(srcfilename, 'w') f.write(testsrc) f.close() globs = {} globs.update(module.__dict__) try: # Note that %r is vital here. '%s' instead can, e.g., cause # backslashes to get treated as metacharacters on Windows. pdb.run("execfile(%r)" % srcfilename, globs, globs) finally: os.remove(srcfilename)
def debug(module, name): """Debug a single docstring containing doctests. Provide the module (or dotted name of the module) containing the docstring to be debugged, and the name (within the module) of the object with the docstring to be debugged. The doctest examples are extracted (see function testsource()), and written to a temp file. The Python debugger (pdb) is then invoked on that file. """ examples = _extract_examples(src) src = '\n'.join([ "%s%s" % (source, _expect(expect)) for (source, expect, lineno) in examples ]) debug_script(src, pm, globs) def debug_script(src, pm=False, globs=None): "Debug a test script" import pdb import tempfile module = _normalize_module(module) testsrc = testsource(module, name) srcfilename = tempfile.mktemp("doctestdebug.py") f = file(srcfilename, 'w') f.write(testsrc) f.close() globs = {} globs.update(module.__dict__) try: # Note that %r is vital here. '%s' instead can, e.g., cause # backslashes to get treated as metacharacters on Windows. pdb.run("execfile(%r)" % srcfilename, globs, globs) finally: os.remove(srcfilename)
9,571
def debug(module, name): """Debug a single docstring containing doctests. Provide the module (or dotted name of the module) containing the docstring to be debugged, and the name (within the module) of the object with the docstring to be debugged. The doctest examples are extracted (see function testsource()), and written to a temp file. The Python debugger (pdb) is then invoked on that file. """ import os import pdb import tempfile module = _normalize_module(module) testsrc = testsource(module, name) srcfilename = tempfile.mktemp("doctestdebug.py") f = file(srcfilename, 'w') f.write(testsrc) f.close() globs = {} globs.update(module.__dict__) try: # Note that %r is vital here. '%s' instead can, e.g., cause # backslashes to get treated as metacharacters on Windows. pdb.run("execfile(%r)" % srcfilename, globs, globs) finally: os.remove(srcfilename)
def debug(module, name): """Debug a single docstring containing doctests. Provide the module (or dotted name of the module) containing the docstring to be debugged, and the name (within the module) of the object with the docstring to be debugged. The doctest examples are extracted (see function testsource()), and written to a temp file. The Python debugger (pdb) is then invoked on that file. """ import os import pdb srcfilename = tempfile.mktemp("doctestdebug.py") f = file(srcfilename, 'w') f.write(testsrc) f.close() globs = {} globs.update(module.__dict__) try: # Note that %r is vital here. '%s' instead can, e.g., cause # backslashes to get treated as metacharacters on Windows. pdb.run("execfile(%r)" % srcfilename, globs, globs) finally: os.remove(srcfilename)
9,572
def debug(module, name): """Debug a single docstring containing doctests. Provide the module (or dotted name of the module) containing the docstring to be debugged, and the name (within the module) of the object with the docstring to be debugged. The doctest examples are extracted (see function testsource()), and written to a temp file. The Python debugger (pdb) is then invoked on that file. """ import os import pdb import tempfile module = _normalize_module(module) testsrc = testsource(module, name) srcfilename = tempfile.mktemp("doctestdebug.py") f = file(srcfilename, 'w') f.write(testsrc) f.close() globs = {} globs.update(module.__dict__) try: # Note that %r is vital here. '%s' instead can, e.g., cause # backslashes to get treated as metacharacters on Windows. pdb.run("execfile(%r)" % srcfilename, globs, globs) finally: os.remove(srcfilename)
def debug(module, name): """Debug a single docstring containing doctests. Provide the module (or dotted name of the module) containing the docstring to be debugged, and the name (within the module) of the object with the docstring to be debugged. The doctest examples are extracted (see function testsource()), and written to a temp file. The Python debugger (pdb) is then invoked on that file. """ import os import pdb import tempfile module = _normalize_module(module) testsrc = testsource(module, name) srcfilename = tempfile.mktemp("doctestdebug.py") open(srcfilename, 'w').write(src) if globs: globs = globs.copy() else: globs = {} try: # Note that %r is vital here. '%s' instead can, e.g., cause # backslashes to get treated as metacharacters on Windows. pdb.run("execfile(%r)" % srcfilename, globs, globs) finally: os.remove(srcfilename)
9,573
def debug(module, name): """Debug a single docstring containing doctests. Provide the module (or dotted name of the module) containing the docstring to be debugged, and the name (within the module) of the object with the docstring to be debugged. The doctest examples are extracted (see function testsource()), and written to a temp file. The Python debugger (pdb) is then invoked on that file. """ import os import pdb import tempfile module = _normalize_module(module) testsrc = testsource(module, name) srcfilename = tempfile.mktemp("doctestdebug.py") f = file(srcfilename, 'w') f.write(testsrc) f.close() globs = {} globs.update(module.__dict__) try: # Note that %r is vital here. '%s' instead can, e.g., cause # backslashes to get treated as metacharacters on Windows. pdb.run("execfile(%r)" % srcfilename, globs, globs) finally: os.remove(srcfilename)
def debug(module, name): """Debug a single docstring containing doctests. Provide the module (or dotted name of the module) containing the docstring to be debugged, and the name (within the module) of the object with the docstring to be debugged. The doctest examples are extracted (see function testsource()), and written to a temp file. The Python debugger (pdb) is then invoked on that file. """ import os import pdb import tempfile module = _normalize_module(module) testsrc = testsource(module, name) srcfilename = tempfile.mktemp("doctestdebug.py") f = file(srcfilename, 'w') f.write(testsrc) f.close() globs = {} globs.update(module.__dict__) try: # Note that %r is vital here. '%s' instead can, e.g., cause # backslashes to get treated as metacharacters on Windows. pdb.run("execfile(%r)" % srcfilename, globs, globs) finally: os.remove(srcfilename)
9,574
def __init__(self, editwin): self.editwin = editwin text = editwin.text text.bind("<<run-module>>", self.run_module) text.bind("<<run-script>>", self.run_script) text.bind("<<new-shell>>", self.new_shell)
def __init__(self, editwin): self.editwin = editwin text = editwin.text text.bind("<<run-module>>", self.run_module) text.bind("<<run-script>>", self.run_script) text.bind("<<new-shell>>", self.new_shell)
9,575
def run_module(self, event=None): filename = self.editwin.io.filename if not filename: tkMessageBox.showerror("No file name", "This window has no file name", master=self.editwin.text) return modname, ext = os.path.splitext(os.path.basename(filename)) try: mod = sys.modules[modname] except KeyError: mod = imp.new_module(modname) sys.modules[modname] = mod source = self.editwin.text.get("1.0", "end") exec source in mod.__dict__
def run_module_event(self, event, debugger=None): if not self.editwin.get_saved(): tkMessageBox.showerror("Not saved", "Please save first!", master=self.editwin.text) self.editwin.text.focus_set() return filename = self.editwin.io.filename if not filename: tkMessageBox.showerror("No file name", "This window has no file name", master=self.editwin.text) return modname, ext = os.path.splitext(os.path.basename(filename)) try: mod = sys.modules[modname] except KeyError: mod = imp.new_module(modname) sys.modules[modname] = mod source = self.editwin.text.get("1.0", "end") exec source in mod.__dict__
9,576
def run_module(self, event=None): filename = self.editwin.io.filename if not filename: tkMessageBox.showerror("No file name", "This window has no file name", master=self.editwin.text) return modname, ext = os.path.splitext(os.path.basename(filename)) try: mod = sys.modules[modname] except KeyError: mod = imp.new_module(modname) sys.modules[modname] = mod source = self.editwin.text.get("1.0", "end") exec source in mod.__dict__
def run_module(self, event=None): filename = self.editwin.io.filename if not filename: tkMessageBox.showerror("No file name", "This window has no file name", master=self.editwin.text) return modname, ext = os.path.splitext(os.path.basename(filename)) if sys.modules.has_key(modname): mod = sys.modules[modname] except KeyError: mod = imp.new_module(modname) sys.modules[modname] = mod source = self.editwin.text.get("1.0", "end") exec source in mod.__dict__
9,577
def run_module(self, event=None): filename = self.editwin.io.filename if not filename: tkMessageBox.showerror("No file name", "This window has no file name", master=self.editwin.text) return modname, ext = os.path.splitext(os.path.basename(filename)) try: mod = sys.modules[modname] except KeyError: mod = imp.new_module(modname) sys.modules[modname] = mod source = self.editwin.text.get("1.0", "end") exec source in mod.__dict__
def run_module(self, event=None): filename = self.editwin.io.filename if not filename: tkMessageBox.showerror("No file name", "This window has no file name", master=self.editwin.text) return modname, ext = os.path.splitext(os.path.basename(filename)) try: mod = sys.modules[modname] else: mod = imp.new_module(modname) sys.modules[modname] = mod source = self.editwin.text.get("1.0", "end") exec source in mod.__dict__
9,578
def run_module(self, event=None): filename = self.editwin.io.filename if not filename: tkMessageBox.showerror("No file name", "This window has no file name", master=self.editwin.text) return modname, ext = os.path.splitext(os.path.basename(filename)) try: mod = sys.modules[modname] except KeyError: mod = imp.new_module(modname) sys.modules[modname] = mod source = self.editwin.text.get("1.0", "end") exec source in mod.__dict__
def run_module(self, event=None): filename = self.editwin.io.filename if not filename: tkMessageBox.showerror("No file name", "This window has no file name", master=self.editwin.text) return modname, ext = os.path.splitext(os.path.basename(filename)) try: mod = sys.modules[modname] except KeyError: mod = imp.new_module(modname) sys.modules[modname] = mod source = self.editwin.text.get("1.0", "end") exec source in mod.__dict__
9,579
def run_script(self, event=None): pass
def debug_module_event(self, event): import Debugger debugger = Debugger.Debugger(self) self.run_module_event(event, debugger) def close_debugger(self): pass
9,580
def run_script(self, event=None): pass
def run_script(self, event=None): pass
9,581
def get_source_files (self): self.check_extension_list() filenames = []
def get_source_files (self): self.check_extensions_list(self.extensions) filenames = []
9,582
def _execute_child(self, args, executable, preexec_fn, close_fds, cwd, env, universal_newlines, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite): """Execute program (MS Windows version)"""
def _execute_child(self, args, executable, preexec_fn, close_fds, cwd, env, universal_newlines, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite): """Execute program (MS Windows version)"""
9,583
def __add__(self, other): return NotImplemented
def __add__(self, other): return NotImplemented
9,584
def process_request(self, request, client_address): """Start a new thread to process the request.""" import threading t = threading.Thread(target = self.finish_request, args = (request, client_address)) t.start()
def process_request(self, request, client_address): """Start a new thread to process the request.""" import threading t = threading.Thread(target = self.process_request_thread, args = (request, client_address)) t.start()
9,585
exec('def f(a, a): pass')
exec('def f(a, a): pass')
9,586
exec('def f(a = 0, a = 1): pass')
exec('def f(a = 0, a = 1): pass')
9,587
exec('def f(a): global a; a = 1')
exec('def f(a): global a; a = 1')
9,588
def __str__(self): if self.__den == 1: return str(self.__num) else: return '%s/%s' % (str(self.__num), str(self.__den))
def __str__(self): if self.__den == 1: return str(self.__num) else: return '%s/%s' % (str(self.__num), str(self.__den))
9,589
def __cmp__(a, b): diff = a - b if diff.__num < 0: return -1 elif diff.__num > 0: return 1 else: return 0
def __cmp__(a, b): diff = Rat(a - b) if diff.__num < 0: return -1 elif diff.__num > 0: return 1 else: return 0
9,590
def test(): '''\ Test function for rat module. The expected output is (module some differences in floating precission): -1 -1 0 0L 0.1 (0.1+0j) [Rat(1,2), Rat(-3,10), Rat(1,25), Rat(1,4)] [Rat(-3,10), Rat(1,25), Rat(1,4), Rat(1,2)] 0 11/10 11/10 1.1 OK 2 1.5 3/2 (1.5+1.5j) 15707963/5000000 2 2 2.0 (2+0j) 4 0 4 1 4 0 3.5 0.5 3.0 1.33333333333 2.82842712475 1 7/2 1/2 3 4/3 2.82842712475 1 (3.5+1.5j) (0.5-1.5j) (3+3j) (0.666666666667-0.666666666667j) (1.43248815986+2.43884761145j) 1 1.5 1 1.5 (1.5+0j) 3.5 -0.5 3.0 0.75 2.25 -1 3.0 0.0 2.25 1.0 1.83711730709 0 3.0 0.0 2.25 1.0 1.83711730709 1 (3+1.5j) -1.5j (2.25+2.25j) (0.5-0.5j) (1.50768393746+1.04970907623j) -1 3/2 1 1.5 (1.5+0j) 7/2 -1/2 3 3/4 9/4 -1 3.0 0.0 2.25 1.0 1.83711730709 -1 3 0 9/4 1 1.83711730709 0 (3+1.5j) -1.5j (2.25+2.25j) (0.5-0.5j) (1.50768393746+1.04970907623j) -1 (1.5+1.5j) (1.5+1.5j) (3.5+1.5j) (-0.5+1.5j) (3+3j) (0.75+0.75j) 4.5j -1 (3+1.5j) 1.5j (2.25+2.25j) (1+1j) (1.18235814075+2.85446505899j) 1 (3+1.5j) 1.5j (2.25+2.25j) (1+1j) (1.18235814075+2.85446505899j) 1 (3+3j) 0j 4.5j (1+0j) (-0.638110484918+0.705394566962j) 0 ''' print rat(-1L, 1) print rat(1, -1) a = rat(1, 10) print int(a), long(a), float(a), complex(a) b = rat(2, 5) l = [a+b, a-b, a*b, a/b] print l l.sort() print l print rat(0, 1) print a+1 print a+1L print a+1.0 try: print rat(1, 0) raise SystemError, 'should have been ZeroDivisionError' except ZeroDivisionError: print 'OK' print rat(2), rat(1.5), rat(3, 2), rat(1.5+1.5j), rat(31415926,10000000) list = [2, 1.5, rat(3,2), 1.5+1.5j] for i in list: print i, if type(i) is not ComplexType: print int(i), float(i), print complex(i) print for j in list: print i + j, i - j, i * j, i / j, i ** j, cmp(i, j)
def test(): '''\ Test function for rat module. The expected output is (module some differences in floating precission): -1 -1 0 0L 0.1 (0.1+0j) [Rat(1,2), Rat(-3,10), Rat(1,25), Rat(1,4)] [Rat(-3,10), Rat(1,25), Rat(1,4), Rat(1,2)] 0 (11/10) (11/10) 1.1 OK 2 1.5 3/2 (1.5+1.5j) 15707963/5000000 2 2 2.0 (2+0j) 4 0 4 1 4 0 3.5 0.5 3.0 1.33333333333 2.82842712475 1 7/2 1/2 3 4/3 2.82842712475 1 (3.5+1.5j) (0.5-1.5j) (3+3j) (0.666666666667-0.666666666667j) (1.43248815986+2.43884761145j) 1 1.5 1 1.5 (1.5+0j) 3.5 -0.5 3.0 0.75 2.25 -1 3.0 0.0 2.25 1.0 1.83711730709 0 3.0 0.0 2.25 1.0 1.83711730709 1 (3+1.5j) -1.5j (2.25+2.25j) (0.5-0.5j) (1.50768393746+1.04970907623j) -1 3/2 1 1.5 (1.5+0j) 7/2 -1/2 3 3/4 9/4 -1 3.0 0.0 2.25 1.0 1.83711730709 -1 3 0 9/4 1 1.83711730709 0 (3+1.5j) -1.5j (2.25+2.25j) (0.5-0.5j) (1.50768393746+1.04970907623j) -1 (1.5+1.5j) (1.5+1.5j) (3.5+1.5j) (-0.5+1.5j) (3+3j) (0.75+0.75j) 4.5j -1 (3+1.5j) 1.5j (2.25+2.25j) (1+1j) (1.18235814075+2.85446505899j) 1 (3+1.5j) 1.5j (2.25+2.25j) (1+1j) (1.18235814075+2.85446505899j) 1 (3+3j) 0j 4.5j (1+0j) (-0.638110484918+0.705394566962j) 0 ''' print rat(-1L, 1) print rat(1, -1) a = rat(1, 10) print int(a), long(a), float(a), complex(a) b = rat(2, 5) l = [a+b, a-b, a*b, a/b] print l l.sort() print l print rat(0, 1) print a+1 print a+1L print a+1.0 try: print rat(1, 0) raise SystemError, 'should have been ZeroDivisionError' except ZeroDivisionError: print 'OK' print rat(2), rat(1.5), rat(3, 2), rat(1.5+1.5j), rat(31415926,10000000) list = [2, 1.5, rat(3,2), 1.5+1.5j] for i in list: print i, if type(i) is not ComplexType: print int(i), float(i), print complex(i) print for j in list: print i + j, i - j, i * j, i / j, i ** j, cmp(i, j)
9,591
def test(): '''\ Test function for rat module. The expected output is (module some differences in floating precission): -1 -1 0 0L 0.1 (0.1+0j) [Rat(1,2), Rat(-3,10), Rat(1,25), Rat(1,4)] [Rat(-3,10), Rat(1,25), Rat(1,4), Rat(1,2)] 0 11/10 11/10 1.1 OK 2 1.5 3/2 (1.5+1.5j) 15707963/5000000 2 2 2.0 (2+0j) 4 0 4 1 4 0 3.5 0.5 3.0 1.33333333333 2.82842712475 1 7/2 1/2 3 4/3 2.82842712475 1 (3.5+1.5j) (0.5-1.5j) (3+3j) (0.666666666667-0.666666666667j) (1.43248815986+2.43884761145j) 1 1.5 1 1.5 (1.5+0j) 3.5 -0.5 3.0 0.75 2.25 -1 3.0 0.0 2.25 1.0 1.83711730709 0 3.0 0.0 2.25 1.0 1.83711730709 1 (3+1.5j) -1.5j (2.25+2.25j) (0.5-0.5j) (1.50768393746+1.04970907623j) -1 3/2 1 1.5 (1.5+0j) 7/2 -1/2 3 3/4 9/4 -1 3.0 0.0 2.25 1.0 1.83711730709 -1 3 0 9/4 1 1.83711730709 0 (3+1.5j) -1.5j (2.25+2.25j) (0.5-0.5j) (1.50768393746+1.04970907623j) -1 (1.5+1.5j) (1.5+1.5j) (3.5+1.5j) (-0.5+1.5j) (3+3j) (0.75+0.75j) 4.5j -1 (3+1.5j) 1.5j (2.25+2.25j) (1+1j) (1.18235814075+2.85446505899j) 1 (3+1.5j) 1.5j (2.25+2.25j) (1+1j) (1.18235814075+2.85446505899j) 1 (3+3j) 0j 4.5j (1+0j) (-0.638110484918+0.705394566962j) 0 ''' print rat(-1L, 1) print rat(1, -1) a = rat(1, 10) print int(a), long(a), float(a), complex(a) b = rat(2, 5) l = [a+b, a-b, a*b, a/b] print l l.sort() print l print rat(0, 1) print a+1 print a+1L print a+1.0 try: print rat(1, 0) raise SystemError, 'should have been ZeroDivisionError' except ZeroDivisionError: print 'OK' print rat(2), rat(1.5), rat(3, 2), rat(1.5+1.5j), rat(31415926,10000000) list = [2, 1.5, rat(3,2), 1.5+1.5j] for i in list: print i, if type(i) is not ComplexType: print int(i), float(i), print complex(i) print for j in list: print i + j, i - j, i * j, i / j, i ** j, cmp(i, j)
def test(): '''\ Test function for rat module. The expected output is (module some differences in floating precission): -1 -1 0 0L 0.1 (0.1+0j) [Rat(1,2), Rat(-3,10), Rat(1,25), Rat(1,4)] [Rat(-3,10), Rat(1,25), Rat(1,4), Rat(1,2)] 0 11/10 11/10 1.1 OK 2 1.5 (3/2) (1.5+1.5j) (15707963/5000000) 2 2 2.0 (2+0j) 4 0 4 1 4 0 3.5 0.5 3.0 1.33333333333 2.82842712475 1 7/2 1/2 3 4/3 2.82842712475 1 (3.5+1.5j) (0.5-1.5j) (3+3j) (0.666666666667-0.666666666667j) (1.43248815986+2.43884761145j) 1 1.5 1 1.5 (1.5+0j) 3.5 -0.5 3.0 0.75 2.25 -1 3.0 0.0 2.25 1.0 1.83711730709 0 3.0 0.0 2.25 1.0 1.83711730709 1 (3+1.5j) -1.5j (2.25+2.25j) (0.5-0.5j) (1.50768393746+1.04970907623j) -1 3/2 1 1.5 (1.5+0j) 7/2 -1/2 3 3/4 9/4 -1 3.0 0.0 2.25 1.0 1.83711730709 -1 3 0 9/4 1 1.83711730709 0 (3+1.5j) -1.5j (2.25+2.25j) (0.5-0.5j) (1.50768393746+1.04970907623j) -1 (1.5+1.5j) (1.5+1.5j) (3.5+1.5j) (-0.5+1.5j) (3+3j) (0.75+0.75j) 4.5j -1 (3+1.5j) 1.5j (2.25+2.25j) (1+1j) (1.18235814075+2.85446505899j) 1 (3+1.5j) 1.5j (2.25+2.25j) (1+1j) (1.18235814075+2.85446505899j) 1 (3+3j) 0j 4.5j (1+0j) (-0.638110484918+0.705394566962j) 0 ''' print rat(-1L, 1) print rat(1, -1) a = rat(1, 10) print int(a), long(a), float(a), complex(a) b = rat(2, 5) l = [a+b, a-b, a*b, a/b] print l l.sort() print l print rat(0, 1) print a+1 print a+1L print a+1.0 try: print rat(1, 0) raise SystemError, 'should have been ZeroDivisionError' except ZeroDivisionError: print 'OK' print rat(2), rat(1.5), rat(3, 2), rat(1.5+1.5j), rat(31415926,10000000) list = [2, 1.5, rat(3,2), 1.5+1.5j] for i in list: print i, if type(i) is not ComplexType: print int(i), float(i), print complex(i) print for j in list: print i + j, i - j, i * j, i / j, i ** j, cmp(i, j)
9,592
def test(): '''\ Test function for rat module. The expected output is (module some differences in floating precission): -1 -1 0 0L 0.1 (0.1+0j) [Rat(1,2), Rat(-3,10), Rat(1,25), Rat(1,4)] [Rat(-3,10), Rat(1,25), Rat(1,4), Rat(1,2)] 0 11/10 11/10 1.1 OK 2 1.5 3/2 (1.5+1.5j) 15707963/5000000 2 2 2.0 (2+0j) 4 0 4 1 4 0 3.5 0.5 3.0 1.33333333333 2.82842712475 1 7/2 1/2 3 4/3 2.82842712475 1 (3.5+1.5j) (0.5-1.5j) (3+3j) (0.666666666667-0.666666666667j) (1.43248815986+2.43884761145j) 1 1.5 1 1.5 (1.5+0j) 3.5 -0.5 3.0 0.75 2.25 -1 3.0 0.0 2.25 1.0 1.83711730709 0 3.0 0.0 2.25 1.0 1.83711730709 1 (3+1.5j) -1.5j (2.25+2.25j) (0.5-0.5j) (1.50768393746+1.04970907623j) -1 3/2 1 1.5 (1.5+0j) 7/2 -1/2 3 3/4 9/4 -1 3.0 0.0 2.25 1.0 1.83711730709 -1 3 0 9/4 1 1.83711730709 0 (3+1.5j) -1.5j (2.25+2.25j) (0.5-0.5j) (1.50768393746+1.04970907623j) -1 (1.5+1.5j) (1.5+1.5j) (3.5+1.5j) (-0.5+1.5j) (3+3j) (0.75+0.75j) 4.5j -1 (3+1.5j) 1.5j (2.25+2.25j) (1+1j) (1.18235814075+2.85446505899j) 1 (3+1.5j) 1.5j (2.25+2.25j) (1+1j) (1.18235814075+2.85446505899j) 1 (3+3j) 0j 4.5j (1+0j) (-0.638110484918+0.705394566962j) 0 ''' print rat(-1L, 1) print rat(1, -1) a = rat(1, 10) print int(a), long(a), float(a), complex(a) b = rat(2, 5) l = [a+b, a-b, a*b, a/b] print l l.sort() print l print rat(0, 1) print a+1 print a+1L print a+1.0 try: print rat(1, 0) raise SystemError, 'should have been ZeroDivisionError' except ZeroDivisionError: print 'OK' print rat(2), rat(1.5), rat(3, 2), rat(1.5+1.5j), rat(31415926,10000000) list = [2, 1.5, rat(3,2), 1.5+1.5j] for i in list: print i, if type(i) is not ComplexType: print int(i), float(i), print complex(i) print for j in list: print i + j, i - j, i * j, i / j, i ** j, cmp(i, j)
def test(): '''\ Test function for rat module. The expected output is (module some differences in floating precission): -1 -1 0 0L 0.1 (0.1+0j) [Rat(1,2), Rat(-3,10), Rat(1,25), Rat(1,4)] [Rat(-3,10), Rat(1,25), Rat(1,4), Rat(1,2)] 0 11/10 11/10 1.1 OK 2 1.5 3/2 (1.5+1.5j) 15707963/5000000 2 2 2.0 (2+0j) 4 0 4 1 4 0 3.5 0.5 3.0 1.33333333333 2.82842712475 1 (7/2) (1/2) 3 (4/3) 2.82842712475 1 (3.5+1.5j) (0.5-1.5j) (3+3j) (0.666666666667-0.666666666667j) (1.43248815986+2.43884761145j) 1 1.5 1 1.5 (1.5+0j) 3.5 -0.5 3.0 0.75 2.25 -1 3.0 0.0 2.25 1.0 1.83711730709 0 3.0 0.0 2.25 1.0 1.83711730709 1 (3+1.5j) -1.5j (2.25+2.25j) (0.5-0.5j) (1.50768393746+1.04970907623j) -1 3/2 1 1.5 (1.5+0j) 7/2 -1/2 3 3/4 9/4 -1 3.0 0.0 2.25 1.0 1.83711730709 -1 3 0 9/4 1 1.83711730709 0 (3+1.5j) -1.5j (2.25+2.25j) (0.5-0.5j) (1.50768393746+1.04970907623j) -1 (1.5+1.5j) (1.5+1.5j) (3.5+1.5j) (-0.5+1.5j) (3+3j) (0.75+0.75j) 4.5j -1 (3+1.5j) 1.5j (2.25+2.25j) (1+1j) (1.18235814075+2.85446505899j) 1 (3+1.5j) 1.5j (2.25+2.25j) (1+1j) (1.18235814075+2.85446505899j) 1 (3+3j) 0j 4.5j (1+0j) (-0.638110484918+0.705394566962j) 0 ''' print rat(-1L, 1) print rat(1, -1) a = rat(1, 10) print int(a), long(a), float(a), complex(a) b = rat(2, 5) l = [a+b, a-b, a*b, a/b] print l l.sort() print l print rat(0, 1) print a+1 print a+1L print a+1.0 try: print rat(1, 0) raise SystemError, 'should have been ZeroDivisionError' except ZeroDivisionError: print 'OK' print rat(2), rat(1.5), rat(3, 2), rat(1.5+1.5j), rat(31415926,10000000) list = [2, 1.5, rat(3,2), 1.5+1.5j] for i in list: print i, if type(i) is not ComplexType: print int(i), float(i), print complex(i) print for j in list: print i + j, i - j, i * j, i / j, i ** j, cmp(i, j)
9,593
def test(): '''\ Test function for rat module. The expected output is (module some differences in floating precission): -1 -1 0 0L 0.1 (0.1+0j) [Rat(1,2), Rat(-3,10), Rat(1,25), Rat(1,4)] [Rat(-3,10), Rat(1,25), Rat(1,4), Rat(1,2)] 0 11/10 11/10 1.1 OK 2 1.5 3/2 (1.5+1.5j) 15707963/5000000 2 2 2.0 (2+0j) 4 0 4 1 4 0 3.5 0.5 3.0 1.33333333333 2.82842712475 1 7/2 1/2 3 4/3 2.82842712475 1 (3.5+1.5j) (0.5-1.5j) (3+3j) (0.666666666667-0.666666666667j) (1.43248815986+2.43884761145j) 1 1.5 1 1.5 (1.5+0j) 3.5 -0.5 3.0 0.75 2.25 -1 3.0 0.0 2.25 1.0 1.83711730709 0 3.0 0.0 2.25 1.0 1.83711730709 1 (3+1.5j) -1.5j (2.25+2.25j) (0.5-0.5j) (1.50768393746+1.04970907623j) -1 3/2 1 1.5 (1.5+0j) 7/2 -1/2 3 3/4 9/4 -1 3.0 0.0 2.25 1.0 1.83711730709 -1 3 0 9/4 1 1.83711730709 0 (3+1.5j) -1.5j (2.25+2.25j) (0.5-0.5j) (1.50768393746+1.04970907623j) -1 (1.5+1.5j) (1.5+1.5j) (3.5+1.5j) (-0.5+1.5j) (3+3j) (0.75+0.75j) 4.5j -1 (3+1.5j) 1.5j (2.25+2.25j) (1+1j) (1.18235814075+2.85446505899j) 1 (3+1.5j) 1.5j (2.25+2.25j) (1+1j) (1.18235814075+2.85446505899j) 1 (3+3j) 0j 4.5j (1+0j) (-0.638110484918+0.705394566962j) 0 ''' print rat(-1L, 1) print rat(1, -1) a = rat(1, 10) print int(a), long(a), float(a), complex(a) b = rat(2, 5) l = [a+b, a-b, a*b, a/b] print l l.sort() print l print rat(0, 1) print a+1 print a+1L print a+1.0 try: print rat(1, 0) raise SystemError, 'should have been ZeroDivisionError' except ZeroDivisionError: print 'OK' print rat(2), rat(1.5), rat(3, 2), rat(1.5+1.5j), rat(31415926,10000000) list = [2, 1.5, rat(3,2), 1.5+1.5j] for i in list: print i, if type(i) is not ComplexType: print int(i), float(i), print complex(i) print for j in list: print i + j, i - j, i * j, i / j, i ** j, cmp(i, j)
def test(): '''\ Test function for rat module. The expected output is (module some differences in floating precission): -1 -1 0 0L 0.1 (0.1+0j) [Rat(1,2), Rat(-3,10), Rat(1,25), Rat(1,4)] [Rat(-3,10), Rat(1,25), Rat(1,4), Rat(1,2)] 0 11/10 11/10 1.1 OK 2 1.5 3/2 (1.5+1.5j) 15707963/5000000 2 2 2.0 (2+0j) 4 0 4 1 4 0 3.5 0.5 3.0 1.33333333333 2.82842712475 1 7/2 1/2 3 4/3 2.82842712475 1 (3.5+1.5j) (0.5-1.5j) (3+3j) (0.666666666667-0.666666666667j) (1.43248815986+2.43884761145j) 1 1.5 1 1.5 (1.5+0j) 3.5 -0.5 3.0 0.75 2.25 -1 3.0 0.0 2.25 1.0 1.83711730709 0 3.0 0.0 2.25 1.0 1.83711730709 1 (3+1.5j) -1.5j (2.25+2.25j) (0.5-0.5j) (1.50768393746+1.04970907623j) -1 (3/2) 1 1.5 (1.5+0j) (7/2) (-1/2) 3 (3/4) (9/4) -1 3.0 0.0 2.25 1.0 1.83711730709 -1 3 0 9/4 1 1.83711730709 0 (3+1.5j) -1.5j (2.25+2.25j) (0.5-0.5j) (1.50768393746+1.04970907623j) -1 (1.5+1.5j) (1.5+1.5j) (3.5+1.5j) (-0.5+1.5j) (3+3j) (0.75+0.75j) 4.5j -1 (3+1.5j) 1.5j (2.25+2.25j) (1+1j) (1.18235814075+2.85446505899j) 1 (3+1.5j) 1.5j (2.25+2.25j) (1+1j) (1.18235814075+2.85446505899j) 1 (3+3j) 0j 4.5j (1+0j) (-0.638110484918+0.705394566962j) 0 ''' print rat(-1L, 1) print rat(1, -1) a = rat(1, 10) print int(a), long(a), float(a), complex(a) b = rat(2, 5) l = [a+b, a-b, a*b, a/b] print l l.sort() print l print rat(0, 1) print a+1 print a+1L print a+1.0 try: print rat(1, 0) raise SystemError, 'should have been ZeroDivisionError' except ZeroDivisionError: print 'OK' print rat(2), rat(1.5), rat(3, 2), rat(1.5+1.5j), rat(31415926,10000000) list = [2, 1.5, rat(3,2), 1.5+1.5j] for i in list: print i, if type(i) is not ComplexType: print int(i), float(i), print complex(i) print for j in list: print i + j, i - j, i * j, i / j, i ** j, cmp(i, j)
9,594
def test(): '''\ Test function for rat module. The expected output is (module some differences in floating precission): -1 -1 0 0L 0.1 (0.1+0j) [Rat(1,2), Rat(-3,10), Rat(1,25), Rat(1,4)] [Rat(-3,10), Rat(1,25), Rat(1,4), Rat(1,2)] 0 11/10 11/10 1.1 OK 2 1.5 3/2 (1.5+1.5j) 15707963/5000000 2 2 2.0 (2+0j) 4 0 4 1 4 0 3.5 0.5 3.0 1.33333333333 2.82842712475 1 7/2 1/2 3 4/3 2.82842712475 1 (3.5+1.5j) (0.5-1.5j) (3+3j) (0.666666666667-0.666666666667j) (1.43248815986+2.43884761145j) 1 1.5 1 1.5 (1.5+0j) 3.5 -0.5 3.0 0.75 2.25 -1 3.0 0.0 2.25 1.0 1.83711730709 0 3.0 0.0 2.25 1.0 1.83711730709 1 (3+1.5j) -1.5j (2.25+2.25j) (0.5-0.5j) (1.50768393746+1.04970907623j) -1 3/2 1 1.5 (1.5+0j) 7/2 -1/2 3 3/4 9/4 -1 3.0 0.0 2.25 1.0 1.83711730709 -1 3 0 9/4 1 1.83711730709 0 (3+1.5j) -1.5j (2.25+2.25j) (0.5-0.5j) (1.50768393746+1.04970907623j) -1 (1.5+1.5j) (1.5+1.5j) (3.5+1.5j) (-0.5+1.5j) (3+3j) (0.75+0.75j) 4.5j -1 (3+1.5j) 1.5j (2.25+2.25j) (1+1j) (1.18235814075+2.85446505899j) 1 (3+1.5j) 1.5j (2.25+2.25j) (1+1j) (1.18235814075+2.85446505899j) 1 (3+3j) 0j 4.5j (1+0j) (-0.638110484918+0.705394566962j) 0 ''' print rat(-1L, 1) print rat(1, -1) a = rat(1, 10) print int(a), long(a), float(a), complex(a) b = rat(2, 5) l = [a+b, a-b, a*b, a/b] print l l.sort() print l print rat(0, 1) print a+1 print a+1L print a+1.0 try: print rat(1, 0) raise SystemError, 'should have been ZeroDivisionError' except ZeroDivisionError: print 'OK' print rat(2), rat(1.5), rat(3, 2), rat(1.5+1.5j), rat(31415926,10000000) list = [2, 1.5, rat(3,2), 1.5+1.5j] for i in list: print i, if type(i) is not ComplexType: print int(i), float(i), print complex(i) print for j in list: print i + j, i - j, i * j, i / j, i ** j, cmp(i, j)
def test(): '''\ Test function for rat module. The expected output is (module some differences in floating precission): -1 -1 0 0L 0.1 (0.1+0j) [Rat(1,2), Rat(-3,10), Rat(1,25), Rat(1,4)] [Rat(-3,10), Rat(1,25), Rat(1,4), Rat(1,2)] 0 11/10 11/10 1.1 OK 2 1.5 3/2 (1.5+1.5j) 15707963/5000000 2 2 2.0 (2+0j) 4 0 4 1 4 0 3.5 0.5 3.0 1.33333333333 2.82842712475 1 7/2 1/2 3 4/3 2.82842712475 1 (3.5+1.5j) (0.5-1.5j) (3+3j) (0.666666666667-0.666666666667j) (1.43248815986+2.43884761145j) 1 1.5 1 1.5 (1.5+0j) 3.5 -0.5 3.0 0.75 2.25 -1 3.0 0.0 2.25 1.0 1.83711730709 0 3.0 0.0 2.25 1.0 1.83711730709 1 (3+1.5j) -1.5j (2.25+2.25j) (0.5-0.5j) (1.50768393746+1.04970907623j) -1 3/2 1 1.5 (1.5+0j) 7/2 -1/2 3 3/4 9/4 -1 3.0 0.0 2.25 1.0 1.83711730709 -1 3 0 (9/4) 1 1.83711730709 0 (3+1.5j) -1.5j (2.25+2.25j) (0.5-0.5j) (1.50768393746+1.04970907623j) -1 (1.5+1.5j) (1.5+1.5j) (3.5+1.5j) (-0.5+1.5j) (3+3j) (0.75+0.75j) 4.5j -1 (3+1.5j) 1.5j (2.25+2.25j) (1+1j) (1.18235814075+2.85446505899j) 1 (3+1.5j) 1.5j (2.25+2.25j) (1+1j) (1.18235814075+2.85446505899j) 1 (3+3j) 0j 4.5j (1+0j) (-0.638110484918+0.705394566962j) 0 ''' print rat(-1L, 1) print rat(1, -1) a = rat(1, 10) print int(a), long(a), float(a), complex(a) b = rat(2, 5) l = [a+b, a-b, a*b, a/b] print l l.sort() print l print rat(0, 1) print a+1 print a+1L print a+1.0 try: print rat(1, 0) raise SystemError, 'should have been ZeroDivisionError' except ZeroDivisionError: print 'OK' print rat(2), rat(1.5), rat(3, 2), rat(1.5+1.5j), rat(31415926,10000000) list = [2, 1.5, rat(3,2), 1.5+1.5j] for i in list: print i, if type(i) is not ComplexType: print int(i), float(i), print complex(i) print for j in list: print i + j, i - j, i * j, i / j, i ** j, cmp(i, j)
9,595
def main(): """Script main program.""" import getopt try: opts, args = getopt.getopt(sys.argv[1:], 'lfqd:x:') except getopt.error, msg: print msg print "usage: python compileall.py [-l] [-f] [-q] [-d destdir] " \ "[-s regexp] [directory ...]" print "-l: don't recurse down" print "-f: force rebuild even if timestamps are up-to-date" print "-q: quiet operation" print "-d destdir: purported directory name for error messages" print " if no directory arguments, -l sys.path is assumed" print "-x regexp: skip files matching the regular expression regexp" print " the regexp is search for in the full path of the file" sys.exit(2) maxlevels = 10 ddir = None force = 0 quiet = 0 rx = None for o, a in opts: if o == '-l': maxlevels = 0 if o == '-d': ddir = a if o == '-f': force = 1 if o == '-q': quiet = 1 if o == '-x': import re rx = re.compile(a) if ddir: if len(args) != 1: print "-d destdir require exactly one directory argument" sys.exit(2) success = 1 try: if args: for dir in args: if not compile_dir(dir, maxlevels, ddir, force, rx, quiet): success = 0 else: success = compile_path() except KeyboardInterrupt: print "\n[interrupt]" success = 0 return success
def main(): """Script main program.""" import getopt try: opts, args = getopt.getopt(sys.argv[1:], 'lfqd:x:') except getopt.error, msg: print msg print "usage: python compileall.py [-l] [-f] [-q] [-d destdir] " \ "[-x regexp] [directory ...]" print "-l: don't recurse down" print "-f: force rebuild even if timestamps are up-to-date" print "-q: quiet operation" print "-d destdir: purported directory name for error messages" print " if no directory arguments, -l sys.path is assumed" print "-x regexp: skip files matching the regular expression regexp" print " the regexp is search for in the full path of the file" sys.exit(2) maxlevels = 10 ddir = None force = 0 quiet = 0 rx = None for o, a in opts: if o == '-l': maxlevels = 0 if o == '-d': ddir = a if o == '-f': force = 1 if o == '-q': quiet = 1 if o == '-x': import re rx = re.compile(a) if ddir: if len(args) != 1: print "-d destdir require exactly one directory argument" sys.exit(2) success = 1 try: if args: for dir in args: if not compile_dir(dir, maxlevels, ddir, force, rx, quiet): success = 0 else: success = compile_path() except KeyboardInterrupt: print "\n[interrupt]" success = 0 return success
9,596
def visitModule(self, mod): self.emit("""
def visitModule(self, mod): self.emit("""
9,597
def visitModule(self, mod): self.emit("""
def visitModule(self, mod): self.emit("""
9,598
def visitModule(self, mod): self.emit("""
def visitModule(self, mod): self.emit("""
9,599