Beispiel #1
0
 def add(context, template):
     """Add features to your existing Plone package"""
     if context.obj.get('target_dir', None) is None:
         raise NotInPackageError(context.command.name)
     bobtemplate = reg.resolve_template_name(template)
     if bobtemplate is None:
         raise NoSuchValue(context.command.name,
                           template,
                           possibilities=reg.get_templates())
     echo('\nRUN: mrbob {0}'.format(bobtemplate), fg='green', reverse=True)
     subprocess.call(['mrbob', bobtemplate])
Beispiel #2
0
 def create(context, template, name):
     """Create a new Plone package"""
     bobtemplate = reg.resolve_template_name(template)
     if bobtemplate is None:
         raise NoSuchValue(context.command.name,
                           template,
                           possibilities=reg.get_templates())
     cur_dir = os.getcwd()
     context.obj['target_dir'] = '{0}/{1}'.format(cur_dir, name)
     echo(
         '\nRUN: mrbob {0} -O {1}'.format(bobtemplate, name),
         fg='green',
         reverse=True,
     )
     subprocess.call(['mrbob', bobtemplate, '-O', name])
def create(context, template, name):
    """Create a new Plone package"""
    bobtemplate = reg.resolve_template_name(template)
    if bobtemplate is None:
        raise NoSuchValue(context.command.name,
                          template,
                          possibilities=reg.get_templates())
    cur_dir = os.getcwd()
    context.obj["target_dir"] = "{0}/{1}".format(cur_dir, name)
    echo(
        "\nRUN: mrbob {0} -O {1}".format(bobtemplate, name),
        fg="green",
        reverse=True,
    )
    subprocess.call(["mrbob", bobtemplate, "-O", name])
Beispiel #4
0
 def add(context, template, verbose):
     """Add features to your existing Plone package"""
     if context.obj.get('target_dir', None) is None:
         raise NotInPackageError(context.command.name)
     bobtemplate = reg.resolve_template_name(template)
     if bobtemplate is None:
         raise NoSuchValue(
             context.command.name,
             template,
             possibilities=reg.get_templates(),
         )
     if verbose:
         click.echo('RUN: mrbob {0}'.format(bobtemplate))
     subprocess.call([
         'mrbob',
         bobtemplate,
     ], )
Beispiel #5
0
 def create(context, template, name, verbose):
     """Create a new Plone package"""
     bobtemplate = reg.resolve_template_name(template)
     if bobtemplate is None:
         raise NoSuchValue(
             context.command.name,
             template,
             possibilities=reg.get_templates(),
         )
     cur_dir = os.getcwd()
     context.obj['target_dir'] = '{0}/{1}'.format(cur_dir, name)
     if verbose:
         click.echo('RUN: mrbob {0} -O {1}'.format(bobtemplate, name))
     subprocess.call([
         'mrbob',
         bobtemplate,
         '-O',
         name,
     ], )
Beispiel #6
0
def get_templates(ctx, args, incomplete):
    """Return a list of available mr.bob templates."""
    templates = reg.get_templates()
    return templates