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


Python BaseHandler.__init__方法代码示例

本文整理汇总了Python中londiste.handler.BaseHandler.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python BaseHandler.__init__方法的具体用法?Python BaseHandler.__init__怎么用?Python BaseHandler.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在londiste.handler.BaseHandler的用法示例。


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

示例1: __init__

# 需要导入模块: from londiste.handler import BaseHandler [as 别名]
# 或者: from londiste.handler.BaseHandler import __init__ [as 别名]
 def __init__(self, table_name, args, log):
     """Init per-batch table data cache."""
     BaseHandler.__init__(self, table_name, args, log)
     try:
         self.dst_queue_name = args['queue']
     except KeyError:
         raise Exception('specify queue with handler-arg')
     self.rows = []
开发者ID:digideskio,项目名称:skytools,代码行数:10,代码来源:qtable.py

示例2: __init__

# 需要导入模块: from londiste.handler import BaseHandler [as 别名]
# 或者: from londiste.handler.BaseHandler import __init__ [as 别名]
 def __init__(self, table_name, args, log):
     BaseHandler.__init__(self, table_name, args, log)
     # show args
     self.log.debug("dispatch.init: table_name=%r, args=%r" % \
                    (table_name, args))
     # get table name
     self.table_name = args.get('table', self.table_name)
     self.quoted_name = quote_fqident(self.table_name)
     self.batch_info = None
     self.dst_curs = None
     self.pkeys = None
     # config
     self.conf = self.get_config()
     hdlr_cls = ROW_HANDLERS[self.conf.row_mode]
     self.row_handler = hdlr_cls(self.log)
开发者ID:ssinger,项目名称:skytools,代码行数:17,代码来源:dispatch.py

示例3: __init__

# 需要导入模块: from londiste.handler import BaseHandler [as 别名]
# 或者: from londiste.handler.BaseHandler import __init__ [as 别名]
    def __init__(self, table_name, args, log):
        """Init per-batch table data cache."""

        BaseHandler.__init__(self, table_name, args, log)

        self.pkey_list = None
        self.dist_fields = None
        self.col_list = None

        self.pkey_ev_map = {}
        self.method = int(args.get('method', DEFAULT_METHOD))
        if not self.method in (0,1,2):
            raise Exception('unknown method: %s' % self.method)

        self.log.debug('bulk_init(%s), method=%d' % (repr(args), self.method))
开发者ID:digideskio,项目名称:skytools,代码行数:17,代码来源:bulk.py

示例4: __init__

# 需要导入模块: from londiste.handler import BaseHandler [as 别名]
# 或者: from londiste.handler.BaseHandler import __init__ [as 别名]
    def __init__(self, table_name, args, dest_table):
        """Init per-batch table data cache."""

        BaseHandler.__init__(self, table_name, args, dest_table)

        self.pkey_list = None
        self.dist_fields = None
        self.col_list = None

        self.pkey_ev_map = {}
        self.method = int(args.get("method", DEFAULT_METHOD))
        if not self.method in (0, 1, 2):
            raise Exception("unknown method: %s" % self.method)

        self.log.debug("bulk_init(%r), method=%d", args, self.method)
开发者ID:SonicWang,项目名称:skytools,代码行数:17,代码来源:bulk.py

示例5: __init__

# 需要导入模块: from londiste.handler import BaseHandler [as 别名]
# 或者: from londiste.handler.BaseHandler import __init__ [as 别名]
 def __init__(self, table_name, args, log):
     BaseHandler.__init__(self, table_name, args, log)
     # show args
     self.log.debug("dispatch.init: table_name=%r, args=%r" % (table_name, args))
     # get table name
     self.table_name = args.get("table", self.table_name)
     self.quoted_name = quote_fqident(self.table_name)
     self.batch_info = None
     self.dst_curs = None
     self.pkeys = None
     # config
     self.conf = self.get_config()
     hdlr_cls = ROW_HANDLERS[self.conf.row_mode]
     self.row_handler = hdlr_cls(self.log)
     if self.conf.encoding:
         self.encoding_validator = EncodingValidator(self.log, self.conf.encoding)
     else:
         self.encoding_validator = None
开发者ID:kevpie,项目名称:skytools,代码行数:20,代码来源:dispatch.py

示例6: __init__

# 需要导入模块: from londiste.handler import BaseHandler [as 别名]
# 或者: from londiste.handler.BaseHandler import __init__ [as 别名]
    def __init__(self, table_name, args, dest_table):

        # compat for dest-table
        dest_table = args.get('table', dest_table)

        BaseHandler.__init__(self, table_name, args, dest_table)

        # show args
        self.log.debug("dispatch.init: table_name=%r, args=%r", table_name, args)
        self.batch_info = None
        self.dst_curs = None
        self.pkeys = None
        # config
        self.conf = self.get_config()
        hdlr_cls = ROW_HANDLERS[self.conf.row_mode]
        self.row_handler = hdlr_cls(self.log)
        if self.conf.encoding:
            self.encoding_validator = EncodingValidator(self.log,
                                                        self.conf.encoding)
        else:
            self.encoding_validator = None
开发者ID:kitsemets,项目名称:skytools,代码行数:23,代码来源:dispatch.py

示例7: __init__

# 需要导入模块: from londiste.handler import BaseHandler [as 别名]
# 或者: from londiste.handler.BaseHandler import __init__ [as 别名]
    def __init__(self, table_name, next, args, log):
        """Init per-batch table data cache."""

        BaseHandler.__init__(self, table_name, next, args, log)

        self.method = DEFAULT_METHOD

        self.pkey_list = None
        self.dist_fields = None
        self.col_list = None

        self.pkey_ev_map = {}

        for a in args:
            k, v = a.split('=')
            if k == 'method':
                m = int(v)
                if m not in (0,1,2):
                    raise Exception('unknown method: %s' % v)
                self.method = int(v)
            else:
                raise Exception('unknown argument: %s' % a)

        self.log.debug('bulk_init(%s), method=%d' % (repr(args), self.method))
开发者ID:famoseagle,项目名称:skytools,代码行数:26,代码来源:bulk.py

示例8: __init__

# 需要导入模块: from londiste.handler import BaseHandler [as 别名]
# 或者: from londiste.handler.BaseHandler import __init__ [as 别名]
 def __init__(self, name, next, args):
     BaseHandler.__init__(self, name, next, args)
     self.key = args[0]
开发者ID:mpihlak,项目名称:skytools-dev,代码行数:5,代码来源:bublin.py


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