How to use the plumbum.cli.switch function in plumbum

To help you get started, we’ve selected a few plumbum 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 tomerfiliba / plumbum / tests / test_argcompleter.py View on Github external
    @cli.switch(["a"])
    def spam(self):
        print("!!a")
github tomerfiliba / plumbum / tests / test_clicolor.py View on Github external
        @cli.switch(["a"])
        def spam(self):
            print("!!a")
github tomerfiliba / plumbum / tests / test_cli.py View on Github external
    @cli.switch(["b", "bacon"], argtype=int, mandatory = True, envname="PLUMBUM_TEST_BACON")
    def bacon(self, param):
        """give me some bacon"""
        print ("!!b", param)
github tomerfiliba / plumbum / tests / test_clicolor.py View on Github external
            @cli.switch(["b"], help="this is a bacon switch")
            def bacon(self):
                print("Oooooh, I love BACON!")
github crowdrec / idomaar / datastreammanager / orchestrator / main / orchestrator_cli.py View on Github external
    @cli.switch("--data-topic", str)
    def get_data_topic(self, topic):
        """The Kafka topic where train and test data is fed."""
        self.data_topic = topic
github EVEprosper / ProsperAPI / scripts / create_splitcache.py View on Github external
    @cli.switch(
        ['r', '--range'],
        int,
        help='How many days to back-fetch'
    )
    def override_back_range(self, back_range):
        """override back_range from user"""
        self.back_range = back_range
github Omrigan / essay-writer / essay.py View on Github external
    @cli.switch(['-e'], float, help='Change emotionality')
    def abuse_lexical(self, abuse):
        self._abuse = abuse
github crowdrec / idomaar / datastreammanager / orchestrator / main / orchestrator_cli.py View on Github external
    @cli.switch("--newsreel")
    def get_newsreel(self, requires=['--data-source']):
        """Use the settings relevant for the Newsreel competition Task 2. Equivalent to the switches --skip-training --input-data split --no-control-messages. 
        It will check that the computing environment communication protocol is HTTP or HTTPS."""
        self.newsreel = True
        self.skip_training_cycle = True
        self.input_data = "split"
        self.no_control_messages = True
        if not self.computing_environment_url.scheme in ['http', 'https']: raise Exception("For Newsreel, the computing environment URL must have scheme http or https.")
github crowdrec / idomaar / datastreammanager / orchestrator / main / orchestrator_cli.py View on Github external
    @cli.switch("--training-uri", str)
    def get_training_uri(self, training_uri):
        """The location of the training data."""
        self.training_uri = training_uri
        self.input_data = 'test'
github crowdrec / idomaar / datastreammanager / orchestrator / main / orchestrator_cli.py View on Github external
    @cli.switch("--test-uri", str)
    def get_test_uri(self, test_uri):
        """The location of the test data."""
        self.test_uri = test_uri
        self.input_data = 'test'