rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
args = req.args.get('args', [()])[0] if args != (): args = json.parse(args) kwargs = req.args.get('kw', [{}])[0] if kwargs != {}: kwargs = json.parse(kwargs)
args, kwargs = json.parse(req.content.read())
def renderHTTP(self, ctx): req = inevow.IRequest(ctx) try: d = self.livePage.addTransport(req) except defer.QueueOverflow: log.msg("Fast transport-close path") d = defer.succeed('') args = req.args.get('args', [()])[0] if args != (): args = json.parse(args) kwargs = req.args.get('kw', [{}])[0] if kwargs != {}: kwargs =...
6c5638f204c18e9e3c87b0b1d171c3c020212136 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7162/6c5638f204c18e9e3c87b0b1d171c3c020212136/athena.py
self.deps = set(self._extractImports(file(jsFile, 'r')))
depgen = self._extractImports(file(jsFile, 'r')) self.deps = dict.fromkeys(depgen).keys()
def dependencies(self): jsFile = self.mapping[self.name] if jsFile is None: return iter(()) mtime = os.path.getmtime(jsFile) if mtime >= self.lastModified: self.deps = set(self._extractImports(file(jsFile, 'r'))) self.lastModified = mtime return self.deps
432bc3f82f4b4d22f70d117902f9d53d9599fd64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7162/432bc3f82f4b4d22f70d117902f9d53d9599fd64/athena.py
jsMod = jsMod.rsplit('.', 1)[0]
jsMod = '.'.join(jsMod.split('.')[:-1])
def getModuleForClass(self, className): if self._loadPlugins: self.mapping.update(allJavascriptPackages()) self._loadPlugins = False
432bc3f82f4b4d22f70d117902f9d53d9599fd64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7162/432bc3f82f4b4d22f70d117902f9d53d9599fd64/athena.py
modules = (dep.name for dep in self._getModuleForClass().allDependencies())
modules = [dep.name for dep in self._getModuleForClass().allDependencies()]
def render_liveFragment(self, ctx, data): modules = (dep.name for dep in self._getModuleForClass().allDependencies())
432bc3f82f4b4d22f70d117902f9d53d9599fd64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7162/432bc3f82f4b4d22f70d117902f9d53d9599fd64/athena.py
def qual(clazz): return clazz.__module__ + '.' + clazz.__name__
from twisted.python.reflect import qual, namedAny, allYourBase, accumulateBases from twisted.python.util import uniquify
def qual(clazz): return clazz.__module__ + '.' + clazz.__name__
6e22ce9f8df0be4cb1b7334c3b59483b70316f9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7162/6e22ce9f8df0be4cb1b7334c3b59483b70316f9b/util.py
def namedAny(name): """Get a fully named package, module, module-global object, or attribute. """ names = name.split('.') topLevelPackage = None moduleNames = names[:] while not topLevelPackage: try: trialname = '.'.join(moduleNames) topLevelPackage = __import__(trialname) except ImportError: import traceback i...
def namedAny(name): """Get a fully named package, module, module-global object, or attribute. """ names = name.split('.') topLevelPackage = None moduleNames = names[:] while not topLevelPackage: try: trialname = '.'.join(moduleNames) topLevelPackage = __import__(trialname) except ImportError: # if the ImportError happe...
6e22ce9f8df0be4cb1b7334c3b59483b70316f9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7162/6e22ce9f8df0be4cb1b7334c3b59483b70316f9b/util.py
if type(devname) is TupleType: docs[ele.sig_name.data] = (ele.alt_name.data, ele.description.data, []) for d in devname: docs[ele.sig_name.data][2].append(d) else: docs[ele.sig_name.data] = (ele.alt_name.data, ele.description.data, [devname])
try: if type(devname) is TupleType: docs[ele.sig_name.data] = (ele.alt_name.data, ele.description.data, []) for d in devname: docs[ele.sig_name.data][2].append(d) else: docs[ele.sig_name.data] = (ele.alt_name.data, ele.description.data, [devname]) except AttributeError: pass
def create_tabs (string): "Create a number of tabs according to the length of string" x = '' lim = (32 - len(string) + 7) / 8 if lim <= 0: lim = 1 for i in range(0, lim): x += "\t" return x
8cc2baac69d1ea93b6400bdaed234fcf4224d9e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/598/8cc2baac69d1ea93b6400bdaed234fcf4224d9e0/patch-headers.py
reg_info = ioreg_info_dict[name] reg_desc = reg_info.getElements ('DESCRIPTION')[0].getData ()
try: reg_info = ioreg_info_dict[name] try: reg_desc = reg_info.getElements ('DESCRIPTION')[0].getData () except IndexError: reg_desc = '' except KeyError: reg_info = None
def dump_ioregs (root): path = ['AVRPART', 'MEMORY', 'IO_MEMORY'] io_mem = root.getSubTree (path) ioregs = io_mem.getElements () ioreg_info_dict = gather_io_info (root) print ' <ioregisters>' # Skip the first 6 elements since they are just give start and stop # addresses. for ioreg in ioregs[6:]: name = ioreg.name...
cfd2a3e7d4b18217073422afbbf32437f59a1161 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/598/cfd2a3e7d4b18217073422afbbf32437f59a1161/Atmel2libc.py
bit_desc = bit_el.getElements ('DESCRIPTION')[0].getData () bit_access = bit_el.getElements ('ACCESS')[0].getData ()
try: bit_desc = bit_el.getElements ('DESCRIPTION')[0].getData () except IndexError: bit_desc = '' try: bit_access = bit_el.getElements ('ACCESS')[0].getData () except IndexError: bit_access = 'FIXME!'
def dump_ioregs (root): path = ['AVRPART', 'MEMORY', 'IO_MEMORY'] io_mem = root.getSubTree (path) ioregs = io_mem.getElements () ioreg_info_dict = gather_io_info (root) print ' <ioregisters>' # Skip the first 6 elements since they are just give start and stop # addresses. for ioreg in ioregs[6:]: name = ioreg.name...
cfd2a3e7d4b18217073422afbbf32437f59a1161 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/598/cfd2a3e7d4b18217073422afbbf32437f59a1161/Atmel2libc.py
nrww_start = 'nrww_start="0x%x"' % (int (data, 16))
if data == 'x': nrww_start = '' else: nrww_start = 'nrww_start="0x%x"' % (int (data, 16))
def dump_boot_info (root): path = ['AVRPART', 'MEMORY', 'BOOT_CONFIG'] info = root.getSubTree (path) if info: # The device has bootloader support. data = info.getElements ('NRWW_START_ADDR')[0].getData () if data[0] == '$': data = '0x' + data[1:] nrww_start = 'nrww_start="0x%x"' % (int (data, 16)) data = info.getEle...
cfd2a3e7d4b18217073422afbbf32437f59a1161 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/598/cfd2a3e7d4b18217073422afbbf32437f59a1161/Atmel2libc.py
nrww_end = 'nrww_end="0x%x"' % (int (data, 16))
if data == 'x': nrww_end = '' else: nrww_end = 'nrww_end="0x%x"' % (int (data, 16))
def dump_boot_info (root): path = ['AVRPART', 'MEMORY', 'BOOT_CONFIG'] info = root.getSubTree (path) if info: # The device has bootloader support. data = info.getElements ('NRWW_START_ADDR')[0].getData () if data[0] == '$': data = '0x' + data[1:] nrww_start = 'nrww_start="0x%x"' % (int (data, 16)) data = info.getEle...
cfd2a3e7d4b18217073422afbbf32437f59a1161 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/598/cfd2a3e7d4b18217073422afbbf32437f59a1161/Atmel2libc.py
rww_start = 'rww_start="0x%x"' % (int (data, 16))
if data == 'x': rww_start = '' else: rww_start = 'rww_start="0x%x"' % (int (data, 16))
def dump_boot_info (root): path = ['AVRPART', 'MEMORY', 'BOOT_CONFIG'] info = root.getSubTree (path) if info: # The device has bootloader support. data = info.getElements ('NRWW_START_ADDR')[0].getData () if data[0] == '$': data = '0x' + data[1:] nrww_start = 'nrww_start="0x%x"' % (int (data, 16)) data = info.getEle...
cfd2a3e7d4b18217073422afbbf32437f59a1161 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/598/cfd2a3e7d4b18217073422afbbf32437f59a1161/Atmel2libc.py
rww_end = 'rww_end="0x%x"' % (int (data, 16))
if data == 'x': rww_end = '' else: rww_end = 'rww_end="0x%x"' % (int (data, 16))
def dump_boot_info (root): path = ['AVRPART', 'MEMORY', 'BOOT_CONFIG'] info = root.getSubTree (path) if info: # The device has bootloader support. data = info.getElements ('NRWW_START_ADDR')[0].getData () if data[0] == '$': data = '0x' + data[1:] nrww_start = 'nrww_start="0x%x"' % (int (data, 16)) data = info.getEle...
cfd2a3e7d4b18217073422afbbf32437f59a1161 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/598/cfd2a3e7d4b18217073422afbbf32437f59a1161/Atmel2libc.py
print ' <bootloader %s %s %s' % (pagesize, nrww_start, nrww_end) print ' %s %s>' % (rww_start, rww_end)
nrww = ' %s %s' % (nrww_start, nrww_end) print ' <bootloader %s %s %s%s' % (pagesize, rww_start, rww_end, nrww)
def dump_boot_info (root): path = ['AVRPART', 'MEMORY', 'BOOT_CONFIG'] info = root.getSubTree (path) if info: # The device has bootloader support. data = info.getElements ('NRWW_START_ADDR')[0].getData () if data[0] == '$': data = '0x' + data[1:] nrww_start = 'nrww_start="0x%x"' % (int (data, 16)) data = info.getEle...
cfd2a3e7d4b18217073422afbbf32437f59a1161 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/598/cfd2a3e7d4b18217073422afbbf32437f59a1161/Atmel2libc.py
start = 'start="0x%x"' % (int (data,16))
if data == 'x': start = 'start="FIXME: Broken xml from Atmel!"' else: start = 'start="0x%x"' % (int (data,16))
def dump_boot_info (root): path = ['AVRPART', 'MEMORY', 'BOOT_CONFIG'] info = root.getSubTree (path) if info: # The device has bootloader support. data = info.getElements ('NRWW_START_ADDR')[0].getData () if data[0] == '$': data = '0x' + data[1:] nrww_start = 'nrww_start="0x%x"' % (int (data, 16)) data = info.getEle...
cfd2a3e7d4b18217073422afbbf32437f59a1161 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/598/cfd2a3e7d4b18217073422afbbf32437f59a1161/Atmel2libc.py
r = re.compile(r'
r = re.compile(r'
def create_tabs (string): "Create a number of tabs according to the length of string" x = '' lim = (32 - len(string) + 7) / 8 if lim <= 0: lim = 1 for i in range(0, lim): x += "\t" return x
7ba2e690e2778cea8f406c27b3c3c84c6e95f33c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/598/7ba2e690e2778cea8f406c27b3c3c84c6e95f33c/patch-headers.py
lastline = ''
def create_tabs (string): "Create a number of tabs according to the length of string" x = '' lim = (32 - len(string) + 7) / 8 if lim <= 0: lim = 1 for i in range(0, lim): x += "\t" return x
7ba2e690e2778cea8f406c27b3c3c84c6e95f33c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/598/7ba2e690e2778cea8f406c27b3c3c84c6e95f33c/patch-headers.py
newh = open(header, "w") for line in h:
lines = h.readlines() h.close() firstidx = 0 lastidx = -1 parseddev = parser.getContentHandler().dev for idx, line in enumerate(lines):
def create_tabs (string): "Create a number of tabs according to the length of string" x = '' lim = (32 - len(string) + 7) / 8 if lim <= 0: lim = 1 for i in range(0, lim): x += "\t" return x
7ba2e690e2778cea8f406c27b3c3c84c6e95f33c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/598/7ba2e690e2778cea8f406c27b3c3c84c6e95f33c/patch-headers.py
key = m.group(2) ele = parser.getContentHandler().dev.interrupts[key] if 1: if len(ele.description.data) > 0: newh.write("/* " + ele.description.data + " */\n") newh.write(" create_tabs(ele.sig_name.data) + "_VECTOR(" + key + ")\n") for x in ele.alt_name.data: newh.write(" create_tabs(x) + "_VECTOR(" + key + ")\n\n") ...
if firstidx == 0: firstidx = idx key = m.group(4) ele = parseddev.interrupts[key] lastidx = idx if idx > 0 and lines[idx - 1].find(ele.description.data) >= 0: if idx - 1 < firstidx: firstidx = idx - 1 if re.match('^$', lines[idx + 1]): lastidx = idx + 1 del lines[firstidx:lastidx] keys = parseddev.interrupts.k...
def create_tabs (string): "Create a number of tabs according to the length of string" x = '' lim = (32 - len(string) + 7) / 8 if lim <= 0: lim = 1 for i in range(0, lim): x += "\t" return x
7ba2e690e2778cea8f406c27b3c3c84c6e95f33c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/598/7ba2e690e2778cea8f406c27b3c3c84c6e95f33c/patch-headers.py
newh.write(line) else: newh.write(line) lastline = line
docs[ele.sig_name.data][2].append(devname) except KeyError: if type(devname) is TupleType: docs[ele.sig_name.data] = (ele.alt_name.data, ele.description.data, []) for d in devname: docs[ele.sig_name.data][2].append(d) else: docs[ele.sig_name.data] = (ele.alt_name.data, ele.description.data, [devname]) lines.insert(fi...
def create_tabs (string): "Create a number of tabs according to the length of string" x = '' lim = (32 - len(string) + 7) / 8 if lim <= 0: lim = 1 for i in range(0, lim): x += "\t" return x
7ba2e690e2778cea8f406c27b3c3c84c6e95f33c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/598/7ba2e690e2778cea8f406c27b3c3c84c6e95f33c/patch-headers.py
shutil.rmtree( outdir )
if os.path.exists( outdir ): shutil.rmtree( outdir )
def main(): print 'Deleting previous directory...', shutil.rmtree( outdir ) print 'Done!' if not os.path.exists( outdir ): print '\nCreating directory %s...' %( outdir ), os.mkdir( outdir ) print 'Done!' print '\nDownloading style sheet...', data = getData( 'http://www.yellowduck.be/ydf2/wiki/css/wakka.css' ) saveDa...
244de7fa25b723ec81e0a754e0eb9e8f418c2653 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2295/244de7fa25b723ec81e0a754e0eb9e8f418c2653/convert_wiki.py
self.file_chooser_dialog = self.xml.get_widget("file_chooser_dialog")
def __init__(self, gofoto, dir): self.gofoto = gofoto self.dir = dir
197c33d735d49bab858cd4dda3c7f019e3dd0db3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/197c33d735d49bab858cd4dda3c7f019e3dd0db3/VideoCD.py
self.tv_vcd_chapters.enable_model_drag_dest([('MY_TREE_MODEL_ROW', 0, 0), ('text/plain', 0, 1), ('TEXT', 0, 2), ('STRING', 0, 3)], gtk.gdk.ACTION_DEFAULT)
self.tv_vcd_chapters.enable_model_drag_source(gtk.gdk.BUTTON1_MASK, [('path', 0, 0)], gtk.gdk.ACTION_DEFAULT | gtk.gdk.ACTION_MOVE) self.tv_vcd_chapters.enable_model_drag_dest([('path', 0, 0)], gtk.gdk.ACTION_DEFAULT | gtk.gdk.ACTION_MOVE)
def __init__(self, gofoto, dir): self.gofoto = gofoto self.dir = dir
197c33d735d49bab858cd4dda3c7f019e3dd0db3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/197c33d735d49bab858cd4dda3c7f019e3dd0db3/VideoCD.py
chapter = row[self.VCD_CLMN_CHTR] mpeg_dir = os.path.join(chapter.album.dir, "mpeg")
name = row[self.VCD_CLMN_NAME] chapter = self.__find_chapter(name)
def on_btn_create_mpegs_clicked(self, widget): print "create mpegs"
197c33d735d49bab858cd4dda3c7f019e3dd0db3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/197c33d735d49bab858cd4dda3c7f019e3dd0db3/VideoCD.py
if not os.path.exists(mpeg_dir): os.mkdir(mpeg_dir) pass esc_name = chapter.props.name.replace(" ", "_") chapter.esc_name = esc_name chapter.props.mpg_name = os.path.join(mpeg_dir, ("mpg-"+esc_name+".mpg")) chapter.props.sound_name = os.path.join(mpeg_dir, ("snd-"+esc_name+".mp2")) chapter.props.video_name = os.path.jo...
chapter.esc_name = name.replace(" ", "_") chapter.mpg_name = os.path.join(mpeg_dir, ("mpg-"+chapter.esc_name+".mpg")) chapter.sound_name = os.path.join(mpeg_dir, ("snd-"+chapter.esc_name+".mp2")) chapter.video_name = os.path.join(mpeg_dir, ("vid-"+chapter.esc_name+".m2v"))
def on_btn_create_mpegs_clicked(self, widget): print "create mpegs"
197c33d735d49bab858cd4dda3c7f019e3dd0db3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/197c33d735d49bab858cd4dda3c7f019e3dd0db3/VideoCD.py
chapter.props.wav_name = os.path.join(chapter.mpeg_dir, chapter.esc_name+".wav")
chapter.wav_name = os.path.join(chapter.mpeg_dir, chapter.esc_name+".wav")
def __check_sound(self, chapter): chapter.wav_name_in = os.path.join(chapter.mpeg_dir, chapter.esc_name+"-in.wav") chapter.props.wav_name = os.path.join(chapter.mpeg_dir, chapter.esc_name+".wav") wav_cmd = "madplay '%s' --output=wave:'%s'" join_wav = "qwavjoin -o '%s' '%s'" cut_wav = "qwavcut -d -B %ds '%s'" mp2_cmd = ...
197c33d735d49bab858cd4dda3c7f019e3dd0db3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/197c33d735d49bab858cd4dda3c7f019e3dd0db3/VideoCD.py
print " creating sound %s" % chapter.props.sound_name if os.access(chapter.props.sound_name, os.F_OK): print " sound %s already exists" % chapter.props.sound_name
print " creating sound %s" % chapter.sound_name if chapter.mp3_name == "": raise "chapter %s: MP3 file was not provided" % chapter.name if not os.access(chapter.mp3_name, os.F_OK): raise "chapter %s: MP3 file was not provided" % chapter.name if os.access(chapter.sound_name, os.F_OK): print " sound %s already exists" ...
def __check_sound(self, chapter): chapter.wav_name_in = os.path.join(chapter.mpeg_dir, chapter.esc_name+"-in.wav") chapter.props.wav_name = os.path.join(chapter.mpeg_dir, chapter.esc_name+".wav") wav_cmd = "madplay '%s' --output=wave:'%s'" join_wav = "qwavjoin -o '%s' '%s'" cut_wav = "qwavcut -d -B %ds '%s'" mp2_cmd = ...
197c33d735d49bab858cd4dda3c7f019e3dd0db3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/197c33d735d49bab858cd4dda3c7f019e3dd0db3/VideoCD.py
os.system(wav_cmd % (chapter.props.mp3_name, chapter.wav_name_in))
os.system(wav_cmd % (chapter.mp3_name, chapter.wav_name_in))
def __check_sound(self, chapter): chapter.wav_name_in = os.path.join(chapter.mpeg_dir, chapter.esc_name+"-in.wav") chapter.props.wav_name = os.path.join(chapter.mpeg_dir, chapter.esc_name+".wav") wav_cmd = "madplay '%s' --output=wave:'%s'" join_wav = "qwavjoin -o '%s' '%s'" cut_wav = "qwavcut -d -B %ds '%s'" mp2_cmd = ...
197c33d735d49bab858cd4dda3c7f019e3dd0db3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/197c33d735d49bab858cd4dda3c7f019e3dd0db3/VideoCD.py
video_len = len(chapter.picts)*5
video_len = self.__count_picts_in_chapter(chapter)*5
def __check_sound(self, chapter): chapter.wav_name_in = os.path.join(chapter.mpeg_dir, chapter.esc_name+"-in.wav") chapter.props.wav_name = os.path.join(chapter.mpeg_dir, chapter.esc_name+".wav") wav_cmd = "madplay '%s' --output=wave:'%s'" join_wav = "qwavjoin -o '%s' '%s'" cut_wav = "qwavcut -d -B %ds '%s'" mp2_cmd = ...
197c33d735d49bab858cd4dda3c7f019e3dd0db3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/197c33d735d49bab858cd4dda3c7f019e3dd0db3/VideoCD.py
chapter.props.wav_name = chapter.wav_name_in os.system(cut_wav % (video_len, chapter.props.wav_name))
chapter.wav_name = chapter.wav_name_in os.system(cut_wav % (video_len, chapter.wav_name))
def __check_sound(self, chapter): chapter.wav_name_in = os.path.join(chapter.mpeg_dir, chapter.esc_name+"-in.wav") chapter.props.wav_name = os.path.join(chapter.mpeg_dir, chapter.esc_name+".wav") wav_cmd = "madplay '%s' --output=wave:'%s'" join_wav = "qwavjoin -o '%s' '%s'" cut_wav = "qwavcut -d -B %ds '%s'" mp2_cmd = ...
197c33d735d49bab858cd4dda3c7f019e3dd0db3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/197c33d735d49bab858cd4dda3c7f019e3dd0db3/VideoCD.py
os.system(join_wav % (chapter.props.wav_name, files_in)) os.system(cut_wav % (video_len, chapter.props.wav_name))
os.system(join_wav % (chapter.wav_name, files_in)) os.system(cut_wav % (video_len, chapter.wav_name))
def __check_sound(self, chapter): chapter.wav_name_in = os.path.join(chapter.mpeg_dir, chapter.esc_name+"-in.wav") chapter.props.wav_name = os.path.join(chapter.mpeg_dir, chapter.esc_name+".wav") wav_cmd = "madplay '%s' --output=wave:'%s'" join_wav = "qwavjoin -o '%s' '%s'" cut_wav = "qwavcut -d -B %ds '%s'" mp2_cmd = ...
197c33d735d49bab858cd4dda3c7f019e3dd0db3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/197c33d735d49bab858cd4dda3c7f019e3dd0db3/VideoCD.py
os.system(mp2_cmd % (chapter.props.wav_name, chapter.props.sound_name))
os.system(mp2_cmd % (chapter.wav_name, chapter.sound_name))
def __check_sound(self, chapter): chapter.wav_name_in = os.path.join(chapter.mpeg_dir, chapter.esc_name+"-in.wav") chapter.props.wav_name = os.path.join(chapter.mpeg_dir, chapter.esc_name+".wav") wav_cmd = "madplay '%s' --output=wave:'%s'" join_wav = "qwavjoin -o '%s' '%s'" cut_wav = "qwavcut -d -B %ds '%s'" mp2_cmd = ...
197c33d735d49bab858cd4dda3c7f019e3dd0db3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/197c33d735d49bab858cd4dda3c7f019e3dd0db3/VideoCD.py
if os.access(chapter.props.wav_name, os.F_OK): os.unlink(chapter.props.wav_name)
if os.access(chapter.wav_name, os.F_OK): os.unlink(chapter.wav_name)
def __check_sound(self, chapter): chapter.wav_name_in = os.path.join(chapter.mpeg_dir, chapter.esc_name+"-in.wav") chapter.props.wav_name = os.path.join(chapter.mpeg_dir, chapter.esc_name+".wav") wav_cmd = "madplay '%s' --output=wave:'%s'" join_wav = "qwavjoin -o '%s' '%s'" cut_wav = "qwavcut -d -B %ds '%s'" mp2_cmd = ...
197c33d735d49bab858cd4dda3c7f019e3dd0db3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/197c33d735d49bab858cd4dda3c7f019e3dd0db3/VideoCD.py
for pict in chapter.picts:
for pict in self.album.picts: if pict.props.vcd_chapter != chapter.name or not pict.props.vcd_included: continue
def __check_picts(self, chapter): print " converting picts.." convert_cmd1 = "convert -resize 704x576! '%s' '%s'" convert_cmd2 = "convert -resize 704x576 '%s' '%s'" convert_cmd3 = "convert -border %dx0 -bordercolor black '%s' '%s'"
197c33d735d49bab858cd4dda3c7f019e3dd0db3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/197c33d735d49bab858cd4dda3c7f019e3dd0db3/VideoCD.py
os.system(convert_cmd1 % (pict.props.name, tmp_pict))
os.system(convert_cmd1 % (os.path.join(self.album.dir, pict.props.name), tmp_pict))
def __check_picts(self, chapter): print " converting picts.." convert_cmd1 = "convert -resize 704x576! '%s' '%s'" convert_cmd2 = "convert -resize 704x576 '%s' '%s'" convert_cmd3 = "convert -border %dx0 -bordercolor black '%s' '%s'"
197c33d735d49bab858cd4dda3c7f019e3dd0db3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/197c33d735d49bab858cd4dda3c7f019e3dd0db3/VideoCD.py
os.system(convert_cmd2 % (pict.props.name, tmp_pict))
os.system(convert_cmd2 % (os.path.join(self.album.dir, pict.props.name), tmp_pict))
def __check_picts(self, chapter): print " converting picts.." convert_cmd1 = "convert -resize 704x576! '%s' '%s'" convert_cmd2 = "convert -resize 704x576 '%s' '%s'" convert_cmd3 = "convert -border %dx0 -bordercolor black '%s' '%s'"
197c33d735d49bab858cd4dda3c7f019e3dd0db3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/197c33d735d49bab858cd4dda3c7f019e3dd0db3/VideoCD.py
for pict in chapter.picts:
for pict in self.album.picts: if pict.props.vcd_chapter != chapter.name or not pict.props.vcd_included: continue
def __rm_picts_links(self, chapter): duration = 5*25 # 5 seconds * 25 fps i = 0 for pict in chapter.picts: for j in range(0, duration): slink = os.path.join(chapter.mpeg_dir, "pict-%s-%04d.jpg" % (chapter.esc_name, i*duration+j)) os.unlink(slink) pass i = i + 1 pass pass
197c33d735d49bab858cd4dda3c7f019e3dd0db3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/197c33d735d49bab858cd4dda3c7f019e3dd0db3/VideoCD.py
print " creating video %s" % chapter.props.video_name
print " creating video %s" % chapter.video_name
def __check_video(self, chapter): print " creating video %s" % chapter.props.video_name yuv_cmd = "jpeg2yuv -v 0 -f 25 -I p -j '%s' " mpeg_cmd = "mpeg2enc -v 0 -a 2 -n p -f 4 -o '%s'" if os.access(chapter.props.video_name, os.F_OK): print " video %s already exists" % chapter.props.video_name return
197c33d735d49bab858cd4dda3c7f019e3dd0db3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/197c33d735d49bab858cd4dda3c7f019e3dd0db3/VideoCD.py
if os.access(chapter.props.video_name, os.F_OK): print " video %s already exists" % chapter.props.video_name
if not chapter.remake and os.access(chapter.video_name, os.F_OK): print " video %s already exists" % chapter.video_name
def __check_video(self, chapter): print " creating video %s" % chapter.props.video_name yuv_cmd = "jpeg2yuv -v 0 -f 25 -I p -j '%s' " mpeg_cmd = "mpeg2enc -v 0 -a 2 -n p -f 4 -o '%s'" if os.access(chapter.props.video_name, os.F_OK): print " video %s already exists" % chapter.props.video_name return
197c33d735d49bab858cd4dda3c7f019e3dd0db3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/197c33d735d49bab858cd4dda3c7f019e3dd0db3/VideoCD.py
mpeg_cmd % chapter.props.video_name)
mpeg_cmd % chapter.video_name)
def __check_video(self, chapter): print " creating video %s" % chapter.props.video_name yuv_cmd = "jpeg2yuv -v 0 -f 25 -I p -j '%s' " mpeg_cmd = "mpeg2enc -v 0 -a 2 -n p -f 4 -o '%s'" if os.access(chapter.props.video_name, os.F_OK): print " video %s already exists" % chapter.props.video_name return
197c33d735d49bab858cd4dda3c7f019e3dd0db3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/197c33d735d49bab858cd4dda3c7f019e3dd0db3/VideoCD.py
if os.access(chapter.props.mpg_name, os.F_OK): print "mpeg %s already exists" % chapter.props.mpg_name
if not chapter.remake and os.access(chapter.mpg_name, os.F_OK): print "mpeg %s already exists" % chapter.mpg_name
def __check_mpg(self, chapter): mplex_cmd = "mplex -v 0 -f 4 -o '%s' '%s' '%s'" if os.access(chapter.props.mpg_name, os.F_OK): print "mpeg %s already exists" % chapter.props.mpg_name return
197c33d735d49bab858cd4dda3c7f019e3dd0db3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/197c33d735d49bab858cd4dda3c7f019e3dd0db3/VideoCD.py
os.system(mplex_cmd % (chapter.props.mpg_name, chapter.props.video_name, chapter.props.sound_name))
os.system(mplex_cmd % (chapter.mpg_name, chapter.video_name, chapter.sound_name))
def __check_mpg(self, chapter): mplex_cmd = "mplex -v 0 -f 4 -o '%s' '%s' '%s'" if os.access(chapter.props.mpg_name, os.F_OK): print "mpeg %s already exists" % chapter.props.mpg_name return
197c33d735d49bab858cd4dda3c7f019e3dd0db3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/197c33d735d49bab858cd4dda3c7f019e3dd0db3/VideoCD.py
print "creating mpeg for chapter " + chapter.props.name + "..."
print "creating mpeg for chapter " + chapter.name + "..."
def __create_mpeg(self, chapter): print "creating mpeg for chapter " + chapter.props.name + "..."
197c33d735d49bab858cd4dda3c7f019e3dd0db3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/197c33d735d49bab858cd4dda3c7f019e3dd0db3/VideoCD.py
for row in self.tv_vcd_chapters.get_model(): xml.write(' <sequence-item src="%s" id="sequence-%02d"/>\n' % (row[1].props.mpg_name, i))
for chpt in self.album.props.vcd_chapters: xml.write(' <sequence-item src="%s" id="sequence-%02d"/>\n' % (chpt.mpg_name, i))
def on_btn_build_cd_clicked(self, widget): print "build CD" xml = open("/tmp/videocd.xml", "w")
197c33d735d49bab858cd4dda3c7f019e3dd0db3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/197c33d735d49bab858cd4dda3c7f019e3dd0db3/VideoCD.py
chapter = model.get_value(iter, self.VCD_CLMN_CHTR) chapter.props.mp3_name = self.file_chooser_dialog.get_filename() self.ent_music.set_text(chapter.props.mp3_name)
if model.iter_depth(iter) == 1: iter = model.iter_parent(iter) pass name = model.get_value(iter, self.VCD_CLMN_NAME) chapter = self.__find_chapter(name) chapter.mp3_name = self.file_chooser_dialog.get_filename() self.ent_music.set_text(chapter.mp3_name)
def on_btn_choose_music_clicked(self, widget): self.file_chooser_dialog.set_action(gtk.FILE_CHOOSER_ACTION_OPEN) self.file_chooser_dialog.set_title("Choose background music") response = self.file_chooser_dialog.run() self.file_chooser_dialog.hide() if response == gtk.RESPONSE_OK: model, iter = self.tv_vcd_chapters.get_...
197c33d735d49bab858cd4dda3c7f019e3dd0db3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/197c33d735d49bab858cd4dda3c7f019e3dd0db3/VideoCD.py
chapter = model.get_value(iter, self.VCD_CLMN_CHTR) if os.access(chapter.props.mpg_name, os.F_OK): os.system("vlc '%s'" % chapter.props.mpg_name)
pict = model.get_value(iter, self.VCD_CLMN_PICT) if pict: chapter = self.__find_chapter(pict.props.vcd_chapter) else: chapter = self.__find_chapter(model.get_value(iter, self.VCD_CLMN_NAME)) pass if os.access(chapter.mpg_name, os.F_OK): os.system("vlc '%s'" % chapter.mpg_name)
def on_btn_chapters_play_clicked(self, widget): model, iter = self.tv_vcd_chapters.get_selection().get_selected() if iter == None: return chapter = model.get_value(iter, self.VCD_CLMN_CHTR) if os.access(chapter.props.mpg_name, os.F_OK): os.system("vlc '%s'" % chapter.props.mpg_name) pass pass
197c33d735d49bab858cd4dda3c7f019e3dd0db3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/197c33d735d49bab858cd4dda3c7f019e3dd0db3/VideoCD.py
if os.access(chapter.props.sound_name, os.F_OK): os.system("vlc '%s'" % chapter.props.sound_name) elif os.access(chapter.props.mp3_name, os.F_OK): os.system("vlc '%s'" % chapter.props.mp3_name)
if os.access(chapter.sound_name, os.F_OK): os.system("vlc '%s'" % chapter.sound_name) elif os.access(chapter.mp3_name, os.F_OK): os.system("vlc '%s'" % chapter.mp3_name)
def on_btn_sound_play_clicked(self, widget): model, iter = self.tv_vcd_chapters.get_selection().get_selected() if iter == None: return chapter = model.get_value(iter, self.VCD_CLMN_CHTR) if os.access(chapter.props.sound_name, os.F_OK): os.system("vlc '%s'" % chapter.props.sound_name) elif os.access(chapter.props.mp3_na...
197c33d735d49bab858cd4dda3c7f019e3dd0db3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/197c33d735d49bab858cd4dda3c7f019e3dd0db3/VideoCD.py
pass
print "on_tv_vcd_chapters_cursor_changed" model, iter = self.tv_vcd_chapters.get_selection().get_selected() pict = model.get_value(iter, self.VCD_CLMN_PICT) if pict: mp3_name = self.__find_chapter(pict.props.vcd_chapter).mp3_name else: mp3_name = self.__find_chapter(model.get_value(iter, self.VCD_CLMN_NAME)).mp3_name p...
def on_tv_vcd_chapters_cursor_changed(self, widget): #print "on_tv_vcd_chapters_cursor_changed" #model, iter = self.tv_vcd_chapters.get_selection().get_selected() #chapter = model.get_value(iter, self.VCD_CLMN_CHTR) #self.ent_music.set_text(chapter.props.mp3_name) pass
197c33d735d49bab858cd4dda3c7f019e3dd0db3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/197c33d735d49bab858cd4dda3c7f019e3dd0db3/VideoCD.py
chapter = self.gofoto.albumCollection.get_chapter(selection_data.data) if chapter != None: name = chapter.album.props.name + " / " + chapter.props.name self.tv_vcd_chapters.get_model().append(None, [name, chapter]) pass
print "received:" + str(selection_data.data) model = self.tv_vcd_chapters.get_model() src_row = model[selection_data.data] dest_row = model[dest_path] if dest_row[self.VCD_CLMN_PICT] != None or src_row[self.VCD_CLMN_PICT] == None: return 0 pict = src_row[self.VCD_CLMN_PICT] model.append(dest_row.iter, [pict, src_row[se...
def on_tv_vcd_chapters_drag_data_received(self, widget, context, x, y, selection_data, info, timestamp): print "on_tv_vcd_chapters_drag_data_received" dest = self.tv_vcd_chapters.get_dest_row_at_pos(x, y) print "dest "+str(dest) context.finish(gtk.TRUE, gtk.FALSE, timestamp) chapter = self.gofoto.albumCollection.get_ch...
197c33d735d49bab858cd4dda3c7f019e3dd0db3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/197c33d735d49bab858cd4dda3c7f019e3dd0db3/VideoCD.py
def on_tv_vcd_chapters_button_press_event(self, widget, event): if event.button == 3: #model, paths = self.tv_images.get_selection().get_selected_rows() #if paths == []: # return gtk.TRUE #if self.albumCollection.get_album_by_path(paths[0]) != None: # self.ctxmnu_images.popup(None, None, None, event.button, event...
197c33d735d49bab858cd4dda3c7f019e3dd0db3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/197c33d735d49bab858cd4dda3c7f019e3dd0db3/VideoCD.py
print "Removed chapter had no children"
print "Removed chapter '%s' had no children" % name self.album.props.vcd_chapters.remove(chpt)
def on_remove_chapter_activate(self, widget): model, iter = self.tv_vcd_chapters.get_selection().get_selected() if not iter: return
197c33d735d49bab858cd4dda3c7f019e3dd0db3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/197c33d735d49bab858cd4dda3c7f019e3dd0db3/VideoCD.py
for chpt in self.album.props.vcd_chapters: if chpt.name == name: self.album.props.vcd_chapters.remove(chpt) break pass
self.album.props.vcd_chapters.remove(chpt)
def on_remove_chapter_activate(self, widget): model, iter = self.tv_vcd_chapters.get_selection().get_selected() if not iter: return
197c33d735d49bab858cd4dda3c7f019e3dd0db3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/197c33d735d49bab858cd4dda3c7f019e3dd0db3/VideoCD.py
class Properties: def save(self, doc, xml_base): xml = doc.createElement("props") xml_base.appendChild(xml) for key in self.__dict__.keys(): type = self.__dict__[key].__class__.__name__ if type == "int": node_key = doc.createElement(key) xml.appendChild(node_key) node_key.setAttribute("type", "int") node_key.setAttri...
def appdir(path): return os.path.join(os.path.dirname(sys.argv[0]), path)
11389c4188f2eaefc8d10f1626492bcb264391a7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/11389c4188f2eaefc8d10f1626492bcb264391a7/gofoto.py
self.props = Properties()
self.props = properties.Properties()
def __init__(self, album, arg): self.album = album self.props = Properties()
11389c4188f2eaefc8d10f1626492bcb264391a7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/11389c4188f2eaefc8d10f1626492bcb264391a7/gofoto.py
pict_xml = doc.createElement("pict") xml.appendChild(pict_xml) self.props.save(doc, pict_xml)
self.props.save(doc, xml, "pict")
def save(self, doc, xml): pict_xml = doc.createElement("pict") xml.appendChild(pict_xml) self.props.save(doc, pict_xml) pass
11389c4188f2eaefc8d10f1626492bcb264391a7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/11389c4188f2eaefc8d10f1626492bcb264391a7/gofoto.py
self.props = Properties()
self.props = properties.Properties()
def __init__(self, album, chpt_xml=None, dir=None): self.album = album self.props = Properties() self.picts = []
11389c4188f2eaefc8d10f1626492bcb264391a7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/11389c4188f2eaefc8d10f1626492bcb264391a7/gofoto.py
self.props = Properties()
self.props = properties.Properties()
def __init__(self, dir, alb_xml=None): self.dir = os.path.abspath(dir) self.props = Properties() self.picts = []
11389c4188f2eaefc8d10f1626492bcb264391a7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/11389c4188f2eaefc8d10f1626492bcb264391a7/gofoto.py
self.props.save(doc, alb_xml)
self.props.save(doc, alb_xml, "album")
def save(self): doc = xml.dom.minidom.Document()
11389c4188f2eaefc8d10f1626492bcb264391a7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/11389c4188f2eaefc8d10f1626492bcb264391a7/gofoto.py
log.info("Album saved")
log.info("Album %s saved" % self.props.name)
def save(self): doc = xml.dom.minidom.Document()
11389c4188f2eaefc8d10f1626492bcb264391a7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/11389c4188f2eaefc8d10f1626492bcb264391a7/gofoto.py
album = Album(dir, alb_xml)
props_xml = alb_xml.getElementsByTagName("album")[0] album = Album(dir, props_xml)
def append_album(self, dir, doc): if self.get_album_by_dir(dir): return # album alb_xml = doc.getElementsByTagName("gofoto")[0] album = Album(dir, alb_xml) self.albums.append(album) # picts for pict_xml in alb_xml.getElementsByTagName("pict"): album.picts.append(Pict(album, pict_xml)) pass
11389c4188f2eaefc8d10f1626492bcb264391a7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/11389c4188f2eaefc8d10f1626492bcb264391a7/gofoto.py
def cell_func(self, column, cell, model, iter, clmn_number): obj = model.get_value(iter, 0) #print "cell func clmn:%d obj:%s" % (clmn_number, obj.__class__.__name__) if clmn_number == CLMN_MARK: if obj.__class__.__name__ in ["Album", "Chapter"]: cell.set_property("active", obj.props.marked) cell.set_property("activatab...
11389c4188f2eaefc8d10f1626492bcb264391a7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/11389c4188f2eaefc8d10f1626492bcb264391a7/gofoto.py
def __init__(self, name, seq, context): """Construct an iterator
6c04bde54c3951a058cf205988e6619840bf2dda /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9778/6c04bde54c3951a058cf205988e6619840bf2dda/tales.py
raise TypeError("No iteration position")
raise TypeError("No iteration position")
def index(self): """Get the iterator index
6c04bde54c3951a058cf205988e6619840bf2dda /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9778/6c04bde54c3951a058cf205988e6619840bf2dda/tales.py
def __init__(self, name, seq, context): """Construct an iterator Iterators are defined for a name, a sequence, or an iterator and a context, where a context simply has a setLocal method: >>> context = Context(ExpressionEngine(), {}) >>> it = Iterator('foo', ("apple", "pear", "orange"), context) A local variable is n...
c9050828c4e3746e0a681d6d5cf0a74a8c74bae5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9778/c9050828c4e3746e0a681d6d5cf0a74a8c74bae5/tales.py
>>> context = Context(ExpressionEngine(), {}) >>> it = Iterator('foo', ("apple", "pear", "orange"), context)
>>> context = Context(ExpressionEngine(), {}) >>> it = Iterator('foo', ("apple", "pear", "orange"), context)
def __init__(self, name, seq, context): """Construct an iterator Iterators are defined for a name, a sequence, or an iterator and a context, where a context simply has a setLocal method: >>> context = Context(ExpressionEngine(), {}) >>> it = Iterator('foo', ("apple", "pear", "orange"), context) A local variable is n...
c9050828c4e3746e0a681d6d5cf0a74a8c74bae5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9778/c9050828c4e3746e0a681d6d5cf0a74a8c74bae5/tales.py
def __init__(self, name, seq, context): """Construct an iterator Iterators are defined for a name, a sequence, or an iterator and a context, where a context simply has a setLocal method: >>> context = Context(ExpressionEngine(), {}) >>> it = Iterator('foo', ("apple", "pear", "orange"), context) A local variable is n...
c9050828c4e3746e0a681d6d5cf0a74a8c74bae5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9778/c9050828c4e3746e0a681d6d5cf0a74a8c74bae5/tales.py
def __init__(self, name, seq, context): """Construct an iterator Iterators are defined for a name, a sequence, or an iterator and a context, where a context simply has a setLocal method: >>> context = Context(ExpressionEngine(), {}) >>> it = Iterator('foo', ("apple", "pear", "orange"), context) A local variable is n...
c9050828c4e3746e0a681d6d5cf0a74a8c74bae5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9778/c9050828c4e3746e0a681d6d5cf0a74a8c74bae5/tales.py
def __init__(self, name, seq, context): """Construct an iterator Iterators are defined for a name, a sequence, or an iterator and a context, where a context simply has a setLocal method: >>> context = Context(ExpressionEngine(), {}) >>> it = Iterator('foo', ("apple", "pear", "orange"), context) A local variable is n...
c9050828c4e3746e0a681d6d5cf0a74a8c74bae5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9778/c9050828c4e3746e0a681d6d5cf0a74a8c74bae5/tales.py
def __init__(self, name, seq, context): """Construct an iterator Iterators are defined for a name, a sequence, or an iterator and a context, where a context simply has a setLocal method: >>> context = Context(ExpressionEngine(), {}) >>> it = Iterator('foo', ("apple", "pear", "orange"), context) A local variable is n...
c9050828c4e3746e0a681d6d5cf0a74a8c74bae5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9778/c9050828c4e3746e0a681d6d5cf0a74a8c74bae5/tales.py
def __init__(self, name, seq, context): """Construct an iterator Iterators are defined for a name, a sequence, or an iterator and a context, where a context simply has a setLocal method: >>> context = Context(ExpressionEngine(), {}) >>> it = Iterator('foo', ("apple", "pear", "orange"), context) A local variable is n...
c9050828c4e3746e0a681d6d5cf0a74a8c74bae5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9778/c9050828c4e3746e0a681d6d5cf0a74a8c74bae5/tales.py
"""
"""
def __init__(self, name, seq, context): """Construct an iterator Iterators are defined for a name, a sequence, or an iterator and a context, where a context simply has a setLocal method: >>> context = Context(ExpressionEngine(), {}) >>> it = Iterator('foo', ("apple", "pear", "orange"), context) A local variable is n...
c9050828c4e3746e0a681d6d5cf0a74a8c74bae5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9778/c9050828c4e3746e0a681d6d5cf0a74a8c74bae5/tales.py
def number(self): """Get the iterator position >>> context = Context(ExpressionEngine(), {}) >>> it = Iterator('foo', ("apple", "pear", "orange"), context) >>> int(bool(it.next())) 1 >>> it.number() 1 >>> int(bool(it.next())) 1 >>> it.number() 2 >>> int(bool(it.next())) 1 >>> it.number() 3 """ return self._nextIndex
c9050828c4e3746e0a681d6d5cf0a74a8c74bae5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9778/c9050828c4e3746e0a681d6d5cf0a74a8c74bae5/tales.py
def even(self): """Test whether the position is even >>> context = Context(ExpressionEngine(), {}) >>> it = Iterator('foo', ("apple", "pear", "orange"), context) >>> int(bool(it.next())) 1 >>> int(bool(it.even())) 0 >>> int(bool(it.next())) 1 >>> int(bool(it.even())) 1 >>> int(bool(it.next())) 1 >>> int(bool(it.even()...
c9050828c4e3746e0a681d6d5cf0a74a8c74bae5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9778/c9050828c4e3746e0a681d6d5cf0a74a8c74bae5/tales.py
def odd(self): """Test whether the position is odd >>> context = Context(ExpressionEngine(), {}) >>> it = Iterator('foo', ("apple", "pear", "orange"), context) >>> int(bool(it.next())) 1 >>> int(bool(it.odd())) 1 >>> int(bool(it.next())) 1 >>> int(bool(it.odd())) 0 >>> int(bool(it.next())) 1 >>> int(bool(it.odd())) 1 ...
c9050828c4e3746e0a681d6d5cf0a74a8c74bae5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9778/c9050828c4e3746e0a681d6d5cf0a74a8c74bae5/tales.py
def letter(self, base=ord('a'), radix=26): """Get the iterator position as a lower-case letter >>> context = Context(ExpressionEngine(), {}) >>> it = Iterator('foo', ("apple", "pear", "orange"), context) >>> int(bool(it.next())) 1 >>> it.letter() 'a' >>> int(bool(it.next())) 1 >>> it.letter() 'b' >>> int(bool(it.next(...
c9050828c4e3746e0a681d6d5cf0a74a8c74bae5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9778/c9050828c4e3746e0a681d6d5cf0a74a8c74bae5/tales.py
def Letter(self): """Get the iterator position as an upper-case letter >>> context = Context(ExpressionEngine(), {}) >>> it = Iterator('foo', ("apple", "pear", "orange"), context) >>> int(bool(it.next())) 1 >>> it.Letter() 'A' >>> int(bool(it.next())) 1 >>> it.Letter() 'B' >>> int(bool(it.next())) 1 >>> it.Letter() 'C...
c9050828c4e3746e0a681d6d5cf0a74a8c74bae5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9778/c9050828c4e3746e0a681d6d5cf0a74a8c74bae5/tales.py
def Roman(self, rnvalues=( (1000,'M'),(900,'CM'),(500,'D'),(400,'CD'), (100,'C'),(90,'XC'),(50,'L'),(40,'XL'), (10,'X'),(9,'IX'),(5,'V'),(4,'IV'),(1,'I')) ): """Get the iterator position as an upper-case roman numeral >>> context = Context(ExpressionEngine(), {}) >>> it = Iterator('foo', ("apple", "pear", "orange"), c...
c9050828c4e3746e0a681d6d5cf0a74a8c74bae5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9778/c9050828c4e3746e0a681d6d5cf0a74a8c74bae5/tales.py
def roman(self): """Get the iterator position as a lower-case roman numeral >>> context = Context(ExpressionEngine(), {}) >>> it = Iterator('foo', ("apple", "pear", "orange"), context) >>> int(bool(it.next())) 1 >>> it.roman() 'i' >>> int(bool(it.next())) 1 >>> it.roman() 'ii' >>> int(bool(it.next())) 1 >>> it.roman()...
c9050828c4e3746e0a681d6d5cf0a74a8c74bae5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9778/c9050828c4e3746e0a681d6d5cf0a74a8c74bae5/tales.py
def start(self): """Test whether the position is the first position >>> context = Context(ExpressionEngine(), {}) >>> it = Iterator('foo', ("apple", "pear", "orange"), context) >>> int(bool(it.next())) 1 >>> int(bool(it.start())) 1 >>> int(bool(it.next())) 1 >>> int(bool(it.start())) 0 >>> int(bool(it.next())) 1 >>> i...
c9050828c4e3746e0a681d6d5cf0a74a8c74bae5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9778/c9050828c4e3746e0a681d6d5cf0a74a8c74bae5/tales.py
def end(self): """Test whether the position is the last position >>> context = Context(ExpressionEngine(), {}) >>> it = Iterator('foo', ("apple", "pear", "orange"), context) >>> int(bool(it.next())) 1 >>> int(bool(it.end())) 0 >>> int(bool(it.next())) 1 >>> int(bool(it.end())) 0 >>> int(bool(it.next())) 1 >>> int(bool...
c9050828c4e3746e0a681d6d5cf0a74a8c74bae5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9778/c9050828c4e3746e0a681d6d5cf0a74a8c74bae5/tales.py
def item(self): """Get the iterator value >>> context = Context(ExpressionEngine(), {}) >>> it = Iterator('foo', ("apple", "pear", "orange"), context) >>> int(bool(it.next())) 1 >>> it.item() 'apple' >>> int(bool(it.next())) 1 >>> it.item() 'pear' >>> int(bool(it.next())) 1 >>> it.item() 'orange'
c9050828c4e3746e0a681d6d5cf0a74a8c74bae5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9778/c9050828c4e3746e0a681d6d5cf0a74a8c74bae5/tales.py
def length(self): """Get the length of the iterator sequence >>> context = Context(ExpressionEngine(), {}) >>> it = Iterator('foo', ("apple", "pear", "orange"), context) >>> it.length() 3
c9050828c4e3746e0a681d6d5cf0a74a8c74bae5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9778/c9050828c4e3746e0a681d6d5cf0a74a8c74bae5/tales.py
def length(self): """Get the length of the iterator sequence >>> context = Context(ExpressionEngine(), {}) >>> it = Iterator('foo', ("apple", "pear", "orange"), context) >>> it.length() 3
c9050828c4e3746e0a681d6d5cf0a74a8c74bae5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9778/c9050828c4e3746e0a681d6d5cf0a74a8c74bae5/tales.py
def length(self): """Get the length of the iterator sequence >>> context = Context(ExpressionEngine(), {}) >>> it = Iterator('foo', ("apple", "pear", "orange"), context) >>> it.length() 3
c9050828c4e3746e0a681d6d5cf0a74a8c74bae5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9778/c9050828c4e3746e0a681d6d5cf0a74a8c74bae5/tales.py
def length(self): """Get the length of the iterator sequence >>> context = Context(ExpressionEngine(), {}) >>> it = Iterator('foo', ("apple", "pear", "orange"), context) >>> it.length() 3
c9050828c4e3746e0a681d6d5cf0a74a8c74bae5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9778/c9050828c4e3746e0a681d6d5cf0a74a8c74bae5/tales.py
def length(self): """Get the length of the iterator sequence >>> context = Context(ExpressionEngine(), {}) >>> it = Iterator('foo', ("apple", "pear", "orange"), context) >>> it.length() 3
c9050828c4e3746e0a681d6d5cf0a74a8c74bae5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9778/c9050828c4e3746e0a681d6d5cf0a74a8c74bae5/tales.py
def length(self): """Get the length of the iterator sequence >>> context = Context(ExpressionEngine(), {}) >>> it = Iterator('foo', ("apple", "pear", "orange"), context) >>> it.length() 3
c9050828c4e3746e0a681d6d5cf0a74a8c74bae5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9778/c9050828c4e3746e0a681d6d5cf0a74a8c74bae5/tales.py
__implements__ = ITALExpressionErrorInfo
implements(ITALExpressionErrorInfo)
def length(self): """Get the length of the iterator sequence >>> context = Context(ExpressionEngine(), {}) >>> it = Iterator('foo', ("apple", "pear", "orange"), context) >>> it.length() 3
c9050828c4e3746e0a681d6d5cf0a74a8c74bae5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9778/c9050828c4e3746e0a681d6d5cf0a74a8c74bae5/tales.py
def __init__(self, err, position=(None, None)): if isinstance(err, Exception): self.type = err.__class__ self.value = err else: self.type = err self.value = None self.lineno = position[0] self.offset = position[1]
c9050828c4e3746e0a681d6d5cf0a74a8c74bae5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9778/c9050828c4e3746e0a681d6d5cf0a74a8c74bae5/tales.py
def __init__(self, err, position=(None, None)): if isinstance(err, Exception): self.type = err.__class__ self.value = err else: self.type = err self.value = None self.lineno = position[0] self.offset = position[1]
c9050828c4e3746e0a681d6d5cf0a74a8c74bae5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9778/c9050828c4e3746e0a681d6d5cf0a74a8c74bae5/tales.py
__implements__ = ITALExpressionCompiler
implements(ITALExpressionCompiler)
def __init__(self, err, position=(None, None)): if isinstance(err, Exception): self.type = err.__class__ self.value = err else: self.type = err self.value = None self.lineno = position[0] self.offset = position[1]
c9050828c4e3746e0a681d6d5cf0a74a8c74bae5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9778/c9050828c4e3746e0a681d6d5cf0a74a8c74bae5/tales.py
def lower(self): return self.context.lower()
c9050828c4e3746e0a681d6d5cf0a74a8c74bae5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9778/c9050828c4e3746e0a681d6d5cf0a74a8c74bae5/tales.py
""" self.namespaces[namespacename] = namespacecallable
""" self.namespaces[namespacename] = namespacecallable
def lower(self): return self.context.lower()
c9050828c4e3746e0a681d6d5cf0a74a8c74bae5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9778/c9050828c4e3746e0a681d6d5cf0a74a8c74bae5/tales.py
__implements__ = ITALExpressionEngine
implements(ITALExpressionEngine)
def getCompilerError(self): return CompilerError
c9050828c4e3746e0a681d6d5cf0a74a8c74bae5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9778/c9050828c4e3746e0a681d6d5cf0a74a8c74bae5/tales.py
def __init__(self, engine, contexts): self._engine = engine self.contexts = contexts self.setContext('nothing', None) self.setContext('default', _default)
c9050828c4e3746e0a681d6d5cf0a74a8c74bae5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9778/c9050828c4e3746e0a681d6d5cf0a74a8c74bae5/tales.py
def endScope(self): self._vars_stack.pop() self.vars = self._vars_stack[-1]
c9050828c4e3746e0a681d6d5cf0a74a8c74bae5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9778/c9050828c4e3746e0a681d6d5cf0a74a8c74bae5/tales.py
"""Return whether the length of the sequence
"""Return the length of the sequence
def length(): """Return whether the length of the sequence
511707d78c6d53b7c02fb1809cb5da6206ac87f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9778/511707d78c6d53b7c02fb1809cb5da6206ac87f5/interfaces.py
self._done = 1
self._done = True
def __init__(self, name, seq, context): """Construct an iterator
c2450cd2db47fce45ceeda283ccc45145d72ec81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9778/c2450cd2db47fce45ceeda283ccc45145d72ec81/tales.py
self._done = 0
self._done = False
def __init__(self, name, seq, context): """Construct an iterator
c2450cd2db47fce45ceeda283ccc45145d72ec81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9778/c2450cd2db47fce45ceeda283ccc45145d72ec81/tales.py
>>> int(bool(it.next())) 1
>>> bool(it.next()) True
def next(self): """Advance the iterator, if possible.
c2450cd2db47fce45ceeda283ccc45145d72ec81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9778/c2450cd2db47fce45ceeda283ccc45145d72ec81/tales.py