• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python util.logDebug函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中util.logDebug函数的典型用法代码示例。如果您正苦于以下问题:Python logDebug函数的具体用法?Python logDebug怎么用?Python logDebug使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: clientAction

 def clientAction(self, client, move):
     """violation: player may not say mah jongg"""
     move.player.popupMsg(self)
     move.player.mayWin = False
     if Debug.originalCall:
         logDebug('%s: cleared mayWin' % move.player)
     return client.ask(move, [Message.OK])
开发者ID:ospalh,项目名称:kajongg-fork,代码行数:7,代码来源:message.py


示例2: switchUser

	def switchUser(self, userId, pin):
		if not self.authenticationToken: return False
		url = MyPlexService.SWITCHUSER_URL % (userId, pin)
		http = self.plexManager.buildPlexHttpRequest()
		http.SetHttpHeader('X-Plex-Token',self.authenticationToken)
		data = http.Post(url)
		if not data:
			if http.ResultUnauthorised() and pin != '':
				util.logDebug("User switch failed PIN invalid");
				return PlexManager.ERR_USER_PIN_FAILED
			util.logDebug("Error failed to access users %s HttpCode: %d" % (url, http.code));
			return PlexManager.ERR_USER_OTHER
		
		tree = ElementTree.fromstring(data)
		token = None
		for child in tree:
			if child.tag == 'authentication-token':
				token = child.text
				break
		if token is None:
			return PlexManager.ERR_USER_OTHER
		#Set usertoken
		self.userToken = token

		#reload myplex servers
		self.loadServers()

		return PlexManager.SUCCESS
开发者ID:grantmcwilliams,项目名称:PlexForBoxee,代码行数:28,代码来源:plex.py


示例3: monitorPlayback

	def monitorPlayback(self, key, offset):
		progress = 0
		#Whilst the file is playing back
		while xbmc.Player().isPlaying():
			#Get the current playback time
			currentTime = int(xbmc.Player().getTime())
			totalTime = int(xbmc.Player().getTotalTime())
			try:
				progress = int(( float(currentTime) / float(totalTime) ) * 100)
			except:
				progress = 0
			
			#If we are less than 95% complete, store resume time
			if progress > 0 and progress < 95:
				progress=currentTime*1000
				if offset == 0:
					#Clear it, likely start from beginning clicked
					offset = 1
					self.setMediaWatched(key)
				self.setMediaPlayedPosition(key, progress)

			#Otherwise, mark as watched
			elif progress >= 95:
				self.setMediaWatched(key)
				break
			xbmc.sleep(5000)
		#If we get this far, playback has stopped
		util.logDebug("Playback Stopped (or at 95%)")
开发者ID:buckycannon,项目名称:PlexForBoxee,代码行数:28,代码来源:plexee.py


示例4: checkMovie

    def checkMovie(self, movie):
        imdbNumber = movie["imdbnumber"]
        oldPosition = movie["top250"]

        if imdbNumber == "":
            util.logWarning("%(label)s: no IMDb id" % movie)
            return None

        if imdbNumber in self.top250:
            newPosition = self.top250[imdbNumber]["position"]
            self.notMissing.add(imdbNumber)

            if oldPosition == newPosition:
                util.logDebug("%(label)s: up to date" % movie)
                return None

            self.updateMovie(movie, newPosition)

            if oldPosition == 0:
                util.log("%s: added at position %s" % (movie["label"], newPosition))
                return "added"

            util.log("%s: updated from %s to %s" % (movie["label"], oldPosition, newPosition))
            return "updated"

        if oldPosition != 0:
            util.log("%(label)s: was removed because no more in IMDb Top250" % movie)
            self.updateMovie(movie, 0)
            return "removed"
开发者ID:jansepke,项目名称:script.imdbupdate,代码行数:29,代码来源:top250.py


示例5: transaction

 def transaction(self, silent=None):
     """commit and log it"""
     if QSqlDatabase.transaction(self):
         if not silent and Debug.sql:
             logDebug('%x started transaction' % id(self))
     else:
         logWarning('%s cannot start transaction: %s' % (self.name, self.lastError()))
开发者ID:ospalh,项目名称:kajongg-fork,代码行数:7,代码来源:query.py


示例6: speak

 def speak(self, text, angle):
     """text must be a sound filename without extension"""
     fileName = self.localTextName(text, angle)
     if not os.path.exists(fileName):
         if Debug.sound:
             logDebug('Voice.speak: fileName %s not found' % fileName)
     Sound.speak(fileName)
开发者ID:ospalh,项目名称:kajongg-fork,代码行数:7,代码来源:sound.py


示例7: deleteFromPlaylist

	def deleteFromPlaylist(self, server, playlistId, itemId):
		#Delete - DELETE http://10.1.3.200:32400/playlists/35339/items/72
		url = server.getUrl("/playlists/%s/items/%s" % (playlistId, itemId))
		util.logDebug("Deleting playlist item: "+url)
		http = self.buildPlexHttpRequest()
		http.Delete(url)
		PlexManager.handleRequestError(http)
开发者ID:grantmcwilliams,项目名称:PlexForBoxee,代码行数:7,代码来源:plex.py


示例8: getVideoDirectStreamUrl

	def getVideoDirectStreamUrl(self, manager, mediaKey, mediaIndex, partIndex, offset = 0):
		args = dict()
		args['path']="http://127.0.0.1:"+str(self.port)+"/library/metadata/" + str(mediaKey)
		args['mediaIndex']=str(mediaIndex)
		args['partIndex']=str(partIndex)
		#args['protocol']="http"
		args['protocol']="hls"
		#args['protocol']="dash"
		args['offset']=str(offset)
		args['fastSeek']="1"
		args['directPlay']="0"
		args['directStream']="1"
		args['waitForSegments']="1"
		args['videoQuality']="100"
		args['subtitleSize']="100"
		args['audioBoost']="100"
		args['X-Plex-Product']=manager.xPlexProduct
		args['X-Plex-Version']=manager.xPlexVersion
		args['X-Plex-Client-Identifier']=manager.xPlexClientIdentifier
		args['X-Plex-Platform']=manager.xPlexPlatform
		args['X-Plex-Platform-Version']=manager.xPlexPlatformVersion
		args['X-Plex-Device']=manager.xPlexDevice
		args['Accept-Language']="en"
		
		url = self.getUrl(PlexServer.TRANSCODE_URL, args)
		util.logDebug("-->Setting direct stream: "+url)
		return url
开发者ID:InsaneSplash,项目名称:PlexForBoxee,代码行数:27,代码来源:plex.py


示例9: hideTableList

 def hideTableList(result):
     """hide it only after player says I am ready"""
     if result == Message.OK and client.tableList:
         if Debug.table:
             logDebug('%s hiding table list because game started' % client.name)
         client.tableList.hide()
     return result
开发者ID:ospalh,项目名称:kajongg-fork,代码行数:7,代码来源:message.py


示例10: start

 def start(self, dummyResults='DIREKT'):
     """start the animation, returning its deferred"""
     assert self.state() != QAbstractAnimation.Running
     tiles = set()
     for animation in self.animations:
         tile = animation.targetObject()
         self.debug |= tile.element in Debug.animation
         tiles.add(tile)
         tile.setActiveAnimation(animation)
         self.addAnimation(animation)
         propName = animation.pName()
         animation.setStartValue(tile.getValue(propName))
         if propName == 'rotation':
             # change direction if that makes the difference smaller
             endValue = animation.unpackEndValue()
             currValue = tile.rotation
             if endValue - currValue > 180:
                 animation.setStartValue(currValue + 360)
             if currValue - endValue > 180:
                 animation.setStartValue(currValue - 360)
     for tile in tiles:
         tile.graphics.setDrawingOrder()
     self.finished.connect(self.allFinished)
     scene = Internal.field.centralScene
     scene.disableFocusRect = True
     QParallelAnimationGroup.start(self, QAbstractAnimation.DeleteWhenStopped)
     if self.debug:
         logDebug('Animation group %d started (%s)' % (
                 id(self), ','.join('A%d' % (id(x) % 10000) for x in self.animations)))
     return succeed(None)
开发者ID:ospalh,项目名称:kajongg-fork,代码行数:30,代码来源:animation.py


示例11: __init__

 def __init__(self, hand, meld=None, idx=None, xoffset=None, yoffset=None):
     if isinstance(hand, Tile):
         self.element = hand.element
         self.xoffset = hand.xoffset
         self.yoffset = hand.yoffset
         self.dark = hand.dark
         self.focusable = hand.focusable
     else:
         self.element = meld.pairs[idx] if idx is not None else meld
         self.xoffset = xoffset
         self.yoffset = yoffset
         player = hand.player
         isScoringGame = player.game.isScoringGame()
         if yoffset == 0:
             self.dark = self.element.istitle()
         else:
             self.dark = self.element == 'Xy' or isScoringGame
         self.focusable = True
         if isScoringGame:
             self.focusable = idx == 0
         else:
             self.focusable = (self.element[0] not in 'fy'
                 and self.element != 'Xy'
                 and player == player.game.activePlayer
                 and player == player.game.myself
                 and (meld.state == CONCEALED
                 and (len(meld) < 4 or meld.meldType == REST)))
         if self.element in Debug.focusable:
             logDebug('TileAttr %s:%s' % (self.element, self.focusable))
开发者ID:ospalh,项目名称:kajongg-fork,代码行数:29,代码来源:handboard.py


示例12: initDb

def initDb():
    """open the db, create or update it if needed.
    Returns a dbHandle."""
    dbhandle = QSqlDatabase("QSQLITE")
    if InternalParameters.isServer:
        name = 'kajonggserver.db'
    else:
        name = 'kajongg.db'
    dbpath = InternalParameters.dbPath or appdataDir() + name
    dbhandle.setDatabaseName(dbpath)
    dbExisted = os.path.exists(dbpath)
    if Debug.sql:
        logDebug('%s database %s' % \
            ('using' if dbExisted else 'creating', dbpath))
    # timeout in msec:
    dbhandle.setConnectOptions("QSQLITE_BUSY_TIMEOUT=2000")
    if not dbhandle.open():
        logError('%s %s' % (str(dbhandle.lastError().text()), dbpath))
        sys.exit(1)
    with Transaction(dbhandle=dbhandle):
        if not dbExisted:
            Query.createTables(dbhandle)
        else:
            Query.upgradeDb(dbhandle)
    generateDbIdent(dbhandle)
    return dbhandle
开发者ID:jsj2008,项目名称:kdegames,代码行数:26,代码来源:query.py


示例13: rollback

 def rollback(self, silent=None):
     """rollback and log it"""
     if QSqlDatabase.rollback(self):
         if not silent and Debug.sql:
             logDebug('%x rollbacked transaction' % id(self))
     else:
         logWarning('%s cannot rollback: %s' % (self.name, self.lastError()))
开发者ID:ospalh,项目名称:kajongg-fork,代码行数:7,代码来源:query.py


示例14: getData

	def getData(self, url, args = None):
		if not args is None:
			url = util.buildUrl(url, args)
		util.logDebug("Retrieving data from: %s" % url)
		http = util.Http()
		data = http.Get(url)
		PlexManager.handleRequestError(http)
		return data
开发者ID:grantmcwilliams,项目名称:PlexForBoxee,代码行数:8,代码来源:plex.py


示例15: setEndValue

 def setEndValue(self, endValue):
     """wrapper with debugging code"""
     tile = self.targetObject()
     if tile.element in Debug.animation:
         pName = self.pName()
         logDebug('%s: change endValue for %s: %s->%s  %s' % (self.ident(), pName, self.formatValue(self.endValue()),
                 self.formatValue(endValue), str(tile)))
     QPropertyAnimation.setEndValue(self, endValue)
开发者ID:ospalh,项目名称:kajongg-fork,代码行数:8,代码来源:animation.py


示例16: addToPlaylist

	def addToPlaylist(self, server, id, key):
		#PUT http://10.1.3.200:32400/playlists/35339/items?uri=library%3A%2F%2F9dbbfd79-c597-4294-a32d-edf7c2975a41%2Fitem%2F%252Flibrary%252Fmetadata%252F34980
		key = urllib.quote(key, '')
		args = dict()
		args['uri']="library:///item/%s" % key
		url = server._getUrl(server._getRootUrl(), "/playlists/%s/items" % id, args)
		util.logDebug("Adding playlist item: "+url)
		self.putPlexCommand(url)
开发者ID:InsaneSplash,项目名称:PlexForBoxee,代码行数:8,代码来源:plex.py


示例17: commit

 def commit(self, silent=None):
     """commit and log it"""
     result = QSqlDatabase.commit(self)
     if result:
         if not silent and Debug.sql:
             logDebug('%x committed transaction' % id(self))
     else:
         logWarning('%s cannot commit: %s :' % (self.name, self.lastError()))
开发者ID:ospalh,项目名称:kajongg-fork,代码行数:8,代码来源:query.py


示例18: getServers

	def getServers(self):
		localServers = dict()
		remoteServers = dict()

		foundServer = False
		
		if self.isAuthenticated():
			url = MyPlexService.SERVERS_URL % self.authenticationToken
			util.logDebug("Finding servers via: "+url)
			data = util.Http().Get(url)
			if data:
				tree = ElementTree.fromstring(data)
				for child in tree:
					host = child.attrib.get("address", "")
					port = child.attrib.get("port", "")
					localAddresses = child.attrib.get("localAddresses", "")
					accessToken = child.attrib.get("accessToken", "")
					machineIdentifier = child.attrib.get("machineIdentifier", "")
					local = child.attrib.get("owned", "0")
					sourceTitle = child.attrib.get("sourceTitle", "")

					util.logInfo("MyPlex found server %s:%s" % (host,port))
					foundServer = True
					server = None
					if local == "1":
						#Try the local addresses
						#TODO: Similiar code exists in the server and this is a bit convoluted....
						if localAddresses:
							localAddresses = localAddresses.split(',')
							util.logInfo("--> Resolving local addresses")
							resolved = False
							for addr in localAddresses:
								http = util.Http()
								util.logDebug("--> Trying local address %s:32400" % addr)
								data = http.Get("http://"+addr+":32400/?X-Plex-Token="+accessToken)
								if http.GetHttpResponseCode() == -1:
									data = http.Get("https://"+addr+":32400/?X-Plex-Token="+accessToken)
								if data:
									tree = ElementTree.fromstring(data)
									localMachineIdentifier = tree.attrib.get("machineIdentifier", "")
									if localMachineIdentifier == machineIdentifier:
										util.logInfo("--> Using local address %s:32400 instead of remote address" % addr)
										server = PlexServer(addr, "32400", accessToken)
										resolved = True
										break
							if not resolved:
								util.logInfo("--> Using remote address %s unable to resolve local address" % host)
								server = PlexServer(host, port, accessToken)

						if server is None or not server.isValid():
							continue
						localServers[machineIdentifier] = server
					else:
						#Remote server found
						server = PlexServer(host, port, accessToken, sourceTitle)
						remoteServers[machineIdentifier] = server
		
		return localServers, remoteServers, foundServer
开发者ID:InsaneSplash,项目名称:PlexForBoxee,代码行数:58,代码来源:plex.py


示例19: getData

	def getData(self, url, args = None):
		url = self.getUrl(url, args)
		util.logDebug("Retrieving data from: " + url)
		http = util.Http()
		#TODO: Handle errors
		data = http.Get(url)
		if util.Http().GetHttpResponseCode() == 400:
			pass
		return data, url
开发者ID:InsaneSplash,项目名称:PlexForBoxee,代码行数:9,代码来源:plex.py


示例20: clientMadeOriginalCall

 def clientMadeOriginalCall(self, dummyResults, msg):
     """first tell everybody about original call
     and then treat the implicit discard"""
     msg.player.originalCall = True
     if Debug.originalCall:
         logDebug('server.clientMadeOriginalCall: %s' % msg.player)
     block = DeferredBlock(self)
     block.tellAll(msg.player, Message.OriginalCall)
     block.callback(self.askForClaims)
开发者ID:jsj2008,项目名称:kdegames,代码行数:9,代码来源:server.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python util.logException函数代码示例发布时间:2022-05-26
下一篇:
Python util.log函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap