當前位置: 首頁>>代碼示例>>Python>>正文


Python script_args.Ccp_Script_Args類代碼示例

本文整理匯總了Python中util_.script_args.Ccp_Script_Args的典型用法代碼示例。如果您正苦於以下問題:Python Ccp_Script_Args類的具體用法?Python Ccp_Script_Args怎麽用?Python Ccp_Script_Args使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Ccp_Script_Args類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的util_.script_args.Ccp_Script_Args類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。