The branch, dharma has been updated
       via  1d2d463ba0c4b82e77ef17e26530e9909e568eec (commit)
      from  9887e5139f9fc7a369fb50c2ed165f8c7e77d67e (commit)

- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=1d2d463ba0c4b82e77ef17e26530e9909e568eec

commit 1d2d463ba0c4b82e77ef17e26530e9909e568eec
Author: taxigps <[email protected]>
Date:   Sun Jan 16 00:15:44 2011 +0800

    [plugin.program.utorrent] chaged: use xbmc.log() to log debug message

diff --git a/plugin.program.utorrent/addon.xml 
b/plugin.program.utorrent/addon.xml
index 7cd2719..143f3f6 100644
--- a/plugin.program.utorrent/addon.xml
+++ b/plugin.program.utorrent/addon.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <addon id="plugin.program.utorrent"
        name="uTorrent"
-       version="1.0.1"
+       version="1.0.2"
        provider-name="Taxigps">
   <requires>
     <import addon="xbmc.python" version="1.0"/>
diff --git a/plugin.program.utorrent/changelog.txt 
b/plugin.program.utorrent/changelog.txt
index c63860f..f7b60e9 100644
--- a/plugin.program.utorrent/changelog.txt
+++ b/plugin.program.utorrent/changelog.txt
@@ -1,4 +1,7 @@
-[B]1.0.1 (2011.1.8)[/B]
+[B]1.0.2 (2011.1.16)[/B]
+chaged: use xbmc.log to log debug message
+
+[B]1.0.1 (2011.1.8)[/B]
 fixed: rssfeeds cause error in updateList()
 
 [B]1.0.0 (2011.1.3)[/B]
diff --git a/plugin.program.utorrent/default.py 
b/plugin.program.utorrent/default.py
index 988a419..4d3bd18 100644
--- a/plugin.program.utorrent/default.py
+++ b/plugin.program.utorrent/default.py
@@ -1,7 +1,7 @@
 import urllib, sys, os, re, time
 import xbmcaddon, xbmcplugin, xbmcgui, xbmc
 
-# uTorrent Plugin v1.0.0
+# uTorrent Plugin v1.0.2
 
 # Plugin constants 
 __addonname__ = "uTorrent"
@@ -53,11 +53,11 @@ def getList():
     torrentList = []
     for line in data:
         if '\"rssfeeds\"' in line:
-            LOG( LOG_DEBUG, "%s %s::%s", __addonname__, 'getList', 'break with 
\"rssfeeds\"')
+            xbmc.log( "%s::getList - %s" % ( __addonname__, 'break with 
\"rssfeeds\"' ), xbmc.LOGDEBUG )
             break
         if len(line) > 80:
             torrentList.append(line)
-            LOG( LOG_DEBUG, "%s %s::%s", __addonname__, 'getList', line)
+            xbmc.log( "%s::getList - %d: %s" % ( __addonname__, 
len(torrentList), line ), xbmc.LOGDEBUG )
     return torrentList
 
 def updateList():
@@ -189,12 +189,12 @@ def addFiles():
         if '.torrent' in TorrentFile:
             ## Read file data..
             realfile = os.path.join(MyTorrents, TorrentFile)
-            LOG( LOG_DEBUG, "%s %s::%s", __addonname__, 'addFiles', realfile)
+            xbmc.log( "%s::addFiles - %s" % ( __addonname__, realfile ), 
xbmc.LOGDEBUG )
             f = open(realfile, 'rb')
             fdata = f.read()
             f.close()
             ## Create post data..
-            Contentx,Postx      =   
MultiPart([],[['torrent_file',TorrentFile,fdata]],'torrent')
+            Contentx,Postx = 
MultiPart([],[['torrent_file',TorrentFile,fdata]],'torrent')
             if Contentx == None and Postx == None   :   raise Exception
 
             ## Now Action the command..?action=add-file
@@ -275,6 +275,6 @@ elif mode == 1005:
     addFiles()
 
 elif 0 < mode < 1000:
-    LOG( LOG_DEBUG, "%s %s::hashnum: %s", __addonname__, 'main', hashNum)
+    xbmc.log( "%s::main - hashNum: %s" % ( __addonname__, hashNum ), 
xbmc.LOGDEBUG )
     performAction(hashNum)
 
diff --git a/plugin.program.utorrent/resources/lib/utilities.py 
b/plugin.program.utorrent/resources/lib/utilities.py
index 3941077..be69cae 100644
--- a/plugin.program.utorrent/resources/lib/utilities.py
+++ b/plugin.program.utorrent/resources/lib/utilities.py
@@ -2,8 +2,6 @@ import urllib, urllib2, cookielib, sys, os
 from base64 import b64encode
 import xbmc
 
-DEBUG_MODE = 3
-
 __addonname__ = sys.modules[ "__main__" ].__addonname__
 __addon__ = sys.modules[ "__main__" ].__addon__
 __language__ = sys.modules[ "__main__" ].__language__
@@ -13,19 +11,12 @@ BASE_DATA_PATH = os.path.join( xbmc.translatePath( 
"special://profile/" ), "addo
 BASE_RESOURCE_PATH = sys.modules[ "__main__" ].BASE_RESOURCE_PATH
 COOKIEFILE = os.path.join( BASE_DATA_PATH, "uTorrent_cookies" )
 
-# Log status codes
-LOG_INFO, LOG_ERROR, LOG_NOTICE, LOG_DEBUG = range( 1, 5 )
-
 def _create_base_paths():
     """ creates the base folders """
     if ( not os.path.isdir( BASE_DATA_PATH ) ):
         os.makedirs( BASE_DATA_PATH )
 _create_base_paths()
 
-def LOG( status, format, *args ):
-    if ( DEBUG_MODE >= status ):
-        xbmc.output( "%s: %s\n" % ( ( "INFO", "ERROR", "NOTICE", "DEBUG", )[ 
status - 1 ], format % args, ) )
-
 def MultiPart(fields,files,ftype) :
     Boundary = '----------ThIs_Is_tHe_bouNdaRY_---$---'
     CrLf = '\r\n'
@@ -76,7 +67,7 @@ class Client(object):
             urllib2.install_opener(opener)
 
     def HttpCmd(self, urldta, postdta=None, content=None):
-        LOG( LOG_DEBUG, "%s %s::url: %s", __addonname__, 'HttpCmd', urldta)
+        xbmc.log( "%s::HttpCmd - url: %s" % ( __addonname__, urldta ), 
xbmc.LOGDEBUG )
         ## Standard code
 
         req = urllib2.Request(urldta,postdta)
@@ -88,7 +79,7 @@ class Client(object):
 
         response = urllib2.urlopen(req)
         link=response.read()
-        LOG( LOG_DEBUG, "%s %s::data: %s", __addonname__, 'HttpCmd', str(link))
+        xbmc.log( "%s::HttpCmd - data: %s" % ( __addonname__, str(link) ), 
xbmc.LOGDEBUG )
         response.close()
         self.MyCookies.save(COOKIEFILE)
         return link

-----------------------------------------------------------------------

Summary of changes:
 plugin.program.utorrent/addon.xml                  |    2 +-
 plugin.program.utorrent/changelog.txt              |    5 ++++-
 plugin.program.utorrent/default.py                 |   12 ++++++------
 plugin.program.utorrent/resources/lib/utilities.py |   13 ++-----------
 4 files changed, 13 insertions(+), 19 deletions(-)


hooks/post-receive
-- 
Plugins

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to