The branch, gotham has been updated
       via  514c22eff5258022b8ce82fe2eab974698676638 (commit)
      from  55ff4d833e4587ff727d62430efa8bce3340ebd7 (commit)

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

commit 514c22eff5258022b8ce82fe2eab974698676638
Author: amet <[email protected]>
Date:   Tue Dec 10 01:26:30 2013 +0400

    [service.subtitles.podnapisi] -v 5.0.3
    
    5.0.3
    - clean temp dir and use python zipfile for extraction

diff --git a/service.subtitles.podnapisi/addon.xml 
b/service.subtitles.podnapisi/addon.xml
index 2aa5a76..6eb8aff 100755
--- a/service.subtitles.podnapisi/addon.xml
+++ b/service.subtitles.podnapisi/addon.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <addon id="service.subtitles.podnapisi"
        name="Podnapisi.net"
-       version="5.0.2"
+       version="5.0.3"
        provider-name="amet">
   <requires>
     <import addon="xbmc.python" version="2.1.0"/>
diff --git a/service.subtitles.podnapisi/changelog.txt 
b/service.subtitles.podnapisi/changelog.txt
index eb2a2c7..48886b8 100644
--- a/service.subtitles.podnapisi/changelog.txt
+++ b/service.subtitles.podnapisi/changelog.txt
@@ -1,3 +1,6 @@
+5.0.3
+- clean temp dir and use python zipfile for extraction
+
 5.0.2
 - fix missing languages
 
diff --git a/service.subtitles.podnapisi/service.py 
b/service.subtitles.podnapisi/service.py
index 4c9d950..e91c7c7 100644
--- a/service.subtitles.podnapisi/service.py
+++ b/service.subtitles.podnapisi/service.py
@@ -6,7 +6,7 @@ import xbmc
 import urllib
 import xbmcvfs
 import xbmcaddon
-import xbmcgui,xbmcplugin
+import xbmcgui,xbmcplugin,shutil,zipfile
 
 __addon__ = xbmcaddon.Addon()
 __author__     = __addon__.getAddonInfo('author')
@@ -20,8 +20,7 @@ __profile__    = xbmc.translatePath( 
__addon__.getAddonInfo('profile') ).decode(
 __resource__   = xbmc.translatePath( os.path.join( __cwd__, 'resources', 'lib' 
) ).decode("utf-8")
 __temp__       = xbmc.translatePath( os.path.join( __profile__, 'temp') 
).decode("utf-8")
 
-if not xbmcvfs.exists(__temp__):
-  xbmcvfs.mkdirs(__temp__)
+
 
 sys.path.append (__resource__)
 
@@ -86,6 +85,9 @@ it["ID"],it["filename"])
 
 
 def Download(url,filename):
+  if xbmcvfs.exists(__temp__):
+    shutil.rmtree(__temp__)
+  xbmcvfs.mkdirs(__temp__) 
   subtitle_list = []
   exts = [".srt", ".sub", ".txt", ".smi", ".ssa", ".ass" ]
   zip = os.path.join( __temp__, "PN.zip")
@@ -94,14 +96,14 @@ def Download(url,filename):
     subFile.write(f.read())
   subFile.close()
   xbmc.sleep(500)
-  xbmc.executebuiltin(('XBMC.Extract("%s","%s")' % 
(zip,__temp__,)).encode('utf-8'), True)
-  for file in xbmcvfs.listdir(zip)[1]:
-    file = os.path.join(__temp__, file)
+  zipf = zipfile.ZipFile(zip, mode='r')
+  for subfile in zipf.namelist():
+    zipf.extract(subfile, __temp__)
+    file = os.path.join(__temp__, subfile)
     if (os.path.splitext( file )[1] in exts):
       subtitle_list.append(file)
     
-  if xbmcvfs.exists(subtitle_list[0]):
-    return subtitle_list
+  return subtitle_list
     
  
 def get_params(string=""):

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

Summary of changes:
 service.subtitles.podnapisi/addon.xml     |    2 +-
 service.subtitles.podnapisi/changelog.txt |    3 +++
 service.subtitles.podnapisi/service.py    |   18 ++++++++++--------
 3 files changed, 14 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
Scripts

------------------------------------------------------------------------------
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to