The branch, eden-pre has been updated
       via  6bb76391e9fe7de3099de0c39d657be1124874bf (commit)
      from  c8aeb5bf630fe920001bf5b3cf367c728c1b7fde (commit)

- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/scripts;a=commit;h=6bb76391e9fe7de3099de0c39d657be1124874bf

commit 6bb76391e9fe7de3099de0c39d657be1124874bf
Author: amet <[email protected]>
Date:   Mon Jul 4 13:32:39 2011 +0400

    [script.xbmc.subtitles] -v 2.9.14
    
    - fix: Service Legendas-Zone.org version 0.1.7
    - fix: Use xbmc.log()

diff --git a/script.xbmc.subtitles/addon.xml b/script.xbmc.subtitles/addon.xml
index c16db44..88f99c4 100644
--- a/script.xbmc.subtitles/addon.xml
+++ b/script.xbmc.subtitles/addon.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <addon id="script.xbmc.subtitles"
        name="XBMC Subtitles"
-       version="2.9.13"
+       version="2.9.14"
        provider-name="Amet, mr_blobby">
   <requires>
     <import addon="xbmc.python" version="2.0"/>
diff --git a/script.xbmc.subtitles/changelog.txt 
b/script.xbmc.subtitles/changelog.txt
index 5dc8aaa..ff28426 100644
--- a/script.xbmc.subtitles/changelog.txt
+++ b/script.xbmc.subtitles/changelog.txt
@@ -1,3 +1,7 @@
+2.9.14
+- fix: Service Legendas-Zone.org version 0.1.7
+- fix: Use xbmc.log()
+
 2.9.13
 - OpenSubtitles fix and re-factor search
 -- download first "sync" subtitle will attempt to download without bringing 
the window up, if unsuccessful it will work as usual
diff --git a/script.xbmc.subtitles/default.py b/script.xbmc.subtitles/default.py
index 2172900..1157170 100644
--- a/script.xbmc.subtitles/default.py
+++ b/script.xbmc.subtitles/default.py
@@ -19,7 +19,7 @@ sys.path.append (BASE_RESOURCE_PATH)
 
 from utilities import *
 
-xbmc.output("### [%s] - Version: %s" % 
(__scriptname__,__version__,),level=xbmc.LOGDEBUG )
+xbmc.log("### [%s] - Version: %s" % 
(__scriptname__,__version__,),level=xbmc.LOGDEBUG )
 
 if ( __name__ == "__main__" ):
           
diff --git 
a/script.xbmc.subtitles/resources/lib/services/LegendasZone/service.py 
b/script.xbmc.subtitles/resources/lib/services/LegendasZone/service.py
index a916fdf..a4153bd 100644
--- a/script.xbmc.subtitles/resources/lib/services/LegendasZone/service.py
+++ b/script.xbmc.subtitles/resources/lib/services/LegendasZone/service.py
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 
-# Service Legendas-Zone.org version 0.1.6
+# Service Legendas-Zone.org version 0.1.7
 # Code based on Undertext service
 # Coded by HiGhLaNdR@OLDSCHOOL
 # Help by VaRaTRoN
@@ -9,6 +9,10 @@
 # License: GPL v2
 #
 #
+# NEW on Service Legendas-Zone.org v0.1.7:
+# Changed 2 patterns that were crashing the plugin, now it works correctly.
+# Better builtin notifications for better information.
+#
 # NEW on Service Legendas-Zone.org v0.1.6:
 # Better search results with 3 types of searching. Single title, multi titles 
and IMDB search.
 # Added builtin notifications for better information.
@@ -37,15 +41,19 @@ packext = ['rar', 'zip']
 """
 #details_pattern = 
"<b>CD\#:</b>\s(.+?)\s.+?<b>Hits:</b>\s(.+?)</b>.+?<b>Linguagem:</b>.+?border=\"0\"\salt=\"(.+?)\"\stitle"
 #subtitle_pattern = 
"onmouseover=\"Tip\(\'<table><tr><td><b>(.+?)</b></td></tr></table>.+?<b>Hits:</b>\s(.+?)\s<br>.+?<b>CDs:</b>\s(.+?)<br>.+?Uploader:</b>\s(.+?)</td>"
-subtitle_pattern = 
"<a\shref=\"legendas.php.+?amp;(.+?)\".+?[\r\n\t]+?.+?[\r\n\t]+?.+?onmouseover=\"Tip\(\'<table><tr><td><b>(.+?)</b></td></tr></table>.+?<b>Hits:</b>\s(.+?)\s<br>.+?<b>CDs:</b>\s(.+?)<br>.+?Uploader:</b>\s(.+?)</td>"
+subtitle_pattern = 
"<b><a\shref=\"legendas.php\?modo=detalhes&amp;(.+?)\".+?[\r\n\t]+?.+?[\r\n\t]+?.+?onmouseover=\"Tip\(\'<table><tr><td><b>(.+?)</b></td></tr></table>.+?<b>Hits:</b>\s(.+?)\s<br>.+?<b>CDs:</b>\s(.+?)<br>.+?Uploader:</b>\s(.+?)</td>"
 # group(1) = ID, group(2) = Name, group(3) = Hits, group(4) = Files, group(5) 
= Uploader
 multiple_results_pattern = 
"<td\salign=\"left\".+?<b><a\shref=\"legendas.php\?imdb=(.+?)&l=pt\"\stitle=\".+?\">.+?</td>"
 # group(1) = IMDB
-imdb_pattern = 
"<p><b>Popular\sTitles</b>\s\(Displaying.+?Results\)<table><tr>.+?<a\shref=\"\/title\/tt(.+?)\/\""
+imdb_pattern = 
"<p><b>Popular\sTitles</b>\s\(Displaying.+?Result.+?<table><tr>.+?<a\shref=\"\/title\/tt(.+?)\/\""
 # group(1) = IMDB
 
#====================================================================================================================
 # Functions
 
#====================================================================================================================
+def msg(text, timeout):
+       icon =  os.path.join(__cwd__,"icon.png")
+       xbmc.executebuiltin("XBMC.Notification(%s,%s,%s,%s)" % 
(__scriptname__,text,timeout,icon))
+
 def getallsubs(searchstring, languageshort, languagelong, file_original_path, 
subtitles_list, searchstring_notclean):
 
        #Grabbing login and pass from xbmc settings
@@ -67,8 +75,7 @@ def getallsubs(searchstring, languageshort, languagelong, 
file_original_path, su
        content = content.read()
        if re.search(multiple_results_pattern, content, re.IGNORECASE | 
re.DOTALL | re.MULTILINE | re.UNICODE | re.VERBOSE) == None:
                log( __name__ ,"%s Getting '%s' subs ..." % (debug_pretext, 
"Single Title"))
-               icon =  os.path.join(__cwd__,"icon.png")
-               xbmc.executebuiltin("XBMC.Notification(%s,%s,6000,%s)" % 
(__scriptname__,"Searching single title... Please wait!",icon))
+               msg("Searching Single Title... Please wait!", 6000)
                while re.search(subtitle_pattern, content, re.IGNORECASE | 
re.DOTALL | re.MULTILINE | re.UNICODE | re.VERBOSE) and page < 6:
                        for matches in re.finditer(subtitle_pattern, content, 
re.IGNORECASE | re.DOTALL | re.MULTILINE | re.UNICODE | re.VERBOSE):
                                hits = matches.group(3)
@@ -125,8 +132,8 @@ def getallsubs(searchstring, languageshort, languagelong, 
file_original_path, su
                                                else:
                                                        if 
re.search(filesearch[1][:len(filesearch[1])-4], desc):
                                                                sync = True
-                               filename = filename + "  " + hits + "Hits" + " 
- " + desc + " - uploader: " + uploader
-                               subtitles_list.append({'rating': 
str(downloads), 'no_files': no_files, 'id': id, 'filename': filename, 'desc': 
desc, 'sync': sync, 'hits' : hits, 'language_flag': 'flags/' + languageshort + 
'.gif', 'language_name': languagelong})
+                               #filename = filename + "  " + hits + "Hits" + " 
- " + desc + " - uploader: " + uploader
+                               subtitles_list.append({'rating': 
str(downloads), 'no_files': no_files, 'id': id, 'filename': filename, 'desc': 
desc, 'sync': sync, 'hits': hits, 'language_flag': 'flags/' + languageshort + 
'.gif', 'language_name': languagelong})
                        page = page + 1
                        url = main_url + "      legendas.php?l=pt&page=" + 
str(page) + "&s=" + urllib.quote_plus(searchstring)
                        content = opener.open(url)
@@ -142,8 +149,7 @@ def getallsubs(searchstring, languageshort, languagelong, 
file_original_path, su
                maxsubs = re.findall(multiple_results_pattern, content, 
re.IGNORECASE | re.DOTALL | re.MULTILINE | re.UNICODE | re.VERBOSE)
                maxsubs = len(maxsubs)
                if maxsubs < 10:
-                       icon =  os.path.join(__cwd__,"icon.png")
-                       xbmc.executebuiltin("XBMC.Notification(%s,%s,6000,%s)" 
% (__scriptname__,"Searching many titles... Please wait!",icon))
+                       msg("Searching Many Title... Please wait!", 6000)
                        while re.search(multiple_results_pattern, content, 
re.IGNORECASE | re.DOTALL | re.MULTILINE | re.UNICODE | re.VERBOSE):
                                log( __name__ ,"%s Getting '%s' subs ..." % 
(debug_pretext, "Less Then 10 Titles"))
                                for resmatches in 
re.finditer(multiple_results_pattern, content, re.IGNORECASE | re.DOTALL | 
re.MULTILINE | re.UNICODE | re.VERBOSE):
@@ -226,8 +232,7 @@ def getallsubs(searchstring, languageshort, languagelong, 
file_original_path, su
                        page1 = 0
                        content1 = opener.open(main_url + 
"legendas.php?l=pt&imdb=" + imdb[0] + "&page=" + str(page1))
                        content1 = content1.read()
-                       icon =  os.path.join(__cwd__,"icon.png")
-                       xbmc.executebuiltin("XBMC.Notification(%s,%s,6000,%s)" 
% (__scriptname__,"Too many hits. Grabbing IMDB title!",icon))
+                       msg("Too many hits. Grabbing IMDB title!", 6000)
                        while re.search(subtitle_pattern, content1, 
re.IGNORECASE | re.DOTALL | re.MULTILINE | re.UNICODE | re.VERBOSE):
                                log( __name__ ,"%s Getting '%s' subs ..." % 
(debug_pretext, "IMDB Title"))
                                for matches in re.finditer(subtitle_pattern, 
content1, re.IGNORECASE | re.DOTALL | re.MULTILINE | re.UNICODE | re.VERBOSE):
@@ -294,7 +299,11 @@ def getallsubs(searchstring, languageshort, languagelong, 
file_original_path, su
                                #For DEBUG only uncomment next line
 
 
-       xbmc.executebuiltin("XBMC.Notification(%s,%s,6000,%s)" % 
(__scriptname__,"Finished searching!",icon))
+       if subtitles_list != []:
+               msg("Finished Searching. Choose One!", 3000)
+       else:
+               msg("No Results! Try Parent Dir Or Manual!", 4000)
+
        #Bubble sort, to put syncs on top
        for n in range(0,len(subtitles_list)):
                for i in range(1, len(subtitles_list)):
@@ -391,6 +400,7 @@ def recursive_glob(treeroot, pattern):
 
 def download_subtitles (subtitles_list, pos, zip_subs, tmp_sub_dir, 
sub_folder, session_id): #standard input
 
+       msg("Downloading... Please Wait!", 6000)
        id = subtitles_list[pos][ "id" ]
        id = string.split(id,"=")
        id = id[-1]
@@ -450,8 +460,7 @@ def download_subtitles (subtitles_list, pos, zip_subs, 
tmp_sub_dir, sub_folder,
                                                max_mtime =  mtime
                        init_max_mtime = max_mtime
                        time.sleep(2)  # wait 2 seconds so that the unpacked 
files are at least 1 second newer
-                       icon =  os.path.join(__cwd__,"icon.png")
-                       xbmc.executebuiltin("XBMC.Notification(%s,%s,6000,%s)" 
% (__scriptname__,"Extracting Subtitles...",icon))
+                       msg("Extracting Subtitles!", 6000)
                        xbmc.executebuiltin("XBMC.Extract(" + local_tmp_file + 
"," + tmp_sub_dir +")")
                        waittime  = 0
                        while (filecount == init_filecount) and (waittime < 20) 
and (init_max_mtime == max_mtime): # nothing yet extracted
@@ -469,6 +478,7 @@ def download_subtitles (subtitles_list, pos, zip_subs, 
tmp_sub_dir, sub_folder,
                        if waittime == 20:
                                log( __name__ ,"%s Failed to unpack subtitles 
in '%s'" % (debug_pretext, tmp_sub_dir))
                        else:
+                               msg("Done Extracting!", 3000)
                                log( __name__ ,"%s Unpacked files in '%s'" % 
(debug_pretext, tmp_sub_dir))
                                searchrars = recursive_glob(tmp_sub_dir, 
packext)
                                searchrarcount = len(searchrars)
@@ -552,6 +562,6 @@ def download_subtitles (subtitles_list, pos, zip_subs, 
tmp_sub_dir, sub_folder,
                                                subs_file = sub_tmp[0]
        
                
-               
-       
+               msg("Playing Title!", 3000)
+
                return False, language, subs_file #standard output
\ No newline at end of file
diff --git 
a/script.xbmc.subtitles/resources/lib/services/SuperSubtitles/subenv.py 
b/script.xbmc.subtitles/resources/lib/services/SuperSubtitles/subenv.py
index 97fa678..f7c359d 100644
--- a/script.xbmc.subtitles/resources/lib/services/SuperSubtitles/subenv.py
+++ b/script.xbmc.subtitles/resources/lib/services/SuperSubtitles/subenv.py
@@ -4,11 +4,11 @@ debug_pretext = "[Feliratok.hu] "
 
 def debuglog(msg):
     import xbmc
-    xbmc.output( debug_pretext + msg, level=xbmc.LOGDEBUG )     
+    xbmc.log( debug_pretext + msg, level=xbmc.LOGDEBUG )     
 
 def errorlog(msg):
     import xbmc
-    xbmc.output( debug_pretext + msg, level=xbmc.LOGERROR )     
+    xbmc.log( debug_pretext + msg, level=xbmc.LOGERROR )     
 
 def unpack_archive(archive_file, dst_dir):
     import xbmc
diff --git a/script.xbmc.subtitles/resources/lib/utilities.py 
b/script.xbmc.subtitles/resources/lib/utilities.py
index d33d152..d475ac5 100644
--- a/script.xbmc.subtitles/resources/lib/utilities.py
+++ b/script.xbmc.subtitles/resources/lib/utilities.py
@@ -79,7 +79,7 @@ LANGUAGES = (
 ###-------------------------  Log  ------------------###############
    
 def log(module,msg):
-  xbmc.output("### [%s-%s] - %s" % 
(__scriptname__,module,msg,),level=xbmc.LOGDEBUG ) 
+  xbmc.log("### [%s-%s] - %s" % 
(__scriptname__,module,msg,),level=xbmc.LOGDEBUG ) 
 
 ###-------------------------- match sub to file  -------------################ 
       
 

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

Summary of changes:
 script.xbmc.subtitles/addon.xml                    |    2 +-
 script.xbmc.subtitles/changelog.txt                |    4 ++
 script.xbmc.subtitles/default.py                   |    2 +-
 .../resources/lib/services/LegendasZone/service.py |   42 ++++++++++++-------
 .../lib/services/SuperSubtitles/subenv.py          |    4 +-
 script.xbmc.subtitles/resources/lib/utilities.py   |    2 +-
 6 files changed, 35 insertions(+), 21 deletions(-)


hooks/post-receive
-- 
Scripts

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to