当前位置: 首页>>代码示例>>Python>>正文


Python admin.CascadeAdmin类代码示例

本文整理汇总了Python中pgq.cascade.admin.CascadeAdmin的典型用法代码示例。如果您正苦于以下问题:Python CascadeAdmin类的具体用法?Python CascadeAdmin怎么用?Python CascadeAdmin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CascadeAdmin类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: install_code

 def install_code(self, db):
     fn = skytools.installer_find_file('londiste.sql')
     main_sql = open(fn, 'r').read()
     noschema_sql = main_sql.replace('create schema', '-- create schema')
     self.extra_objs = [
         skytools.DBSchema("londiste", sql_file = 'londiste.sql'),
         skytools.DBFunction("londiste.global_add_table", 2, sql = noschema_sql),
     ]
     CascadeAdmin.install_code(self, db)
开发者ID:cbbrowne,项目名称:skytools-dev,代码行数:9,代码来源:setup.py

示例2: __init__

    def __init__(self, args):
        """Londiste setup init."""
        CascadeAdmin.__init__(self, 'londiste3', 'db', args, worker_setup = True)

        # compat
        self.queue_name = self.cf.get('pgq_queue_name', '')
        # real
        if not self.queue_name:
            self.queue_name = self.cf.get('queue_name')

        self.set_name = self.queue_name
开发者ID:cbbrowne,项目名称:skytools-dev,代码行数:11,代码来源:setup.py

示例3: load_extra_status

 def load_extra_status(self, curs, node):
     """Fetch extra info."""
     CascadeAdmin.load_extra_status(self, curs, node)
     curs.execute("select * from londiste.get_table_list(%s)", [self.queue_name])
     n_ok = n_half = n_ign = 0
     for tbl in curs.fetchall():
         if not tbl['local']:
             n_ign += 1
         elif tbl['merge_state'] == 'ok':
             n_ok += 1
         else:
             n_half += 1
     node.add_info_line('Tables: %d/%d/%d' % (n_ok, n_half, n_ign))
开发者ID:askoja,项目名称:skytools,代码行数:13,代码来源:setup.py

示例4: __init__

    def __init__(self, args):
        """Londiste setup init."""
        CascadeAdmin.__init__(self, "londiste3", "db", args, worker_setup=True)

        # compat
        self.queue_name = self.cf.get("pgq_queue_name", "")
        # real
        if not self.queue_name:
            self.queue_name = self.cf.get("queue_name")

        self.set_name = self.queue_name

        londiste.handler.load_handler_modules(self.cf)
开发者ID:lalinsky,项目名称:skytools,代码行数:13,代码来源:setup.py

示例5: __init__

    def __init__(self, args):
        """Londiste setup init."""
        CascadeAdmin.__init__(self, 'londiste3', 'db', args, worker_setup = True)

        # compat
        self.queue_name = self.cf.get('pgq_queue_name', '')
        # real
        if not self.queue_name:
            self.queue_name = self.cf.get('queue_name')

        self.set_name = self.queue_name

        self.lock_timeout = self.cf.getfloat('lock_timeout', 10)

        londiste.handler.load_handler_modules(self.cf)
开发者ID:cesterlizi,项目名称:skytools,代码行数:15,代码来源:setup.py

示例6: init_optparse

    def init_optparse(self, parser=None):
        """Add londiste switches to cascadeadmin ones."""

        p = CascadeAdmin.init_optparse(self, parser)
        p.add_option("--expect-sync", action="store_true", dest="expect_sync",
                    help = "no copy needed", default=False)
        p.add_option("--skip-truncate", action="store_true", dest="skip_truncate",
                    help = "dont delete old data", default=False)
        p.add_option("--copy-condition", dest="copy_condition",
                help = "copy: where expression")
        p.add_option("--force", action="store_true",
                    help="force", default=False)
        p.add_option("--all", action="store_true",
                    help="include all tables", default=False)
        p.add_option("--create", action="store_true",
                    help="include all tables", default=False)
        p.add_option("--create-only",
                    help="pkey,fkeys,indexes")
        p.add_option("--trigger-flags",
                    help="Set trigger flags (BAIUDLQ)")
        p.add_option("--trigger-arg", action="append",
                    help="Custom trigger arg")
        p.add_option("--no-triggers", action="store_true",
                    help="Custom trigger arg")
        p.add_option("--handler", action="append",
                    help="add: Custom handler for table")
        return p
开发者ID:famoseagle,项目名称:skytools,代码行数:27,代码来源:setup.py

示例7: init_optparse

    def init_optparse(self, parser=None):
        """Add londiste switches to cascadeadmin ones."""

        p = CascadeAdmin.init_optparse(self, parser)
        p.add_option("--expect-sync", action="store_true", dest="expect_sync",
                    help = "no copy needed", default=False)
        p.add_option("--skip-truncate", action="store_true", dest="skip_truncate",
                    help = "dont delete old data", default=False)
        p.add_option("--copy-condition", dest="copy_condition",
                help = "copy: where expression")
        p.add_option("--force", action="store_true",
                    help="force", default=False)
        p.add_option("--all", action="store_true",
                    help="include all tables", default=False)
        p.add_option("--create", action="store_true",
                    help="create, minimal", default=False)
        p.add_option("--create-full", action="store_true",
                    help="create, full")
        p.add_option("--trigger-flags",
                    help="Set trigger flags (BAIUDLQ)")
        p.add_option("--trigger-arg", action="append",
                    help="Custom trigger arg")
        p.add_option("--no-triggers", action="store_true",
                    help="Custom trigger arg")
        p.add_option("--handler", action="store",
                help="add: Custom handler for table")
        p.add_option("--handler-arg", action="append",
                    help="add: Argument to custom handler")
        p.add_option("--merge-all", action="store_true",
                    help="merge tables from all source queues", default=False)
        p.add_option("--no-merge", action="store_true",
                    help="don't merge tables from source queues", default=False)
        return p
开发者ID:kevpie,项目名称:skytools,代码行数:33,代码来源:setup.py

示例8: init_optparse

    def init_optparse(self, parser=None):
        """Add londiste switches to cascadeadmin ones."""

        p = CascadeAdmin.init_optparse(self, parser)
        p.add_option("--expect-sync", action="store_true", dest="expect_sync",
                    help = "no copy needed", default=False)
        p.add_option("--skip-truncate", action="store_true", dest="skip_truncate",
                    help = "dont delete old data", default=False)
        p.add_option("--force", action="store_true",
                    help="force", default=False)
        p.add_option("--all", action="store_true",
                    help="include all tables", default=False)
        p.add_option("--create", action="store_true",
                    help="include all tables", default=False)
        p.add_option("--create-only",
                    help="pkey,fkeys,indexes")
        return p
开发者ID:askoja,项目名称:skytools-dev,代码行数:17,代码来源:setup.py

示例9: init_optparse

    def init_optparse(self, parser=None):
        """Add londiste switches to cascadeadmin ones."""

        p = CascadeAdmin.init_optparse(self, parser)
        p.add_option("--expect-sync", action="store_true", dest="expect_sync",
                help = "no copy needed", default=False)
        p.add_option("--skip-truncate", action="store_true", dest="skip_truncate",
                help = "do not delete old data", default=False)
        p.add_option("--find-copy-node", action="store_true", dest="find_copy_node",
                help = "add: find table source for copy by walking upwards")
        p.add_option("--copy-node", metavar = "NODE", dest="copy_node",
                help = "add: use NODE as source for initial copy")
        p.add_option("--force", action="store_true",
                help="force", default=False)
        p.add_option("--all", action="store_true",
                help="include all tables", default=False)
        p.add_option("--wait-sync", action="store_true",
                help = "add: wait until all tables are in sync"),
        p.add_option("--create", action="store_true",
                help="create, minimal", default=False)
        p.add_option("--create-full", action="store_true",
                help="create, full")
        p.add_option("--trigger-flags",
                help="set trigger flags (BAIUDLQ)")
        p.add_option("--trigger-arg", action="append",
                help="custom trigger arg")
        p.add_option("--no-triggers", action="store_true",
                help="no triggers on table")
        p.add_option("--handler", action="store",
                help="add: custom handler for table")
        p.add_option("--handler-arg", action="append",
                help="add: argument to custom handler")
        p.add_option("--merge-all", action="store_true",
                help="merge tables from all source queues", default=False)
        p.add_option("--no-merge", action="store_true",
                help="do not merge tables from source queues", default=False)
        p.add_option("--max-parallel-copy", metavar = "NUM", type = "int",
                help="max number of parallel copy processes")
        p.add_option("--dest-table", metavar = "NAME",
                help="add: name for actual table")
        p.add_option("--skip-non-existing", action="store_true",
                help="add: skip object that does not exist")
        return p
开发者ID:PJMODOS,项目名称:skytools,代码行数:43,代码来源:setup.py

示例10: install_code

 def install_code(self, db):
     self.extra_objs = [
         skytools.DBSchema("londiste", sql_file = 'londiste.sql'),
         skytools.DBFunction("londiste.global_add_table", 2, sql_file = 'londiste.upgrade.2to3.sql'),
     ]
     CascadeAdmin.install_code(self, db)
开发者ID:askoja,项目名称:skytools,代码行数:6,代码来源:setup.py


注:本文中的pgq.cascade.admin.CascadeAdmin类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。