def run_chekers(): is_ok = True style = color_style() for app in settings.INSTALLED_APPS: if app=='apps.tools': continue; try: klass = get_class_by_string("%s.check_settings.Check" % app) except ImportError: continue except Exception, e: sys.stderr.write(style.ERROR("%s\n" % unicode(e))) from apps.ice_logger.global_log import log log.exception(e) continue if klass: try: obj = klass() obj.run() except Exception, e: is_ok = False try: sys.stderr.write(style.ERROR("%s\n" % force_unicode(e))) from apps.ice_logger.global_log import log log.exception(e) except Exception, ee: sys.stderr.write(style.ERROR("Exception in show excaption '%s'\n" % type(e))) sys.stderr.write(style.ERROR("%s" % ee))
def _load_urls(self, url): self.url_name = safe_get_attr(url, 'name') self.url_href = safe_get_attr(url, 'href') assert self.url_href or self.url_name, "xml_menu:url mast have 'name' or 'href' attribute" self.url_attrs={} for url_attr in url.childNodes: if url_attr.nodeType==Node.ELEMENT_NODE: call_function = safe_get_attr(url_attr, 'call_function') if call_function: self.url_attrs[str(url_attr.tagName)]= get_class_by_string(call_function) else: self.url_attrs[str(url_attr.tagName)]=get_attr(url_attr, 'value')
def initialize_processors(self): if not self.processors: for processor_name in PROCESSOR_LIST: klass = get_class_by_string(processor_name) self.processors.append(klass())