rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
if tm_item.isSelected:
if tm_item.isSelected():
def setupScene(self, pipeline): """ setupScene(pipeline: Pipeline) -> None Construct the scene to view a pipeline """ old_pipeline = self.pipeline self.pipeline = pipeline
bb5e4e6e1f45b2acc9dd36ba0e6d8b580347ac97 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/bb5e4e6e1f45b2acc9dd36ba0e6d8b580347ac97/pipeline_view.py
tar_bin = configuration.git_bin
tar_bin = configuration.tar_bin
def initialize(): global global_db, local_db, search_dbs, compress_by_default, db_access, \ git_bin, tar_bin, debug if configuration.check('git_bin'): git_bin = configuration.git_bin if git_bin.startswith("@executable_path/"): non_expand_path = git_bin git_bin = get_executable_path(git_bin[len("@executable_path/"):]) if git_bin is not None: configuration.git_bin = non_expand_path if git_bin is None: git_bin = 'git' configuration.git_bin = git_bin if configuration.check('tar_bin'): tar_bin = configuration.git_bin if tar_bin.startswith("@executable_path/"): non_expand_path = tar_bin tar_bin = get_executable_path(tar_bin[len("@executable_path/"):]) if tar_bin is not None: configuration.tar_bin = non_expand_path if tar_bin is None: tar_bin = 'tar' configuration.tar_bin = tar_bin if configuration.check('compress_by_default'): compress_by_default = configuration.compress_by_default if configuration.check('debug'): debug = configuration.debug if configuration.check('global_db'): global_db = configuration.global_db if configuration.check('local_db'): local_db = configuration.local_db if not os.path.exists(local_db): raise Exception('local_db "%s" does not exist' % local_db) else: local_db = os.path.join(default_dot_vistrails(), 'persistent_files') if not os.path.exists(local_db): try: os.mkdir(local_db) except: raise Exception('local_db "%s" does not exist' % local_db) git_init(local_db) debug_print('creating DatabaseAccess') db_path = os.path.join(local_db, '.files.db') db_access = DatabaseAccessSingleton(db_path) debug_print('done', db_access) search_dbs = [local_db,] if configuration.check('search_dbs'): try: check_paths = eval(configuration.search_dbs) except: print "*** persistence error: cannot parse search_dbs ***" for path in check_paths: if os.path.exists(path): search_dbs.append(path) else: print '*** persistence warning: cannot find path "%s"' % path
9e24464874e0f148ba394ab08f951be94dce0bb2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/9e24464874e0f148ba394ab08f951be94dce0bb2/init.py
qual_name += m if qual_name not in self._existing_paths and not qual_name.endswith('_rc'): self._imported_paths.add(qual_name) qual_name += '.'
qual_name += m if qual_name not in self._existing_paths and \ not qual_name.endswith('_rc'): self._imported_paths.add(qual_name) qual_name += '.' if fromlist is not None: for from_module in fromlist: qual_name = res_name + '.' + from_module if qual_name not in self._existing_paths and \ not qual_name.endswith('_rc'): self._imported_paths.add(qual_name)
def _import(self, name, globals=None, locals=None, fromlist=None, level=-1): # if name != 'core.modules.module_registry': # print 'running import', name, fromlist res = apply(self._real_import, (name, globals, locals, fromlist, level)) if len(name) > len(res.__name__): res_name = name else: res_name = res.__name__ qual_name = '' for m in res_name.split('.'): qual_name += m if qual_name not in self._existing_paths and not qual_name.endswith('_rc'): # print ' adding', name, qual_name self._imported_paths.add(qual_name) # else: # if name != 'core.modules.module_registry': # print ' already exists', name, res.__name__
38976729a2a93ca9f60718bf8d475cfcfe20c329 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/38976729a2a93ca9f60718bf8d475cfcfe20c329/package.py
def populate_table(self): self._unrunnable_table.clear()
98409d064cdfec158820194ae897a365db78af1a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/98409d064cdfec158820194ae897a365db78af1a/repository.py
self._branch_button.hide()
def check_dependencies(self, index): """ determines if current VisTrail will be supported by the repository's VisTrail server """
98409d064cdfec158820194ae897a365db78af1a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/98409d064cdfec158820194ae897a365db78af1a/repository.py
self.unsupported_packages = filter(lambda p: p not in \ server_packages, local_packages)
def check_dependencies(self, index): """ determines if current VisTrail will be supported by the repository's VisTrail server """
98409d064cdfec158820194ae897a365db78af1a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/98409d064cdfec158820194ae897a365db78af1a/repository.py
print "save login state: ", self.saveLogin.checkState()
def clicked_on_login(self): """ Attempts to log into web repository stores auth cookie for session """ from gui.application import VistrailsApplication
98409d064cdfec158820194ae897a365db78af1a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/98409d064cdfec158820194ae897a365db78af1a/repository.py
print "save repo login checked"
def clicked_on_login(self): """ Attempts to log into web repository stores auth cookie for session """ from gui.application import VistrailsApplication
98409d064cdfec158820194ae897a365db78af1a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/98409d064cdfec158820194ae897a365db78af1a/repository.py
print "setting repo login" print self.dialog.loginUser.text()
def clicked_on_login(self): """ Attempts to log into web repository stores auth cookie for session """ from gui.application import VistrailsApplication
98409d064cdfec158820194ae897a365db78af1a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/98409d064cdfec158820194ae897a365db78af1a/repository.py
print "save repo login unchecked"
def clicked_on_login(self): """ Attempts to log into web repository stores auth cookie for session """ from gui.application import VistrailsApplication
98409d064cdfec158820194ae897a365db78af1a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/98409d064cdfec158820194ae897a365db78af1a/repository.py
print "removing repo login"
def clicked_on_login(self): """ Attempts to log into web repository stores auth cookie for session """ from gui.application import VistrailsApplication
98409d064cdfec158820194ae897a365db78af1a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/98409d064cdfec158820194ae897a365db78af1a/repository.py
for (m, n) in neighbors]
for (m, n) in neighbors if (Module.vtType, m.id) in id_remap]
def create_ungroup(self, full_pipeline, module_id):
e1ea9b437507d906a96b8a4f7c2bbc0cc643e3cf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/e1ea9b437507d906a96b8a4f7c2bbc0cc643e3cf/controller.py
cmdline = ['unzip', '-q','-o','-d', vt_save_dir, filename]
cmdline = ['unzip', '-q','-o','-d', vt_save_dir, shell_quote(filename)]
def open_vistrail_bundle_from_zip_xml(filename): """open_vistrail_bundle_from_zip_xml(filename) -> SaveBundle Open a vistrail from a zip compressed format. It expects that the vistrail file inside archive has name 'vistrail', the log inside archive has name 'log', abstractions inside archive have prefix 'abstraction_', and thumbnails inside archive are '.png' files in 'thumbs' dir """ core.requirements.require_executable('unzip') vt_save_dir = tempfile.mkdtemp(prefix='vt_save') output = [] cmdline = ['unzip', '-q','-o','-d', vt_save_dir, filename] result = execute_cmdline(cmdline, output) if result != 0 and len(output) != 0: raise VistrailsDBException("Unzip of '%s' failed" % filename) vistrail = None log = None log_fname = None abstraction_files = [] unknown_files = [] thumbnail_files = [] try: for root, dirs, files in os.walk(vt_save_dir): for fname in files: if fname == 'vistrail' and root == vt_save_dir: vistrail = open_vistrail_from_xml(os.path.join(root, fname)) elif fname == 'log' and root == vt_save_dir: # FIXME read log to get execution info # right now, just ignore the file log = None log_fname = os.path.join(root, fname) # log = open_log_from_xml(os.path.join(root, fname)) # objs.append(DBLog.vtType, log) elif fname.startswith('abstraction_'): abstraction_file = os.path.join(root, fname) abstraction_files.append(abstraction_file) elif (fname.endswith('.png') and root == os.path.join(vt_save_dir,'thumbs')): thumbnail_file = os.path.join(root, fname) thumbnail_files.append(thumbnail_file) else: unknown_files.append(os.path.join(root, fname)) except OSError, e: raise VistrailsDBException("Error when reading vt file") if len(unknown_files) > 0: raise VistrailsDBException("Unknown files in vt file: %s" % \ unknown_files) if vistrail is None: raise VistrailsDBException("vt file does not contain vistrail") vistrail.db_log_filename = log_fname save_bundle = SaveBundle(DBVistrail.vtType, vistrail, log, abstractions=abstraction_files, thumbnails=thumbnail_files) return (save_bundle, vt_save_dir)
cdfa0c97493d9cf5a6ddc914cab2fd1f5d55bba0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/cdfa0c97493d9cf5a6ddc914cab2fd1f5d55bba0/io.py
def open_vistrail_bundle_from_zip_xml(filename): """open_vistrail_bundle_from_zip_xml(filename) -> SaveBundle Open a vistrail from a zip compressed format. It expects that the vistrail file inside archive has name 'vistrail', the log inside archive has name 'log', abstractions inside archive have prefix 'abstraction_', and thumbnails inside archive are '.png' files in 'thumbs' dir """ core.requirements.require_executable('unzip') vt_save_dir = tempfile.mkdtemp(prefix='vt_save') output = [] cmdline = ['unzip', '-q','-o','-d', vt_save_dir, filename] result = execute_cmdline(cmdline, output) if result != 0 and len(output) != 0: raise VistrailsDBException("Unzip of '%s' failed" % filename) vistrail = None log = None log_fname = None abstraction_files = [] unknown_files = [] thumbnail_files = [] try: for root, dirs, files in os.walk(vt_save_dir): for fname in files: if fname == 'vistrail' and root == vt_save_dir: vistrail = open_vistrail_from_xml(os.path.join(root, fname)) elif fname == 'log' and root == vt_save_dir: # FIXME read log to get execution info # right now, just ignore the file log = None log_fname = os.path.join(root, fname) # log = open_log_from_xml(os.path.join(root, fname)) # objs.append(DBLog.vtType, log) elif fname.startswith('abstraction_'): abstraction_file = os.path.join(root, fname) abstraction_files.append(abstraction_file) elif (fname.endswith('.png') and root == os.path.join(vt_save_dir,'thumbs')): thumbnail_file = os.path.join(root, fname) thumbnail_files.append(thumbnail_file) else: unknown_files.append(os.path.join(root, fname)) except OSError, e: raise VistrailsDBException("Error when reading vt file") if len(unknown_files) > 0: raise VistrailsDBException("Unknown files in vt file: %s" % \ unknown_files) if vistrail is None: raise VistrailsDBException("vt file does not contain vistrail") vistrail.db_log_filename = log_fname save_bundle = SaveBundle(DBVistrail.vtType, vistrail, log, abstractions=abstraction_files, thumbnails=thumbnail_files) return (save_bundle, vt_save_dir)
cdfa0c97493d9cf5a6ddc914cab2fd1f5d55bba0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/cdfa0c97493d9cf5a6ddc914cab2fd1f5d55bba0/io.py
self.DEBUG_FILTER_BACKGROUND_COLOR = QtGui.QColor(" class MacTheme(DefaultTheme): def __init__(self):
def __init__(self): """ DefaultTheme() -> DefaultTheme This is for initializing all Qt objects """ ###################### #### MEASUREMENTS ####
1cad8e21fafbc3d6e45d1fc94e51ba147ae252b4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/1cad8e21fafbc3d6e45d1fc94e51ba147ae252b4/theme.py
self.DEBUG_FILTER_BACKGROUND_COLOR = QTransparentColor("transparent")
def name(self): return 'transparent'
1cad8e21fafbc3d6e45d1fc94e51ba147ae252b4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/1cad8e21fafbc3d6e45d1fc94e51ba147ae252b4/theme.py
cmd_list = [self.git_command() + \
if systemType == "Windows": cmd_list = [self.git_command() + \ ["archive", str(version + ':' + name)], ["%s:" % out_dirname[0], "&&", "cd", "%s"%out_dirname, "&&", 'tar', '-xf-']] else: cmd_list = [self.git_command() + \
def git_get_dir(self, name, version="HEAD", out_dirname=None): global temp_persist_files if out_dirname is None: # create a temporary directory out_dirname = tempfile.mkdtemp(prefix='vt_persist') temp_persist_files.append(out_dirname) cmd_list = [self.git_command() + \ ["archive", str(version + ':' + name)], ['tar', '-C', out_dirname, '-xf-']] debug_print('executing commands', cmd_list) result, output, errs = execute_piped_cmdlines(cmd_list) debug_print('stdout:', type(output), output) debug_print('stderr:', type(errs), errs) if result != 0: # check output for error messages raise ModuleError(self, "Error retrieving file '%s'\n" % name + errs) return out_dirname
430e29bcaf2ef3a86df6d88fe381e758d1b68b40 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/430e29bcaf2ef3a86df6d88fe381e758d1b68b40/init.py
if operation.data.vtType == Abstraction.vtType:
if operation.data is not None and operation.data.vtType == Abstraction.vtType:
def find_abstractions(self, vistrail, recurse=False): abstractions = [] for action in vistrail.actions: for operation in action.operations: if operation.vtType == 'add' or \ operation.vtType == 'change': if operation.data.vtType == Abstraction.vtType: abstraction = operation.data if abstraction.package == abstraction_pkg: abstractions.append(abstraction) if recurse: for abstraction in abstractions: try: vistrail = abstraction.vistrail except MissingPackageVersion, e: reg = core.modules.module_registry.get_module_registry() abstraction._module_descriptor = \ reg.get_similar_descriptor(*abstraction.descriptor_info) vistrail = abstraction.vistrail abstractions.extend(self.find_abstractions(vistrail, recurse)) return abstractions
a10969a95d17d70e019edcc9c295fc1850634d58 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/a10969a95d17d70e019edcc9c295fc1850634d58/controller.py
new_id = self.perform_action(action)
def add_parameter_changes_from_execution(self, pipeline, version, parameter_changes): """add_parameter_changes_from_execution(pipeline, version, parameter_changes) -> int.
a10969a95d17d70e019edcc9c295fc1850634d58 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/a10969a95d17d70e019edcc9c295fc1850634d58/controller.py
return new_id
return action.id
def add_parameter_changes_from_execution(self, pipeline, version, parameter_changes): """add_parameter_changes_from_execution(pipeline, version, parameter_changes) -> int.
a10969a95d17d70e019edcc9c295fc1850634d58 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/a10969a95d17d70e019edcc9c295fc1850634d58/controller.py
self.setupDefaultFolders()
def init(self): """ init() -> None Initialize VisTrails with optionsDict. optionsDict can be another VisTrails Configuration object, e.g. ConfigurationObject """ if self._do_load_packages: self.load_packages() self.setupDefaultFolders() if self._do_load_packages: # don't call this anymore since we do an add_package for it now # self.setupBaseModules() self.installPackages() self.runStartupHooks()
bc27cdc4b171f8884f6c910ca6e5db90d3def751 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/bc27cdc4b171f8884f6c910ca6e5db90d3def751/startup.py
def mouseReleaseEvent(self, e): """mousePressEvent(e) -> None Keep the cursor after the last prompt. """ if e.button() == QtCore.Qt.LeftButton: self.copy() cursor = self.textCursor() cursor.movePosition(QtGui.QTextCursor.End) self.setTextCursor(cursor) return
def focusNextPrevChild(self, next): """focusNextPrevChild(next) -> None Suppress tabbing to the next window in multi-line commands. """ if next and self.more: return 0 return QtGui.QTextEdit.focusNextPrevChild(self, next)
2ebd6bc4e0eb510100be16312631d9480ec1782c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/2ebd6bc4e0eb510100be16312631d9480ec1782c/shell.py
user = ""
data = node.get('user') user = convert_from_str(data, 'str')
def bool_conv(x): s = str(x).upper() if s == 'TRUE': return True if s == 'FALSE': return False
3e9473dbf8fb704899606e4928bba1e72e5dbe6f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/3e9473dbf8fb704899606e4928bba1e72e5dbe6f/locator.py
data = convert_data(op.db_data)
data = convert_data(op.db_data, op.db_parentObjType, op.db_parentObjId)
def translateVistrail(_vistrail): vistrail = DBVistrail() for _action in _vistrail.db_actions.itervalues(): ops = [] for op in _action.db_operations: if op.vtType == 'add': data = convert_data(op.db_data) ops.append(DBAdd(id=op.db_id, what=op.db_what, objectId=op.db_objectId, parentObjId=op.db_parentObjId, parentObjType=op.db_parentObjType, data=data)) elif op.vtType == 'change': data = convert_data(op.db_data) ops.append(DBChange(id=op.db_id, what=op.db_what, oldObjId=op.db_oldObjId, newObjId=op.db_newObjId, parentObjId=op.db_parentObjId, parentObjType=op.db_parentObjType, data=data)) elif op.vtType == 'delete': ops.append(DBDelete(id=op.db_id, what=op.db_what, objectId=op.db_objectId, parentObjId=op.db_parentObjId, parentObjType=op.db_parentObjType)) action = DBAction(id=_action.db_id, prevId=_action.db_prevId, date=_action.db_date, user=_action.db_user, operations=ops, annotations=_action.db_annotations.values()) vistrail.db_add_action(action) for _tag in _vistrail.db_tags.itervalues(): tag = DBTag(id=_tag.db_id, name=_tag.db_name) vistrail.db_add_tag(tag) vistrail.db_version = '0.7.0' return vistrail
e9a459aaaed9515e022f9df75afd05a395629769 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/e9a459aaaed9515e022f9df75afd05a395629769/v0_6_0.py
data = convert_data(op.db_data)
data = convert_data(op.db_data, op.db_parentObjType, op.db_parentObjId)
def translateVistrail(_vistrail): vistrail = DBVistrail() for _action in _vistrail.db_actions.itervalues(): ops = [] for op in _action.db_operations: if op.vtType == 'add': data = convert_data(op.db_data) ops.append(DBAdd(id=op.db_id, what=op.db_what, objectId=op.db_objectId, parentObjId=op.db_parentObjId, parentObjType=op.db_parentObjType, data=data)) elif op.vtType == 'change': data = convert_data(op.db_data) ops.append(DBChange(id=op.db_id, what=op.db_what, oldObjId=op.db_oldObjId, newObjId=op.db_newObjId, parentObjId=op.db_parentObjId, parentObjType=op.db_parentObjType, data=data)) elif op.vtType == 'delete': ops.append(DBDelete(id=op.db_id, what=op.db_what, objectId=op.db_objectId, parentObjId=op.db_parentObjId, parentObjType=op.db_parentObjType)) action = DBAction(id=_action.db_id, prevId=_action.db_prevId, date=_action.db_date, user=_action.db_user, operations=ops, annotations=_action.db_annotations.values()) vistrail.db_add_action(action) for _tag in _vistrail.db_tags.itervalues(): tag = DBTag(id=_tag.db_id, name=_tag.db_name) vistrail.db_add_tag(tag) vistrail.db_version = '0.7.0' return vistrail
e9a459aaaed9515e022f9df75afd05a395629769 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/e9a459aaaed9515e022f9df75afd05a395629769/v0_6_0.py
if tuple(vtk.vtkVersion().GetVTKVersion().split('.')) < ('5', '7', '0'): def get_method_signature(method): """ get_method_signature(method: vtkmethod) -> [ret, arg] Re-wrap Prabu's method to increase performance """ doc = method.__doc__ tmp = doc.split('\n') sig = [] pat = re.compile(r'\b') offset = 2+len(method.__name__) for i in xrange(len(tmp)): s = tmp[i] if s=='': break if i%2==0: x = s.split('->') arg = x[0].strip()[offset:] if len(x) == 1: ret = None
def get_method_signature(method): """ get_method_signature(method: vtkmethod) -> [ret, arg] Re-wrap Prabu's method to increase performance """ doc = method.__doc__ tmp = doc.split('\n') sig = [] pat = re.compile(r'\b') offset = 2+len(method.__name__) for i in xrange(len(tmp)): s = tmp[i] if s=='': break if i%2==0: x = s.split('->') arg = x[0].strip()[offset:] if len(x) == 1: ret = None else: ret = x[1].strip() arg = arg[1:-1] if not arg: arg = None if arg and arg[-1] == ')': arg = arg + ',' if ret and ret[:3]!='vtk': ret = eval(pat.sub('\"', ret)) if arg: if arg.find('(')!=-1: arg = eval(pat.sub('\"', arg))
def typeMap(name, package=None): """ typeMap(name: str) -> Module Convert from C/C++ types into VisTrails Module type """ if package is None: package = identifier if type(name) == tuple: return [typeMap(x, package) for x in name] if name in typeMapDict: return typeMapDict[name] else: registry = get_module_registry() if not registry.has_descriptor_with_name(package, name): return None else: return registry.get_descriptor_by_name(package, name).module
21d04ae851991cad62ae179d576dda05abc3b68d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/21d04ae851991cad62ae179d576dda05abc3b68d/init.py
ret = x[1].strip() arg = arg[1:-1] if not arg: arg = None if arg and arg[-1] == ')': arg = arg + ',' if ret and ret[:3]!='vtk': ret = eval(pat.sub('\"', ret)) if arg: if arg.find('(')!=-1: arg = eval(pat.sub('\"', arg))
arg = arg.split(', ') if len(arg)>1: arg = tuple(arg)
def get_method_signature(method): """ get_method_signature(method: vtkmethod) -> [ret, arg] Re-wrap Prabu's method to increase performance
21d04ae851991cad62ae179d576dda05abc3b68d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/21d04ae851991cad62ae179d576dda05abc3b68d/init.py
arg = arg.split(', ') if len(arg)>1: arg = tuple(arg) else: arg = arg[0] if type(arg) == str: arg = [arg] sig.append(([ret], arg)) return sig else: funcRE = re.compile(r'^(virtual|static)*([\w\d\s*&]+[\s*&])([\w\d]+)\(([\w\d\s,=-\[\]*&]*)\)', re.MULTILINE) paramRE = re.compile(r'(const\s+)*(([\w\d]+\s?)+?([*&\s]?|\b))[^=\[*]*(\[\d*\])*(\=.*)*') C2PMap = { 'unsigned': 'int', 'int': 'int', 'float': 'float', 'char': 'char', 'short': 'int', 'id': 'int', 'signed': 'int', 'double': 'float', 'long': 'int', 'bool': 'bool', 'int': 'int', 'void': 'None', 'void *': 'string', 'char *': 'string', } def convertToPythonType(pType): pType = pType.strip() m = paramRE.match(pType) if m==None: return None pType = m.group(2) if pType[:3]!='vtk': pType = pType.strip() if pType in C2PMap: pType = C2PMap[pType] else: return None else: pType = pType.replace('*', '') pType = pType.replace('&', '') pType = pType.strip() arrayStr = m.group(5) if arrayStr!=None: count = int(arrayStr[1:-1]) pType = tuple([pType]*count) return pType def get_method_signature(method): """ get_method_signature(method: vtkmethod) -> [ret, arg] Re-wrap Prabu's method to increase performance """ doc = method.__doc__ sig = [] for m in funcRE.finditer(doc): fName = m.group(3) retType = convertToPythonType(m.group(2)) argType = tuple([convertToPythonType(a) for a in m.group(4).split(',')]) if None not in argType: sig.append(([retType], argType)) return sig
arg = arg[0] if type(arg) == str: arg = [arg] sig.append(([ret], arg)) return sig
def get_method_signature(method): """ get_method_signature(method: vtkmethod) -> [ret, arg] Re-wrap Prabu's method to increase performance
21d04ae851991cad62ae179d576dda05abc3b68d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/21d04ae851991cad62ae179d576dda05abc3b68d/init.py
self.mRenWin.Render()
if self.mRenWin.GetInteractor(): self.mRenWin.GetInteractor().Render() else: self.mRenWin.Render()
def resizeEvent(self, e): """ resizeEvent(e: QEvent) -> None Re-adjust the vtkRenderWindow size then QVTKWidget resized """ qt_super(QVTKWidget, self).resizeEvent(e) if not self.mRenWin: return
e175a9549183d116184e819333c7aab42c6b4e24 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/e175a9549183d116184e819333c7aab42c6b4e24/vtkcell.py
self.mRenWin.Render()
if self.mRenWin.GetInteractor(): self.mRenWin.GetInteractor().Render() else: self.mRenWin.Render()
def paintEvent(self, e): """ paintEvent(e: QPaintEvent) -> None Paint the QVTKWidget with vtkRenderWindow """ iren = None if self.mRenWin: iren = self.mRenWin.GetInteractor()
e175a9549183d116184e819333c7aab42c6b4e24 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/e175a9549183d116184e819333c7aab42c6b4e24/vtkcell.py
self.mRenWin.Render() self.mRenWin.Render()
if self.mRenWin.GetInteractor(): self.mRenWin.GetInteractor().Render() self.mRenWin.GetInteractor().Render() else: self.mRenWin.Render() self.mRenWin.Render()
def saveToPNG(self, filename): """ saveToPNG(filename: str) -> filename or vtkUnsignedCharArray Save the current widget contents to an image file. If str==None, then it returns the vtkUnsignedCharArray containing the PNG image. Otherwise, the filename is returned. """ w2i = vtk.vtkWindowToImageFilter() w2i.ReadFrontBufferOff() w2i.SetInput(self.mRenWin) # Render twice to get a clean image on the back buffer self.mRenWin.Render() self.mRenWin.Render() w2i.Update() writer = vtk.vtkPNGWriter() writer.SetInputConnection(w2i.GetOutputPort()) if filename!=None: writer.SetFileName(filename) else: writer.WriteToMemoryOn() writer.Write() if filename: return filename else: return writer.GetResult()
e175a9549183d116184e819333c7aab42c6b4e24 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/e175a9549183d116184e819333c7aab42c6b4e24/vtkcell.py
return self.perform_action(action)
res = self.perform_action(action) self.current_pipeline.ensure_modules_are_on_registry( [m.id for m in modules]) self.current_pipeline.ensure_connection_specs( [c.id for c in connections]) return res
def create_ungroup(self, module_id): (modules, connections) = \ BaseController.create_ungroup(self, self.current_pipeline, module_id) pipeline = self.current_pipeline old_conn_ids = self.get_module_connection_ids([module_id], pipeline.graph) op_list = [] op_list.extend(('delete', pipeline.connections[c_id]) for c_id in old_conn_ids) op_list.append(('delete', pipeline.modules[module_id])) op_list.extend(('add', m) for m in modules) op_list.extend(('add', c) for c in connections) action = core.db.action.create_action(op_list) self.add_new_action(action) return self.perform_action(action)
bbee8ea9af592f23314df03d332e95ea15e42fec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/bbee8ea9af592f23314df03d332e95ea15e42fec/vistrail_controller.py
cmd_list = [["echo", str(version + ':' + name)], self.git_command() + ["cat-file", "--batch-check"]]
cmd_list = [self.git_command() + ["cat-file", "-t", str(version + ':' + name)]]
def git_get_type(self, name, version="HEAD"): cmd_list = [["echo", str(version + ':' + name)], self.git_command() + ["cat-file", "--batch-check"]] debug_print('executing commands', cmd_list) result, output, errs = execute_piped_cmdlines(cmd_list) debug_print('stdout:', type(output), output) debug_print('stderr:', type(errs), errs) if result != 0: # check output for error messages raise ModuleError(self, "Error retrieving file '%s'" % name + errs) return output.split(None, 2)[1]
df8a7c2ef7d174e4db413bdc85c13c730f6c0437 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/df8a7c2ef7d174e4db413bdc85c13c730f6c0437/init.py
return output.split(None, 2)[1]
return output.split(None,1)[0]
def git_get_type(self, name, version="HEAD"): cmd_list = [["echo", str(version + ':' + name)], self.git_command() + ["cat-file", "--batch-check"]] debug_print('executing commands', cmd_list) result, output, errs = execute_piped_cmdlines(cmd_list) debug_print('stdout:', type(output), output) debug_print('stderr:', type(errs), errs) if result != 0: # check output for error messages raise ModuleError(self, "Error retrieving file '%s'" % name + errs) return output.split(None, 2)[1]
df8a7c2ef7d174e4db413bdc85c13c730f6c0437 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/df8a7c2ef7d174e4db413bdc85c13c730f6c0437/init.py
if invalid_module.internal_version != invalid_module.module_descriptor.version:
desc = None try:
def attempt_automatic_upgrade(controller, pipeline, module_id, function_remap={}, src_port_remap={}, dst_port_remap={}, annotation_remap={}): """attempt_automatic_upgrade(module_id, pipeline): [Action]
6599e17ec5695db0a0389e47986fbae0d2b583d5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/6599e17ec5695db0a0389e47986fbae0d2b583d5/upgradeworkflow.py
else: abs_fname = invalid_module.module_descriptor.module.vt_fname abs_name = controller.parse_abstraction_name(abs_fname) lookup = {abs_name: abs_fname} descriptor_info = invalid_module.descriptor_info newest_version = str(invalid_module.vistrail.get_latest_version()) desc = controller.check_abstraction((descriptor_info[0], descriptor_info[1], descriptor_info[2], descriptor_info[3], newest_version), lookup) desired_version = desc.version
except: pass if desc is not None: if invalid_module.internal_version != desc.version: pass else: abs_fname = invalid_module.module_descriptor.module.vt_fname abs_name = controller.parse_abstraction_name(abs_fname) lookup = {abs_name: abs_fname} descriptor_info = invalid_module.descriptor_info newest_version = str(invalid_module.vistrail.get_latest_version()) desc = controller.check_abstraction((descriptor_info[0], descriptor_info[1], descriptor_info[2], descriptor_info[3], newest_version), lookup) desired_version = desc.version
def attempt_automatic_upgrade(controller, pipeline, module_id, function_remap={}, src_port_remap={}, dst_port_remap={}, annotation_remap={}): """attempt_automatic_upgrade(module_id, pipeline): [Action]
6599e17ec5695db0a0389e47986fbae0d2b583d5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/6599e17ec5695db0a0389e47986fbae0d2b583d5/upgradeworkflow.py
""" paintEvent(e: QPaintEvent) -> QPaintEngine
""" paintEngine() -> QPaintEngine
def paintEngine(self): """ paintEvent(e: QPaintEvent) -> QPaintEngine On Windows, this has to return None to fully disable double-buffer (we let vtkRenderWindow handle this instead). """ if system.systemType=='Win32': return None else: return QCellWidget.paintEngine(self)
39fe2d1e1139c161cecaa412212e7e137c43866f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/39fe2d1e1139c161cecaa412212e7e137c43866f/vtkcell.py
if system.systemType=='Win32':
if system.systemType in ['Windows', 'Microsoft']:
def paintEngine(self): """ paintEvent(e: QPaintEvent) -> QPaintEngine On Windows, this has to return None to fully disable double-buffer (we let vtkRenderWindow handle this instead). """ if system.systemType=='Win32': return None else: return QCellWidget.paintEngine(self)
39fe2d1e1139c161cecaa412212e7e137c43866f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/39fe2d1e1139c161cecaa412212e7e137c43866f/vtkcell.py
if exPipe:
if exPipe is not None:
def compute(self): exPipe = self.forceGetInputFromPort('ExternalPipe') if exPipe: self.setResult('InternalPipe', exPipe) else: self.setResult('InternalPipe', InvalidOutput)
6fc007c0535d1a760281242526c5194698eecb72 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/6fc007c0535d1a760281242526c5194698eecb72/sub_module.py
if type(sig_item) == __builtin__.type: return (sig_item, '<no description>') elif type(sig_item) == __builtin__.tuple:
if type(sig_item) == __builtin__.tuple:
def canonicalize(sig_item): if type(sig_item) == __builtin__.type: return (sig_item, '<no description>') elif type(sig_item) == __builtin__.tuple: # assert len(sig_item) == 2 # assert type(sig_item[0]) == __builtin__.type # assert type(sig_item[1]) == __builtin__.str return sig_item elif type(sig_item) == __builtin__.list: return (registry.get_descriptor_by_name('edu.utah.sci.vistrails.basic', 'List').module, '<no description>')
0f03291efbf6709dea62fb1e26e87a0a0edd6236 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/0f03291efbf6709dea62fb1e26e87a0a0edd6236/port_spec.py
handler = logging.handlers.RotatingFileHandler(f, maxBytes=1024*1024, backupCount=5)
import core.system if core.system.systemType in ["Windows", "Microsoft"]: rotate_file_if_necessary(f) handler = logging.FileHandler(f) else: handler = logging.handlers.RotatingFileHandler(f, maxBytes=1024*1024, backupCount=5)
def set_logfile(self, f): """set_logfile(file) -> None. Redirects debugging output to file.""" try: handler = logging.handlers.RotatingFileHandler(f, maxBytes=1024*1024, backupCount=5) handler.setFormatter(self.format) handler.setLevel(logging.DEBUG) if self.fhandler: self.logger.removeHandler(self.fhandler) self.fhandler = handler self.logger.addHandler(handler)
e5afc47797cbf5544255244d199279f1cd8aec73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/e5afc47797cbf5544255244d199279f1cd8aec73/debug.py
def git_get_hash(self, name, version="HEAD"): cmd_list = [["echo", str(version + ':' + name)], self.git_command() + ["cat-file", "--batch-check"]]
def git_get_hash(self, name): cmd_list = [self.git_command() + ["ls-files", "--stage", str(name)]]
def git_get_hash(self, name, version="HEAD"): cmd_list = [["echo", str(version + ':' + name)], self.git_command() + ["cat-file", "--batch-check"]] debug_print('executing commands', cmd_list) result, output, errs = execute_piped_cmdlines(cmd_list) debug_print('stdout:', type(output), output) debug_print('stderr:', type(errs), errs) if result != 0: # check output for error messages raise ModuleError(self, "Error retrieving file '%s'\n" % name + errs) return output.split(None, 1)[0]
1b190225cce9e4fbbd1fe9e0fd1d77297b6572cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/1b190225cce9e4fbbd1fe9e0fd1d77297b6572cb/init.py
return output.split(None, 1)[0]
return output.split(None, 2)[1]
def git_get_hash(self, name, version="HEAD"): cmd_list = [["echo", str(version + ':' + name)], self.git_command() + ["cat-file", "--batch-check"]] debug_print('executing commands', cmd_list) result, output, errs = execute_piped_cmdlines(cmd_list) debug_print('stdout:', type(output), output) debug_print('stderr:', type(errs), errs) if result != 0: # check output for error messages raise ModuleError(self, "Error retrieving file '%s'\n" % name + errs) return output.split(None, 1)[0]
1b190225cce9e4fbbd1fe9e0fd1d77297b6572cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/1b190225cce9e4fbbd1fe9e0fd1d77297b6572cb/init.py
context['commands'] = [] context['contains'] = [] import pmxbot.pmxbot as p p.run(configInput = context['config'], start=False) for typ, name, f, doc, channels, exclude, rate in sorted(p._handler_registry, key=lambda x: x[1]): if typ == 'command': aliases = sorted([x[1] for x in p._handler_registry if x[0] == 'alias' and x[2] == f]) context['commands'].append((name, doc, aliases)) elif typ == 'contains': context['contains'].append((name, doc))
if not self.run: self.commands = [] self.contains = [] import pmxbot.pmxbot as p p.run(configInput = context['config'], start=False) for typ, name, f, doc, channels, exclude, rate in sorted(p._handler_registry, key=lambda x: x[1]): if typ == 'command': aliases = sorted([x[1] for x in p._handler_registry if x[0] == 'alias' and x[2] == f]) self.commands.append((name, doc, aliases)) elif typ == 'contains': self.contains.append((name, doc)) self.run = True context['commands'] = self.commands context['contains'] = self.contains
def default(self): page = jenv.get_template('help.html') context = get_context() context['commands'] = [] context['contains'] = [] import pmxbot.pmxbot as p p.run(configInput = context['config'], start=False) for typ, name, f, doc, channels, exclude, rate in sorted(p._handler_registry, key=lambda x: x[1]): if typ == 'command': aliases = sorted([x[1] for x in p._handler_registry if x[0] == 'alias' and x[2] == f]) context['commands'].append((name, doc, aliases)) elif typ == 'contains': context['contains'].append((name, doc)) return page.render(**context)
c95eef754eedf5f78410e7b070e7b6288ccdccbf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/999/c95eef754eedf5f78410e7b070e7b6288ccdccbf/viewer.py
self.assertRaises(Exception, test_view('ldap_connection'))
test_view('ldap_connection')
def test0005views(self): ''' Test views. ''' self.assertRaises(Exception, test_view('ldap_connection'))
f6f169d242c6a66b279b8dcf034c271c4c72f84b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9308/f6f169d242c6a66b279b8dcf034c271c4c72f84b/test_ldap_connection.py
scale = diff_time
scale = diff_time / (self.scale_x)
def onTimer(self, timer): new_time = time() diff_time = new_time - self.cur_time self.cur_time = new_time
3983c3f67a8639c4935944d901fe4252411f93ce /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4166/3983c3f67a8639c4935944d901fe4252411f93ce/dash2.py
queue1.put(('startobsblock',) + tuple(args))
queue1.put(args)
def startobsblock(self, args): _logger.info('Received start observing block command') queue1.put(('startobsblock',) + tuple(args))
f0f56d534c156a20f445d9e93a14f6d83f1abb02 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3469/f0f56d534c156a20f445d9e93a14f6d83f1abb02/dbengine.py
hdulist.writeto('data/' + filename, clobber=True)
hdulist.writeto(os.path.join(datadir, filename), clobber=True)
def store_image(bindata, index): # Convert binary data back to HDUList handle = StringIO.StringIO(bindata) hdulist = pyfits.open(handle) # Write to disk filename = FORMAT % index hdulist.writeto('data/' + filename, clobber=True) # Update database img = Images(filename) img.exposure = hdulist[0].header['EXPOSED'] img.imgtype = hdulist[0].header['IMGTYP'] img.stamp = datetime.datetime.utcnow() ob.images.append(img) session.commit()
f0f56d534c156a20f445d9e93a14f6d83f1abb02 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3469/f0f56d534c156a20f445d9e93a14f6d83f1abb02/dbengine.py
activity_toolbar = toolbox.get_activity_toolbar()
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
c0e1917cf0d4900abd5013a385d6af6f05895e07 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/c0e1917cf0d4900abd5013a385d6af6f05895e07/pippy_app.py
goicon_bw = gtk.Image() goicon_bw.set_from_file("%s/icons/run_bw.svg" % os.getcwd()) goicon_color = gtk.Image() goicon_color.set_from_file("%s/icons/run_color.svg" % os.getcwd()) gobutton = ToolButton(label=_("_Run!")) gobutton.props.accelerator = _('<alt>r') gobutton.set_icon_widget(goicon_bw) gobutton.set_tooltip("Run") gobutton.connect('clicked', self.flash_cb, dict({'bw':goicon_bw, 'color':goicon_color})) gobutton.connect('clicked', self.gobutton_cb) activity_toolbar.insert(gobutton, 2) stopicon_bw = gtk.Image() stopicon_bw.set_from_file("%s/icons/stopit_bw.svg" % os.getcwd()) stopicon_color = gtk.Image() stopicon_color.set_from_file("%s/icons/stopit_color.svg" % os.getcwd()) stopbutton = ToolButton(label=_("_Stop")) stopbutton.props.accelerator = _('<alt>s') stopbutton.set_icon_widget(stopicon_bw) stopbutton.connect('clicked', self.flash_cb, dict({'bw':stopicon_bw, 'color':stopicon_color})) stopbutton.connect('clicked', self.stopbutton_cb) stopbutton.set_tooltip("Stop Running") activity_toolbar.insert(stopbutton, 3) clearicon_bw = gtk.Image() clearicon_bw.set_from_file("%s/icons/eraser_bw.svg" % os.getcwd()) clearicon_color = gtk.Image() clearicon_color.set_from_file("%s/icons/eraser_color.svg" % os.getcwd()) clearbutton = ToolButton(label=_("_Clear")) clearbutton.props.accelerator = _('<alt>c') clearbutton.set_icon_widget(clearicon_bw) clearbutton.connect('clicked', self.clearbutton_cb) clearbutton.connect('clicked', self.flash_cb, dict({'bw':clearicon_bw, 'color':clearicon_color})) clearbutton.set_tooltip("Clear") activity_toolbar.insert(clearbutton, 4) separator = gtk.SeparatorToolItem() separator.set_draw(True) activity_toolbar.insert(separator, 5)
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
c0e1917cf0d4900abd5013a385d6af6f05895e07 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/c0e1917cf0d4900abd5013a385d6af6f05895e07/pippy_app.py
hpane = gtk.HPaned() vpane = gtk.VPaned()
hbox = gtk.HBox() vbox = gtk.VBox()
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
c0e1917cf0d4900abd5013a385d6af6f05895e07 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/c0e1917cf0d4900abd5013a385d6af6f05895e07/pippy_app.py
treeview.set_size_request(int(SIZE_X * 0.3), SIZE_Y)
treeview.set_size_request(220, 900)
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
c0e1917cf0d4900abd5013a385d6af6f05895e07 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/c0e1917cf0d4900abd5013a385d6af6f05895e07/pippy_app.py
hpane.add1(sidebar)
hbox.pack_start(sidebar)
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
c0e1917cf0d4900abd5013a385d6af6f05895e07 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/c0e1917cf0d4900abd5013a385d6af6f05895e07/pippy_app.py
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
c0e1917cf0d4900abd5013a385d6af6f05895e07 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/c0e1917cf0d4900abd5013a385d6af6f05895e07/pippy_app.py
self.text_view.set_size_request(0, int(SIZE_Y * 0.5))
self.text_view.set_size_request(900, 350)
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
c0e1917cf0d4900abd5013a385d6af6f05895e07 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/c0e1917cf0d4900abd5013a385d6af6f05895e07/pippy_app.py
vpane.add1(codesw)
vbox.pack_start(codesw) buttonhbox = gtk.HBox() goicon = gtk.Image() goicon.set_from_stock(gtk.STOCK_YES, gtk.ICON_SIZE_BUTTON) gobutton = gtk.Button(label=_("_Run!")) gobutton.set_image(goicon) gobutton.connect('clicked', self.gobutton_cb) gobutton.set_size_request(650, 2) buttonhbox.pack_start(gobutton) stopbutton = gtk.Button(stock=gtk.STOCK_STOP) stopbutton.connect('clicked', self.stopbutton_cb) stopbutton.set_size_request(200, 2) buttonhbox.pack_start(stopbutton) clearbutton = gtk.Button(stock=gtk.STOCK_CLEAR) clearbutton.connect('clicked', self.clearbutton_cb) clearbutton.set_size_request(150, 2) buttonhbox.pack_end(clearbutton) vbox.pack_start(buttonhbox)
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
c0e1917cf0d4900abd5013a385d6af6f05895e07 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/c0e1917cf0d4900abd5013a385d6af6f05895e07/pippy_app.py
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
c0e1917cf0d4900abd5013a385d6af6f05895e07 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/c0e1917cf0d4900abd5013a385d6af6f05895e07/pippy_app.py
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
c0e1917cf0d4900abd5013a385d6af6f05895e07 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/c0e1917cf0d4900abd5013a385d6af6f05895e07/pippy_app.py
vpane.add2(outbox) hpane.add2(vpane) self.set_canvas(hpane)
vbox.pack_end(outbox) hbox.pack_end(vbox) self.set_canvas(hbox)
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
c0e1917cf0d4900abd5013a385d6af6f05895e07 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/c0e1917cf0d4900abd5013a385d6af6f05895e07/pippy_app.py
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
c0e1917cf0d4900abd5013a385d6af6f05895e07 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/c0e1917cf0d4900abd5013a385d6af6f05895e07/pippy_app.py
def timer_cb(self, button, icons): button.set_icon_widget(icons['bw']) button.show_all() return False def flash_cb(self, button, icons): button.set_icon_widget(icons['color']) button.show_all() gobject.timeout_add(400, self.timer_cb, button, icons)
def selection_cb(self, column): self.save() model, _iter = column.get_selected() value = model.get_value(_iter,0) self._logger.debug("clicked! %s" % value['path']) _file = open(value['path'], 'r') lines = _file.readlines() global text_buffer text_buffer.set_text("".join(lines)) self.metadata['title'] = value['name'] self.stopbutton_cb(None) self._reset_vte() self.text_view.grab_focus()
c0e1917cf0d4900abd5013a385d6af6f05895e07 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/c0e1917cf0d4900abd5013a385d6af6f05895e07/pippy_app.py
def gobutton_cb(self, button): from shutil import copy2 self.stopbutton_cb(button) # try stopping old code first. self._reset_vte()
c0e1917cf0d4900abd5013a385d6af6f05895e07 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/c0e1917cf0d4900abd5013a385d6af6f05895e07/pippy_app.py
def gobutton_cb(self, button): from shutil import copy2 self.stopbutton_cb(button) # try stopping old code first. self._reset_vte()
c0e1917cf0d4900abd5013a385d6af6f05895e07 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/c0e1917cf0d4900abd5013a385d6af6f05895e07/pippy_app.py
def write_file(self, file_path): self.metadata['mime_type'] = 'text/x-python' global text_buffer start, end = text_buffer.get_bounds() text = text_buffer.get_text(start, end) _file = open(file_path, 'w') _file.write(text)
c0e1917cf0d4900abd5013a385d6af6f05895e07 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/c0e1917cf0d4900abd5013a385d6af6f05895e07/pippy_app.py
def read_file(self, file_path): text = open(file_path).read() # discard the '#!/usr/bin/python' and 'coding: utf-8' lines, if present text = re.sub(r'^' + re.escape(PYTHON_PREFIX), '', text) global text_buffer text_buffer.set_text(text)
c0e1917cf0d4900abd5013a385d6af6f05895e07 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/c0e1917cf0d4900abd5013a385d6af6f05895e07/pippy_app.py
self.hbox = gtk.HBox() vbox = gtk.VBox()
self.hpane = gtk.HPaned() self.vpane = gtk.VPaned()
def initialize_display(self): self._logger = logging.getLogger('pippy-activity')
15cc3eb1beb726a2af26b5552c7f7a5016157644 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/15cc3eb1beb726a2af26b5552c7f7a5016157644/pippy_app.py
treeview.set_size_request(220, 900)
treeview.set_size_request(int(SIZE_X * 0.3), SIZE_Y)
def initialize_display(self): self._logger = logging.getLogger('pippy-activity')
15cc3eb1beb726a2af26b5552c7f7a5016157644 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/15cc3eb1beb726a2af26b5552c7f7a5016157644/pippy_app.py
self.hbox.pack_start(self.sidebar)
self.hpane.add1(self.sidebar)
def initialize_display(self): self._logger = logging.getLogger('pippy-activity')
15cc3eb1beb726a2af26b5552c7f7a5016157644 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/15cc3eb1beb726a2af26b5552c7f7a5016157644/pippy_app.py
def initialize_display(self): self._logger = logging.getLogger('pippy-activity')
15cc3eb1beb726a2af26b5552c7f7a5016157644 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/15cc3eb1beb726a2af26b5552c7f7a5016157644/pippy_app.py
self.text_view.set_size_request(900, 350)
self.text_view.set_size_request(0, int(SIZE_Y * 0.5))
def initialize_display(self): self._logger = logging.getLogger('pippy-activity')
15cc3eb1beb726a2af26b5552c7f7a5016157644 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/15cc3eb1beb726a2af26b5552c7f7a5016157644/pippy_app.py
self.text_view.modify_font(pango.FontDescription("Monospace " +
self.text_view.modify_font(pango.FontDescription("Monospace " +
def initialize_display(self): self._logger = logging.getLogger('pippy-activity')
15cc3eb1beb726a2af26b5552c7f7a5016157644 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/15cc3eb1beb726a2af26b5552c7f7a5016157644/pippy_app.py
vbox.pack_start(codesw) buttonhbox = gtk.HBox() goicon = gtk.Image() goicon.set_from_stock(gtk.STOCK_YES, gtk.ICON_SIZE_BUTTON) gobutton = gtk.Button(label=_("_Run!")) gobutton.set_image(goicon) gobutton.connect('clicked', self.gobutton_cb) gobutton.set_size_request(650, 2) buttonhbox.pack_start(gobutton) stopbutton = gtk.Button(stock=gtk.STOCK_STOP) stopbutton.connect('clicked', self.stopbutton_cb) stopbutton.set_size_request(200, 2) buttonhbox.pack_start(stopbutton) clearbutton = gtk.Button(stock=gtk.STOCK_CLEAR) clearbutton.connect('clicked', self.clearbutton_cb) clearbutton.set_size_request(150, 2) buttonhbox.pack_end(clearbutton) vbox.pack_start(buttonhbox)
self.vpane.add1(codesw)
def initialize_display(self): self._logger = logging.getLogger('pippy-activity')
15cc3eb1beb726a2af26b5552c7f7a5016157644 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/15cc3eb1beb726a2af26b5552c7f7a5016157644/pippy_app.py
def initialize_display(self): self._logger = logging.getLogger('pippy-activity')
15cc3eb1beb726a2af26b5552c7f7a5016157644 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/15cc3eb1beb726a2af26b5552c7f7a5016157644/pippy_app.py
self._vte.set_size_request(200, 300)
def initialize_display(self): self._logger = logging.getLogger('pippy-activity')
15cc3eb1beb726a2af26b5552c7f7a5016157644 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/15cc3eb1beb726a2af26b5552c7f7a5016157644/pippy_app.py
def initialize_display(self): self._logger = logging.getLogger('pippy-activity')
15cc3eb1beb726a2af26b5552c7f7a5016157644 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/15cc3eb1beb726a2af26b5552c7f7a5016157644/pippy_app.py
vbox.pack_end(outbox) self.hbox.pack_end(vbox) return self.hbox
self.vpane.add2(outbox) self.hpane.add2(self.vpane) return self.hpane
def initialize_display(self): self._logger = logging.getLogger('pippy-activity')
15cc3eb1beb726a2af26b5552c7f7a5016157644 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/15cc3eb1beb726a2af26b5552c7f7a5016157644/pippy_app.py
self.hbox.remove(self.sidebar)
self.hpane.remove(self.hpane.get_child1())
def when_shared(self): self.hbox.remove(self.sidebar) global text_buffer self.cloud.sharefield = groupthink.gtk_tools.TextBufferSharePoint(text_buffer)
15cc3eb1beb726a2af26b5552c7f7a5016157644 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/15cc3eb1beb726a2af26b5552c7f7a5016157644/pippy_app.py
def timer_cb(self, button, icons): button.set_icon_widget(icons['bw']) button.show_all() return False def flash_cb(self, button, icons): button.set_icon_widget(icons['color']) button.show_all() gobject.timeout_add(400, self.timer_cb, button, icons)
def selection_cb(self, column): self.save() model, _iter = column.get_selected() value = model.get_value(_iter,0) self._logger.debug("clicked! %s" % value['path']) _file = open(value['path'], 'r') lines = _file.readlines() global text_buffer text_buffer.set_text("".join(lines)) self.metadata['title'] = value['name'] self.stopbutton_cb(None) self._reset_vte() self.text_view.grab_focus()
15cc3eb1beb726a2af26b5552c7f7a5016157644 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/15cc3eb1beb726a2af26b5552c7f7a5016157644/pippy_app.py
def gobutton_cb(self, button): from shutil import copy2 self.stopbutton_cb(button) # try stopping old code first. self._reset_vte() # FIXME: We're losing an odd race here # gtk.main_iteration(block=False) pippy_app_name = '%s/tmp/pippy_app.py' % self.get_activity_root() self._write_text_buffer(pippy_app_name) # write activity.py here too, to support pippy-based activities. copy2('%s/activity.py' % get_bundle_path(), '%s/tmp/activity.py' % self.get_activity_root())
15cc3eb1beb726a2af26b5552c7f7a5016157644 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/15cc3eb1beb726a2af26b5552c7f7a5016157644/pippy_app.py
def gobutton_cb(self, button): from shutil import copy2 self.stopbutton_cb(button) # try stopping old code first. self._reset_vte() # FIXME: We're losing an odd race here # gtk.main_iteration(block=False) pippy_app_name = '%s/tmp/pippy_app.py' % self.get_activity_root() self._write_text_buffer(pippy_app_name) # write activity.py here too, to support pippy-based activities. copy2('%s/activity.py' % get_bundle_path(), '%s/tmp/activity.py' % self.get_activity_root())
15cc3eb1beb726a2af26b5552c7f7a5016157644 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/15cc3eb1beb726a2af26b5552c7f7a5016157644/pippy_app.py
def save_to_journal(self, file_path, cloudstring): _file = open(file_path, 'w') if not self._shared_activity: self.metadata['mime_type'] = 'text/x-python' global text_buffer start, end = text_buffer.get_bounds() text = text_buffer.get_text(start, end) _file.write(text) else: self.metadata['mime_type'] = groupthink_mimetype _file.write(cloudstring)
15cc3eb1beb726a2af26b5552c7f7a5016157644 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/15cc3eb1beb726a2af26b5552c7f7a5016157644/pippy_app.py
def load_from_journal(self, file_path): if self.metadata['mime_type'] == 'text/x-python': text = open(file_path).read() # discard the '#!/usr/bin/python' and 'coding: utf-8' lines, if present text = re.sub(r'^' + re.escape(PYTHON_PREFIX), '', text) global text_buffer text_buffer.set_text(text) elif self.metadata['mime_type'] == groupthink_mimetype: return open(file_path).read()
15cc3eb1beb726a2af26b5552c7f7a5016157644 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/15cc3eb1beb726a2af26b5552c7f7a5016157644/pippy_app.py
hbox = gtk.HBox() vbox = gtk.VBox()
hpane = gtk.HPaned() vpane = gtk.VPaned()
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
022d096d4933fb8b27ead24e0904a67e14e88379 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/022d096d4933fb8b27ead24e0904a67e14e88379/pippy_app.py
treeview.set_size_request(220, 900)
treeview.set_size_request(int(SIZE_X * 0.3), SIZE_Y)
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
022d096d4933fb8b27ead24e0904a67e14e88379 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/022d096d4933fb8b27ead24e0904a67e14e88379/pippy_app.py
hbox.pack_start(sidebar)
hpane.add1(sidebar)
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
022d096d4933fb8b27ead24e0904a67e14e88379 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/022d096d4933fb8b27ead24e0904a67e14e88379/pippy_app.py
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
022d096d4933fb8b27ead24e0904a67e14e88379 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/022d096d4933fb8b27ead24e0904a67e14e88379/pippy_app.py
self.text_view.set_size_request(900, 350)
self.text_view.set_size_request(0, int(SIZE_Y * 0.5))
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
022d096d4933fb8b27ead24e0904a67e14e88379 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/022d096d4933fb8b27ead24e0904a67e14e88379/pippy_app.py
vbox.pack_start(codesw) buttonhbox = gtk.HBox() goicon = gtk.Image() goicon.set_from_stock(gtk.STOCK_YES, gtk.ICON_SIZE_BUTTON) gobutton = gtk.Button(label=_("_Run!")) gobutton.set_image(goicon) gobutton.connect('clicked', self.gobutton_cb) gobutton.set_size_request(650, 2) buttonhbox.pack_start(gobutton) stopbutton = gtk.Button(stock=gtk.STOCK_STOP) stopbutton.connect('clicked', self.stopbutton_cb) stopbutton.set_size_request(200, 2) buttonhbox.pack_start(stopbutton) clearbutton = gtk.Button(stock=gtk.STOCK_CLEAR) clearbutton.connect('clicked', self.clearbutton_cb) clearbutton.set_size_request(150, 2) buttonhbox.pack_end(clearbutton) vbox.pack_start(buttonhbox)
vpane.add1(codesw)
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
022d096d4933fb8b27ead24e0904a67e14e88379 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/022d096d4933fb8b27ead24e0904a67e14e88379/pippy_app.py
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
022d096d4933fb8b27ead24e0904a67e14e88379 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/022d096d4933fb8b27ead24e0904a67e14e88379/pippy_app.py
self._vte.set_size_request(200, 300)
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
022d096d4933fb8b27ead24e0904a67e14e88379 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/022d096d4933fb8b27ead24e0904a67e14e88379/pippy_app.py
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
022d096d4933fb8b27ead24e0904a67e14e88379 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/022d096d4933fb8b27ead24e0904a67e14e88379/pippy_app.py
vbox.pack_end(outbox) hbox.pack_end(vbox) self.set_canvas(hbox)
vpane.add2(outbox) hpane.add2(vpane) self.set_canvas(hpane)
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
022d096d4933fb8b27ead24e0904a67e14e88379 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/022d096d4933fb8b27ead24e0904a67e14e88379/pippy_app.py
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
022d096d4933fb8b27ead24e0904a67e14e88379 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/022d096d4933fb8b27ead24e0904a67e14e88379/pippy_app.py
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
022d096d4933fb8b27ead24e0904a67e14e88379 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/022d096d4933fb8b27ead24e0904a67e14e88379/pippy_app.py
def timer_cb(self, button, icons): button.set_icon_widget(icons['bw']) button.show_all() return False def flash_cb(self, button, icons): button.set_icon_widget(icons['color']) button.show_all() gobject.timeout_add(400, self.timer_cb, button, icons)
def selection_cb(self, column): self.save() model, _iter = column.get_selected() value = model.get_value(_iter,0) self._logger.debug("clicked! %s" % value['path']) _file = open(value['path'], 'r') lines = _file.readlines() global text_buffer text_buffer.set_text("".join(lines)) self.metadata['title'] = value['name'] self.stopbutton_cb(None) self._reset_vte() self.text_view.grab_focus()
022d096d4933fb8b27ead24e0904a67e14e88379 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/022d096d4933fb8b27ead24e0904a67e14e88379/pippy_app.py
def gobutton_cb(self, button): from shutil import copy2 self.stopbutton_cb(button) # try stopping old code first. self._reset_vte() # FIXME: We're losing an odd race here # gtk.main_iteration(block=False) pippy_app_name = '%s/tmp/pippy_app.py' % self.get_activity_root() self._write_text_buffer(pippy_app_name) # write activity.py here too, to support pippy-based activities. copy2('%s/activity.py' % get_bundle_path(), '%s/tmp/activity.py' % self.get_activity_root())
022d096d4933fb8b27ead24e0904a67e14e88379 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/022d096d4933fb8b27ead24e0904a67e14e88379/pippy_app.py
def gobutton_cb(self, button): from shutil import copy2 self.stopbutton_cb(button) # try stopping old code first. self._reset_vte() # FIXME: We're losing an odd race here # gtk.main_iteration(block=False) pippy_app_name = '%s/tmp/pippy_app.py' % self.get_activity_root() self._write_text_buffer(pippy_app_name) # write activity.py here too, to support pippy-based activities. copy2('%s/activity.py' % get_bundle_path(), '%s/tmp/activity.py' % self.get_activity_root())
022d096d4933fb8b27ead24e0904a67e14e88379 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/022d096d4933fb8b27ead24e0904a67e14e88379/pippy_app.py
def write_file(self, file_path): self.metadata['mime_type'] = 'text/x-python' global text_buffer start, end = text_buffer.get_bounds() text = text_buffer.get_text(start, end) _file = open(file_path, 'w') _file.write(text)
022d096d4933fb8b27ead24e0904a67e14e88379 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/022d096d4933fb8b27ead24e0904a67e14e88379/pippy_app.py
def read_file(self, file_path): text = open(file_path).read() # discard the '#!/usr/bin/python' and 'coding: utf-8' lines, if present text = re.sub(r'^' + re.escape(PYTHON_PREFIX), '', text) global text_buffer text_buffer.set_text(text)
022d096d4933fb8b27ead24e0904a67e14e88379 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/022d096d4933fb8b27ead24e0904a67e14e88379/pippy_app.py
python_c_extension = Extension("google.protobuf.internal._net_proto2___python", [ "google/protobuf/pyext/python_descriptor.cc", "google/protobuf/pyext/python_protobuf.cc", "google/protobuf/pyext/python-proto2.cc", ], include_dirs = [ "../src", ".", ], libraries = [ "protobuf" ], runtime_library_dirs = [ "../src/.libs" ], library_dirs = [ "../src/.libs" ], )
ext_module_list = [] if os.getenv("PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION", "python") == "cpp": print "Using EXPERIMENTAL C++ Implmenetation." ext_module_list.append(Extension( "google.protobuf.internal._net_proto2___python", [ "google/protobuf/pyext/python_descriptor.cc", "google/protobuf/pyext/python_protobuf.cc", "google/protobuf/pyext/python-proto2.cc" ], include_dirs = [ "../src", ".", ], libraries = [ "protobuf" ], runtime_library_dirs = [ "../src/.libs" ], library_dirs = [ "../src/.libs" ]))
def MakeTestSuite(): # This is apparently needed on some systems to make sure that the tests # work even if a previous version is already installed. if 'google' in sys.modules: del sys.modules['google'] generate_proto("../src/google/protobuf/unittest.proto") generate_proto("../src/google/protobuf/unittest_custom_options.proto") generate_proto("../src/google/protobuf/unittest_import.proto") generate_proto("../src/google/protobuf/unittest_mset.proto") generate_proto("../src/google/protobuf/unittest_no_generic_services.proto") generate_proto("google/protobuf/internal/more_extensions.proto") generate_proto("google/protobuf/internal/more_messages.proto") import unittest import google.protobuf.internal.generator_test as generator_test import google.protobuf.internal.descriptor_test as descriptor_test import google.protobuf.internal.reflection_test as reflection_test import google.protobuf.internal.service_reflection_test \ as service_reflection_test import google.protobuf.internal.text_format_test as text_format_test import google.protobuf.internal.wire_format_test as wire_format_test loader = unittest.defaultTestLoader suite = unittest.TestSuite() for test in [ generator_test, descriptor_test, reflection_test, service_reflection_test, text_format_test, wire_format_test ]: suite.addTest(loader.loadTestsFromModule(test)) return suite
514bdbee452fcb1c53274f7a00c0d18bf63e19d1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10745/514bdbee452fcb1c53274f7a00c0d18bf63e19d1/setup.py