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')
Exemple #2
0
    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.',
        )
Exemple #3
0
   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)')
Exemple #4
0
 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')
    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')
Exemple #6
0
   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')
   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.',)
   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.
      """
Exemple #9
0
   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.
      """
   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')
Exemple #11
0
   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.',)
Exemple #12
0
    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')
    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')
    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.',
        )
Exemple #15
0
 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.')
   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')
 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.')
Exemple #18
0
 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')
Exemple #19
0
   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)')
 def prepare(self):
    Ccp_Script_Args.prepare(self)
Exemple #21
0
    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)')
Exemple #22
0
 def prepare(self):
     Ccp_Script_Args.prepare(self)