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


Python FileHandler.threadbound方法代码示例

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


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

示例1: Application

# 需要导入模块: from logbook import FileHandler [as 别名]
# 或者: from logbook.FileHandler import threadbound [as 别名]
class Application(object):
    """a base class for dispatching WSGI requests"""
    
    def __init__(self, settings={}, prefix=""):
        """initialize the Application with a settings dictionary and an optional
        ``prefix`` if this is a sub application"""
        self.settings = settings
        self.mapper = routes.Mapper()
        self.setup_handlers(self.mapper)
        self.loghandler = FileHandler(self.logfilename)

    def __call__(self, environ, start_response):
        with self.loghandler.threadbound():
            request = werkzeug.Request(environ)
            m = self.mapper.match(environ = environ)
            if m is not None:
                handler = m['handler'](app=self, request=request, settings=self.settings)
                try:
                    return handler.handle(**m)(environ, start_response)
                except werkzeug.exceptions.HTTPException, e:
                    return e(environ, start_response)
            # no view found => 404
            return werkzeug.exceptions.NotFound()(environ, start_response)
开发者ID:mrtopf,项目名称:We-Rate-It,代码行数:25,代码来源:app.py

示例2: print

# 需要导入模块: from logbook import FileHandler [as 别名]
# 或者: from logbook.FileHandler import threadbound [as 别名]
        password=password
    )
    
    print("logged in successfully as: %" % client.get('/me').username)

    track = client.post('/tracks', track={
    'title': 'Harmonic Mix %s' % mixfilename,
    'sharing': 'private',
    'description': 'Someone should add the song names in the mix here',
    'asset_data': open(mixfilename, 'rb')
})

    print("uploaded your mix as: %s", track.title)



class extenddict(dict):

    def __setitem__(self, key, value):
        """add the given value to the list of values for this key"""
        self.setdefault(key, []).append(value)




with file_handler.threadbound():
    newest = mixmaster(120)
    #soundcloudupload(newest)
    

开发者ID:paulkarayan,项目名称:harmonicmixing,代码行数:30,代码来源:keymix.py


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