The branch, dharma has been updated
       via  1bbf07cf2f146916266186c9ff4d41045481a80c (commit)
      from  690bc4db649de74d678223983411bef52ceb9378 (commit)

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

commit 1bbf07cf2f146916266186c9ff4d41045481a80c
Author: amet <[email protected]>
Date:   Sun Feb 6 16:57:52 2011 +0400

    [script.xbmc.subtitles] -v2.2.9
    - fixed: undertexter download
    
    2.2.8
    - reverted: legacy window support
    - fixed: theSubDB service extraction

diff --git a/script.xbmc.subtitles/addon.xml b/script.xbmc.subtitles/addon.xml
index ba7bec0..a82c031 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.2.7"
+       version="2.2.9"
        provider-name="Amet">
   <requires>
     <import addon="xbmc.python" version="1.0"/>
diff --git a/script.xbmc.subtitles/changelog.txt 
b/script.xbmc.subtitles/changelog.txt
index 5e5ddaa..6f72121 100644
--- a/script.xbmc.subtitles/changelog.txt
+++ b/script.xbmc.subtitles/changelog.txt
@@ -1,3 +1,10 @@
+2.2.9
+- fixed: undertexter download
+
+2.2.8
+- reverted: legacy window support
+- fixed: theSubDB service extraction
+
 2.2.7
 - fixed: reverted part of 5ae14804a9c0c7dff49af852759f9a15ba337a23, should fix 
Legendas.TV issue. 
 
diff --git a/script.xbmc.subtitles/resources/lib/gui.py 
b/script.xbmc.subtitles/resources/lib/gui.py
index 2a6bfd2..273fd84 100644
--- a/script.xbmc.subtitles/resources/lib/gui.py
+++ b/script.xbmc.subtitles/resources/lib/gui.py
@@ -33,6 +33,7 @@ class GUI( xbmcgui.WindowXMLDialog ):
   def set_allparam(self):       
     temp = False
     rar = False
+    self.newWindow = True
     movieFullPath = urllib.unquote(xbmc.Player().getPlayingFile())
     path = __settings__.getSetting( "subfolder" ) == "true"                 # 
True for movie folder
     sub_folder = xbmc.translatePath(__settings__.getSetting( "subfolderpath" ))
@@ -178,7 +179,11 @@ class GUI( xbmcgui.WindowXMLDialog ):
       log( __name__ ,"Languages: [%s] [%s] [%s]"   % (self.language_1, 
self.language_2, self.language_3,))
       log( __name__ ,"Parent Folder Search: [%s]"  % self.parsearch)
 
-      self.list_services()
+      try:
+        self.list_services()
+      except:
+        self.newWindow = False
+        self.list_services()
 
       try:
         self.Search_Subtitles()
@@ -238,10 +243,16 @@ class GUI( xbmcgui.WindowXMLDialog ):
         self.getControl( STATUS_LABEL ).setLabel( msg )
       else:
         self.getControl( STATUS_LABEL ).setLabel( _( 657 ) )
-      self.setFocusId( SERVICES_LIST )
-      self.getControl( SERVICES_LIST ).selectItem( 0 )
+      if self.newWindow:  
+        self.setFocusId( SERVICES_LIST )
+        self.getControl( SERVICES_LIST ).selectItem( 0 )
+      else:
+        self.list_services()
+        self.setFocusId( SUBTITLES_LIST )
+        self.getControl( SUBTITLES_LIST ).selectItem( 0 )  
 
     else:
+      if not self.newWindow: self.list_services()
       subscounter = 0
       for item in self.subtitles_list:
         listitem = xbmcgui.ListItem( label=item["language_name"], 
label2=item["filename"], iconImage=item["rating"], 
thumbnailImage=item["language_flag"] )
@@ -292,8 +303,11 @@ class GUI( xbmcgui.WindowXMLDialog ):
     exts = [".srt", ".sub", ".txt", ".smi", ".ssa", ".ass" ]
     if len(files) < 1 :
       self.getControl( STATUS_LABEL ).setLabel( _( 654 ) )
-      self.setFocusId( SERVICES_LIST )
-      self.getControl( SERVICES_LIST ).selectItem( 0 )
+      if self.newWindow:  
+        self.setFocusId( SERVICES_LIST )
+        self.getControl( SERVICES_LIST ).selectItem( 0 )
+      else:
+        self.list_services()
     else :    
       self.getControl( STATUS_LABEL ).setLabel(  _( 652 ) )
       un.extract( zip_subs, self.tmp_sub_dir )
@@ -324,8 +338,13 @@ class GUI( xbmcgui.WindowXMLDialog ):
       self.exit_script()
     else:
       self.getControl( STATUS_LABEL ).setLabel( _( 654 ) )
-      self.setFocusId( SERVICES_LIST )
-      self.getControl( SERVICES_LIST ).selectItem( 0 )
+      if self.newWindow:  
+        self.setFocusId( SERVICES_LIST )
+        self.getControl( SERVICES_LIST ).selectItem( 0 )
+      else:
+        self.list_services()           
+        self.setFocusId( SUBTITLES_LIST )
+        self.getControl( SUBTITLES_LIST ).selectItem( 0 )                      
 
 
 ###-------------------------- Create name  -------------################
 
@@ -362,30 +381,52 @@ class GUI( xbmcgui.WindowXMLDialog ):
 
   def list_services( self ):
     self.list = []
-    self.getControl( SERVICES_LIST ).reset()
-    for serv in self.service_list:
-      listitem = xbmcgui.ListItem( serv )
-      self.list.append(serv)
-      listitem.setProperty( "man", "false" )
-      self.getControl( SERVICES_LIST ).addItem( listitem )
-
-    if self.mansearch :
-        listitem = xbmcgui.ListItem( _( 612 ) )
-        listitem.setProperty( "man", "true" )
-        self.list.append("Man")
+    if self.newWindow:
+      self.getControl( SERVICES_LIST ).reset()
+      for serv in self.service_list:
+        listitem = xbmcgui.ListItem( serv )
+        self.list.append(serv)
+        listitem.setProperty( "man", "false" )
         self.getControl( SERVICES_LIST ).addItem( listitem )
 
-    if self.parsearch :
-        listitem = xbmcgui.ListItem( _( 747 ) )
-        listitem.setProperty( "man", "true" )
-        self.list.append("Par")
-        self.getControl( SERVICES_LIST ).addItem( listitem )
+      if self.mansearch :
+          listitem = xbmcgui.ListItem( _( 612 ) )
+          listitem.setProperty( "man", "true" )
+          self.list.append("Man")
+          self.getControl( SERVICES_LIST ).addItem( listitem )
+
+      if self.parsearch :
+          listitem = xbmcgui.ListItem( _( 747 ) )
+          listitem.setProperty( "man", "true" )
+          self.list.append("Par")
+          self.getControl( SERVICES_LIST ).addItem( listitem )
         
-    listitem = xbmcgui.ListItem( _( 762 ) )
-    listitem.setProperty( "man", "true" )
-    self.list.append("Set")
-    self.getControl( SERVICES_LIST ).addItem( listitem )
-       
+      listitem = xbmcgui.ListItem( _( 762 ) )
+      listitem.setProperty( "man", "true" )
+      self.list.append("Set")
+      self.getControl( SERVICES_LIST ).addItem( listitem )
+              
+    else:
+        self.getControl( SUBTITLES_LIST ).reset()
+        label = ""
+        for serv in self.service_list:
+            if serv != self.service:
+              label2 = "[COLOR=FF0084ff]%s%s[/COLOR]" %(_( 610 ), serv,)
+              listitem = xbmcgui.ListItem( label,label2 )
+              self.list.append(serv)
+              self.getControl( SUBTITLES_LIST ).addItem( listitem )
+
+        if self.mansearch :
+            label2 = "[COLOR=FF00FF00]%s[/COLOR]" % ( _( 612 ) )
+            listitem = xbmcgui.ListItem( label,label2 )
+            self.list.append("Man")
+            self.getControl( SUBTITLES_LIST ).addItem( listitem )
+
+        if self.parsearch :
+            label2 = "[COLOR=FF00FF00]%s[/COLOR]" % ( _( 747 ) )
+            listitem = xbmcgui.ListItem( label,label2 )
+            self.list.append("Par")
+            self.getControl( SUBTITLES_LIST ).addItem( listitem )   
 
 ###-------------------------- Manual search Keyboard  
-------------################
 
@@ -422,7 +463,23 @@ class GUI( xbmcgui.WindowXMLDialog ):
 
   def onClick( self, controlId ):
     if controlId == 120:
-      self.Download_Subtitles( self.getControl( SUBTITLES_LIST 
).getSelectedPosition() )
+      if self.newWindow:
+        self.Download_Subtitles( self.getControl( SUBTITLES_LIST 
).getSelectedPosition() )
+      else:
+        selection = str(self.list[self.getControl( SUBTITLES_LIST 
).getSelectedPosition()])
+        log( __name__ ,"In 'On click' selected : [%s]" % (selection, ) )
+        if selection.isdigit():
+          log( __name__ , "Selected : [%s]" % (selection, ) )
+          self.Download_Subtitles( int(selection) )
+        else:
+          if selection == "Man":
+            self.keyboard(False)
+          elif selection == "Par":
+            self.keyboard(True)
+          else:
+            self.service = selection
+            self.Search_Subtitles()
+
     elif controlId == 150:     
       selection = str(self.list[self.getControl( SERVICES_LIST 
).getSelectedPosition()])
       log( __name__ ,"In 'On click' selected : [%s]" % (selection, )  )
diff --git a/script.xbmc.subtitles/resources/lib/services/SubDB/service.py 
b/script.xbmc.subtitles/resources/lib/services/SubDB/service.py
index 5e805ca..9077f82 100644
--- a/script.xbmc.subtitles/resources/lib/services/SubDB/service.py
+++ b/script.xbmc.subtitles/resources/lib/services/SubDB/service.py
@@ -90,18 +90,15 @@ def download_subtitles (subtitles_list, pos, zip_subs, 
tmp_sub_dir, sub_folder,
        link = subtitles_list[pos][ "link" ]
        file = os.path.splitext(subtitles_list[pos]["filename"])[0]
        ext = ""
-       
        req = urllib2.Request(link)
        req.add_header('User-Agent', user_agent)
        try:
                response = urllib2.urlopen(req)
                ext = response.info()['Content-Disposition'].split(".")[1]
-               
-               local_file = open(zip_subs, "w" + "b")
+               filename = os.path.join(tmp_sub_dir, "%s.%s" % (file, ext))
+               local_file = open(filename, "w" + "b")
                local_file.write(response.read())
                local_file.close()
-
-               filename = "%s.%s" % (file, ext)
                return False, language, filename #standard output
        except:
                return False , language, "" #standard output    
diff --git 
a/script.xbmc.subtitles/resources/lib/services/Undertexter/service.py 
b/script.xbmc.subtitles/resources/lib/services/Undertexter/service.py
index 3666da2..7f49ac4 100644
--- a/script.xbmc.subtitles/resources/lib/services/Undertexter/service.py
+++ b/script.xbmc.subtitles/resources/lib/services/Undertexter/service.py
@@ -111,7 +111,7 @@ def download_subtitles (subtitles_list, pos, zip_subs, 
tmp_sub_dir, sub_folder,
     id = subtitles_list[pos][ "id" ]
     language = subtitles_list[pos][ "language_name" ]
     if string.lower(language) == "swedish":
-        url = main_url + "utext.php?id=" + id
+        url = main_url + "laddatext.php?id=" + id
     if string.lower(language) == "english":
         url = eng_download_url + "download.php?id=" + id
     log( __name__ ,"%s Fetching subtitles using url %s" % (debug_pretext, url))

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

Summary of changes:
 script.xbmc.subtitles/addon.xml                    |    2 +-
 script.xbmc.subtitles/changelog.txt                |    7 ++
 script.xbmc.subtitles/resources/lib/gui.py         |  115 +++++++++++++++-----
 .../resources/lib/services/SubDB/service.py        |    7 +-
 .../resources/lib/services/Undertexter/service.py  |    2 +-
 5 files changed, 97 insertions(+), 36 deletions(-)


hooks/post-receive
-- 
Scripts

------------------------------------------------------------------------------
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world? 
http://p.sf.net/sfu/oracle-sfdevnlfb
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to