本文整理汇总了Python中LibCIA.Database.quoteBlob方法的典型用法代码示例。如果您正苦于以下问题:Python Database.quoteBlob方法的具体用法?Python Database.quoteBlob怎么用?Python Database.quoteBlob使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LibCIA.Database
的用法示例。
在下文中一共展示了Database.quoteBlob方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _subscribe
# 需要导入模块: from LibCIA import Database [as 别名]
# 或者: from LibCIA.Database import quoteBlob [as 别名]
def _subscribe(self, cursor, target, client, trigger, scope=None, ttl=25*60*60):
"""A database interaction for adding subscriptions.
'target' must be the StatsTarget object this subscription is for.
'client' is the IP address of the client requesting this subscription.
'trigger' is a trigger pickle, as returned by makeTrigger
'scope' refers to a part of the stats target this refers to. By default, all of it.
'ttl' is the time to live for this subscription, 25 hours by default.
"""
cursor.execute("INSERT INTO stats_subscriptions "
"(target_path, expiration, scope, client, `trigger`) "
"VALUES (%s, %s, %s, %s, '%s')" %
(Database.quote(target.path, 'varchar'),
Database.quote(int(time.time() + ttl), 'bigint'),
Database.quote(scope, 'varchar'),
Database.quote(client, 'varchar'),
Database.quoteBlob(trigger)))