Example #1
0
import sys
import clik
import fondz
import logging

from optparse import make_option as opt

version = '0.0.1'
description = "create automated archival descriptions of digital content"
app = clik.App('fondz', version=version, description=description)


@app(usage="COLLECTION_NAME COLLECTION_DIR BAG1 [BAG2 ...]",
     opts=(opt('-o',
               '--overwrite',
               dest='overwrite',
               action='store_true',
               help='use an existing directory for the fondz project',
               default=False)))
def create(args, opts, console):
    """
    Create a new fondz project.

    Pass in a name for your collection, a directory to use for your fondz 
    project, and the path(s) to one or more bag directories.

        % fondz create "Carl Sagan Collection" /vol/fondz/sagan /vol/bags/bag1 /vol/bags/bag2

    """
    if len(args) < 3:
        console.error(
Example #2
0
import clik

from pyramid.scripts import pserve

from h import __version__

version = __version__
description = """\
The Hypothes.is Project Annotation System
"""

command = clik.App(
    'hypothesis',
    version=version,
    description=description,
)


@command(usage='CONFIG_FILE')
def assets(args, console):
    """Build the static assets."""

    if len(args) == 0:
        console.error('You must supply a paste configuration file.')
        return 2

    from h import bootstrap
    from pyramid_webassets import IWebAssetsEnvironment

    def build(env):
        asset_env = env['registry'].queryUtility(IWebAssetsEnvironment)
Example #3
0
import clik
from os import path
import os
from optparse import make_option as opt
from cipr.commands.cfg import CiprCfg
from cipr.commands import env


def _args(opts):
    env.project_directory = opts.project_directory

    return dict(
        env = env,
        ciprcfg = CiprCfg(path.join(env.project_directory, '.ciprcfg'))
    )

command = clik.App('cipr',
    version='0.8',
    description='Corona SDK package manager.',
    console_opts=True,
    conf_enabled=False,
    opts= opt('-d', '--project',
        dest='project_directory', default=path.abspath(os.getcwd()),
        help='Project directory'
    ),
    args_callback=_args
)