How to use the pybombs.commands.CommandBase function in PyBOMBS

To help you get started, we’ve selected a few PyBOMBS examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gnuradio / pybombs / pybombs / commands / install.py View on Github external
# Return False (0) on success, as it gets sent to exit()
        return not self.install_manager.install(
                self.args.packages,
                mode=self.cmd,
                fail_if_not_exists=self.fail_if_not_exists,
                update_if_exists=self.update_if_exists,
                quiet=False,
                print_tree=self.args.print_tree,
                deps_only=getattr(self.args, 'deps_only', False),
                no_deps=self.args.no_deps,
                verify=self.args.verify,
                static=getattr(self.args, 'static', False),
        )

### Damn, you found it :)
class Doge(CommandBase):
    """ Secret woofy component of PyBOMBS """
    cmds = {
        'doge': 'Doge',
    }
    hidden = True

    def __init__(self, cmd, args):
        CommandBase.__init__(self,
                cmd, args,
                load_recipes=False,
                require_prefix=False,
        )

    def run(self):
        """ Woof, woof, woof! """
        print(r"         ▄              ▄     ")
github gnuradio / pybombs / pybombs / commands / rebuild.py View on Github external
def __init__(self, cmd, args):
        CommandBase.__init__(self,
                cmd, args,
                load_recipes=True,
                require_prefix=True,
        )
        self.pm = packagers.source.Source()
        self.args.packages = args.packages[0]
        if len(self.args.packages) == 0:
            self.args.packages = self.inventory.get_packages()
github gnuradio / pybombs / pybombs / commands / digraph.py View on Github external
#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING.  If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
#
""" PyBOMBS command: digraph """

import os
from pybombs.commands import CommandBase
from pybombs.requirer import Requirer
from pybombs import recipe_manager
from pybombs import recipe
from pybombs.utils import subproc

class Digraph(CommandBase, Requirer):
    """ Generate dependency graph """
    cmds = {
        'digraph': 'Write out package.dot digraph for graphviz',
    }
    host_sys_deps = ['graphviz']

    @staticmethod
    def setup_subparser(parser, cmd=None):
        """
        Set up a subparser for 'digraph'
        """
        parser.add_argument(
            '--all',
            help="Print dependency tree",
            action='store_true',
        )
github gnuradio / pybombs / pybombs / commands / deploy.py View on Github external
'xz': XZDeployer,
            #'ssh': SSHDeployer
        }[ttype]
    if re.match(r'.*\.tar\.gz$', target):
        return GZipDeployer
    if re.match(r'.*\.tar\.bz2$', target):
        return BZip2Deployer
    if re.match(r'.*\.tar\.xz$', target):
        return XZDeployer
    if re.match(r'.*\.tar$', target):
        return TarfileDeployer
    if target.find('@') != -1:
        return SSHDeployer
    raise PBException("Cannot determine deployment type for target `{0}'".format(target))

class Deploy(CommandBase):
    """ Package and deploy the prefix """
    cmds = {
        'deploy': 'Deploy a prefix',
    }

    @staticmethod
    def setup_subparser(parser, cmd=None):
        """
        Set up a subparser for 'deploy'
        """
        parser.add_argument(
            'target', help="Deployment destination",
        )
        parser.add_argument(
            '-t', '--tar',
            help="Deploy to .tar",
github gnuradio / pybombs / pybombs / commands / show.py View on Github external
# along with GNU Radio; see the file COPYING.  If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
#
""" PyBOMBS command: show """

from pybombs.commands import CommandBase
from pybombs import package_manager

RECIPE_INFO_TPL = """
Recipe name:    {rname}
Is installed:   {installed}
Is installable: {installable}
""".strip()

class Show(CommandBase):
    """ Show information about a package """
    cmds = {
        'show': 'Show information about a recipe',
    }

    @staticmethod
    def setup_subparser(parser, cmd=None):
        """
        Set up a subparser for 'show'
        """
        parser.add_argument(
                'packages',
                help="List of packages to display information on",
                action='append',
                default=[],
                nargs='*'