def examples_action(): """ Show examples action :return: None """ tpl.message(package.examples())
def update_action(): """ App update action :raise SrcError :return: None """ try: tpl.message(package.update()) except (AttributeError, PackageError) as error: raise SrcError(error)
def local_version(): """ Show app local version :raise SrcError :return: None """ try: tpl.message(package.local_version()) except (AttributeError, PackageError) as error: raise SrcError(error)
def version_action(): """ Show app version action :raise SrcError :return: None """ try: tpl.message(package.version()) except (AttributeError, PackageError) as error: raise SrcError(error)
def run(self): """ Bootstrap action :raise SrcError :return: None """ try: tpl.message(package.banner()) if 'host' in self.ioargs or 'wizard' in self.ioargs: getattr(self, 'scan_action')(self.ioargs) else: for action in self.ioargs.keys(): if hasattr(self, '{0}_action'.format(action))\ and args().is_arg_callable(getattr(self, '{0}_action'.format(action))): getattr(self, '{func}_action'.format(func=action))() break except (SrcError, PackageError, BrowserError, AttributeError) as error: raise SrcError(tpl.error(error))