bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def setupScene(self, pipeline): """ setupScene(pipeline: Pipeline) -> None Construct the scene to view a pipeline """ old_pipeline = self.pipeline self.pipeline = pipeline
def setupScene(self, pipeline): """ setupScene(pipeline: Pipeline) -> None Construct the scene to view a pipeline """ old_pipeline = self.pipeline self.pipeline = pipeline
477,500
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
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.tar_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
477,501
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__
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__
477,502
def populate_table(self): self._unrunnable_table.clear()
defpopulate_table(self):self._unrunnable_table.clear()
477,503
def check_dependencies(self, index): """ determines if current VisTrail will be supported by the repository's VisTrail server """
def check_dependencies(self, index): """ determines if current VisTrail will be supported by the repository's VisTrail server """
477,504
def check_dependencies(self, index): """ determines if current VisTrail will be supported by the repository's VisTrail server """
def check_dependencies(self, index): """ determines if current VisTrail will be supported by the repository's VisTrail server """
477,505
def clicked_on_login(self): """ Attempts to log into web repository stores auth cookie for session """ from gui.application import VistrailsApplication
def clicked_on_login(self): """ Attempts to log into web repository stores auth cookie for session """ from gui.application import VistrailsApplication
477,506
def clicked_on_login(self): """ Attempts to log into web repository stores auth cookie for session """ from gui.application import VistrailsApplication
def clicked_on_login(self): """ Attempts to log into web repository stores auth cookie for session """ from gui.application import VistrailsApplication
477,507
def clicked_on_login(self): """ Attempts to log into web repository stores auth cookie for session """ from gui.application import VistrailsApplication
def clicked_on_login(self): """ Attempts to log into web repository stores auth cookie for session """ from gui.application import VistrailsApplication
477,508
def clicked_on_login(self): """ Attempts to log into web repository stores auth cookie for session """ from gui.application import VistrailsApplication
def clicked_on_login(self): """ Attempts to log into web repository stores auth cookie for session """ from gui.application import VistrailsApplication
477,509
def clicked_on_login(self): """ Attempts to log into web repository stores auth cookie for session """ from gui.application import VistrailsApplication
def clicked_on_login(self): """ Attempts to log into web repository stores auth cookie for session """ from gui.application import VistrailsApplication
477,510
def create_ungroup(self, full_pipeline, module_id):
def create_ungroup(self, full_pipeline, module_id):
477,511
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)
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, shell_quote(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)
477,512
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)
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)
477,513
def __init__(self): """ DefaultTheme() -> DefaultTheme This is for initializing all Qt objects """ ###################### #### MEASUREMENTS ####
def __init__(self): """ DefaultTheme() -> DefaultTheme This is for initializing all Qt objects """ ###################### #### MEASUREMENTS ####
477,514
def name(self): return 'transparent'
def name(self): return 'transparent'
477,515
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
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) 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() + \ ["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
477,516
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
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 is not None and 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
477,517
def add_parameter_changes_from_execution(self, pipeline, version, parameter_changes): """add_parameter_changes_from_execution(pipeline, version, parameter_changes) -> int.
def add_parameter_changes_from_execution(self, pipeline, version, parameter_changes): """add_parameter_changes_from_execution(pipeline, version, parameter_changes) -> int.
477,518
def add_parameter_changes_from_execution(self, pipeline, version, parameter_changes): """add_parameter_changes_from_execution(pipeline, version, parameter_changes) -> int.
def add_parameter_changes_from_execution(self, pipeline, version, parameter_changes): """add_parameter_changes_from_execution(pipeline, version, parameter_changes) -> int.
477,519
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()
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() 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()
477,520
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)
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)
477,521
def bool_conv(x): s = str(x).upper() if s == 'TRUE': return True if s == 'FALSE': return False
def bool_conv(x): s = str(x).upper() if s == 'TRUE': return True if s == 'FALSE': return False
477,522
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
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, op.db_parentObjType, op.db_parentObjId) 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, op.db_parentObjType, op.db_parentObjId) 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
477,523
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
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, op.db_parentObjType, op.db_parentObjId) 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, op.db_parentObjType, op.db_parentObjId) 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
477,524
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
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
477,525
def get_method_signature(method): """ get_method_signature(method: vtkmethod) -> [ret, arg] Re-wrap Prabu's method to increase performance
def get_method_signature(method): """ get_method_signature(method: vtkmethod) -> [ret, arg] Re-wrap Prabu's method to increase performance
477,526
def get_method_signature(method): """ get_method_signature(method: vtkmethod) -> [ret, arg] Re-wrap Prabu's method to increase performance
def get_method_signature(method): """ get_method_signature(method: vtkmethod) -> [ret, arg] Re-wrap Prabu's method to increase performance
477,527
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
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
477,528
def paintEvent(self, e): """ paintEvent(e: QPaintEvent) -> None Paint the QVTKWidget with vtkRenderWindow """ iren = None if self.mRenWin: iren = self.mRenWin.GetInteractor()
def paintEvent(self, e): """ paintEvent(e: QPaintEvent) -> None Paint the QVTKWidget with vtkRenderWindow """ iren = None if self.mRenWin: iren = self.mRenWin.GetInteractor()
477,529
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()
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 if self.mRenWin.GetInteractor(): self.mRenWin.GetInteractor().Render() self.mRenWin.GetInteractor().Render() else: 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()
477,530
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)
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)
477,531
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]
def git_get_type(self, name, version="HEAD"): cmd_list = [self.git_command() + ["cat-file", "-t", str(version + ':' + name)]] 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]
477,532
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]
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]
477,533
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]
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]
477,534
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]
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]
477,535
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)
def paintEngine(self): """ paintEngine() -> 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)
477,536
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)
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 in ['Windows', 'Microsoft']: return None else: return QCellWidget.paintEngine(self)
477,537
def compute(self): exPipe = self.forceGetInputFromPort('ExternalPipe') if exPipe: self.setResult('InternalPipe', exPipe) else: self.setResult('InternalPipe', InvalidOutput)
def compute(self): exPipe = self.forceGetInputFromPort('ExternalPipe') if exPipe is not None: self.setResult('InternalPipe', exPipe) else: self.setResult('InternalPipe', InvalidOutput)
477,538
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>')
def canonicalize(sig_item): if 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>')
477,539
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)
def set_logfile(self, f): """set_logfile(file) -> None. Redirects debugging output to file.""" try: 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) handler.setFormatter(self.format) handler.setLevel(logging.DEBUG) if self.fhandler: self.logger.removeHandler(self.fhandler) self.fhandler = handler self.logger.addHandler(handler)
477,540
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]
def git_get_hash(self, name): cmd_list = [self.git_command() + ["ls-files", "--stage", str(name)]] 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]
477,541
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]
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]
477,542
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)
def default(self): page = jenv.get_template('help.html') context = get_context() 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 return page.render(**context)
477,543
def test0005views(self): ''' Test views. ''' self.assertRaises(Exception, test_view('ldap_connection'))
def test0005views(self): ''' Test views. ''' self.assertRaises(Exception, test_view('ldap_connection'))
477,544
def onTimer(self, timer): new_time = time() diff_time = new_time - self.cur_time self.cur_time = new_time
def onTimer(self, timer): new_time = time() diff_time = new_time - self.cur_time self.cur_time = new_time
477,545
def startobsblock(self, args): _logger.info('Received start observing block command') queue1.put(('startobsblock',) + tuple(args))
def startobsblock(self, args): _logger.info('Received start observing block command') queue1.put(('startobsblock',) + tuple(args))
477,546
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()
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(os.path.join(datadir, 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()
477,547
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
477,548
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
477,549
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
477,550
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
477,551
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
477,552
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
477,553
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
477,554
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
477,555
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
477,556
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
477,557
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
477,558
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
477,559
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()
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()
477,560
def gobutton_cb(self, button): from shutil import copy2 self.stopbutton_cb(button) # try stopping old code first. self._reset_vte()
def gobutton_cb(self, button): from shutil import copy2 self.stopbutton_cb(button) # try stopping old code first. self._reset_vte()
477,561
def gobutton_cb(self, button): from shutil import copy2 self.stopbutton_cb(button) # try stopping old code first. self._reset_vte()
def gobutton_cb(self, button): from shutil import copy2 self.stopbutton_cb(button) # try stopping old code first. self._reset_vte()
477,562
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)
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)
477,563
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)
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)
477,564
def initialize_display(self): self._logger = logging.getLogger('pippy-activity')
def initialize_display(self): self._logger = logging.getLogger('pippy-activity')
477,565
def initialize_display(self): self._logger = logging.getLogger('pippy-activity')
def initialize_display(self): self._logger = logging.getLogger('pippy-activity')
477,566
def initialize_display(self): self._logger = logging.getLogger('pippy-activity')
def initialize_display(self): self._logger = logging.getLogger('pippy-activity')
477,567
def initialize_display(self): self._logger = logging.getLogger('pippy-activity')
def initialize_display(self): self._logger = logging.getLogger('pippy-activity')
477,568
def initialize_display(self): self._logger = logging.getLogger('pippy-activity')
def initialize_display(self): self._logger = logging.getLogger('pippy-activity')
477,569
def initialize_display(self): self._logger = logging.getLogger('pippy-activity')
def initialize_display(self): self._logger = logging.getLogger('pippy-activity')
477,570
def initialize_display(self): self._logger = logging.getLogger('pippy-activity')
def initialize_display(self): self._logger = logging.getLogger('pippy-activity')
477,571
def initialize_display(self): self._logger = logging.getLogger('pippy-activity')
def initialize_display(self): self._logger = logging.getLogger('pippy-activity')
477,572
def initialize_display(self): self._logger = logging.getLogger('pippy-activity')
def initialize_display(self): self._logger = logging.getLogger('pippy-activity')
477,573
def initialize_display(self): self._logger = logging.getLogger('pippy-activity')
def initialize_display(self): self._logger = logging.getLogger('pippy-activity')
477,574
def initialize_display(self): self._logger = logging.getLogger('pippy-activity')
def initialize_display(self): self._logger = logging.getLogger('pippy-activity')
477,575
def when_shared(self): self.hbox.remove(self.sidebar) global text_buffer self.cloud.sharefield = groupthink.gtk_tools.TextBufferSharePoint(text_buffer)
def when_shared(self): self.hpane.remove(self.hpane.get_child1()) global text_buffer self.cloud.sharefield = groupthink.gtk_tools.TextBufferSharePoint(text_buffer)
477,576
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()
def 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) selection_cb(self, 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) column): 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) self.save() 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) model, 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) _iter 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 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) column.get_selected() 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) value 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 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) model.get_value(_iter,0) 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) self._logger.debug("clicked! 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) %s" 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 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) value['path']) 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) _file 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 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) open(value['path'], 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) 'r') 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) lines 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 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) _file.readlines() 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) global 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) text_buffer 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) text_buffer.set_text("".join(lines)) 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) self.metadata['title'] 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 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) value['name'] 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) self.stopbutton_cb(None) 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) self._reset_vte() 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) self.text_view.grab_focus() 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)
477,577
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())
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())
477,578
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())
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())
477,579
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)
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)
477,580
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()
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()
477,581
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
477,582
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
477,583
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
477,584
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
477,585
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
477,586
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
477,587
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
477,588
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
477,589
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
477,590
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
477,591
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
def__init__(self,handle):"""SetupthePippyactivity."""super(PippyActivity,self).__init__(handle)self._logger=logging.getLogger('pippy-activity')
477,592
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity')
477,593
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()
def 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) selection_cb(self, 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) column): 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) self.save() 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) model, 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) _iter 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 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) column.get_selected() 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) value 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 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) model.get_value(_iter,0) 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) self._logger.debug("clicked! 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) %s" 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 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) value['path']) 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) _file 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 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) open(value['path'], 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) 'r') 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) lines 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 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) _file.readlines() 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) global 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) text_buffer 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) text_buffer.set_text("".join(lines)) 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) self.metadata['title'] 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 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) value['name'] 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) self.stopbutton_cb(None) 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) self._reset_vte() 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) self.text_view.grab_focus() 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)
477,594
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())
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())
477,595
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())
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())
477,596
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)
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)
477,597
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)
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)
477,598
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
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
477,599