本文整理汇总了Python中util_.script_args.Ccp_Script_Args类的典型用法代码示例。如果您正苦于以下问题:Python Ccp_Script_Args类的具体用法?Python Ccp_Script_Args怎么用?Python Ccp_Script_Args使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Ccp_Script_Args类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: prepare
def prepare(self):
Ccp_Script_Args.prepare(self)
# 2013.12.02:
#
# SELECT z_level, COUNT(*)
# FROM tiles_cache_byway_segment
# GROUP BY z_level ORDER BY z_level;
#
# z_level | count
# ---------+--------
# 130 | 59
# 131 | 23
# 132 | 161
# 133 | 469
# 134 | 483287
# 135 | 362
# 136 | 912
# 137 | 217
# 138 | 30
# (9 rows)
#
# BUG nnnn: Fix z_levels 130, 131, 137, 138 to use 132-136... save so
# much tilecache time...
#
# DEVS: Use this (temporarily) when testing tiles to make it 88.8%
# faster. E.g., -l 134 134
#
self.add_argument(
'-l', '--bridge', dest='bridge_levels', type=int, nargs=2,
default=(byway.One.z_level_min, byway.One.z_level_max),
help='For debugging: render just these bridge_levels (130 to 138)')
开发者ID:landonb,项目名称:Cyclopath,代码行数:33,代码来源:make_mapfile.py
示例2: prepare
def prepare(self, exclude_normal=False):
Ccp_Script_Args.prepare(self)
self.add_argument('--force', dest='force',
action='store_true', default=False,
help='force coverage_area update')
开发者ID:landonb,项目名称:Cyclopath,代码行数:7,代码来源:gen_tilecache_cfg.py
示例3: prepare
def prepare(self):
Ccp_Script_Args.prepare(self)
#
self.add_argument('-C', '--count', dest='row_count',
action='store', default=0, type=int, required=True,
help='the number of aliases to insert')
self.add_argument('-O', '--offset', dest='row_offset',
action='store', default=0, type=int, required=True,
help='the row offset at which to start')
开发者ID:landonb,项目名称:Cyclopath,代码行数:10,代码来源:aliases.py
示例4: prepare
def prepare(self):
Ccp_Script_Args.prepare(self)
self.add_argument('-X', '--drop-table', dest='cache_table_drop',
default=False, action='store_true',
help='Drop the cache tables from the database.',)
self.add_argument('-C', '--create-table', dest='cache_table_create',
default=False, action='store_true',
help='Create the cache tables in the database.',)
开发者ID:landonb,项目名称:Cyclopath,代码行数:11,代码来源:gtfsdb_build_cache.py
示例5: prepare
def prepare(self):
Ccp_Script_Args.prepare(self)
# Desired operation.
self.add_argument('--update-branch', dest='update_branch',
action='store', default=None, type=str,
help='the name or ID of the existing branch to update')
#
self.add_argument('--new-branch-name', dest='new_branch_name',
action='store', default='', type=str,
help='the name of the new branch')
#
self.add_argument('--purge-branch', dest='purge_branch',
action='store_true', default=False,
help='delete all traces of the branch instead of creating it')
# For new branches.
#
# Either:
self.add_argument('--last-merge-rid', dest='last_merge_rid',
action='store', default=0, type=int,
help='the last merge revision ID, or Current if not specified')
# or:
self.add_argument('--is-basemap', dest='is_basemap',
action='store_true', default=False,
help='make a parenty branch rather than a leafy branch')
# For new and existing branches.
#
self.add_argument('--callback-class', dest='callback_class',
action='store', default='', type=str,
help='classname of the branches module w/ process_import/_export')
#
self.add_argument('--tile-skins', dest='tile_skins',
# Note: default is None, not [], so that --tile-skins all alone means
# to clear list of skins, so no tiles will be generated.
action='store', default=None, type=str, nargs='*',
help='a list of skins to use to make tiles for branch')
#
self.add_argument('--owners', dest='owners',
action='store', default=[], type=str, nargs='*',
help='a list of usernames to add to branch owners group')
self.add_argument('--arbiters', dest='arbiters',
action='store', default=[], type=str, nargs='*',
help='a list of usernames to add to branch arbiters group')
self.add_argument('--editors', dest='editors',
action='store', default=[], type=str, nargs='*',
help='a list of usernames to add to branch editors group')
#
# FIXME: Implement: Create new database from schema dump and populate
# standard tables.
"""
开发者ID:uohzoaix,项目名称:Cyclopath,代码行数:53,代码来源:make_new_branch.py
示例6: prepare
def prepare(self):
Ccp_Script_Args.prepare(self)
#
# MAYBE: We'll probably want a new profile, 'commentable', or
# something, that means a group cannot edit features but can
# edit posts and/or notes, etc., maybe points, whatnot. Maybe
# it just restricts certain types, instead, no mostly 'normal',
# but maybe cannot edit byways and regions, say.
self.add_argument('-p', '--profile', dest='policy_profile',
action='store', default='standard',
choices=(None, 'standard', 'denied',),
help='policy profile: how to setup group\'s access')
开发者ID:landonb,项目名称:Cyclopath,代码行数:13,代码来源:new_item_policy_init.py
示例7: verify_handler
def verify_handler(self):
ok = Ccp_Script_Args.verify_handler(self)
if self.cli_opts.recipient_file and self.cli_opts.bug_number:
log.error(
'Please specify either --output or --bug-number, not both')
ok = False
elif self.cli_opts.bug_number:
# Use the server name in the path.
hostname = socket.gethostname() # E.g., 'runic', 'my.home.domain'
dot_index = hostname.find('.')
if dot_index > 0:
hostname = hostname[0:dot_index]
# else, dot_index is 0 (unexpected, e.g., ".home.domain"?)
# or dot_index is -1 (not found)
self.cli_opts.recipient_file = (
#'/ccp/bin/ccpdev/private/runic/schema/bug_%s/recipient_file'
'/ccp/bin/ccpdev/private/%s/schema/bug_%s/recipient_file'
% (socket.gethostname(), self.cli_opts.bug_number,))
elif not self.cli_opts.recipient_file:
log.error('Please specify either --output or --bug-number.')
ok = False
num_inputs = 0
num_inputs += 1 if self.cli_opts.email_addrs else 0
num_inputs += 1 if self.cli_opts.usernames else 0
num_inputs += 1 if self.cli_opts.userids else 0
if num_inputs > 1:
log.error(
'Cannot specify more than one of --emails, --usernames, --userids')
ok = False
g.assurt(self.cli_opts.split_count >= 1)
return ok
开发者ID:landonb,项目名称:Cyclopath,代码行数:31,代码来源:emails_for_spam.py
示例8: prepare
def prepare(self):
Ccp_Script_Args.prepare(self)
self.add_argument(
'--access-log', dest='access_log',
default=None, action='store',
help='Use the specified logfile instead of access.log.',)
self.add_argument(
'--skip-date-check', dest='skip_date_check',
default=False, action='store_true',
help='Import all records, regardless of timestamp.',)
self.add_argument(
'--skip-analyze', dest='skip_analyze',
default=False, action='store_true',
help='Skip vacuum analyze.',)
开发者ID:uohzoaix,项目名称:Cyclopath,代码行数:18,代码来源:apache2sql.py
示例9: verify
def verify(self):
verified = Ccp_Script_Args.verify(self)
if ((self.cli_opts.bridge_levels[0] < byway.One.z_level_min)
or (self.cli_opts.bridge_levels[1] > byway.One.z_level_max)):
log.error('Please specify bridge levels between %d and %d, inclusive.'
% (byway.One.z_level_min, byway.One.z_level_max,))
verified = False
self.handled = True
return verified
开发者ID:landonb,项目名称:Cyclopath,代码行数:12,代码来源:make_mapfile.py
示例10: prepare
def prepare(self):
Ccp_Script_Args.prepare(self, exclude_normal=True)
#
self.add_argument('--emails', dest='email_addrs',
action='store', default=[], type=str, nargs='*', required=False,
help='a list of email addresses to verify, or none if you want all')
#
self.add_argument('--usernames', dest='usernames',
action='store', default=[], type=str, nargs='*', required=False,
help='a list of usernames to verify, or none if you want all')
#
self.add_argument('--userids', dest='userids',
action='store', default=[], type=str, nargs='*', required=False,
help='a list of userids to verify, or none if you want all')
#
self.add_argument('--output', dest='recipient_file',
action='store', default=None, type=str, required=False,
help='the file in which to store the list of emails okay to email')
#
self.add_argument('--bug-number', dest='bug_number',
action='store', default=None, type=int, required=False,
help='the bug number, if you want to use standard paths and names')
#
self.add_argument('--split-count', dest='split_count',
action='store', default=1, type=int, required=False,
help='the number of output files to create')
#
self.add_argument('--force', dest='force_overwrite',
action='store_true', default=False, required=False,
help='overwrite the output file(s), if they exist')
#
self.add_argument('--sort-mode', dest='sort_mode',
action='store', default='', type=str, required=False,
choices=('id ASC', 'id DESC', 'email ASC', 'email DESC',
'username ASC', 'username DESC', 'RANDOM()',),
help='how to order the results')
# If you're testing, you may want to ignore dont_study, etc.
self.add_argument('--ignore-flags', dest='ignore_flags',
action='store_true', default=False, required=False,
help='always email, even if dont_study.')
开发者ID:landonb,项目名称:Cyclopath,代码行数:40,代码来源:emails_for_spam.py
示例11: prepare
def prepare(self):
'''Defines the CLI options for this script'''
Ccp_Script_Args.prepare(self)
self.add_argument('-d', '--scripts-dir', dest='scripts_dir',
action='store', default=default_schema_dir, type=str,
help='relative path of dir containing the schema scripts')
self.add_argument('-I', '--run-all', dest='run_all',
action='store_true', default=False,
help='run all scripts, from #1, ignore upgrade_event table')
# yesall has the same meaning as --non-interactive
self.add_argument('-y', '--yes-all', dest='do_yesall',
action='store_true', default=False,
help='run all scripts without prompting (unless one fails)')
self.add_argument('--revert', dest='do_revert',
action='store_true', default=False,
help='revert previous script (if revert script available)')
self.add_argument('--noerrs', dest='do_noerrs',
action='store_true', default=False,
help='always ask user to check output between scripts')
self.add_argument('--novacu', dest='do_novacu',
action='store_true', default=False,
help='skip vacuuming after every script (experimental)')
self.add_argument('--dovacu', dest='do_dovacu',
action='store_true', default=False,
help='vacuum database after every script (experimental)')
self.add_argument('--stopon', dest='stop_on_script',
action='store_true', default=False,
help='stop if the named script is next to run')
开发者ID:landonb,项目名称:Cyclopath,代码行数:37,代码来源:schema-upgrade.py
示例12: verify_handler
def verify_handler(self):
ok = Ccp_Script_Args.verify_handler(self)
#
if ((self.cli_opts.recipient_file
or self.cli_opts.content_plain
or self.cli_opts.content_html)
and self.cli_opts.bug_number):
log.error('%s%s'
% ('Please specify either recipient_file, content_plain, and ',
'content_html, or --bug-number, not both',))
ok = False
elif self.cli_opts.bug_number:
self.cli_opts.recipient_file = (
'/ccp/bin/ccpdev/schema/runic/bug_%s/recipient_file'
% (self.cli_opts.bug_number,))
if self.cli_opts.file_number:
self.cli_opts.recipient_file += (
'.%d' % (self.cli_opts.file_number,))
self.cli_opts.content_plain = (
'/ccp/bin/ccpdev/schema/runic/bug_%s/content_plain'
% (self.cli_opts.bug_number,))
self.cli_opts.content_html = (
'/ccp/bin/ccpdev/schema/runic/bug_%s/content_html'
% (self.cli_opts.bug_number,))
elif (not (self.cli_opts.recipient_file
and self.cli_opts.content_plain
and self.cli_opts.content_html)):
log.error('%s%s'
% ('Please specify either --recipient-file, --plain, ',
'and --html, or --bug-number.',))
#
file_paths = [
self.cli_opts.recipient_file,
self.cli_opts.content_plain,
self.cli_opts.content_html,
]
if self.cli_opts.send_test_emails:
file_paths.append(self.cli_opts.test_emails_file)
for fpath in file_paths:
if not os.path.exists(fpath):
log.error('File does not exist: "%s"' % (fpath,))
ok = False
#
if self.cli_opts.send_test_emails:
self.cli_opts.recipient_file = self.cli_opts.test_emails_file
#
return ok
开发者ID:landonb,项目名称:Cyclopath,代码行数:47,代码来源:spam.py
示例13: verify_handler
def verify_handler(self):
ok = Ccp_Script_Args.verify_handler(self)
if self.cli_opts.username == conf.anonymous_username:
log.error('Please specify a real username (no anonymous cowards).')
ok = False
op_count = ( (1 if (self.cli_opts.update_branch is not None) else 0)
+ (1 if (self.cli_opts.new_branch_name) else 0)
+ (1 if (self.cli_opts.purge_branch) else 0))
if op_count != 1:
log.error(
'Specify one: --update-branch, --new-branch-name, or --purge-branch.')
ok = False
if self.cli_opts.purge_branch:
if not self.cli_opts.branch:
log.error('Please use --branch to specify the branch to purge.')
ok = False
if self.cli_opts.last_merge_rid and self.cli_opts.is_basemap:
log.error('Please specify either --last-merge-rid or --is-basemap.')
ok = False
return ok
开发者ID:uohzoaix,项目名称:Cyclopath,代码行数:20,代码来源:make_new_branch.py
示例14: verify
def verify(self):
verified = Ccp_Script_Args.verify(self)
开发者ID:landonb,项目名称:Cyclopath,代码行数:2,代码来源:schema-upgrade.py
示例15: __init__
def __init__(self):
Ccp_Script_Args.__init__(self, script_name, script_version,
usage=None)
开发者ID:landonb,项目名称:Cyclopath,代码行数:3,代码来源:schema-upgrade.py
示例16: prepare
def prepare(self):
Ccp_Script_Args.prepare(self, exclude_normal=True)
self.add_argument('--subject', dest='email_subject',
action='store', default='', type=str, required=True,
help='the subject of the email')
#
self.add_argument('--recipients', dest='recipient_file',
action='store', default=None, type=str, required=False,
help='file of user IDs (or maybe usernames or email addresses')
#
self.add_argument('--plain', dest='content_plain',
action='store', default=None, type=str, required=False,
help='file containing the email plaintext')
#
self.add_argument('--html', dest='content_html',
action='store', default=None, type=str, required=False,
help='file containing the email html')
# Or, instead of the last three:
self.add_argument('--bug-number', dest='bug_number',
action='store', default=None, type=int, required=False,
help='the bug number, if you want to use standard paths and names')
#
self.add_argument('--file-number', dest='file_number',
action='store', default=None, type=int, required=False,
help='the file number of the emails_for_spam-created file')
#
self.add_argument('--test', dest='send_test_emails',
action='store_true', default=False,
help='if set, send emails to the users listed in the test file')
#
self.add_argument('--test-file', dest='test_emails_file',
action='store', type=str, required=False,
default='/ccp/bin/ccpdev/schema/runic/spam_test_uids',
help='the location of the test email user IDs')
# To test the code without sending even test emails, try this.
self.add_argument('--do-not-email', dest='do_not_email',
action='store_true', default=False, required=False,
help='do not even send test emails, just test the code.')
# Generally when you test you'll want to ignore dont_study, etc.
self.add_argument('--ignore-flags', dest='ignore_flags',
action='store_true', default=False, required=False,
help='always email, even if dont_study.')
#
# MAGIC_NUMBER: 0.3 seconds seems... reasonable. We've not tested
# anything smaller (circa 2012.11.12).
self.add_argument('--delay-time', dest='delay_time',
action='store', default=0.3, type=float,
help='if nonzero, wait time between sendmail calls')
#
self.add_argument('--dont-shake', dest='dont_shake',
action='store_true', default=True,
help='if set, use a variable delay time each time')
#
self.add_argument('--mail-from', dest='mail_from',
action='store', default=conf.mail_from_addr, type=str,
help='used to override CONFIG.mail_from_addr')
#
self.add_argument('--bcc-size', dest='bcc_size',
action='store', default=0, type=int,
help='number of recipients to Bcc at once (per sendmail call)')
开发者ID:landonb,项目名称:Cyclopath,代码行数:65,代码来源:spam.py
示例17: __init__
def __init__(self):
Ccp_Script_Args.__init__(self, script_name, script_version)
开发者ID:landonb,项目名称:Cyclopath,代码行数:2,代码来源:spam.py
示例18: parse
def parse(self):
Ccp_Script_Args.parse(self)
开发者ID:landonb,项目名称:Cyclopath,代码行数:2,代码来源:spam.py
示例19: prepare
def prepare(self):
Ccp_Script_Args.prepare(self)
#
self.add_argument('--create-tables', dest='create_tables',
action='store_true', default=False,
help='recreate the tile cache tables')
开发者ID:landonb,项目名称:Cyclopath,代码行数:6,代码来源:item_loader_test.py
示例20: __init__
def __init__(self):
Ccp_Script_Args.__init__(self, script_name, script_version)
#
self.groups_none_use_public = True
开发者ID:uohzoaix,项目名称:Cyclopath,代码行数:4,代码来源:make_new_branch.py
注:本文中的util_.script_args.Ccp_Script_Args类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论