Esempio n. 1
0
def main(args, parser, subparser):

    from scif.main import ScifRecipe

    client = ScifRecipe(writable=False, quiet=True)
    longlist = args.longlist

    result = []
    for app in client.apps():
        config = client.get_appenv(app)

        # Long listing includes a number with path to app
        if longlist is True:
            result.append([app.rjust(10), config["SCIF_APPROOT"]])
        else:
            result.append(app.rjust(10))

    if len(result) > 0:

        if longlist is True:
            header = "[app]              [root]"
            bot.custom(prefix="SCIF", message=header, color="CYAN")
            bot.table(result)
        else:
            print("\n".join(result))
Esempio n. 2
0
def main(args, parser, subparser):

    from scif.main import ScifRecipe

    # Inspect choices, r, e, l, a
    choices = [
        "r",
        "e",
        "l",
        "a",
        "f",
        "i",
        "h",
        "dump",
        "labels",
        "all",
        "files",
        "help",
        "install",
        "environment",
        "definition",
        "runscript",
    ]

    attributes = [x for x in args.attributes if x in choices]

    write_recipe = False
    if "dump" in attributes:
        write_recipe = True
        attributes.pop(attributes.index("dump"))

    apps = [x for x in args.attributes if x not in attributes]

    # First instantiate the client
    client = ScifRecipe(quiet=True, writable=False)

    # Filter down to apps that we want
    if len(apps) == 0:
        apps = client.apps()

    if len(attributes) == 0:
        attributes = ["a"]

    result = {}
    for app in apps:

        inspection = client.inspect(app, attributes)
        if len(inspection) > 0:
            result[app] = inspection

    if write_recipe is True:
        for app, atts in result.items():
            for key, val in atts.items():
                print("%" + key)
                print("\n".join(val) + "\n")
    else:
        print(json.dumps(result, indent=4, separators=(",", ": ")))
Esempio n. 3
0
def main(args, parser, subparser):

    from scif.main import ScifRecipe

    client = ScifRecipe(quiet=True, writable=False)
    apps = client.apps()

    for app in apps:
        inspection = client.inspect(app)
        if len(inspection) > 0:
            for key, val in inspection.items():
                print('%' + key)
                print('\n'.join(val) + '\n')
Esempio n. 4
0
File: list.py Progetto: satra/scif
def main(args, parser, subparser):

    from scif.main import ScifRecipe
    client = ScifRecipe(writable=False, quiet=True)

    result = []
    for app in client.apps():
        config = client.get_appenv(app)
        result.append([app.rjust(10), config['SCIF_APPROOT']])

    if len(result) > 0:
        header = "[app]              [root]"
        bot.custom(prefix="SCIF", message=header, color="CYAN")
        bot.table(result)
Esempio n. 5
0
def main(args,parser,subparser):

    from scif.main import ScifRecipe

    # Inspect choices, r, e, l, a
    choices = ['r', 'e', 'l', 'a', 'f', 'i', 'h', 'dump',
               'labels', 'all', 'files', "help", "install",
               'environment', 'definition', 'runscript'] 

    attributes = [x for x in args.attributes if x in choices]

    write_recipe = False
    if "dump" in attributes:
        write_recipe = True
        attributes.pop(attributes.index('dump'))

    apps = [x for x in args.attributes if x not in attributes]
    
    # First instantiate the client
    client = ScifRecipe(quiet=True, writable=False)

    # Filter down to apps that we want
    if len(apps) == 0:
        apps = client.apps()

    if len(attributes) == 0:
        attributes = ['a']

    result = {}
    for app in apps:

        inspection = client.inspect(app, attributes)
        if len(inspection) > 0:
            result[app] = inspection 

    if write_recipe is True:
        for app, atts in result.items():
            for key,val in atts.items():
                print('%' + key)
                print('\n'.join(val) + '\n')
    else:
        print(json.dumps(result,
                         indent=4,
                         separators=(',', ': ')))