示例#1
0
    def examples_action():
        """
        Show examples action
        :return: None
        """

        tpl.message(package.examples())
示例#2
0
    def examples_action():
        """
        Show examples action
        :return: None
        """

        tpl.message(package.examples())
示例#3
0
    def update_action():
        """
        App update action
        :raise SrcError
        :return: None
        """

        try:
            tpl.message(package.update())
        except (AttributeError, PackageError) as error:
            raise SrcError(error)
示例#4
0
    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)
示例#5
0
    def update_action():
        """
        App update action
        :raise SrcError
        :return: None
        """

        try:
            tpl.message(package.update())
        except (AttributeError, PackageError) as error:
            raise SrcError(error)
示例#6
0
    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)
示例#7
0
    def version_action():
        """
        Show app version action

        :raise SrcError
        :return: None
        """

        try:
            tpl.message(package.version())
        except (AttributeError, PackageError) as error:
            raise SrcError(error)
示例#8
0
    def version_action():
        """
        Show app version action

        :raise SrcError
        :return: None
        """

        try:
            tpl.message(package.version())
        except (AttributeError, PackageError) as error:
            raise SrcError(error)
示例#9
0
    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))
示例#10
0
    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))