bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def _from_csv(cls,system,data,csv_type,log): """ Import data from CSV file into System Objects """ if 'key' in data and data['key']: try: key = Key.by_name(data['key']) except InvalidRequestError: log.append('%s: Invalid Key %s ' % data['key']) return False else: log.append('%s: Key must not be blank!' % system.fqdn) r...
def _from_csv(cls,system,data,csv_type,log): """ Import data from CSV file into System Objects """ if 'key' in data and data['key']: try: key = Key.by_name(data['key']) except InvalidRequestError: log.append('%s: Invalid Key %s ' % (system.fqdn, data['key'])) return False else: log.append('%s: Key must not be blank!' %...
448,700
def get_results(self,arch,whiteboard=None): try: if not whiteboard: return_list = [] for w in self.results[arch]: return_list += self.results[arch][w] return return_list else: return self.results[arch][whiteboard] except KeyError, (e): #This is fine, just means that this task has no entry for a given arch/whiteboard #l...
def get_results(self,arch,whiteboard=None): try: if not whiteboard: return_list = [] for w in self.results[arch]: return_list += self.results[arch][w] return return_list else: return self.results[arch][whiteboard] except KeyError, (e): #This is fine, just means that this task has no entry for a given arch/whiteboard #l...
448,701
def inner_data_grid(self,data,this_arch,show_headers): """ inner_data_grid() displays the grid that is the recipe whiteboard grid for each arch. """ fields = [] my_list = [] sorted_keys = sorted(set(self.whiteboards_used[this_arch])) for whiteboard in sorted_keys: whiteboard_title = whiteboard_name = orig_whiteboard_na...
def inner_data_grid(self,data,this_arch,show_headers): """ inner_data_grid() displays the grid that is the recipe whiteboard grid for each arch. """ fields = [] my_list = [] sorted_keys = sorted(set(self.whiteboards_used[this_arch])) for whiteboard in sorted_keys: whiteboard_title = whiteboard_name = orig_whiteboard_na...
448,702
def update_products(xml_file): dom = etree.parse(xml_file) xpath_string = '//cpe' cpes = dom.xpath(xpath_string) session.begin() try: to_add = {} dupe_errors = [] for cpe in cpes: cpe_text = cpe.text if cpe_text in to_add: dupe_errors.append(cpe_text) else: to_add[cpe_text] = 1 for cpe_to_add in to_add: try: prod = ...
def update_products(xml_file): dom = etree.parse(xml_file) xpath_string = '//cpe' cpes = dom.xpath(xpath_string) session.begin() try: to_add = {} dupe_errors = [] for cpe in cpes: cpe_text = cpe.text if cpe_text in to_add: dupe_errors.append(cpe_text) else: to_add[cpe_text] = 1 for cpe_to_add in to_add: try: prod = ...
448,703
def queued_recipes(*args): recipes = Recipe.query()\ .join('status')\ .join('systems')\ .join(['recipeset','priority'])\ .filter( or_( and_(Recipe.status==TaskStatus.by_name(u'Queued'), System.user==None, RecipeSet.lab_controller==None ), and_(Recipe.status==TaskStatus.by_name(u'Queued'), System.user==None, RecipeSet.l...
def queued_recipes(*args): recipes = Recipe.query()\ .join('status')\ .join('systems')\ .join(['recipeset','priority'])\ .filter( or_( and_(Recipe.status==TaskStatus.by_name(u'Queued'), System.user==None, RecipeSet.lab_controller==None ), and_(Recipe.status==TaskStatus.by_name(u'Queued'), System.user==None, RecipeSet.l...
448,704
def parse_recipe_xml(input_xml, hostname): root = minidom.parseString(input_xml) for er in root.getElementsByTagName('recipe'): system = xml_attr(er, 'system') if system == hostname: break else: log.info("parse_recipe_xml: No recipe for %s." % hostname) return None task_env = {} rs = xml_attr(er, 'status') if rs not ...
def parse_recipe_xml(input_xml, hostname): root = minidom.parseString(input_xml) for er in root.getElementsByTagName('recipe'): system = xml_attr(er, 'system') if system == hostname: break else: for er in root.getElementsByTagName('guestrecipe'): system = xml_attr(er, 'system') if system == hostname: break else: log.i...
448,705
def update(self): """ If the log exists and the file has grown then upload the new piece """ if os.path.exists(self.log): file = open(self.log, "r") where = self.where file.seek(where) line = file.read(65536) self.where = file.tell() file.close() #FIXME make this work on a list of search items # Also, allow it to be di...
def update(self): """ If the log exists and the file has grown then upload the new piece """ if os.path.exists(self.log): file = open(self.log, "r") where = self.where file.seek(where) line = file.read(65536) self.where = file.tell() file.close() #FIXME make this work on a list of search items # Also, allow it to be di...
448,706
def update(self): """ If the log exists and the file has grown then upload the new piece """ if os.path.exists(self.log): file = open(self.log, "r") where = self.where file.seek(where) line = file.read(65536) self.where = file.tell() file.close() #FIXME make this work on a list of search items # Also, allow it to be di...
def update(self): """ If the log exists and the file has grown then upload the new piece """ if os.path.exists(self.log): file = open(self.log, "r") where = self.where file.seek(where) line = file.read(65536) self.where = file.tell() file.close() #FIXME make this work on a list of search items # Also, allow it to be di...
448,707
def update(self): """ If the log exists and the file has grown then upload the new piece """ if os.path.exists(self.log): file = open(self.log, "r") where = self.where file.seek(where) line = file.read(65536) self.where = file.tell() file.close() #FIXME make this work on a list of search items # Also, allow it to be di...
def update(self): """ If the log exists and the file has grown then upload the new piece """ if os.path.exists(self.log): file = open(self.log, "r") where = self.where file.seek(where) line = file.read(65536) self.where = file.tell() file.close() #FIXME make this work on a list of search items # Also, allow it to be di...
448,708
def __init__(self, *args, **kwargs): self.node = self.doc.createElement('recipe') self.node.setAttribute('whiteboard','') self.andDistroRequires = self.doc.createElement('and') self.andHostRequires = self.doc.createElement('and') distroRequires = self.doc.createElement('distroRequires') hostRequires = self.doc.createEl...
def __init__(self, *args, **kwargs): self.node = self.doc.createElement('recipe') self.node.setAttribute('whiteboard','') self.andDistroRequires = self.doc.createElement('and') self.andHostRequires = self.doc.createElement('and') distroRequires = self.doc.createElement('distroRequires') hostRequires = self.doc.createEl...
448,709
def __init__(self, *args, **kwargs): self.node = self.doc.createElement('recipe') self.node.setAttribute('whiteboard','') self.andDistroRequires = self.doc.createElement('and') self.andHostRequires = self.doc.createElement('and') distroRequires = self.doc.createElement('distroRequires') hostRequires = self.doc.createEl...
def __init__(self, *args, **kwargs): self.node = self.doc.createElement('recipe') self.node.setAttribute('whiteboard','') self.andDistroRequires = self.doc.createElement('and') self.andHostRequires = self.doc.createElement('and') distroRequires = self.doc.createElement('distroRequires') hostRequires = self.doc.createEl...
448,710
def update_params(self,d): log.debug(d) if 'value' in d: if 'distro_ids' in d['value']: if(isinstance(d['value']['distro_ids'],list)): for distro_id in d['value']['distro_ids']: d['hidden_fields'] = [HiddenField(name='distro_id',attrs = {'value' : distro_id})] + d['hidden_fields'][0:]
def update_params(self,d): log.debug(d) if 'value' in d: if 'distro_ids' in d['value']: if(isinstance(d['value']['distro_ids'],list)): for distro_id in d['value']['distro_ids']: d['hidden_fields'] = [HiddenField(name='distro_id',attrs = {'value' : distro_id})] + d['hidden_fields'][0:]
448,711
def report_problem(self, system_id, recipe_id=None, problem_description=None): """ Allows users to report a problem with a system to the system's owner. """ try: system = System.by_id(system_id, identity.current.user) except InvalidRequestError: flash(_(u'Unable to find system with id of %s' % id)) redirect('/') try: r...
def report_problem(self, system_id, recipe_id=None, problem_description=None): """ Allows users to report a problem with a system to the system's owner. """ try: system = System.by_id(system_id, identity.current.user) except InvalidRequestError: flash(_(u'Unable to find system with id of %s' % system_id)) redirect('/')...
448,712
def my_cmp(x,y): m1 = re.search('^(.+?)(\d{1,})?$',x) m2 = re.search('^(.+?)(\d{1,})?$',y) try: distro_1 = m1.group(1).lower() except AttributeError,e: #x has no value, it goes first return -1
def my_cmp(x,y): m1 = re.search('^(.+?)(\d{1,})?$',x) m2 = re.search('^(.+?)(\d{1,})?$',y) try: distro_1 = m1.group(1).lower() except AttributeError,e: #x has no value, it goes first return -1
448,713
def my_cmp(x,y): m1 = re.search('^(.+?)(\d{1,})?$',x) m2 = re.search('^(.+?)(\d{1,})?$',y) try: distro_1 = m1.group(1).lower() except AttributeError,e: #x has no value, it goes first return -1
def @staticmethod def my_cmp(x,y): m1 = re.search('^(.+?)(\d{1,})?$',x) m2 = re.search('^(.+?)(\d{1,})?$',y) try: distro_1 = m1.group(1).lower() except AttributeError,e: return -1 try: distro_2 = m2.group(1).lower() except AttributeError,e: return 1 distro_1_ver = int(m1.group(2) or 0) distro_2_ver = int(m2.group(2...
448,714
def display(self,value=None,**params): if 'options' in params: for k in params['options'].keys(): params[k] = params['options'][k] del params['options'][k] params['all_arches'] = [[elem.arch,elem.arch] for elem in model.Arch.query()] params['all_tags'] = [['','None Selected']] + [[elem.tag,elem.tag] for elem in model.D...
def display(self,value=None,**params): if 'options' in params: for k in params['options'].keys(): params[k] = params['options'][k] del params['options'][k] params['all_arches'] = [[elem.arch,elem.arch] for elem in model.Arch.query()] params['all_tags'] = [['','None Selected']] + [[elem.tag,elem.tag] for elem in model.D...
448,715
def available(cls, user,systems=None): """ Builds on all. Only systems which this user has permission to reserve. If a system is loaned then its only available for that person. """ if systems: query = systems else: query = System.all(user) query = query.filter(and_( System.status==SystemStatus.by_name(u'Working'), ca...
def available(cls, user,systems=None): """ Builds on all. Only systems which this user has permission to reserve. If a system is loaned then its only available for that person. """ if systems: try: query = systems.outerjoin(['groups','users'], aliased=True) except AttributeError, (e): log.error('A non Query object has...
448,716
def available(cls, user,systems=None): """ Builds on all. Only systems which this user has permission to reserve. If a system is loaned then its only available for that person. """ if systems: query = systems else: query = System.all(user) query = query.filter(and_( System.status==SystemStatus.by_name(u'Working'), ca...
def available(cls, user,systems=None): """ Builds on all. Only systems which this user has permission to reserve. If a system is loaned then its only available for that person. """ if systems: query = systems else: query = System.all(user) query = query.filter(and_( System.status==SystemStatus.by_name(u'Working'), or...
448,717
def __getattr__(self, attrname): if attrname == 'name': self.get_xml_attr('name', unicode, u'None') else: raise AttributeError, attrname
def __getattr__(self, attrname): if attrname == 'name': return self.get_xml_attr('name', unicode, u'None') else: raise AttributeError, attrname
448,718
def __getattr__(self, attrname): if attrname == 'name': return self.get_xml_attr('name', unicode, u'None') else: raise AttributeError, attrname
def __getattr__(self, attrname): if attrname == 'name': return self.get_xml_attr('name', unicode, u'None') else: raise AttributeError, attrname
448,719
def __getattr__(self, attrname): if attrname == 'name': return self.get_xml_attr('name', unicode, u'None') else: raise AttributeError, attrname
def __getattr__(self, attrname): if attrname == 'name': return self.get_xml_attr('name', unicode, u'None') else: raise AttributeError, attrname
448,720
def wait_for_event(self, task_id): """ Wait for cobbler task to finish, return True on success raise an exception if it fails. raise an exception if it takes more then 5 minutes """ try: expiredelta = datetime.utcnow() + timedelta(minutes=10) while(True): for line in self.get_event_log(task_id).split('\n'): if line.fin...
def wait_for_event(self, task_id): """ Wait for cobbler task to finish, return True on success raise an exception if it fails. raise an exception if it takes more then 5 minutes """ try: expiredelta = datetime.utcnow() + timedelta(minutes=10) while(True): for line in self.get_event_log(task_id).split('\n'): if line.fin...
448,721
def action_release(self): self.user = None # Attempt to remove Netboot entry # and turn off machine, but don't fail if we can't if self.release_action: try: self.remote.release(power=False) self.release_action.do(self) except BX, error: pass else: try: self.remote.release() except: pass
def action_release(self): # Attempt to remove Netboot entry # and turn off machine, but don't fail if we can't if self.release_action: try: self.remote.release(power=False) self.release_action.do(self) except BX, error: pass else: try: self.remote.release() except: pass
448,722
def _create_task_list_params(self,query_obj,result): """ _create_task_list_params() takes a query obj of the type generated in generate_data() and will return a string representation of a URL pointing to a page which will display the results of the given task """ job_string = '' for job in self.job_ids: if job: job_str...
def _create_task_list_params(self,query_obj,result): """ _create_task_list_params() takes a query obj of the type generated in generate_data() and will return a string representation of a URL pointing to a page which will display the results of the given task """ job_string = '' for job in self.job_ids: if job: job_str...
448,723
def queued_recipes(*args): working = SystemStatus.by_name(u'Working') recipes = Recipe.query()\ .join('status')\ .join('systems')\ .join(['recipeset','priority'])\ .filter( or_( and_(Recipe.status==TaskStatus.by_name(u'Queued'), System.user==None, System.status==working, RecipeSet.lab_controller==None ), and_(Recipe.st...
def queued_recipes(*args): working = SystemStatus.by_name(u'Working') recipes = Recipe.query()\ .join('status')\ .join('systems')\ .join(['recipeset','priority'])\ .filter( or_( and_(Recipe.status==TaskStatus.by_name(u'Queued'), System.user==None, System.status==working, RecipeSet.lab_controller==None ), and_(Recipe.st...
448,724
def systems(self, systems, *args, **kw): # Reset joinpoint and then outerjoin on user. This is so the sort # column works in paginate/datagrid. # Also need to do distinct or paginate gets confused by the joins #log.debug(kw)
def systems(self, systems, *args, **kw): # Reset joinpoint and then outerjoin on user. This is so the sort # column works in paginate/datagrid. # Also need to do distinct or paginate gets confused by the joins #log.debug(kw)
448,725
def run(self, *args, **kwargs): username = kwargs.get("username", None) password = kwargs.get("password", None)
def run(self, *args, **kwargs): username = kwargs.get("username", None) password = kwargs.get("password", None)
448,726
def view(self, fqdn=None, **kw): if fqdn: try: system = System.by_fqdn(fqdn,identity.current.user) except InvalidRequestError: flash( _(u"Unable to find %s" % fqdn) ) redirect("/")
def view(self, fqdn=None, **kw): if fqdn: try: system = System.by_fqdn(fqdn,identity.current.user) except InvalidRequestError: flash( _(u"Unable to find %s" % fqdn) ) redirect("/")
448,727
def queued_recipes(*args): working = SystemStatus.by_name(u'Working') recipes = Recipe.query()\ .join('status')\ .join('systems')\ .join(['recipeset','priority'])\ .filter( or_( and_(Recipe.status==TaskStatus.by_name(u'Queued'), System.user==None, System.status==working, RecipeSet.lab_controller==None ), and_(Recipe.st...
def queued_recipes(*args): working = SystemStatus.by_name(u'Working') recipes = Recipe.query()\ .join('status')\ .join('systems')\ .join(['recipeset','priority'])\ .filter( or_( and_(Recipe.status==TaskStatus.by_name(u'Queued'), System.user==None, System.status==working, RecipeSet.lab_controller==None ), and_(Recipe.st...
448,728
def filter(self): queries = [] joins = [] for child in self: if callable(getattr(child, 'filter', None)): (join, query) = child.filter() queries.append(query) joins.extend(join) return (joins, and_(*queries))
def filter(self): queries = [] joins = [] for child in self: if callable(getattr(child, 'filter', None)): (join, query) = child.filter() queries.append(query) joins.extend(join) return (joins, and_(*queries))
448,729
def filter(self): queries = [] joins = [] for child in self: if callable(getattr(child, 'filter', None)): (join, query) = child.filter() queries.append(query) joins.extend(join) return (joins, or_(*queries))
def filter(self): queries = [] joins = [] for child in self: if callable(getattr(child, 'filter', None)): (join, query) = child.filter() queries.append(query) joins.extend(join) return (joins, or_(*queries))
448,730
def content(self): self.write_line("""
def content(self): self.write_line("""
448,731
def handle_partition(self, partition): fs = None type = 'part' name = 'testarea' size = '5' for child in partition.childNodes: if child.nodeName == 'type': type = self.getText(child.childNodes) if child.nodeName == 'name': name = self.getText(child.childNodes) if child.nodeName == 'size': size = self.getText(child.chil...
def handle_partition(self, node): partition = self.doc.createElement('partition') for child in node.childNodes: if child.nodeName == 'type': type = self.getText(child.childNodes) if child.nodeName == 'name': name = self.getText(child.childNodes) if child.nodeName == 'size': size = self.getText(child.childNodes) if chil...
448,732
def handle_partition(self, partition): fs = None type = 'part' name = 'testarea' size = '5' for child in partition.childNodes: if child.nodeName == 'type': type = self.getText(child.childNodes) if child.nodeName == 'name': name = self.getText(child.childNodes) if child.nodeName == 'size': size = self.getText(child.chil...
def handle_partition(self, partition): fs = None type = 'part' name = 'testarea' size = '5' for child in partition.childNodes: if child.nodeName == 'type': partition.setAttribute('type', self.getText(child.childNodes)) if child.nodeName == 'name': name = self.getText(child.childNodes) if child.nodeName == 'size': size ...
448,733
def handle_partition(self, partition): fs = None type = 'part' name = 'testarea' size = '5' for child in partition.childNodes: if child.nodeName == 'type': type = self.getText(child.childNodes) if child.nodeName == 'name': name = self.getText(child.childNodes) if child.nodeName == 'size': size = self.getText(child.chil...
def handle_partition(self, partition): fs = None type = 'part' name = 'testarea' size = '5' for child in partition.childNodes: if child.nodeName == 'type': type = self.getText(child.childNodes) if child.nodeName == 'name': partition.setAttribute('name', self.getText(child.childNodes)) if child.nodeName == 'size': size ...
448,734
def handle_partition(self, partition): fs = None type = 'part' name = 'testarea' size = '5' for child in partition.childNodes: if child.nodeName == 'type': type = self.getText(child.childNodes) if child.nodeName == 'name': name = self.getText(child.childNodes) if child.nodeName == 'size': size = self.getText(child.chil...
def handle_partition(self, partition): fs = None type = 'part' name = 'testarea' size = '5' for child in partition.childNodes: if child.nodeName == 'type': type = self.getText(child.childNodes) if child.nodeName == 'name': name = self.getText(child.childNodes) if child.nodeName == 'size': partition.setAttribute('size',...
448,735
def handle_partition(self, partition): fs = None type = 'part' name = 'testarea' size = '5' for child in partition.childNodes: if child.nodeName == 'type': type = self.getText(child.childNodes) if child.nodeName == 'name': name = self.getText(child.childNodes) if child.nodeName == 'size': size = self.getText(child.chil...
def handle_partition(self, partition): fs = None type = 'part' name = 'testarea' size = '5' for child in partition.childNodes: if child.nodeName == 'type': type = self.getText(child.childNodes) if child.nodeName == 'name': name = self.getText(child.childNodes) if child.nodeName == 'size': size = self.getText(child.chil...
448,736
def __getattr__(self, attrname): if attrname == 'arch': return self.get_xml_attr('arch', unicode, None) elif attrname == 'id': return self.get_xml_attr('id', int, 0) elif attrname == 'recipe_set_id': return self.get_xml_attr('recipe_set_id', int, 0) elif attrname == 'job_id': return self.get_xml_attr('job_id', int, 0) ...
def __getattr__(self, attrname): if attrname == 'arch': return self.get_xml_attr('arch', unicode, None) elif attrname == 'id': return self.get_xml_attr('id', int, 0) elif attrname == 'recipe_set_id': return self.get_xml_attr('recipe_set_id', int, 0) elif attrname == 'job_id': return self.get_xml_attr('job_id', int, 0) ...
448,737
def __init__(self): cfg_defaults = dict(conf.items('DEFAULT')) cfg_defaults.update(conf.items('BACKEND')) cfg_defaults['HOSTNAME'] = os.getenv('HOSTNAME') cfg_defaults['LAB_CONTROLLER'] = os.getenv('LAB_CONTROLLER') or \ 'http://%s:8000/server' % os.getenv('COBBLER_SERVER', 'localhost') self.conf = config.config('BEAH_...
def __init__(self): cfg_defaults = dict(conf.items('DEFAULT')) dict_update(cfg_defaults, conf.items('BACKEND')) cfg_defaults['HOSTNAME'] = os.getenv('HOSTNAME') cfg_defaults['LAB_CONTROLLER'] = os.getenv('LAB_CONTROLLER') or \ 'http://%s:8000/server' % os.getenv('COBBLER_SERVER', 'localhost') self.conf = config.config(...
448,738
def lazy_create(cls, **kwargs): try: item = cls.query.filter_by(**kwargs).one() except: item = cls(**kwargs) session.save(item) session.flush([item]) return item
def lazy_create(cls, **kwargs): try: item = cls.query.filter_by(**kwargs).one() except InvalidRequestError, e: if e == 'Multiple rows returned for one()': log.error('Mutlitple rows returned for %s' % kwargs) elif e == 'No rows returned for one()': item = cls(**kwargs) session.save(item) session.flush([item]) return ite...
448,739
def get_widget_attrs(table,column,with_desc=True,sortable=False,index=None): options = {} lower_column = column.lower() lower_table = table.lower()
def get_widget_attrs(table,column,with_desc=True,sortable=False,index=None): options = {} lower_column = column.lower() lower_table = table.lower()
448,740
def _system_search(self,kw,sys_search,use_custom_columns = False): for search in kw['systemsearch']: #clsinfo = System.get_dict()[search['table']] #Need to change this class_field_list = search['table'].split('/') cls_ref = search_utility.SystemSearch.translate_name(class_field_list[0]) col = class_field_list[1] #If va...
def _system_search(self,kw,sys_search,use_custom_columns = False): for search in kw['systemsearch']: #clsinfo = System.get_dict()[search['table']] #Need to change this class_field_list = search['table'].split('/') cls_ref = search_utility.SystemSearch.translate_name(class_field_list[0]) col = class_field_list[1] #If va...
448,741
def __init__(self,*args,**kw): self.priority_widget = PriorityWidget() if 'recipeset' in kw: self.recipeset = kw['recipeset'] else: self.recipeset = None
def __init__(self,*args,**kw): self.priority_widget = PriorityWidget() if 'recipeset' in kw: self.recipeset = kw['recipeset'] else: self.recipeset = None
448,742
def get_keyvalue_search_options(self,**kw): return_dict = {} return_dict['keyvals'] = Key.get_all_keys() return return_dict
def get_keyvalue_search_options(self,**kw): return_dict = {} return_dict['keyvals'] = [x for x in Key.get_all_keys() if x != 'MODULE'] return return_dict
448,743
def active_watchdogs(self): """Monitor active watchdog entries"""
def active_watchdogs(self): """Monitor active watchdog entries"""
448,744
def __init__(self, watchdog, logger, conf, *args, **kwargs): """ Monitor system """ self.log = logger self.conf = conf self.watchdog = watchdog self.logger.debug("Initialize monitor for system: %s" % self.watchdog['system']) self.watchedFiles = [WatchFile("%s/%s" % (self.conf["CONSOLE_LOGS"], self.watchdog["system"]),s...
def __init__(self, watchdog, logger, conf, hub, *args, **kwargs): """ Monitor system """ self.log = logger self.conf = conf self.watchdog = watchdog self.logger.debug("Initialize monitor for system: %s" % self.watchdog['system']) self.watchedFiles = [WatchFile("%s/%s" % (self.conf["CONSOLE_LOGS"], self.watchdog["system...
448,745
def __init__(self, watchdog, logger, conf, *args, **kwargs): """ Monitor system """ self.log = logger self.conf = conf self.watchdog = watchdog self.logger.debug("Initialize monitor for system: %s" % self.watchdog['system']) self.watchedFiles = [WatchFile("%s/%s" % (self.conf["CONSOLE_LOGS"], self.watchdog["system"]),s...
def __init__(self, watchdog, logger, conf, *args, **kwargs): """ Monitor system """ self.logger = logger self.conf = conf self.watchdog = watchdog self.logger.debug("Initialize monitor for system: %s" % self.watchdog['system']) self.watchedFiles = [WatchFile("%s/%s" % (self.conf["CONSOLE_LOGS"], self.watchdog["system"]...
448,746
def filepath(self): """ Return file path for this recipe """ job = self.recipeset.job return "%s/%02d/%s/%s" % (self.recipeset.queue_time.year, int(str(job.id)[-2:]), job.id, self.id)
def filepath(self): """ Return file path for this recipe """ job = self.recipeset.job return "%s/%02d/%s/%s" % (self.recipeset.queue_time.year, int(str(job.id)[-2:]), job.id, self.id)
448,747
def filepath(self): """ Return file path for this task """ job = self.recipe.recipeset.job recipe = self.recipe return "%s/%02d/%s/%s/%s" % (recipe.recipeset.queue_time.year, int(str(job.id)[-2:]), job.id, recipe.id, self.id)
def filepath(self): """ Return file path for this task """ job = self.recipe.recipeset.job recipe = self.recipe return "%s/%02d/%s/%s/%s" % (recipe.recipeset.queue_time.year, int(str(job.id)[-2:]), job.id, recipe.id, self.id)
448,748
def filepath(self): """ Return file path for this result """ job = self.recipetask.recipe.recipeset.job recipe = self.recipetask.recipe task_id = self.recipetask.id return "%s/%02d/%s/%s/%s/%s" % (recipe.recipeset.queue_time.year, int(str(job.id)[-2:]), job.id, recipe.id, task_id, self.id)
def filepath(self): """ Return file path for this result """ job = self.recipetask.recipe.recipeset.job recipe = self.recipetask.recipe task_id = self.recipetask.id return "%s/%02d/%s/%s/%s/%s" % (recipe.recipeset.queue_time.year, int(str(job.id)[-2:]), job.id, recipe.id, task_id, self.id)
448,749
def append_tasks(self, recipetask): """ Before appending the task to this Recipe, make sure it applies. ie: not excluded for this distro family or arch. """ if self.distro.arch in recipetasks.excluded_arch: return if self.distro.osmajor in recipetasks.excluded_osmajor: return self.tasks.append(recipetask)
def append_tasks(self, recipetask): """ Before appending the task to this Recipe, make sure it applies. ie: not excluded for this distro family or arch. """ if self.distro.arch in recipetask.task.excluded_arch: return if self.distro.osmajor in recipetasks.excluded_osmajor: return self.tasks.append(recipetask)
448,750
def append_tasks(self, recipetask): """ Before appending the task to this Recipe, make sure it applies. ie: not excluded for this distro family or arch. """ if self.distro.arch in recipetasks.excluded_arch: return if self.distro.osmajor in recipetasks.excluded_osmajor: return self.tasks.append(recipetask)
def append_tasks(self, recipetask): """ Before appending the task to this Recipe, make sure it applies. ie: not excluded for this distro family or arch. """ if self.distro.arch in recipetasks.excluded_arch: return if self.distro.osversion.osmajor in recipetask.task.excluded_osmajor: return self.tasks.append(recipetask)
448,751
def _get_distro_requires(self): drs = xml.dom.minidom.parseString(self._distro_requires) # If no distro_virt is asked for default to Virt if not drs.getElementsByTagName("distro_virt"): distroRequires = self.doc.createElement("distroRequires") for dr in drs.getElementsByTagName("distroRequires"): for child in dr.childN...
def _get_distro_requires(self): drs = xml.dom.minidom.parseString(self._distro_requires) # If no distro_virt is asked for default to Virt if not drs.getElementsByTagName("distro_virt"): distroRequires = self.doc.createElement("distroRequires") for dr in drs.getElementsByTagName("distroRequires"): for child in dr.childN...
448,752
def to_xml(self, clone=False): recipeSet = self.doc.createElement("recipeSet") if not clone: recipeSet.setAttribute("id", "%s" % self.id) for r in self.recipes: recipeSet.appendChild(r.to_xml(clone, from_recipeset=True)) return recipeSet
def to_xml(self, clone=False): recipeSet = self.doc.createElement("recipeSet") if not clone: recipeSet.setAttribute("id", "%s" % self.id) for r in self.recipes: if not isinstance(r,GuestRecipe): recipeSet.appendChild(r.to_xml(clone, from_recipeset=True)) return recipeSet
448,753
def to_xml(self, recipe, clone=False, from_recipeset=False): if not clone: recipe.setAttribute("id", "%s" % self.id) recipe.setAttribute("job_id", "%s" % self.recipeset.job_id) recipe.setAttribute("recipe_set_id", "%s" % self.recipe_set_id) recipe.setAttribute("whiteboard", "%s" % self.whiteboard and self.whiteboard or...
def to_xml(self, recipe, clone=False, from_recipeset=False): if not clone: recipe.setAttribute("id", "%s" % self.id) recipe.setAttribute("job_id", "%s" % self.recipeset.job_id) recipe.setAttribute("recipe_set_id", "%s" % self.recipe_set_id) recipe.setAttribute("whiteboard", "%s" % self.whiteboard and self.whiteboard or...
448,754
def queued_recipes(*args): recipes = Recipe.query()\ .join('status')\ .join('systems')\ .join(['recipeset','priority'])\ .filter( or_( and_(Recipe.status==TaskStatus.by_name(u'Queued'), System.user==None, RecipeSet.lab_controller==None ), and_(Recipe.status==TaskStatus.by_name(u'Queued'), System.user==None, RecipeSet.l...
def queued_recipes(*args): recipes = Recipe.query()\ .join('status')\ .join('systems')\ .join(['recipeset','priority'])\ .filter( or_( and_(Recipe.status==TaskStatus.by_name(u'Queued'), System.user==None, RecipeSet.lab_controller==None ), and_(Recipe.status==TaskStatus.by_name(u'Queued'), System.user==None, RecipeSet.l...
448,755
def executed(self, hidden={}, **kw): tmp = self._do_search(hidden, **kw) tmp['form'] = self.task_form tmp['action'] = './do_search' tmp['value'] = None tmp['options'] = dict() return tmp
def executed(self, hidden={}, **kw): tmp = self._do_search(hidden, **kw) tmp['form'] = self.task_form tmp['action'] = './do_search' tmp['value'] = None tmp['options'] = dict() return tmp
448,756
def _do_search(self, hidden={}, **kw): if 'recipe_id' in kw: #most likely we are coming here from a LinkRemoteFunction in recipe_widgets tasks = RecipeTask.query().join(['recipe']).filter(Recipe.id == kw['recipe_id'])
def _do_search(self, hidden={}, **kw): if 'recipe_id' in kw: #most likely we are coming here from a LinkRemoteFunction in recipe_widgets tasks = RecipeTask.query().join(['recipe']).filter(Recipe.id == kw['recipe_id'])
448,757
def _do_search(self, hidden={}, **kw): if 'recipe_id' in kw: #most likely we are coming here from a LinkRemoteFunction in recipe_widgets tasks = RecipeTask.query().join(['recipe']).filter(Recipe.id == kw['recipe_id'])
def _do_search(self, hidden={}, **kw): if 'recipe_id' in kw: #most likely we are coming here from a LinkRemoteFunction in recipe_widgets tasks = RecipeTask.query().join(['recipe']).filter(Recipe.id == kw['recipe_id'])
448,758
def _do_search(self, hidden={}, **kw): if 'recipe_id' in kw: #most likely we are coming here from a LinkRemoteFunction in recipe_widgets tasks = RecipeTask.query().join(['recipe']).filter(Recipe.id == kw['recipe_id'])
def _do_search(self, hidden={}, **kw): if 'recipe_id' in kw: #most likely we are coming here from a LinkRemoteFunction in recipe_widgets tasks = RecipeTask.query().join(['recipe']).filter(Recipe.id == kw['recipe_id'])
448,759
def _do_search(self, hidden={}, **kw): if 'recipe_id' in kw: #most likely we are coming here from a LinkRemoteFunction in recipe_widgets tasks = RecipeTask.query().join(['recipe']).filter(Recipe.id == kw['recipe_id'])
def _do_search(self, hidden={}, **kw): if 'recipe_id' in kw: #most likely we are coming here from a LinkRemoteFunction in recipe_widgets tasks = RecipeTask.query().join(['recipe']).filter(Recipe.id == kw['recipe_id'])
448,760
def has_access(self, user): """ Given a user return True if that user has access to this system """ # If a system is loaned its available exclusively to that user if self.loaned != None: if self.loaned == self.user: return True else return False # If were the owner and its not loaned we have access. if self.owner == us...
def has_access(self, user): """ Given a user return True if that user has access to this system """ # If a system is loaned its available exclusively to that user if self.loaned != None: if self.loaned == self.user: return True else: return False # If were the owner and its not loaned we have access. if self.owner == u...
448,761
def append_tasks(self, recipetask): """ Before appending the task to this Recipe, make sure it applies. ie: not excluded for this distro family or arch. """ if self.distro.arch in recipetask.task.excluded_arch: return if self.distro.osversion.osmajor in recipetask.task.excluded_osmajor: return self.tasks.append(recipet...
def append_tasks(self, recipetask): """ Before appending the task to this Recipe, make sure it applies. ie: not excluded for this distro family or arch. """ if self.distro.arch in [arch.arch for arch in recipetask.task.excluded_arch]: return if self.distro.osversion.osmajor in recipetask.task.excluded_osmajor: return s...
448,762
def append_tasks(self, recipetask): """ Before appending the task to this Recipe, make sure it applies. ie: not excluded for this distro family or arch. """ if self.distro.arch in recipetask.task.excluded_arch: return if self.distro.osversion.osmajor in recipetask.task.excluded_osmajor: return self.tasks.append(recipet...
def append_tasks(self, recipetask): """ Before appending the task to this Recipe, make sure it applies. ie: not excluded for this distro family or arch. """ if self.distro.arch in recipetask.task.excluded_arch: return if self.distro.osversion.osmajor in [osmajor.osmajor for osmajor in recipetask.task.excluded_osmajor]:...
448,763
def push(self, fqdn, inventory): """ Push inventory data to Scheduler """ return self.hub.legacypush(fqdn, inventory)
def push(self, fqdn, inventory): """ Push inventory data to Scheduler """ return self.hub.legacypush(fqdn, inventory)
448,764
def parse_recipe_xml(input_xml, hostname): root = minidom.parseString(input_xml) for er in root.getElementsByTagName('recipe'): system = xml_attr(er, 'system') if system == hostname: break else: for er in root.getElementsByTagName('guestrecipe'): system = xml_attr(er, 'system') if system == hostname: break else: log.i...
def parse_recipe_xml(input_xml, hostname): root = minidom.parseString(input_xml) for er in root.getElementsByTagName('recipe'): system = xml_attr(er, 'system') if system == hostname: break else: for er in root.getElementsByTagName('guestrecipe'): system = xml_attr(er, 'system') if system == hostname: break else: log.i...
448,765
def parse_recipe_xml(input_xml, hostname): root = minidom.parseString(input_xml) for er in root.getElementsByTagName('recipe'): system = xml_attr(er, 'system') if system == hostname: break else: for er in root.getElementsByTagName('guestrecipe'): system = xml_attr(er, 'system') if system == hostname: break else: log.i...
def parse_recipe_xml(input_xml, hostname): root = minidom.parseString(input_xml) for er in root.getElementsByTagName('recipe'): system = xml_attr(er, 'system') if system == hostname: break else: for er in root.getElementsByTagName('guestrecipe'): system = xml_attr(er, 'system') if system == hostname: break else: log.i...
448,766
def parse_recipe_xml(input_xml, hostname): root = minidom.parseString(input_xml) for er in root.getElementsByTagName('recipe'): system = xml_attr(er, 'system') if system == hostname: break else: for er in root.getElementsByTagName('guestrecipe'): system = xml_attr(er, 'system') if system == hostname: break else: log.i...
def parse_recipe_xml(input_xml, hostname): root = minidom.parseString(input_xml) for er in root.getElementsByTagName('recipe'): system = xml_attr(er, 'system') if system == hostname: break else: for er in root.getElementsByTagName('guestrecipe'): system = xml_attr(er, 'system') if system == hostname: break else: log.i...
448,767
def filter(self): op = self.op_table[self.get_xml_attr('op', unicode, '==')] value = self.get_xml_attr('value', unicode, None) joins = [] query = None if value: joins = [system_table.c.id == system_arch_map.c.system_id, arch_table.c.id == system_arch_map.c.arch_id] query = getattr(arch_table.c.arch, op)(value) return...
def filter(self): op = self.op_table[self.get_xml_attr('op', unicode, '==')] value = self.get_xml_attr('value', unicode, None) joins = [] query = None if value: joins = [system_table.c.id == system_arch_map.c.system_id, alias.c.id == system_arch_map.c.arch_id] query = getattr(alias.c.arch, op)(value) return (joins, q...
448,768
def arch_is_not_filter(cls,x,y): return cls._opposites_is_not_filter(x,y)
def arch_is_not_filter(cls,x,y): return cls._opposites_is_not_filter(x,y)
448,769
def distro_is_not_filter(cls,x,y): return cls._opposites_is_not_filter(x,y)
def distro_is_not_filter(cls,x,y): return cls._opposites_is_not_filter(x,y)
448,770
def _opposites_is_not_filter(cls,x,y): wildcard_y = re.sub('\*','%',y) if wildcard_y != y: #looks like we found a wildcard return x.like(wildcard_y) if not y: return or_(x == None,x==y) return x == y
def _opposites_is_not_filter(cls,x,y): wildcard_y = re.sub('\*','%',y) if wildcard_y != y: #looks like we found a wildcard return x.like(wildcard_y) if not y: return or_(x == None,x==y) return x == y
448,771
def user_change(self, id): msg = "" status = None activity = None try: system = System.by_id(id,identity.current.user) except InvalidRequestError: flash( _(u"Unable to find system with id of %s" % id) ) redirect("/") if system.user: if system.user == identity.current.user or \ identity.current.user.is_admin(): # Don't ...
def user_change(self, id): msg = "" status = None activity = None try: system = System.by_id(id,identity.current.user) except InvalidRequestError: flash( _(u"Unable to find system with id of %s" % id) ) redirect("/") if system.user: if system.user == identity.current.user or \ identity.current.user.is_admin(): # Don't ...
448,772
def pre_proc(self, evt): id = evt.task_id = self.get_evt_task_id(evt) if id is None: return False if evt.event() == 'file_write': evt = event.Event(evt) evt.args()['data'] = '...hidden...' self.get_writer(id, '.task_beah_raw').write(jsonln(evt)) return False
def pre_proc(self, evt): id = evt.task_id = self.get_evt_task_id(evt) if id is None: return True if evt.event() == 'file_write': evt = event.Event(evt) evt.args()['data'] = '...hidden...' self.get_writer(id, '.task_beah_raw').write(jsonln(evt)) return False
448,773
def send_mail(sender, to, subject, body): from turbomail import MailNotEnabledException message = turbomail.Message(sender, to, subject) message.plain = body try: #log.debug("Sending mail: %s" % message.plain) turbomail.enqueue(message) except MailNotEnabledException: log.warning("TurboMail is not enabled!") except Exc...
def send_mail(sender, to, subject, body): from turbomail import MailNotEnabledException message = turbomail.Message(sender, to, subject) message.plain = body try: #log.debug("Sending mail: %s" % message.plain) turbomail.send(message) except MailNotEnabledException: log.warning("TurboMail is not enabled!") except Except...
448,774
def failed_recipes(job): msg = "JobID: %s Status: %s Result: %s\n" % \ (job.id, job.status, job.result) for recipe in job.recipes: if recipe.is_failed(): msg = "%s\tRecipeID: %s Arch: %s System: %s Distro: %s OSVersion: Status: %s Result: %s\n" \ % (msg, recipe.id, recipe.distro.arch, recipe.system, recipe.distro, reci...
def failed_recipes(job): msg = "JobID: %s Status: %s Result: %s\n" % \ (job.id, job.status, job.result) for recipeset in job.recipesets: if recipeset.is_failed(): msg = "%s\tRecipeSetID: %s\n" % ( msg, recipeset.id ) for recipe in recipeset.recipes: if recipe.is_failed(): msg = "%s\t\tRecipeID: %s Arch: %s System: %s D...
448,775
def generate_data(self,**kw): """ generate_data() returns a nested tuple which represents tasks->arches->whiteboards and their data objects """ jobs = [] self.arches_used = {} self.whiteboards_used = {} whiteboard_data = {} if 'job_ids' in kw: jobs = kw['job_ids'].split() elif 'whiteboard' in kw: job_query = model.Job....
def generate_data(self,**kw): """ generate_data() returns a nested tuple which represents tasks->arches->whiteboards and their data objects """ jobs = [] self.arches_used = {} self.whiteboards_used = {} whiteboard_data = {} if 'job_ids' in kw: jobs = kw['job_ids'].split() elif 'whiteboard' in kw: job_query = model.Job....
448,776
def search_operators(cls,type,loose_match=None): m = Modeller() log.debug('field type is %s' % type) operators = m.return_operators(type,loose_match) return operators
def search_operators(cls,type,loose_match=None): m = Modeller() operators = m.return_operators(type,loose_match) return operators
448,777
def partitionsKSMeta(self): """ Parse partitions xml into ks_meta variable which cobbler will understand """ partitions = [] try: prs = xml.dom.minidom.parseString(self.partitions) except TypeError: prs = self.doc.createElement("partitions") except xml.parsers.expat.ExpatError: prs = self.doc.createElement("partitions"...
def partitionsKSMeta(self): """ Parse partitions xml into ks_meta variable which cobbler will understand """ partitions = [] try: prs = xml.dom.minidom.parseString(self.partitions) except TypeError: prs = self.doc.createElement("partitions") except xml.parsers.expat.ExpatError: prs = self.doc.createElement("partitions"...
448,778
def provision(self, distro=None, kickstart=None, ks_meta=None, kernel_options=None, kernel_options_post=None, ks_appends=None): """ Provision the System make xmlrpc call to lab controller """ if not distro: return False
def provision(self, distro=None, kickstart=None, ks_meta=None, kernel_options=None, kernel_options_post=None, ks_appends=None): """ Provision the System make xmlrpc call to lab controller """ if not distro: return False
448,779
def systems(self,group_id,*args,**kw): systems = System.by_group(group_id) system_link = ('System', lambda x: x.link) group = Group.by_id(group_id) grid = myDataGrid(fields=[system_link]) return dict(grid=grid,list=systems,title='Systems for group %s' % group.group_name,search_bar = None)
def systems(self,group_id,*args,**kw): systems = System.by_group(group_id) system_link = ('System', lambda x: x.link) group = Group.by_id(group_id) grid = myDataGrid(fields=[system_link]) return dict(grid=grid,list=systems,title='Systems for group %s' % group.group_name,search_bar = None,object_count=systems.count())
448,780
def show_brief(nm, arch): if type(arch.toc) == type({}): toc = arch.toc for name,_ in toc.items(): print name + ',' else: print '[' toc = arch.toc.data for el in toc: print el[5] + ',' if rec_debug: if el[4] == 'z' or el[4] == 'a': show_brief(el[5], getArchive(el[5])) stack.pop() print ']'
def show_brief(nm, arch): if type(arch.toc) == type({}): toc = arch.toc for name,_ in toc.items(): print '"%s",' % name else: print '[' toc = arch.toc.data for el in toc: print el[5] + ',' if rec_debug: if el[4] == 'z' or el[4] == 'a': show_brief(el[5], getArchive(el[5])) stack.pop() print ']'
448,781
def show_brief(nm, arch): if type(arch.toc) == type({}): toc = arch.toc for name,_ in toc.items(): print name + ',' else: print '[' toc = arch.toc.data for el in toc: print el[5] + ',' if rec_debug: if el[4] == 'z' or el[4] == 'a': show_brief(el[5], getArchive(el[5])) stack.pop() print ']'
def show_brief(nm, arch): if type(arch.toc) == type({}): toc = arch.toc for name,_ in toc.items(): print name + ',' else: print '[' toc = arch.toc.data for el in toc: print '"%s",' % el[5] if rec_debug: if el[4] == 'z' or el[4] == 'a': show_brief(el[5], getArchive(el[5])) stack.pop() print ']'
448,782
def checkCache(fnm, strip, upx): # On darwin a cache is required anyway to keep the libaries # with relative install names if (not strip and not upx and sys.platform[:6] != 'darwin' and sys.platform != 'win32') or fnm.lower().endswith(".manifest"): return fnm if strip: strip = 1 else: strip = 0 if upx: upx = 1 else: up...
def checkCache(fnm, strip, upx): # On darwin a cache is required anyway to keep the libaries # with relative install names if (not strip and not upx and sys.platform[:6] != 'darwin' and sys.platform != 'win32') or fnm.lower().endswith(".manifest"): return fnm if strip: strip = 1 else: strip = 0 if upx: upx = 1 else: up...
448,783
def decode(pathnm): h = win32api.LoadLibraryEx(pathnm, 0, LOAD_LIBRARY_AS_DATAFILE) nm = win32api.EnumResourceNames(h, RT_VERSION)[0] data = win32api.LoadResource(h, RT_VERSION, nm) vs = VSVersionInfo() j = vs.fromRaw(data) if TEST: print vs if data[:j] != vs.toRaw(): print "AAAAAGGHHHH" txt = repr(vs) glbls = {} glbls...
def decode(pathnm): h = win32api.LoadLibraryEx(pathnm, 0, LOAD_LIBRARY_AS_DATAFILE) nm = win32api.EnumResourceNames(h, RT_VERSION)[0] data = win32api.LoadResource(h, RT_VERSION, nm) vs = VSVersionInfo() j = vs.fromRaw(data, pe) if TEST: print vs if data[:j] != vs.toRaw(): print "AAAAAGGHHHH" txt = repr(vs) glbls = {} g...
448,784
def fromRaw(self, data): i, (sublen, vallen, wType, nm) = parseCommon(data) #vallen is length of the ffi, typ is 0, nm is 'VS_VERSION_INFO' i = ((i + 3) / 4) * 4 # now a VS_FIXEDFILEINFO self.ffi = FixedFileInfo() j = self.ffi.fromRaw(data, i) #print ffi if TEST: if data[i:j] != self.ffi.toRaw(): print "raw:", `data[i:...
def fromRaw(self, data, pe=None): i, (sublen, vallen, wType, nm) = parseCommon(data) #vallen is length of the ffi, typ is 0, nm is 'VS_VERSION_INFO' i = ((i + 3) / 4) * 4 # now a VS_FIXEDFILEINFO self.ffi = FixedFileInfo() j = self.ffi.fromRaw(data, i) #print ffi if TEST: if data[i:j] != self.ffi.toRaw(): print "raw:",...
448,785
def fromRaw(self, data): i, (sublen, vallen, wType, nm) = parseCommon(data) #vallen is length of the ffi, typ is 0, nm is 'VS_VERSION_INFO' i = ((i + 3) / 4) * 4 # now a VS_FIXEDFILEINFO self.ffi = FixedFileInfo() j = self.ffi.fromRaw(data, i) #print ffi if TEST: if data[i:j] != self.ffi.toRaw(): print "raw:", `data[i:...
def fromRaw(self, data): i, (sublen, vallen, wType, nm) = parseCommon(data) #vallen is length of the ffi, typ is 0, nm is 'VS_VERSION_INFO' i = ((i + 3) / 4) * 4 # now a VS_FIXEDFILEINFO self.ffi = FixedFileInfo() j = self.ffi.fromRaw(data, i, pe) #print ffi if TEST: if data[i:j] != self.ffi.toRaw(): print "raw:", `dat...
448,786
def fromRaw(self, data, i): (self.sig, self.strucVersion, self.fileVersionMS, self.fileVersionLS, self.productVersionMS, self.productVersionLS, self.fileFlagsMask, self.fileFlags, self.fileOS, self.fileType, self.fileSubtype, self.fileDateMS, self.fileDateLS) = struct.unpack('13l', data[i:i+52]) return i+52
def fromRaw(self, data, i, pe=None): if hasattr(pe, 'VS_FIXEDFILEINFO'): info = pe.VS_FIXEDFILEINFO self.sig = info.Signature print 'type self.sig:', type(self.sig) self.strucVersion = info.StrucVersion self.fileVersionMS = info.FileVersionMS self.fileVersionLS = info.FileVersionLS self.productVersionMS = info.ProductV...
448,787
def _bootloader_postfix(self, exe): if target_iswin: exe = exe + "_" is24 = hasattr(sys, "version_info") and sys.version_info[:2] >= (2,4) exe = exe + "67"[is24] exe = exe + "rd"[self.debug] exe = exe + "wc"[self.console] else: if not self.console: exe = exe + 'w' if self.debug: exe = exe + '_d' return exe
def _bootloader_postfix(self, exe): if not self.console: exe = exe + 'w' if self.debug: exe = exe + '_d' return exe
448,788
def __init__(self, scripts=None, pathex=None, hookspath=None, excludes=None): Target.__init__(self) self.inputs = scripts for script in scripts: if not os.path.exists(script): raise ValueError, "script '%s' not found" % script self.pathex = [] if pathex: for path in pathex: self.pathex.append(absnormpath(path)) sys.pat...
def __init__(self, scripts=None, pathex=None, hookspath=None, excludes=None): Target.__init__(self) self.inputs = scripts for script in scripts: if not os.path.exists(script): raise ValueError, "script '%s' not found" % script self.pathex = [] if pathex: for path in pathex: self.pathex.append(absnormpath(path)) sys.pat...
448,789
def checkCache(fnm, strip, upx): # On darwin a cache is required anyway to keep the libaries # with relative install names if not strip and not upx and sys.platform != 'darwin' and sys.platform != 'win32': return fnm global winresource, winmanifest if strip: strip = 1 else: strip = 0 if upx: upx = 1 else: upx = 0 # Lo...
def checkCache(fnm, strip, upx): # On darwin a cache is required anyway to keep the libaries # with relative install names if not strip and not upx and sys.platform != 'darwin' and sys.platform != 'win32': return fnm global winresource, winmanifest if strip: strip = 1 else: strip = 0 if upx: upx = 1 else: upx = 0 # Lo...
448,790
def doimport(self, nm): mod = self.owner.getmod(self.__name__ + '.' + nm) return mod
def doimport(self, nm): mod = self.owner.getmod(self.__name__ + '.' + nm) return mod
448,791
def doimport(self, nm): mod = self.owner.getmod(self.__name__ + '.' + nm) return mod
def doimport(self, nm): mod = self.owner.getmod(self.__name__ + '.' + nm) return mod
448,792
def pass1(code): instrs = [] i = 0 n = len(code) curline = 0 incondition = 0 out = 0 while i < n: if i >= out: incondition = 0 c = code[i] i = i+1 op = ord(c) if op >= dis.HAVE_ARGUMENT: oparg = ord(code[i]) + ord(code[i+1])*256 i = i+2 else: oparg = None if not incondition and op in COND_OPS: incondition = 1 out = i +...
def pass1(code): instrs = [] i = 0 n = len(code) curline = 0 incondition = 0 out = 0 while i < n: if i >= out: incondition = 0 c = code[i] i = i+1 op = ord(c) if op >= dis.HAVE_ARGUMENT: oparg = ord(code[i]) + ord(code[i+1])*256 i = i+2 else: oparg = None if not incondition and op in COND_OPS: incondition = 1 out = opa...
448,793
def scan_code(co, m=None, w=None, b=None, nested=0): instrs = pass1(co.co_code) if m is None: m = [] if w is None: w = [] if b is None: b = [] all = None lastname = None level = -1 # import-level, same behaviour as up to Python 2.4 for i in range(len(instrs)): op, oparg, conditional, curline = instrs[i] if op == IMPORT...
def scan_code(co, m=None, w=None, b=None, nested=0): instrs = pass1(co.co_code) if m is None: m = [] if w is None: w = [] if b is None: b = [] all = None lastname = None level = -1 # import-level, same behaviour as up to Python 2.4 for i in range(len(instrs)): op, oparg, conditional, curline = instrs[i] if op == IMPORT...
448,794
def assemble(self): print "building EXE from", os.path.basename(self.out) trash = [] if not os.path.exists(os.path.dirname(self.name)): os.makedirs(os.path.dirname(self.name)) outf = open(self.name, 'wb') exe = self._bootloader_postfix('support/loader/run') exe = os.path.join(HOMEPATH, exe) if target_iswin or cygwin: e...
def assemble(self): print "building EXE from", os.path.basename(self.out) trash = [] if not os.path.exists(os.path.dirname(self.name)): os.makedirs(os.path.dirname(self.name)) outf = open(self.name, 'wb') exe = self._bootloader_postfix('support/loader/run') exe = os.path.join(HOMEPATH, exe) if target_iswin or cygwin: e...
448,795
def main(): global global_opts global opts import pyi_optparse as optparsae cmds = {} p = optparse.OptionParser( usage="%prog [opts] file", description="Generate a plaintext keyfile containing a " "random-generated encryption key. ") cmds["genkey"] = p for c,p in cmds.items(): p.prog = p.get_prog_name() + " " + c cm...
def main(): global global_opts global opts import pyi_optparse as optparse cmds = {} p = optparse.OptionParser( usage="%prog [opts] file", description="Generate a plaintext keyfile containing a " "random-generated encryption key. ") cmds["genkey"] = p for c,p in cmds.items(): p.prog = p.get_prog_name() + " " + c cmd...
448,796
def assemble(self): print "running Analysis", os.path.basename(self.out) # Reset seen variable to correctly discover dependencies # if there are multiple Analysis in a single specfile. bindepend.seen = {}
def assemble(self): print "running Analysis", os.path.basename(self.out) # Reset seen variable to correctly discover dependencies # if there are multiple Analysis in a single specfile. bindepend.seen = {}
448,797
def assemble(self): print "running Analysis", os.path.basename(self.out) # Reset seen variable to correctly discover dependencies # if there are multiple Analysis in a single specfile. bindepend.seen = {}
def assemble(self): print "running Analysis", os.path.basename(self.out) # Reset seen variable to correctly discover dependencies # if there are multiple Analysis in a single specfile. bindepend.seen = {}
448,798
def checkCache(fnm, strip, upx): # On darwin a cache is required anyway to keep the libaries # with relative install names if (not strip and not upx and sys.platform[:6] != 'darwin' and sys.platform != 'win32') or fnm.lower().endswith(".manifest"): return fnm if strip: strip = 1 else: strip = 0 if upx: upx = 1 else: up...
def checkCache(fnm, strip, upx): # On darwin a cache is required anyway to keep the libaries # with relative install names if (not strip and not upx and sys.platform[:6] != 'darwin' and sys.platform != 'win32') or fnm.lower().endswith(".manifest"): return fnm if strip: strip = 1 else: strip = 0 if upx: upx = 1 else: up...
448,799