예제 #1
0
파일: upgrade.py 프로젝트: vanderheyde/ecm
def sub_command():
    # UPGRADE
    description = 'Synchronize an instance\'s database and files.'
    upgrade_cmd = Subcommand(
        'upgrade',
        parser=OptionParser(usage='%prog [OPTIONS] instance_dir'),
        help=description,
        callback=run)
    upgrade_cmd.parser.description = description
    upgrade_cmd.parser.add_option(
        '--no-syncdb',
        dest='no_syncdb',
        action='store_true',
        default=False,
        help='Do not modify the instance\'s database.')
    upgrade_cmd.parser.add_option('-u',
                                  '--upgrade-from-1.4.9',
                                  dest='upgrade_from_149',
                                  action='store_true',
                                  default=False,
                                  help='Upgrade from ECM-1.4.9.')
    if not os.name == 'nt':
        upgrade_cmd.parser.add_option(
            '-s',
            '--symlink-files',
            dest='symlink_files',
            help='Create symbolic links instead of copying static files.',
            default=False,
            action='store_true')

    return upgrade_cmd
예제 #2
0
def sub_command():
    # INIT
    description = 'Load EVE static data into the instance database.  '\
                  'The data can be in Fuzzwork table format, or preconverted into ECM format.'

    load_cmd = Subcommand(
        'load',
        parser=OptionParser(usage='%prog [OPTIONS] instance_dir [dumppath]'),
        help=description,
        callback=run)
    load_cmd.parser.description = description + '  "dumppath" can be an URL or local path to a dump file (.SQL), optionally compressed as bz2, gz, or zip.  ' \
                                                'If the -f option is specified, "dumppath" is optional and refers to the location of the SDE table files.'
    load_cmd.parser.add_option(
        '-f',
        '--fuzzwork',
        dest='fuzzwork',
        default=False,
        action='store_true',
        help=
        'Download and load the EVE static data from the Fuzzwork website, default path is %s.  (MySQL only)'
        % FUZZWORK_URL_PREFIX)
    load_cmd.parser.add_option(
        '--save',
        dest='save',
        default=False,
        action='store_true',
        help=
        'Save the downloaded file(s) to your current directory for later use.')

    return load_cmd
예제 #3
0
파일: manage.py 프로젝트: vanderheyde/ecm
def sub_command():
    description = 'Manage an instance (proxy for manage.py).'
    manage_cmd = Subcommand(
        'manage',
        parser=PassThroughOptionParser(usage='%prog [OPTIONS] instance_dir'),
        help=description,
        callback=run)
    manage_cmd.parser.description = description
    return manage_cmd
예제 #4
0
def sub_command():
    description = 'Run the embedded server (in the current shell).'
    cmd = Subcommand('run',
                     parser=OptionParser(usage='%prog [OPTIONS] instance_dir'),
                     help=description, callback=run)
    cmd.parser.description = description
    cmd.parser.add_option('-a', '--access-log',
                          dest='access_log', default=False, action='store_true',
                          help='Display HTTP access log.')
    return cmd
예제 #5
0
파일: create.py 프로젝트: vanderheyde/ecm
def sub_command():
    # CREATE
    description = 'Create a new ECM instance in the given directory.'

    create_cmd = Subcommand(
        'create',
        parser=OptionParser(usage='%prog [OPTIONS] instance_dir'),
        help='Create a new ECM instance in the given directory.',
        callback=run)
    create_cmd.parser.description = description
    create_cmd.parser.add_option(
        '-q',
        '--quiet',
        dest='quiet',
        help='Do not prompt user (use default values).',
        default=False,
        action='store_true')

    db_group = OptionGroup(create_cmd.parser, 'Database options')
    db_group.add_option('--db-engine',
                        dest='db_engine',
                        help='DB engine %s' % DB_ENGINES.keys())
    db_group.add_option('--db-host', dest='db_host', help='Database host')
    db_group.add_option('--db-name', dest='db_name', help='Database name')
    db_group.add_option('--db-user', dest='db_user', help='Database user')
    db_group.add_option('--db-password',
                        dest='db_pass',
                        help='Database user password')
    create_cmd.parser.add_option_group(db_group)

    w_group = OptionGroup(create_cmd.parser, 'Web & Mail options')
    w_group.add_option('--host-name',
                       dest='host_name',
                       help='The public name of ECM host computer.')
    w_group.add_option(
        '--admin-email',
        dest='admin_email',
        help='Email of the server administrator (for error notifications)')
    w_group.add_option(
        '--server-email',
        dest='server_email',
        help='Email used as "from" address in emails sent by the server.')
    create_cmd.parser.add_option_group(w_group)

    server_group = OptionGroup(create_cmd.parser, 'Server options')
    server_group.add_option('--bind-address',
                            dest='bind_address',
                            help='Server listening address')
    server_group.add_option('--bind-port',
                            dest='bind_port',
                            help='Server listening address')
    create_cmd.parser.add_option_group(server_group)

    return create_cmd
예제 #6
0
파일: daemon.py 프로젝트: vanderheyde/ecm
def sub_command():
    description = 'Control the embedded daemon server of an existing ECM instance.'
    cmd = Subcommand('start',
                     aliases=('stop', 'restart', 'status'),
                     parser=OptionParser(usage='%prog [OPTIONS] instance_dir'),
                     help=description,
                     callback=run)
    cmd.parser.description = description
    cmd.parser.add_option(
        '-l',
        '--log-file',
        dest='logfile',
        metavar='FILE',
        help='Write server access log to FILE. Default is "/dev/null".')
    return cmd
예제 #7
0
def sub_command():
    # INIT
    description = 'Initialize an instance\'s database and files.'

    init_cmd = Subcommand(
        'init',
        parser=OptionParser(usage='%prog [OPTIONS] instance_dir'),
        help=description,
        callback=run)
    init_cmd.parser.description = description
    if not os.name == 'nt':
        init_cmd.parser.add_option(
            '-s',
            '--symlink-files',
            dest='symlink_files',
            help='Create symbolic links instead of copying static files.',
            default=False,
            action='store_true')
    return init_cmd
예제 #8
0
파일: dump.py 프로젝트: vanderheyde/ecm
def sub_command():
    # INIT
    dump_cmd = Subcommand(
        'dump',
        parser=OptionParser(usage='%prog [OPTIONS] instance_dir dump_file'),
        help='Dump patched EVE data to a file.',
        callback=run)
    dump_cmd.parser.add_option('-o',
                               '--overwrite',
                               dest='overwrite',
                               default=False,
                               action='store_true',
                               help='Force overwrite any existing file.')
    dump_cmd.parser.add_option(
        '-j',
        '--json',
        dest='json',
        default=False,
        action='store_true',
        help='Dump the data in JSON Django serializated format.')
    return dump_cmd