本文整理汇总了Python中handler.Handler.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Handler.__init__方法的具体用法?Python Handler.__init__怎么用?Python Handler.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类handler.Handler
的用法示例。
在下文中一共展示了Handler.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from handler import Handler [as 别名]
# 或者: from handler.Handler import __init__ [as 别名]
def __init__(self, dest=[]):
Handler.__init__(self, dest=dest)
self.last_stamp = 0.0
self.parsers = {}
self.available_parsers = { "stdtime": self._parse_std_time,
"spec1": self._parse_spec1_time,
"vsftpd": self._parse_vsftpd_time }
示例2: __init__
# 需要导入模块: from handler import Handler [as 别名]
# 或者: from handler.Handler import __init__ [as 别名]
def __init__(self, config):
"""
Create a new instance of the ArchiveHandler class
"""
# Initialize Handler
Handler.__init__(self, config)
# Create Archive Logger
self.archive = logging.getLogger('autmon')
示例3: __init__
# 需要导入模块: from handler import Handler [as 别名]
# 或者: from handler.Handler import __init__ [as 别名]
def __init__(self, source_name, filename, dest=[]):
Handler.__init__(self, dest=dest)
self.info("Initializing filereader at %s" % (filename))
self.name = source_name
self.count = 0
self.last_report = time.time()
self.file = open(filename)
self.read()
self.report()
示例4: __init__
# 需要导入模块: from handler import Handler [as 别名]
# 或者: from handler.Handler import __init__ [as 别名]
def __init__(self, source_name, path, dest=[]):
Handler.__init__(self, dest=dest)
self.childrens = []
self.name = source_name
for f in os.listdir(path):
if os.path.isfile("%s/%s" % (path, f)):
self.childrens.append(
FileReader(f, "%s/%s" % (path, f), dest = dest))
else:
self.childrens.append(
DirReader(f, "%s/%s" % (path, f), dest))
示例5: __init__
# 需要导入模块: from handler import Handler [as 别名]
# 或者: from handler.Handler import __init__ [as 别名]
def __init__(self):
'''Init game.'''
Handler.__init__(self)
self.turns = 0
'''Holds the number of turns that have passed. Ticks up every time
Game.input is called.'''
self.actor = None
'''Default actor to pass input to.'''
if self.script != None:
s = self.script.read()
self.script.close()
self.script = s
self.scoreList = {}
示例6: __init__
# 需要导入模块: from handler import Handler [as 别名]
# 或者: from handler.Handler import __init__ [as 别名]
def __init__(self,env):
Handler.__init__(self, env)
self._ut = Utility()
self._conf = self._ut._conf
self._db = self._ut._db
self._jtheme = self._ut._jtheme
self._jtheme_mobile = self._ut._jtheme_mobile
self._jcache = self._ut._jcache
self._errors = []
self._messages = []
self._news = []
self._page = {}
self._site = {}
self._ = self._ut._
self._site['title'] = self._conf.SITE_TITLE
self._lang = self._conf.DEFAULT_LANG
self._template_add = {}
self._is_mobile = self.get_is_mobile()
示例7: __init__
# 需要导入模块: from handler import Handler [as 别名]
# 或者: from handler.Handler import __init__ [as 别名]
def __init__(self, config=None):
"""
Create a new instance of the MySQLHandler class
"""
# Initialize Handler
Handler.__init__(self, config)
# Initialize Options
self.hostname = self.config['hostname']
self.port = int(self.config['port'])
self.username = self.config['username']
self.password = self.config['password']
self.database = self.config['database']
self.table = self.config['table']
self.col_time = self.config['col_time']
self.col_metric = self.config['col_metric']
self.col_value = self.config['col_value']
# Connect
self._connect()
示例8: __init__
# 需要导入模块: from handler import Handler [as 别名]
# 或者: from handler.Handler import __init__ [as 别名]
def __init__(self, config=None):
"""
Create a new instance of the AutmonHandler class
"""
# Initialize Handler
Handler.__init__(self, config)
# Initialize Data
self.socket = None
# Initialize Options
self.proto = self.config.get('proto', 'tcp').lower().strip()
if self.config.get('compress', 'False').strip() == 'True':
self.compress = True
else:
self.compress = False
try:
self.host = (self.config['host'][0], int(self.config['host'][1]))
except Exception, e:
self.log.error("AutmonHandler: Host parameter is invaild. %s", e)
示例9: __init__
# 需要导入模块: from handler import Handler [as 别名]
# 或者: from handler.Handler import __init__ [as 别名]
def __init__(self):
self.word = self.wordClass()
self.word.item = self
Handler.__init__(self)
cls = self.__class__
cls.inst = self
self.game = None
self.props = ()
self.inventory = inventory.Inventory()
'''list - contains all the items this item owns'''
self.newprops = []
self.available = cls.available
if cls.owner != None:
self.owner = None
self.move(cls.owner)
else:
self.owner = None
if cls.location != None:
self.intMove(cls.location)
else:
self.location = None
props = cls.props
if props.__class__ != tuple:
props = (props,)
for prop in props:
prop = prop.clone()
self.addProp(prop)
self.finalizeProps()
self.dispatchEvent(self.EVT_INIT)
示例10: __init__
# 需要导入模块: from handler import Handler [as 别名]
# 或者: from handler.Handler import __init__ [as 别名]
def __init__(self, bot):
Handler.__init__(self)
self.bot = bot
示例11: __init__
# 需要导入模块: from handler import Handler [as 别名]
# 或者: from handler.Handler import __init__ [as 别名]
def __init__(self, initChars = ['!']):
Handler.__init__(self)
self.commands = {}
self.overflowHandlers = []
self.initChars = initChars
示例12: __init__
# 需要导入模块: from handler import Handler [as 别名]
# 或者: from handler.Handler import __init__ [as 别名]
def __init__(self, dest=[]):
Handler.__init__(self, dest=dest)
示例13: __init__
# 需要导入模块: from handler import Handler [as 别名]
# 或者: from handler.Handler import __init__ [as 别名]
def __init__(self, host='localhost', dest=[]):
Handler.__init__(self, dest=dest)
self.es = ElasticSearch('http://%s:9200/' % (host))
self.source_host = socket.gethostname()
示例14: __init__
# 需要导入模块: from handler import Handler [as 别名]
# 或者: from handler.Handler import __init__ [as 别名]
def __init__(self, conn):
Handler.__init__(self, conn)
示例15: __init__
# 需要导入模块: from handler import Handler [as 别名]
# 或者: from handler.Handler import __init__ [as 别名]
def __init__(self, dest=[]):
Handler.__init__(self, dest=dest)
self.match = False