def _print_help(self,command,args,description): from postomaat.funkyconsole import FunkyConsole fc=FunkyConsole() bold=fc.MODE['bold'] cyan=fc.FG['cyan'] print "%s %s\t%s"%(fc.strcolor(command, [bold,]),fc.strcolor(args,[cyan,]),description)
def lint(self): errors=0 from postomaat.funkyconsole import FunkyConsole fc=FunkyConsole() print fc.strcolor('Loading plugins...','magenta') if not self.load_plugins(): print fc.strcolor('At least one plugin failed to load','red') print fc.strcolor('Plugin loading complete','magenta') print "Linting ",fc.strcolor("main configuration",'cyan') if not self.checkConfig(): print fc.strcolor("ERROR","red") else: print fc.strcolor("OK","green") allplugins=self.plugins for plugin in allplugins: print print "Linting Plugin ",fc.strcolor(str(plugin),'cyan') try: result=plugin.lint() except Exception,e: print "ERROR: %s"%e result=False if result: print fc.strcolor("OK","green") else: errors=errors+1 print fc.strcolor("ERROR","red")
def lint(self): errors=0 from postomaat.funkyconsole import FunkyConsole fc=FunkyConsole() self._lint_dependencies(fc) print(fc.strcolor('Loading plugins...','magenta')) if not self.load_plugins(): print(fc.strcolor('At least one plugin failed to load','red')) print(fc.strcolor('Plugin loading complete','magenta')) print("Linting %s" % fc.strcolor("main configuration",'cyan')) if not self.checkConfig(): print(fc.strcolor("ERROR","red")) else: print(fc.strcolor("OK","green")) allplugins=self.plugins for plugin in allplugins: print("") print("Linting Plugin %s Config section: %s" % (fc.strcolor(str(plugin),'cyan'), fc.strcolor(str(plugin.section),'cyan'))) try: result=plugin.lint() except Exception as e: print("ERROR: %s"%e) result=False if result: print(fc.strcolor("OK","green")) else: errors=errors+1 print(fc.strcolor("ERROR","red")) print("%s plugins reported errors."%errors)