Skip to content
A Python console application framework with clint
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
consolas
examples/CopyThat
.gitignore
LICENSE
README.md
consolas.py
consolas.sh

README.md

Project Status

QXSConsolas

A Python console application framework with clint, cli route configuration and logging configuration

A Full example

See our CopyThat example to manage Splunk roles: https://github.com/qxsch/QXSConsolas/tree/master/examples/CopyThat

A simple example

import logging, os
from QXSConsolas.Cli import CliApp
from clint.textui import puts, colored, indent

@CliApp(
    Name = "Deploy an app",
    Description = "Deploys an app to a splunk environment",
    Opts = [ 
        { "argument": "--env:", "default": "ALL", "description": "The targeted Splunk environment", "valuename": "ENV" },
        { "argument": "--app:", "required": True, "multiple": True,  "description": "The app that should be deployed", "valuename": "APP" },
    ]
)
def DeployApp(app):
    puts("Deploying your apps")
    with indent(4):
        for appname in app.options["--app:"]:
            puts("Deploying " + appname)
            # some code here
            successful = True
            if successful:
                app.logger.info("App " + appname + " has been deployed")
            else:
                app.logger.error("App " + appname + " couldn't be deployed")
You can’t perform that action at this time.