本文整理汇总了Python中Debug.log方法的典型用法代码示例。如果您正苦于以下问题:Python Debug.log方法的具体用法?Python Debug.log怎么用?Python Debug.log使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Debug
的用法示例。
在下文中一共展示了Debug.log方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: post
# 需要导入模块: import Debug [as 别名]
# 或者: from Debug import log [as 别名]
def post( self, event ):
if not isinstance( event, TickEvent ):
Debug.log( "Event: " + event.name )
# Event is broadcast to all listeners
for listener in self.listeners:
listener.notify( event )
示例2: randomSong
# 需要导入模块: import Debug [as 别名]
# 或者: from Debug import log [as 别名]
def randomSong(self):
self.__select("count(*) FROM tags")
(count, ) = self.__fetchone()
self.__select("url FROM tags LIMIT 1 OFFSET %s" % random.randint(0, int(count)-1))
(url, ) = self.__fetchone()
Debug.log("Random song: " + url)
return url
示例3: notify
# 需要导入模块: import Debug [as 别名]
# 或者: from Debug import log [as 别名]
def notify( self, event ):
if isinstance( event, KeyboardInputEvent ):
# Handle keyboard input
# Check controllable actor's maps
try:
Debug.log( "Keyboard: %s" % event.data.unicode )
except:
Debug.log( "Keyboard: %s" % event.data.key )
示例4: call
# 需要导入模块: import Debug [as 别名]
# 或者: from Debug import log [as 别名]
def call(call):
Debug.log("DCOP call: " + call)
f = os.popen("dcop amarok %s" % call)
result = f.read()
if f.close() is not None:
raise Error
result = result.strip()
Debug.log("DCOP response: " + result)
return result
示例5: __select
# 需要导入模块: import Debug [as 别名]
# 或者: from Debug import log [as 别名]
def __select(self, query):
query = "SELECT %s" % query
Debug.log("DCOP query: %s" % query)
r = self.__dcop.query(query)
Debug.log("DCOP results: %s" % r)
nargs = len(query.split("FROM")[0].split(","))
self.__results = [ ]
while len(r) > 0:
a = [ ]
for i in range(nargs):
a.append(r.pop(0))
self.__results.append(a)
示例6: __dispatch
# 需要导入模块: import Debug [as 别名]
# 或者: from Debug import log [as 别名]
def __dispatch(self, s):
Debug.log("Event received: " + s)
if s.find("engineStateChange: empty" ) >= 0:
Debug.log("Playlist is empty!")
if self.__state.isRunning():
Debug.log("Queuing random song")
self.__playlist.playRandom()
else:
Debug.log("Not running")
elif s.find("trackChange" ) >= 0:
if not self.__playlist.isPlaying():
Debug.log("Queuing random song")
self.__playlist.playRandom()
示例7: albumCoverMarkup
# 需要导入模块: import Debug [as 别名]
# 或者: from Debug import log [as 别名]
def albumCoverMarkup(s):
try:
import Image
try:
im = Image.open(s)
except IOError:
return "<!-- No cover found -->"
height, width = im.size
if (height > 150):
height = "height='150'"
else:
height = ""
except:
Debug.log("WARNING: install PIL")
height = "height='150'"
return "<p class='cover'><img id='cover' %s src='browse?cover=%s'/></p>" % (height, cgi.escape(s))
示例8: __init__
# 需要导入模块: import Debug [as 别名]
# 或者: from Debug import log [as 别名]
def __init__( self, event ):
self.name = "Alert Event"
Debug.log( event )