rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
"""ScrolledWindow - Window with scrollbars."""
"""ScrolledWindow - Window with automatic scrollbars."""
def __init__(self, master, cnf={}, **kw): TixWidget.__init__(self, master, 'tixScrolledTList', ['options'], cnf, kw) self.subwidget_list['tlist'] = _dummyTList(self, 'tlist') self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb') self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb')
b7b32601281f25ffed50f8187c78a3802fa14039 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b7b32601281f25ffed50f8187c78a3802fa14039/Tix.py
"""Select - Container for buttons. Can enforce radio buttons etc. Subwidgets are buttons added dynamically"""
"""Select - Container of button subwidgets. It can be used to provide radio-box or check-box style of selection options for the user. Subwidgets are buttons added dynamically using the add method."""
def __init__(self, master, cnf={}, **kw): TixWidget.__init__(self, master, 'tixScrolledWindow', ['options'], cnf, kw) self.subwidget_list['window'] = _dummyFrame(self, 'window') self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb') self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb')
b7b32601281f25ffed50f8187c78a3802fa14039 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b7b32601281f25ffed50f8187c78a3802fa14039/Tix.py
"""TList - Hierarchy display.
"""TList - Hierarchy display widget which can be used to display data in a tabular format. The list entries of a TList widget are similar to the entries in the Tk listbox widget. The main differences are (1) the TList widget can display the list entries in a two dimensional format and (2) you can use graphical images a...
def invoke(self, name): if self.subwidget_list.has_key(name): self.tk.call(self._w, 'invoke', name)
b7b32601281f25ffed50f8187c78a3802fa14039 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b7b32601281f25ffed50f8187c78a3802fa14039/Tix.py
"""Tree - The tixTree widget (general purpose DirList like widget)"""
"""Tree - The tixTree widget can be used to display hierachical data in a tree form. The user can adjust the view of the tree by opening or closing parts of the tree."""
def yview(self, *args): apply(self.tk.call, (self._w, 'yview') + args)
b7b32601281f25ffed50f8187c78a3802fa14039 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b7b32601281f25ffed50f8187c78a3802fa14039/Tix.py
class _dummyTList(TList, TixSubWidget): def __init__(self, master, name, destroy_physically=1): TixSubWidget.__init__(self, master, name, destroy_physically) class _dummyComboBox(ComboBox, TixSubWidget): def __init__(self, master, name, destroy_physically=1): TixSubWidget.__init__(self, master, name, destroy_physicall...
class _dummyScrolledHList(ScrolledHList, TixSubWidget):
def __init__(self, master, name, destroy_physically=1): TixSubWidget.__init__(self, master, name, destroy_physically)
b7b32601281f25ffed50f8187c78a3802fa14039 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b7b32601281f25ffed50f8187c78a3802fa14039/Tix.py
index = self._tclCommands.index(name) del self._tclCommands[index]
try: self._tclCommands.remove(name) except ValueError: pass
def deletecommand(self, name): #print '- Tkinter: deleted command', name self.tk.deletecommand(name) index = self._tclCommands.index(name) del self._tclCommands[index]
5ac00ac1403e4d0981c5042cc76cd09ae6de2570 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5ac00ac1403e4d0981c5042cc76cd09ae6de2570/Tkinter.py
def _bind(self, what, sequence, func, add):
def _bind(self, what, sequence, func, add, needcleanup=1):
def _bind(self, what, sequence, func, add): if func: cmd = ("%sset _tkinter_break [%s %s]\n" 'if {"$_tkinter_break" == "break"} break\n') \ % (add and '+' or '', self._register(func, self._substitute), _string.join(self._subst_format)) apply(self.tk.call, what + (sequence, cmd)) elif func == '': apply(self.tk.call, wha...
5ac00ac1403e4d0981c5042cc76cd09ae6de2570 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5ac00ac1403e4d0981c5042cc76cd09ae6de2570/Tkinter.py
self._register(func, self._substitute),
self._register(func, self._substitute, needcleanup),
def _bind(self, what, sequence, func, add): if func: cmd = ("%sset _tkinter_break [%s %s]\n" 'if {"$_tkinter_break" == "break"} break\n') \ % (add and '+' or '', self._register(func, self._substitute), _string.join(self._subst_format)) apply(self.tk.call, what + (sequence, cmd)) elif func == '': apply(self.tk.call, wha...
5ac00ac1403e4d0981c5042cc76cd09ae6de2570 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5ac00ac1403e4d0981c5042cc76cd09ae6de2570/Tkinter.py
return self._bind(('bind', 'all'), sequence, func, add)
return self._bind(('bind', 'all'), sequence, func, add, 0)
def bind_all(self, sequence=None, func=None, add=None): return self._bind(('bind', 'all'), sequence, func, add)
5ac00ac1403e4d0981c5042cc76cd09ae6de2570 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5ac00ac1403e4d0981c5042cc76cd09ae6de2570/Tkinter.py
return self._bind(('bind', className), sequence, func, add)
return self._bind(('bind', className), sequence, func, add, 0)
def bind_class(self, className, sequence=None, func=None, add=None): return self._bind(('bind', className), sequence, func, add)
5ac00ac1403e4d0981c5042cc76cd09ae6de2570 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5ac00ac1403e4d0981c5042cc76cd09ae6de2570/Tkinter.py
def _register(self, func, subst=None):
def _register(self, func, subst=None, needcleanup=1):
def _register(self, func, subst=None): f = CallWrapper(func, subst, self).__call__ name = `id(f)` try: func = func.im_func except AttributeError: pass try: name = name + func.__name__ except AttributeError: pass self.tk.createcommand(name, f) if self._tclCommands is None: self._tclCommands = [] self._tclCommands.append...
5ac00ac1403e4d0981c5042cc76cd09ae6de2570 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5ac00ac1403e4d0981c5042cc76cd09ae6de2570/Tkinter.py
if self._tclCommands is None: self._tclCommands = [] self._tclCommands.append(name)
if needcleanup: if self._tclCommands is None: self._tclCommands = [] self._tclCommands.append(name)
def _register(self, func, subst=None): f = CallWrapper(func, subst, self).__call__ name = `id(f)` try: func = func.im_func except AttributeError: pass try: name = name + func.__name__ except AttributeError: pass self.tk.createcommand(name, f) if self._tclCommands is None: self._tclCommands = [] self._tclCommands.append...
5ac00ac1403e4d0981c5042cc76cd09ae6de2570 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5ac00ac1403e4d0981c5042cc76cd09ae6de2570/Tkinter.py
self.announce('Building RPMs') rpm_args = ['rpm',]
self.announce('building RPMs') rpm_cmd = ['rpm']
def run (self):
d0e4b42ee241b29cc924b18f4c1efd29723c85cf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d0e4b42ee241b29cc924b18f4c1efd29723c85cf/bdist_rpm.py
rpm_args.append('-bs')
rpm_cmd.append('-bs')
def run (self):
d0e4b42ee241b29cc924b18f4c1efd29723c85cf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d0e4b42ee241b29cc924b18f4c1efd29723c85cf/bdist_rpm.py
rpm_args.append('-bb')
rpm_cmd.append('-bb')
def run (self):
d0e4b42ee241b29cc924b18f4c1efd29723c85cf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d0e4b42ee241b29cc924b18f4c1efd29723c85cf/bdist_rpm.py
rpm_args.append('-ba')
rpm_cmd.append('-ba')
def run (self):
d0e4b42ee241b29cc924b18f4c1efd29723c85cf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d0e4b42ee241b29cc924b18f4c1efd29723c85cf/bdist_rpm.py
rpm_args.extend(['--define',
rpm_cmd.extend(['--define',
def run (self):
d0e4b42ee241b29cc924b18f4c1efd29723c85cf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d0e4b42ee241b29cc924b18f4c1efd29723c85cf/bdist_rpm.py
rpm_args.append('--clean') rpm_args.append(spec_path) self.spawn(rpm_args)
rpm_cmd.append('--clean') rpm_cmd.append(spec_path) self.spawn(rpm_cmd)
def run (self):
d0e4b42ee241b29cc924b18f4c1efd29723c85cf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d0e4b42ee241b29cc924b18f4c1efd29723c85cf/bdist_rpm.py
def_build = 'env CFLAGS="$RPM_OPT_FLAGS" python setup.py build' else: def_build = 'python setup.py build'
def_build = 'env CFLAGS="$RPM_OPT_FLAGS" ' + def_build
def _make_spec_file(self): """Generate the text of an RPM spec file and return it as a list of strings (one per line). """ # definitions and headers spec_file = [ '%define name ' + self.distribution.get_name(), '%define version ' + self.distribution.get_version(), '%define release ' + self.release, '', 'Summary: ' + se...
d0e4b42ee241b29cc924b18f4c1efd29723c85cf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d0e4b42ee241b29cc924b18f4c1efd29723c85cf/bdist_rpm.py
"python setup.py install " "--root=$RPM_BUILD_ROOT " "--record=INSTALLED_FILES"),
("%s setup.py install " "--root=$RPM_BUILD_ROOT " "--record=INSTALLED_FILES") % self.python),
def _make_spec_file(self): """Generate the text of an RPM spec file and return it as a list of strings (one per line). """ # definitions and headers spec_file = [ '%define name ' + self.distribution.get_name(), '%define version ' + self.distribution.get_version(), '%define release ' + self.release, '', 'Summary: ' + se...
d0e4b42ee241b29cc924b18f4c1efd29723c85cf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d0e4b42ee241b29cc924b18f4c1efd29723c85cf/bdist_rpm.py
QSIZE = 16 TIME = 5
format = SV.RGB8_FRAMES qsize = 2
def main(): QSIZE = 16 TIME = 5 audio = 0 num, den = 1, 1 opts, args = getopt.getopt(sys.argv[1:], 'aq:r:t:') for opt, arg in opts: if opt == '-a': audio = 1 elif opt == '-q': QSIZE = string.atoi(arg) elif opt == '-r': [nstr, dstr] = string.splitfields(arg, '/') num, den = string.atoi(nstr), string.atoi(dstr) elif opt...
62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a/Vrec.py
num, den = 1, 1 opts, args = getopt.getopt(sys.argv[1:], 'aq:r:t:')
rate = 2 opts, args = getopt.getopt(sys.argv[1:], 'aq:r:')
def main(): QSIZE = 16 TIME = 5 audio = 0 num, den = 1, 1 opts, args = getopt.getopt(sys.argv[1:], 'aq:r:t:') for opt, arg in opts: if opt == '-a': audio = 1 elif opt == '-q': QSIZE = string.atoi(arg) elif opt == '-r': [nstr, dstr] = string.splitfields(arg, '/') num, den = string.atoi(nstr), string.atoi(dstr) elif opt...
62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a/Vrec.py
QSIZE = string.atoi(arg)
qsize = string.atoi(arg)
def main(): QSIZE = 16 TIME = 5 audio = 0 num, den = 1, 1 opts, args = getopt.getopt(sys.argv[1:], 'aq:r:t:') for opt, arg in opts: if opt == '-a': audio = 1 elif opt == '-q': QSIZE = string.atoi(arg) elif opt == '-r': [nstr, dstr] = string.splitfields(arg, '/') num, den = string.atoi(nstr), string.atoi(dstr) elif opt...
62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a/Vrec.py
[nstr, dstr] = string.splitfields(arg, '/') num, den = string.atoi(nstr), string.atoi(dstr) elif opt == '-t': TIME = string.atoi(arg)
rate = string.atoi(arg) if rate < 2: sys.stderr.write('-r rate must be >= 2\n') sys.exit(2)
def main(): QSIZE = 16 TIME = 5 audio = 0 num, den = 1, 1 opts, args = getopt.getopt(sys.argv[1:], 'aq:r:t:') for opt, arg in opts: if opt == '-a': audio = 1 elif opt == '-q': QSIZE = string.atoi(arg) elif opt == '-r': [nstr, dstr] = string.splitfields(arg, '/') num, den = string.atoi(nstr), string.atoi(dstr) elif opt...
62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a/Vrec.py
v.BindGLWindow(win, SV.IN_REPLACE)
def main(): QSIZE = 16 TIME = 5 audio = 0 num, den = 1, 1 opts, args = getopt.getopt(sys.argv[1:], 'aq:r:t:') for opt, arg in opts: if opt == '-a': audio = 1 elif opt == '-q': QSIZE = string.atoi(arg) elif opt == '-r': [nstr, dstr] = string.splitfields(arg, '/') num, den = string.atoi(nstr), string.atoi(dstr) elif opt...
62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a/Vrec.py
v.SetCaptureFormat(SV.RGB_FRAMES) v.SetCaptureMode(SV.BLOCKING_CAPTURE) v.SetQueueSize(QSIZE) v.InitCapture() if v.GetQueueSize() != QSIZE: QSIZE = v.GetQueueSize() print 'Warning: QSIZE reduced to', QSIZE
def main(): QSIZE = 16 TIME = 5 audio = 0 num, den = 1, 1 opts, args = getopt.getopt(sys.argv[1:], 'aq:r:t:') for opt, arg in opts: if opt == '-a': audio = 1 elif opt == '-q': QSIZE = string.atoi(arg) elif opt == '-r': [nstr, dstr] = string.splitfields(arg, '/') num, den = string.atoi(nstr), string.atoi(dstr) elif opt...
62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a/Vrec.py
recorded = 0
def main(): QSIZE = 16 TIME = 5 audio = 0 num, den = 1, 1 opts, args = getopt.getopt(sys.argv[1:], 'aq:r:t:') for opt, arg in opts: if opt == '-a': audio = 1 elif opt == '-q': QSIZE = string.atoi(arg) elif opt == '-r': [nstr, dstr] = string.splitfields(arg, '/') num, den = string.atoi(nstr), string.atoi(dstr) elif opt...
62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a/Vrec.py
if recorded: gl.ringbell() continue gl.prefsize(x, y) gl.winconstraints() record(v, filename, audiofilename) recorded = 1 print 'Wait until "Done writing" is printed!'
info = format, x, y, qsize, rate record(v, info, filename, audiofilename)
def main(): QSIZE = 16 TIME = 5 audio = 0 num, den = 1, 1 opts, args = getopt.getopt(sys.argv[1:], 'aq:r:t:') for opt, arg in opts: if opt == '-a': audio = 1 elif opt == '-q': QSIZE = string.atoi(arg) elif opt == '-r': [nstr, dstr] = string.splitfields(arg, '/') num, den = string.atoi(nstr), string.atoi(dstr) elif opt...
62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a/Vrec.py
if not recorded: x, y = gl.getsize() print x, 'x', y v.SetSize(x, y) v.BindGLWindow(win, SV.IN_REPLACE)
x, y = gl.getsize() print x, 'x', y v.SetSize(x, y) v.BindGLWindow(win, SV.IN_REPLACE)
def main(): QSIZE = 16 TIME = 5 audio = 0 num, den = 1, 1 opts, args = getopt.getopt(sys.argv[1:], 'aq:r:t:') for opt, arg in opts: if opt == '-a': audio = 1 elif opt == '-q': QSIZE = string.atoi(arg) elif opt == '-r': [nstr, dstr] = string.splitfields(arg, '/') num, den = string.atoi(nstr), string.atoi(dstr) elif opt...
62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a/Vrec.py
if not recorded: posix._exit(0) v.EndCapture()
def main(): QSIZE = 16 TIME = 5 audio = 0 num, den = 1, 1 opts, args = getopt.getopt(sys.argv[1:], 'aq:r:t:') for opt, arg in opts: if opt == '-a': audio = 1 elif opt == '-q': QSIZE = string.atoi(arg) elif opt == '-r': [nstr, dstr] = string.splitfields(arg, '/') num, den = string.atoi(nstr), string.atoi(dstr) elif opt...
62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a/Vrec.py
def record(v, filename, audiofilename):
def record(v, info, filename, audiofilename):
def record(v, filename, audiofilename): import thread x, y = gl.getsize() vout = VFile.VoutFile().init(filename) vout.format = 'rgb8' vout.width = x vout.height = y vout.writeheader() buffer = [] thread.start_new_thread(saveframes, (vout, buffer)) if audiofilename: initaudio(audiofilename, buffer) gl.wintitle('(rec) ' ...
62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a/Vrec.py
x, y = gl.getsize()
format, x, y, qsize, rate = info fps = 59.64 tpf = 1000.0 / fps
def record(v, filename, audiofilename): import thread x, y = gl.getsize() vout = VFile.VoutFile().init(filename) vout.format = 'rgb8' vout.width = x vout.height = y vout.writeheader() buffer = [] thread.start_new_thread(saveframes, (vout, buffer)) if audiofilename: initaudio(audiofilename, buffer) gl.wintitle('(rec) ' ...
62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a/Vrec.py
buffer = [] thread.start_new_thread(saveframes, (vout, buffer))
MAXSIZE = 20 import Queue queue = Queue.Queue().init(MAXSIZE) done = thread.allocate_lock() done.acquire_lock() thread.start_new_thread(saveframes, (vout, queue, done))
def record(v, filename, audiofilename): import thread x, y = gl.getsize() vout = VFile.VoutFile().init(filename) vout.format = 'rgb8' vout.width = x vout.height = y vout.writeheader() buffer = [] thread.start_new_thread(saveframes, (vout, buffer)) if audiofilename: initaudio(audiofilename, buffer) gl.wintitle('(rec) ' ...
62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a/Vrec.py
initaudio(audiofilename, buffer)
audiodone = thread.allocate_lock() audiodone.acquire_lock() audiostop = [] initaudio(audiofilename, audiostop, audiodone)
def record(v, filename, audiofilename): import thread x, y = gl.getsize() vout = VFile.VoutFile().init(filename) vout.format = 'rgb8' vout.width = x vout.height = y vout.writeheader() buffer = [] thread.start_new_thread(saveframes, (vout, buffer)) if audiofilename: initaudio(audiofilename, buffer) gl.wintitle('(rec) ' ...
62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a/Vrec.py
v.StartCapture()
lastid = 0
def record(v, filename, audiofilename): import thread x, y = gl.getsize() vout = VFile.VoutFile().init(filename) vout.format = 'rgb8' vout.width = x vout.height = y vout.writeheader() buffer = [] thread.start_new_thread(saveframes, (vout, buffer)) if audiofilename: initaudio(audiofilename, buffer) gl.wintitle('(rec) ' ...
62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a/Vrec.py
if v.GetCaptured() > 2: t = time.millitimer() - t0 cd, st = v.GetCaptureData() data = cd.interleave(x, y) cd.UnlockCaptureData() buffer.append(data, t) else: time.millisleep(10) v.StopCapture() while v.GetCaptured() > 0: t = time.millitimer() - t0 cd, st = v.GetCaptureData() data = cd.interleave(x, y)
try: cd, id = v.GetCaptureData() except RuntimeError: time.millisleep(10) continue id = id + 2*rate lastid = id data = cd.InterleaveFields(1)
def record(v, filename, audiofilename): import thread x, y = gl.getsize() vout = VFile.VoutFile().init(filename) vout.format = 'rgb8' vout.width = x vout.height = y vout.writeheader() buffer = [] thread.start_new_thread(saveframes, (vout, buffer)) if audiofilename: initaudio(audiofilename, buffer) gl.wintitle('(rec) ' ...
62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a/Vrec.py
buffer.append(data, t) buffer.append(None)
queue.put(data, int(id*tpf)) t1 = time.millitimer() gl.wintitle('(busy) ' + filename) print lastid, 'fields in', t1-t0, 'msec', print '--', 0.1 * int(lastid * 10000.0 / (t1-t0)), 'fields/sec' if audiofilename: audiostop.append(None) audiodone.acquire_lock() v.EndContinuousCapture() queue.put(None) done.acquire_lock()
def record(v, filename, audiofilename): import thread x, y = gl.getsize() vout = VFile.VoutFile().init(filename) vout.format = 'rgb8' vout.width = x vout.height = y vout.writeheader() buffer = [] thread.start_new_thread(saveframes, (vout, buffer)) if audiofilename: initaudio(audiofilename, buffer) gl.wintitle('(rec) ' ...
62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a/Vrec.py
def saveframes(vout, buffer):
def saveframes(vout, queue, done):
def saveframes(vout, buffer): while 1: if not buffer: time.millisleep(10) else: x = buffer[0] if not x: break del buffer[0] data, t = x vout.writeframe(t, data, None) del data sys.stderr.write('Done writing\n') vout.close()
62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a/Vrec.py
if not buffer: time.millisleep(10) else: x = buffer[0] if not x: break del buffer[0] data, t = x vout.writeframe(t, data, None) del data sys.stderr.write('Done writing\n')
x = queue.get() if not x: break data, t = x vout.writeframe(t, data, None) del data sys.stderr.write('Done writing video\n')
def saveframes(vout, buffer): while 1: if not buffer: time.millisleep(10) else: x = buffer[0] if not x: break del buffer[0] data, t = x vout.writeframe(t, data, None) del data sys.stderr.write('Done writing\n') vout.close()
62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a/Vrec.py
AQSIZE = 8000 def initaudio(filename, buffer):
AQSIZE = 8000 def initaudio(filename, stop, done):
def saveframes(vout, buffer): while 1: if not buffer: time.millisleep(10) else: x = buffer[0] if not x: break del buffer[0] data, t = x vout.writeframe(t, data, None) del data sys.stderr.write('Done writing\n') vout.close()
62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a/Vrec.py
thread.start_new_thread(audiorecord, (afile, aport, buffer))
thread.start_new_thread(audiorecord, (afile, aport, stop, done))
def initaudio(filename, buffer): import thread, aiff afile = aiff.Aiff().init(filename, 'w') afile.nchannels = AL.MONO afile.sampwidth = AL.SAMPLE_8 params = [AL.INPUT_RATE, 0] al.getparams(AL.DEFAULT_DEVICE, params) print 'audio sampling rate =', params[1] afile.samprate = params[1] c = al.newconfig() c.setchannels(AL...
62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a/Vrec.py
def audiorecord(afile, aport, buffer): while buffer[-1:] <> [None]:
def audiorecord(afile, aport, stop, done): while not stop:
def audiorecord(afile, aport, buffer): while buffer[-1:] <> [None]: data = aport.readsamps(AQSIZE/2)
62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a/Vrec.py
z = zipfile.ZipFile (base_dir + ".zip", "wb", compression=zipfile.ZIP_DEFLATED)
z = zipfile.ZipFile (base_dir + ".zip", "wb", compression=zipfile.ZIP_DEFLATED)
def make_zipfile (self, base_dir):
9f200cbaa607675014d0aa297b11d13f5c4709a7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9f200cbaa607675014d0aa297b11d13f5c4709a7/dist.py
sys.path.append('/ufs/guido/src/video')
sys.path.append('/ufs/jack/src/av/video')
def help(): print 'Usage: video2rgb [options] [file] ...' print print 'Options:' print '-q : quiet, no informative messages' print '-m : create monochrome (greyscale) image files' print '-f prefix : create image files with names "prefix0000.rgb"' print 'file ... : file(s) to convert; default film.vid...
c82cfc86df16f9f6e72654f0b8912c78e4b0eada /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c82cfc86df16f9f6e72654f0b8912c78e4b0eada/video2rgb.py
start = min(start, len(lines) - context)
start = max(0, min(start, len(lines) - context))
def getframeinfo(frame, context=1): """Get information about a frame or traceback object. A tuple of five things is returned: the filename, the line number of the current line, the function name, a list of lines of context from the source code, and the index of the current line within that list. The optional second ar...
a050171ee9e44697260cd5415310777dadb5555e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a050171ee9e44697260cd5415310777dadb5555e/inspect.py
print "Can't copy %s to %s: %s" % (`srcname`, `dstname`, str(why))
errors.append((srcname, dstname, why)) if errors: raise Error, errors
def copytree(src, dst, symlinks=0): """Recursively copy a directory tree using copy2(). The destination directory must not already exist. Error are reported to standard output. If the optional symlinks flag is true, symbolic links in the source tree result in symbolic links in the destination tree; if it is false, th...
e9ce0b0fea16453cb8d75ecac02669998cc7ff36 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e9ce0b0fea16453cb8d75ecac02669998cc7ff36/shutil.py
return '\n'.join(output)
return '\n'.join(output) + '\n'
def script_from_examples(s): r"""Extract script from text with examples. Converts text with examples to a Python script. Example input is converted to regular code. Example output and all other words are converted to comments: >>> text = ''' ... Here are examples of simple math. ... ... Python has s...
1f149642c9940662f45004a0bf5f5b05034aa67b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1f149642c9940662f45004a0bf5f5b05034aa67b/doctest.py
if self.license: self.licence = 1
def parse_command_line (self, args): """Parse the setup script's command line: set any Distribution attributes tied to command-line options, create all command objects, and set their options from the command-line. 'args' must be a list of command-line arguments, most likely 'sys.argv[1:]' (see the 'setup()' function)....
58ec6ede20d0b632f8325e1363aaa6e445ad61ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/58ec6ede20d0b632f8325e1363aaa6e445ad61ef/dist.py
assert sCursor.set('red')
tmp = sCursor.set('red') assert tmp
def test01_join(self): if verbose: print '\n', '-=' * 30 print "Running %s.test01_join..." % \ self.__class__.__name__
e676c5ef3ed8a34431f1c30cf91ef67ab70c6d4e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e676c5ef3ed8a34431f1c30cf91ef67ab70c6d4e/test_join.py
if _active:
if _active is not None:
def __del__(self): # In case the child hasn't been waited on, check if it's done. self.poll(_deadstate=sys.maxint) if self.sts < 0: if _active: # Child is still running, keep us alive until we can wait on it. _active.append(self)
4085f1499c55b38343b86ced4b67b7382ffbecc3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4085f1499c55b38343b86ced4b67b7382ffbecc3/popen2.py
currentThread()
def wait(self, timeout=None): currentThread() # for side-effect assert self._is_owned(), "wait() of un-acquire()d lock" waiter = _allocate_lock() waiter.acquire() self.__waiters.append(waiter) saved_state = self._release_save() try: # restore state no matter what (e.g., KeyboardInterrupt) if timeout is None: waiter....
4b6b7f151501eaee0af46220553c78607474e420 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4b6b7f151501eaee0af46220553c78607474e420/threading.py
currentThread()
def notify(self, n=1): currentThread() # for side-effect assert self._is_owned(), "notify() of un-acquire()d lock" __waiters = self.__waiters waiters = __waiters[:n] if not waiters: if __debug__: self._note("%s.notify(): no waiters", self) return self._note("%s.notify(): notifying %d waiter%s", self, n, n!=1 and "s" or...
4b6b7f151501eaee0af46220553c78607474e420 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4b6b7f151501eaee0af46220553c78607474e420/threading.py
matches = (['class', name], ['class', name + ':'])
pat = re.compile(r'^\s*class\s*' + name + r'\b')
def findsource(object): """Return the entire source file and starting line number for an object. The argument may be a module, class, method, function, traceback, frame, or code object. The source code is returned as a list of all the lines in the file and the line number indexes a line in that list. An IOError is r...
a6e59719ec611a012227719e7d3ed1730601cca9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a6e59719ec611a012227719e7d3ed1730601cca9/inspect.py
if string.split(lines[i])[:2] in matches: return lines, i
if pat.match(lines[i]): return lines, i
def findsource(object): """Return the entire source file and starting line number for an object. The argument may be a module, class, method, function, traceback, frame, or code object. The source code is returned as a list of all the lines in the file and the line number indexes a line in that list. An IOError is r...
a6e59719ec611a012227719e7d3ed1730601cca9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a6e59719ec611a012227719e7d3ed1730601cca9/inspect.py
if string.split(lines[lnum])[:1] == ['def']: break
if pat.match(lines[lnum]): break
def findsource(object): """Return the entire source file and starting line number for an object. The argument may be a module, class, method, function, traceback, frame, or code object. The source code is returned as a list of all the lines in the file and the line number indexes a line in that list. An IOError is r...
a6e59719ec611a012227719e7d3ed1730601cca9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a6e59719ec611a012227719e7d3ed1730601cca9/inspect.py
elif self.header_encoding is QP:
elif self.body_encoding is QP:
def body_encode(self, s, convert=True): """Body-encode a string and convert it to output_charset.
3d57589f0fe4e682df2961294b5cf23571cab70f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3d57589f0fe4e682df2961294b5cf23571cab70f/Charset.py
if address[0] == '<' and address[-1] == '>' and address != '<>':
if not address: pass elif address[0] == '<' and address[-1] == '>' and address != '<>':
def __getaddr(self, keyword, arg): address = None keylen = len(keyword) if arg[:keylen].upper() == keyword: address = arg[keylen:].strip() if address[0] == '<' and address[-1] == '>' and address != '<>': # Addresses can be in the form <person@dom.com> but watch out # for null address, e.g. <> address = address[1:-1] re...
ebf5427bfacae1c0bc497410626cbb3e995dc214 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ebf5427bfacae1c0bc497410626cbb3e995dc214/smtpd.py
Node.debug=open( "debug4.out", "w" )
Node.debug=StringIO()
def __init__( self ): self.childNodes=[] if Node._debug: index=repr( id( self ))+repr( self.__class__ ) Node.allnodes[index]=repr( self.__dict__ ) if Node.debug==None: Node.debug=open( "debug4.out", "w" ) Node.debug.write( "create %s\n"%index )
1e68827c8fa95d10df3c805e5dd8383b19048b18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1e68827c8fa95d10df3c805e5dd8383b19048b18/minidom.py
if type( attname_or_tuple ) == type( () ):
if type( attname_or_tuple ) == types.TupleType:
def __getitem__( self, attname_or_tuple ): if type( attname_or_tuple ) == type( () ): return self._attrsNS[attname_or_tuple] else: return self._attrs[attname_or_tuple]
1e68827c8fa95d10df3c805e5dd8383b19048b18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1e68827c8fa95d10df3c805e5dd8383b19048b18/minidom.py
def __setitem__( self, attname ): raise TypeError, "object does not support item assignment"
def __setitem__( self, attname, value ): if type( value ) == types.StringType: node=Attr( attname ) node.value=value else: assert isinstance( value, Attr ) or type( value )==types.StringType node=value old=self._attrs.get( attname, None) if old: old.unlink() self._attrs[node.name]=node self._attrsNS[(node.namespaceURI...
def __setitem__( self, attname ): raise TypeError, "object does not support item assignment"
1e68827c8fa95d10df3c805e5dd8383b19048b18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1e68827c8fa95d10df3c805e5dd8383b19048b18/minidom.py
'sys_prefix': sysconfig.PREFIX, 'sys_exec_prefix': sysconfig.EXEC_PREFIX,
'sys_prefix': prefix, 'prefix': prefix, 'sys_exec_prefix': exec_prefix, 'exec_prefix': exec_prefix,
def finalize_options (self):
9bd3e9b6b260ac249024c426ec62133e05919f10 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9bd3e9b6b260ac249024c426ec62133e05919f10/install.py
verify(L == ['Commented Bar', 'Foo Bar', 'Internationalized Stuff', 'Spacey Bar'],
verify(L == [r'Commented Bar', r'Foo Bar', r'Internationalized Stuff', r'Section\with$weird%characters[' '\t', r'Spacey Bar', ],
def basic(src): print "Testing basic accessors..." cf = ConfigParser.ConfigParser() sio = StringIO.StringIO(src) cf.readfp(sio) L = cf.sections() L.sort() verify(L == ['Commented Bar', 'Foo Bar', 'Internationalized Stuff', 'Spacey Bar'], "unexpected list of section names") # The use of spaces in the section names serv...
cc1f951b4c4e100979897655c4b8c12f3334936e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cc1f951b4c4e100979897655c4b8c12f3334936e/test_cfgparser.py
def range(*a): if len(a) == 1: start, stop, step = 0, a[0], 1 elif len(a) == 2: start, stop = a step = 1 elif len(a) == 3: start, stop, step = a else: raise TypeError, 'range() needs 1-3 arguments' return Range(start, stop, step)
def genrange(*a): """Function to implement 'range' as a generator""" start, stop, step = handleargs(a) value = start while value < stop: yield value value += step
def range(*a): if len(a) == 1: start, stop, step = 0, a[0], 1 elif len(a) == 2: start, stop = a step = 1 elif len(a) == 3: start, stop, step = a else: raise TypeError, 'range() needs 1-3 arguments' return Range(start, stop, step)
c2b151c66ee9bc6e686400ee93e65e07d1999888 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2b151c66ee9bc6e686400ee93e65e07d1999888/Range.py
Done using the old way (pre-iterators; __len__ and __getitem__) to have an object be used by a 'for' loop.
def range(*a): if len(a) == 1: start, stop, step = 0, a[0], 1 elif len(a) == 2: start, stop = a step = 1 elif len(a) == 3: start, stop, step = a else: raise TypeError, 'range() needs 1-3 arguments' return Range(start, stop, step)
c2b151c66ee9bc6e686400ee93e65e07d1999888 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2b151c66ee9bc6e686400ee93e65e07d1999888/Range.py
class Range:
"""
def range(*a): if len(a) == 1: start, stop, step = 0, a[0], 1 elif len(a) == 2: start, stop = a step = 1 elif len(a) == 3: start, stop, step = a else: raise TypeError, 'range() needs 1-3 arguments' return Range(start, stop, step)
c2b151c66ee9bc6e686400ee93e65e07d1999888 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2b151c66ee9bc6e686400ee93e65e07d1999888/Range.py
def __init__(self, start, stop, step): if step == 0: raise ValueError, 'range() called with zero step' self.start = start self.stop = stop self.step = step self.len = max(0, int((self.stop - self.start) / self.step))
def __init__(self, *a): """ Initialize start, stop, and step values along with calculating the nubmer of values (what __len__ will return) in the range""" self.start, self.stop, self.step = handleargs(a) self.len = max(0, (self.stop - self.start) // self.step)
def range(*a): if len(a) == 1: start, stop, step = 0, a[0], 1 elif len(a) == 2: start, stop = a step = 1 elif len(a) == 3: start, stop, step = a else: raise TypeError, 'range() needs 1-3 arguments' return Range(start, stop, step)
c2b151c66ee9bc6e686400ee93e65e07d1999888 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2b151c66ee9bc6e686400ee93e65e07d1999888/Range.py
def __init__(self, start, stop, step): if step == 0: raise ValueError, 'range() called with zero step' self.start = start self.stop = stop self.step = step self.len = max(0, int((self.stop - self.start) / self.step))
c2b151c66ee9bc6e686400ee93e65e07d1999888 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2b151c66ee9bc6e686400ee93e65e07d1999888/Range.py
def __repr__(self): return 'range(%r, %r, %r)' % (self.start, self.stop, self.step)
c2b151c66ee9bc6e686400ee93e65e07d1999888 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2b151c66ee9bc6e686400ee93e65e07d1999888/Range.py
def __len__(self): return self.len
c2b151c66ee9bc6e686400ee93e65e07d1999888 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2b151c66ee9bc6e686400ee93e65e07d1999888/Range.py
if 0 <= i < self.len:
"""implement x[i]""" if 0 <= i <= self.len:
def __getitem__(self, i): if 0 <= i < self.len: return self.start + self.step * i else: raise IndexError, 'range[i] index out of range'
c2b151c66ee9bc6e686400ee93e65e07d1999888 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2b151c66ee9bc6e686400ee93e65e07d1999888/Range.py
def __getitem__(self, i): if 0 <= i < self.len: return self.start + self.step * i else: raise IndexError, 'range[i] index out of range'
c2b151c66ee9bc6e686400ee93e65e07d1999888 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2b151c66ee9bc6e686400ee93e65e07d1999888/Range.py
self.plist.CFBundleExecutable = self.name
def preProcess(self): self.plist.CFBundleExecutable = self.name resdir = pathjoin("Contents", "Resources") if self.executable is not None: if self.mainprogram is None: execpath = pathjoin(self.execdir, self.name) else: execpath = pathjoin(resdir, os.path.basename(self.executable)) self.files.append((self.executable, ex...
f7aba23644d76d85815d053964dba90c63d1c811 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f7aba23644d76d85815d053964dba90c63d1c811/bundlebuilder.py
python [options] command
python bundlebuilder.py [options] command
def pathjoin(*args): """Safe wrapper for os.path.join: asserts that all but the first argument are relative paths.""" for seg in args[1:]: assert seg[0] != "/" return os.path.join(*args)
f7aba23644d76d85815d053964dba90c63d1c811 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f7aba23644d76d85815d053964dba90c63d1c811/bundlebuilder.py
def read(self, filenames):
2539451fb9ca2cb0828ee10a91ef1ef688670eb3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2539451fb9ca2cb0828ee10a91ef1ef688670eb3/ConfigParser.py
designed so that you can specifiy a list of potential
designed so that you can specify a list of potential
def read(self, filenames):
2539451fb9ca2cb0828ee10a91ef1ef688670eb3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2539451fb9ca2cb0828ee10a91ef1ef688670eb3/ConfigParser.py
index.append(keys[j], offset + len(buf))
index.append( (keys[j], offset + len(buf)) )
def addname(self, name): # Domain name packing (section 4.1.4) # Add a domain name to the buffer, possibly using pointers. # The case of the first occurrence of a name is preserved. # Redundant dots are ignored. list = [] for label in string.splitfields(name, '.'): if label: if len(label) > 63: raise PackError, 'label ...
01b3aa4d08085083c5ecc622ade790441083420f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/01b3aa4d08085083c5ecc622ade790441083420f/dnslib.py
self.fail("Error testing host resolution mechanisms. (fqdn: %s, all: %s)" % (fqdn, repr(all_host_names)))
self.fail("Error testing host resolution mechanisms. (fqdn: %s, all: %s)" % (fqhn, repr(all_host_names)))
def testHostnameRes(self): # Testing hostname resolution mechanisms hostname = socket.gethostname() try: ip = socket.gethostbyname(hostname) except socket.error: # Probably name lookup wasn't set up right; skip this test return self.assert_(ip.find('.') >= 0, "Error resolving host to ip.") try: hname, aliases, ipaddrs ...
04855cc100f2edcb58bac46f7be45e3c770b5d7d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/04855cc100f2edcb58bac46f7be45e3c770b5d7d/test_socket.py
spec_file.append('Source0: %{name}-%{version}.tar.bz2')
spec_file.append('Source0: %{name}-%{unmangled_version}.tar.bz2')
def _make_spec_file(self): """Generate the text of an RPM spec file and return it as a list of strings (one per line). """ # definitions and headers spec_file = [ '%define name ' + self.distribution.get_name(), '%define version ' + self.distribution.get_version().replace('-','_'), '%define release ' + self.release.repl...
962e4317bc925d284d960e04ef304586cabaf479 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/962e4317bc925d284d960e04ef304586cabaf479/bdist_rpm.py
spec_file.append('Source0: %{name}-%{version}.tar.gz')
spec_file.append('Source0: %{name}-%{unmangled_version}.tar.gz')
def _make_spec_file(self): """Generate the text of an RPM spec file and return it as a list of strings (one per line). """ # definitions and headers spec_file = [ '%define name ' + self.distribution.get_name(), '%define version ' + self.distribution.get_version().replace('-','_'), '%define release ' + self.release.repl...
962e4317bc925d284d960e04ef304586cabaf479 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/962e4317bc925d284d960e04ef304586cabaf479/bdist_rpm.py
('prep', 'prep_script', "%setup"),
('prep', 'prep_script', "%setup -n %{name}-%{unmangled_version}"),
def _make_spec_file(self): """Generate the text of an RPM spec file and return it as a list of strings (one per line). """ # definitions and headers spec_file = [ '%define name ' + self.distribution.get_name(), '%define version ' + self.distribution.get_version().replace('-','_'), '%define release ' + self.release.repl...
962e4317bc925d284d960e04ef304586cabaf479 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/962e4317bc925d284d960e04ef304586cabaf479/bdist_rpm.py
def buildappbundle(executable, output=None, copyfunc=None, creator=None, plist=None, nib=None, resources=None): if not output: output = os.path.split(executable)[1] + '.app' if not copyfunc: copyfunc = shutil.copy2 if not creator: creator='????' if not resources: resources = [] if nib: resources = resources + [nib] ...
def buildappbundle(executable, output=None, copyfunc=None, creator=None, plist=None, nib=None, resources=None): if not output: output = os.path.split(executable)[1] + '.app' if not copyfunc: copyfunc = shutil.copy2 if not creator: creator='????' if not resources: resources = [] if nib: resources = resources + [nib] # #...
224405fcfd863017b5b96c37d24251060c5683e5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/224405fcfd863017b5b96c37d24251060c5683e5/buildappbundle.py
print "buildappbundle creates an application bundle" print "Usage:" print " buildappbundle [options] executable" print "Options:" print " --output o Output file; default executable with .app appended, short -o" print " --link Symlink the executable (default: copy), short -l" print " --plist file Plist fi...
print __doc__
def usage(): print "buildappbundle creates an application bundle" print "Usage:" print " buildappbundle [options] executable" print "Options:" print " --output o Output file; default executable with .app appended, short -o" print " --link Symlink the executable (default: copy), short -l" print " --plist f...
224405fcfd863017b5b96c37d24251060c5683e5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/224405fcfd863017b5b96c37d24251060c5683e5/buildappbundle.py
output=None copyfunc=None creator=None plist=None nib=None resources=[] SHORTOPTS = "o:ln:r:p:c:?" LONGOPTS=("output=", "link", "nib=", "resource=", "plist=", "creator=", "help")
output = None symlink = 0 creator = "????" plist = None nib = None resources = [] verbosity = 0 SHORTOPTS = "o:ln:r:p:c:v?h" LONGOPTS=("output=", "link", "nib=", "resource=", "plist=", "creator=", "help", "verbose")
def main(): output=None copyfunc=None creator=None plist=None nib=None resources=[] SHORTOPTS = "o:ln:r:p:c:?" LONGOPTS=("output=", "link", "nib=", "resource=", "plist=", "creator=", "help") try: options, args = getopt.getopt(sys.argv[1:], SHORTOPTS, LONGOPTS) except getopt.error: usage() if len(args) != 1: usage() for...
224405fcfd863017b5b96c37d24251060c5683e5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/224405fcfd863017b5b96c37d24251060c5683e5/buildappbundle.py
copyfunc = os.symlink
symlink = 1
def main(): output=None copyfunc=None creator=None plist=None nib=None resources=[] SHORTOPTS = "o:ln:r:p:c:?" LONGOPTS=("output=", "link", "nib=", "resource=", "plist=", "creator=", "help") try: options, args = getopt.getopt(sys.argv[1:], SHORTOPTS, LONGOPTS) except getopt.error: usage() if len(args) != 1: usage() for...
224405fcfd863017b5b96c37d24251060c5683e5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/224405fcfd863017b5b96c37d24251060c5683e5/buildappbundle.py
elif opt in ('-?', '--help'):
elif opt in ('-v', '--verbose'): verbosity += 1 elif opt in ('-?', '-h', '--help'):
def main(): output=None copyfunc=None creator=None plist=None nib=None resources=[] SHORTOPTS = "o:ln:r:p:c:?" LONGOPTS=("output=", "link", "nib=", "resource=", "plist=", "creator=", "help") try: options, args = getopt.getopt(sys.argv[1:], SHORTOPTS, LONGOPTS) except getopt.error: usage() if len(args) != 1: usage() for...
224405fcfd863017b5b96c37d24251060c5683e5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/224405fcfd863017b5b96c37d24251060c5683e5/buildappbundle.py
buildappbundle(args[0], output=output, copyfunc=copyfunc, creator=creator, plist=plist, resources=resources)
if output is not None: builddir, bundlename = os.path.split(output) else: builddir = os.curdir bundlename = None if plist is not None: plist = Plist.fromFile(plist) builder = AppBuilder(name=bundlename, executable=executable, builddir=builddir, creator=creator, plist=plist, resources=resources, symlink=symlink, verbos...
def main(): output=None copyfunc=None creator=None plist=None nib=None resources=[] SHORTOPTS = "o:ln:r:p:c:?" LONGOPTS=("output=", "link", "nib=", "resource=", "plist=", "creator=", "help") try: options, args = getopt.getopt(sys.argv[1:], SHORTOPTS, LONGOPTS) except getopt.error: usage() if len(args) != 1: usage() for...
224405fcfd863017b5b96c37d24251060c5683e5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/224405fcfd863017b5b96c37d24251060c5683e5/buildappbundle.py
def main(): output=None copyfunc=None creator=None plist=None nib=None resources=[] SHORTOPTS = "o:ln:r:p:c:?" LONGOPTS=("output=", "link", "nib=", "resource=", "plist=", "creator=", "help") try: options, args = getopt.getopt(sys.argv[1:], SHORTOPTS, LONGOPTS) except getopt.error: usage() if len(args) != 1: usage() for...
224405fcfd863017b5b96c37d24251060c5683e5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/224405fcfd863017b5b96c37d24251060c5683e5/buildappbundle.py
codestring = open(pathname, 'r').read()
codestring = open(pathname, 'rU').read()
def _compile(pathname, timestamp): """Compile (and cache) a Python source file. The file specified by <pathname> is compiled to a code object and returned. Presuming the appropriate privileges exist, the bytecodes will be saved back to the filesystem for future imports. The source file's modification timestamp must b...
13f99d7097c23231c18049904b651956e0fd771c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/13f99d7097c23231c18049904b651956e0fd771c/imputil.py
if audioop.lin2ulaw(data[0], 1) != '\377\347\333' or \ audioop.lin2ulaw(data[1], 2) != '\377\377\377' or \ audioop.lin2ulaw(data[2], 4) != '\377\377\377':
if audioop.lin2ulaw(data[0], 1) != '\xff\xe7\xdb' or \ audioop.lin2ulaw(data[1], 2) != '\xff\xff\xff' or \ audioop.lin2ulaw(data[2], 4) != '\xff\xff\xff':
def testlin2ulaw(data): if verbose: print 'lin2ulaw' if audioop.lin2ulaw(data[0], 1) != '\377\347\333' or \ audioop.lin2ulaw(data[1], 2) != '\377\377\377' or \ audioop.lin2ulaw(data[2], 4) != '\377\377\377': return 0 return 1
fa86907aae0178ae93df4e7df3629df748f462b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fa86907aae0178ae93df4e7df3629df748f462b5/test_audioop.py
mode = (os.stat(file)[ST_MODE]) | 0111
mode = ((os.stat(file)[ST_MODE]) | 0111) & 07777
def run (self): if not self.skip_build: self.run_command('build_scripts') self.outfiles = self.copy_tree(self.build_dir, self.install_dir) if os.name == 'posix': # Set the executable bits (owner, group, and world) on # all the scripts we just installed. for file in self.get_outputs(): if self.dry_run: self.announce("ch...
b24231e088ad8c0b99ded3294dc0b1f4c671d38b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b24231e088ad8c0b99ded3294dc0b1f4c671d38b/install_scripts.py
os.chmod(p, stat.S_IMODE(st.st_mode) | stat.S_IXGRP)
os.chmod(p, stat.S_IMODE(st.st_mode) | stat.S_IWGRP) os.chown(p, -1, gid)
def buildPython(): print "Building a universal python" buildDir = os.path.join(WORKDIR, '_bld', 'python') rootDir = os.path.join(WORKDIR, '_root') if os.path.exists(buildDir): shutil.rmtree(buildDir) if os.path.exists(rootDir): shutil.rmtree(rootDir) os.mkdir(buildDir) os.mkdir(rootDir) os.mkdir(os.path.join(rootDir,...
74d3eef73ee22d198245094d765b4b7a1b5b2cd6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/74d3eef73ee22d198245094d765b4b7a1b5b2cd6/build-installer.py
wordlist.sort(lambda a, b: len(b[1])-len(a[1]))
def cmpwords((aword, alist),(bword, blist)): r = -cmp(len(alist),len(blist)) if r: return r return cmp(aword, bword) wordlist.sort(cmpwords)
def makeunicodename(unicode, trace): FILE = "Modules/unicodename_db.h" print "--- Preparing", FILE, "..." # collect names names = [None] * len(unicode.chars) for char in unicode.chars: record = unicode.table[char] if record: name = record[1].strip() if name and name[0] != "<": names[char] = name + chr(0) print len...
97225da29afabd4f5421f649257c3c9b088ccdd0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/97225da29afabd4f5421f649257c3c9b088ccdd0/makeunicodedata.py
def __init__(self, filename, exclusions, expand=1): file = open(filename) table = [None] * 0x110000 while 1: s = file.readline() if not s: break s = s.strip().split(";") char = int(s[0], 16) table[char] = s
97225da29afabd4f5421f649257c3c9b088ccdd0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/97225da29afabd4f5421f649257c3c9b088ccdd0/makeunicodedata.py
for i in range(0, 0xD800):
for i in range(0, 0x110000):
def __init__(self, filename, exclusions, expand=1): file = open(filename) table = [None] * 0x110000 while 1: s = file.readline() if not s: break s = s.strip().split(";") char = int(s[0], 16) table[char] = s
97225da29afabd4f5421f649257c3c9b088ccdd0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/97225da29afabd4f5421f649257c3c9b088ccdd0/makeunicodedata.py
ix = h & 0xff000000
ix = h & 0xff000000L
def myhash(s, magic): h = 0 for c in map(ord, s.upper()): h = (h * magic) + c ix = h & 0xff000000 if ix: h = (h ^ ((ix>>24) & 0xff)) & 0x00ffffff return h
97225da29afabd4f5421f649257c3c9b088ccdd0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/97225da29afabd4f5421f649257c3c9b088ccdd0/makeunicodedata.py
class Backquote(Node): def __init__(self, expr, lineno=None): self.expr = expr self.lineno = lineno def getChildren(self): return self.expr, def getChildNodes(self): return self.expr, def __repr__(self): return "Backquote(%s)" % (repr(self.expr),)
def __repr__(self): return "AugAssign(%s, %s, %s)" % (repr(self.node), repr(self.op), repr(self.expr))
ecfd0b2f3bfd622c3ba148e53d3feebb8c1ae721 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ecfd0b2f3bfd622c3ba148e53d3feebb8c1ae721/ast.py
if map(max, Squares(3), Squares(2)) != [0, 1, None]:
if map(max, Squares(3), Squares(2)) != [0, 1, 4]:
def plus(*v): accu = 0 for i in v: accu = accu + i return accu
38f0223c9cf8d157c596c2e4622a36aa29f4bd84 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/38f0223c9cf8d157c596c2e4622a36aa29f4bd84/test_b1.py
import regex prefix_cache = {} def prefix_regex (needle): if prefix_cache.has_key (needle): return prefix_cache[needle] else: reg = needle[-1] for i in range(1,len(needle)): reg = '%c\(%s\)?' % (needle[-(i+1)], reg) reg = regex.compile (reg+'$') prefix_cache[needle] = reg, len(needle) return reg, len(ne...
def pop (self): if self.list: result = self.list[0] del self.list[0] return (1, result) else: return (0, None)
d305f515f9c4e3cedb3e47ec2711f1dd2a99ceb5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d305f515f9c4e3cedb3e47ec2711f1dd2a99ceb5/asynchat.py
s = ''
s = []
def _safe_read(self, amt): """Read the number of bytes requested, compensating for partial reads.
80ba8e85490515c293959a4196cbd99b1b3819a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/80ba8e85490515c293959a4196cbd99b1b3819a2/httplib.py
chunk = self.fp.read(amt)
chunk = self.fp.read(min(amt, MAXAMOUNT))
def _safe_read(self, amt): """Read the number of bytes requested, compensating for partial reads.
80ba8e85490515c293959a4196cbd99b1b3819a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/80ba8e85490515c293959a4196cbd99b1b3819a2/httplib.py