Пример #1
0
def cli(show_name):

    # get base directory
    base = Config.base()
    # check and create show


    if CreateShow.check(base, show_name):

        path = os.path.join(base, show_name)
        # create show
        new_show = CreateShow(base, show_name)

        # get  short name
        click.echo('Must be only two letters')
        short_name = click.prompt('Short name of the project')

        # get desc
        desc = click.prompt("Project description")

        # create level files
        new_show.create_level_files()

        # add data to main shows json file
        new_show.add_to_json(short_name=short_name, desc=desc)

        # add shots json file
        new_show.shots_json_data(short_name=short_name)

        # display message
        new_show.msg()

        # change directory once all the directories gets created.
        el.cwd(path)
Пример #2
0
    def goshow(cls, showname):
        data = cls.goshow_data()

        # check if the show exists
        shows = []
        for j_showname in data['shows']:
            shows.append(j_showname['name'])

        if showname in shows:
            el.echo(f"Moving to show '{showname}'")
            el.echo('Currently under show level')

            show_path = os.path.join(cls.show_base_path, showname)
            el.cwd(show_path)

        else:
            el.echo(f"Show by the name '{showname}' does not exists.")
Пример #3
0
def cli(list, showname, current):
    '''Go show'''

    # list all the shows with the option
    if list:
        GoShow.goshow_list()

    elif current:
        el.cwd(Path.show_name(os.getcwd()))


    # move into the show
    elif showname:
        GoShow.goshow(showname=showname)

    # only goshow
    else:
        click.echo('Currently/Moved under the "Shows" root directory')
        click.echo('''
        USEFUL COMMANDS:
        el goshow --list : To list all the show.
        el goshow [showname] : Move to the [showname] directory is [showname] exists.
        ''')
        GoShow.toRoot()
Пример #4
0
 def go_asset(cls,cat, asset_name):
     path = os.path.join(os.getcwd(),'asset_build', cat, asset_name)
     if os.path.isdir(path):
         el.cwd(path)
     else:
         el.echo("The asset doesn't exsits under this category.",lvl="ERROR")
Пример #5
0
 def toRoot(cls):
     # change directory
     cls.read_config = read_yaml(CONFIG_FILE_PATH)
     el.cwd(cls.read_config['base_show_path'])