The branch, eden has been updated
via 2c1281ce9429562be2ba0510e6887bd4003c8933 (commit)
via 4764b1530732a02c08fcdc1a3df3127d07db9ce9 (commit)
via 853bfbecee4af2a39487ba51bc5f605a96b4b8a5 (commit)
from 3c7cb09d19b8389a47aec030e6570191f7f7ea79 (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/scripts;a=commit;h=2c1281ce9429562be2ba0510e6887bd4003c8933
commit 2c1281ce9429562be2ba0510e6887bd4003c8933
Author: amet <amet.nos...@gmail.com>
Date: Mon Mar 19 12:32:41 2012 +0400
[script.module.buggalo] -v 1.0.1
- Added option to pass extra data along in the error report
either through addExtraData(key, value) or directly in
onExceptionRaised(data) as a dict or string.
- Added @buggalo_try_except function decorator to easily wrap
a function in a try..except clause.
diff --git a/script.module.buggalo/LICENSE.txt
b/script.module.buggalo/LICENSE.txt
index 758cd62..d159169 100644
--- a/script.module.buggalo/LICENSE.txt
+++ b/script.module.buggalo/LICENSE.txt
@@ -1,20 +1,12 @@
-There are special exceptions to the terms and conditions of the GNU
-General Public License as it is applied to this software. View the
-full text of the exception in file EXCEPTIONS-CLIENT in the directory
-of this software distribution or see the FOSS License Exception at
-www.mysql.com.
-
-
-
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
- Preamble
+ Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
@@ -64,7 +56,7 @@ patent must be licensed for everyone's free use or not
licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
- GNU GENERAL PUBLIC LICENSE
+ GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
@@ -263,7 +255,7 @@ make exceptions for this. Our decision will be guided by
the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
- NO WARRANTY
+ NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
@@ -285,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE
WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
- END OF TERMS AND CONDITIONS
+ END OF TERMS AND CONDITIONS
- How to Apply These Terms to Your New Programs
+ How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
diff --git a/script.module.buggalo/README.md b/script.module.buggalo/README.md
index 1e24a2e..3f39904 100644
--- a/script.module.buggalo/README.md
+++ b/script.module.buggalo/README.md
@@ -17,7 +17,7 @@ http://tommy.winther.nu/files/2011/12/script_error.png
HOW TO USE
==========
-To use this script you must do two things besides importing it.
+To use this script you must do these things besides importing it.
1. Set buggalo.SUBMIT_URL to a full URL where the collected data is submitted.
@@ -40,6 +40,15 @@ To use this script you must do two things besides importing
it.
See this link for an example:
https://github.com/twinther/script.tvguide/blob/master/gui.py#L140
+ Optionally, instead of writing the try..except block yourself, you can
decorate the function
+ with @buggalo_try_except(). Function specific may be provide in the
decorator:
+
+ ```python
+ @buggalo_try_except({'class' : 'MyWindowXML', 'method' : 'onInit',
'other_key' : 'other_value'})
+ def onInit(self)
+ pass
+ ```
+
3. Finally you must setup the website where the error report is submitted.
A good starting point is my buggalo-web module on github:
https://github.com/twinther/buggalo-web
@@ -47,6 +56,11 @@ To use this script you must do two things besides importing
it.
file which store the error report in the database.
https://github.com/twinther/buggalo-web/blob/master/submit.php
+ If you don't want to or can't setup your own website you can use the
shared site at:
+ http://buggalo.xbmc.info/
+ In this case buggalo.SUBMIT_URL must be set to:
+ http://buggalo.xbmc.info/submit.php
+
WHAT IS COLLECTED
=================
Five groups of information is collected beyond basic information
@@ -74,4 +88,4 @@ The module is named after a creature in my favorite animated
show:
http://theinfosphere.org/Where_the_Buggalo_Roam
---------------------------------------------------------------------
- 2012.02.18 - twinther
\ No newline at end of file
+ 2012.02.18 - twinther
diff --git a/script.module.buggalo/addon.xml b/script.module.buggalo/addon.xml
index dfece01..42943fc 100644
--- a/script.module.buggalo/addon.xml
+++ b/script.module.buggalo/addon.xml
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="script.module.buggalo" name="Buggalo Exception Collector"
version="1.0.0" provider-name="twinther [to...@winther.nu]">
+<addon id="script.module.buggalo" name="Buggalo Exception Collector"
version="1.0.1" provider-name="twinther [to...@winther.nu]">
<requires>
<import addon="xbmc.python" version="2.0"/>
+ <import addon="script.module.simplejson" version="2.0.10"/>
</requires>
<extension point="xbmc.python.module" library="lib"/>
<extension point="xbmc.addon.metadata">
diff --git a/script.module.buggalo/changelog.txt
b/script.module.buggalo/changelog.txt
index 23a8fae..a2c01c4 100644
--- a/script.module.buggalo/changelog.txt
+++ b/script.module.buggalo/changelog.txt
@@ -1,3 +1,10 @@
+[B]Version 1.0.1 - 2012-03-16[/B]
+- Added option to pass extra data along in the error report
+ either through addExtraData(key, value) or directly in
+ onExceptionRaised(data) as a dict or string.
+- Added @buggalo_try_except function decorator to easily wrap
+ a function in a try..except clause.
+
[B]Version 1.0.0 - 2012-02-04[/B]
- Initial module version
- Named after a creature in my favorite animated show:
diff --git a/script.module.buggalo/lib/buggalo.py
b/script.module.buggalo/lib/buggalo.py
index 7c65818..fc9636a 100644
--- a/script.module.buggalo/lib/buggalo.py
+++ b/script.module.buggalo/lib/buggalo.py
@@ -34,6 +34,10 @@ import xbmcaddon
# The full URL to where the gathered data should be posted.
SUBMIT_URL = None
+EXTRA_DATA = dict()
+
+def addExtraData(key, value):
+ EXTRA_DATA[key] = value
def getRandomHeading():
"""
@@ -51,13 +55,31 @@ def getLocalizedString(id):
return buggaloAddon.getLocalizedString(id)
-def onExceptionRaised():
+def buggalo_try_except(extraData = None):
+ """
+ @buggalo_try_except function decorator wraps a function in a try..except
clause and invokes onExceptionRaised()
+ in case an exception is raised. Provide extraData to specific function
specific extraData.
+
+ @param extraData: str or dict
+ """
+ def decorator(fn):
+ def wrap_in_try_except(*args, **kwargs):
+ try:
+ fn(*args, **kwargs)
+ except Exception:
+ onExceptionRaised(extraData)
+ return wrap_in_try_except
+ return decorator
+
+def onExceptionRaised(extraData = None):
"""
Invoke this method in an except clause to allow the user to submit
a bug report with stacktrace, system information, etc.
This also avoids the 'Script error' popup in XBMC, unless of course
an exception is thrown in this code :-)
+
+ @param extraData: str or dict
"""
# start by logging the usual info to stderr
(type, value, traceback) = sys.exc_info()
@@ -72,12 +94,12 @@ def onExceptionRaised():
thanks = getLocalizedString(91005)
if xbmcgui.Dialog().yesno(heading, line1, line2, line3, no, yes):
- data = _gatherData(type, value, traceback)
+ data = _gatherData(type, value, traceback, extraData)
_submitData(data)
xbmcgui.Dialog().ok(heading, thanks)
-def _gatherData(type, value, traceback):
+def _gatherData(type, value, traceback, extraData):
data = dict()
data['version'] = 3
data['timestamp'] = datetime.datetime.now().isoformat()
@@ -96,7 +118,7 @@ def _gatherData(type, value, traceback):
system['release'] = release
system['version'] = version
system['machine'] = machine
- except Exception as ex:
+ except Exception, ex:
system['sysname'] = sys.platform
system['exception'] = str(ex)
data['system'] = system
@@ -128,6 +150,20 @@ def _gatherData(type, value, traceback):
exception['stacktrace'] = tb.format_tb(traceback)
data['exception'] = exception
+ extraDataInfo = dict()
+ try:
+ for (key, value) in EXTRA_DATA.items():
+ extraDataInfo[key] = str(value)
+
+ if type(extraData) == dict:
+ for (key, value) in extraData.items():
+ extraDataInfo[key] = str(value)
+ elif extraData is not None:
+ extraDataInfo[''] = str(extraData)
+ except Exception, ex:
+ extraDataInfo['exception'] = str(ex)
+ data['extraData'] = extraDataInfo
+
return simplejson.dumps(data)
@@ -143,3 +179,5 @@ def _submitData(data):
except Exception:
pass # probably timeout; retry
+
+
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/scripts;a=commit;h=4764b1530732a02c08fcdc1a3df3127d07db9ce9
commit 4764b1530732a02c08fcdc1a3df3127d07db9ce9
Author: amet <amet.nos...@gmail.com>
Date: Mon Mar 19 12:28:32 2012 +0400
9script.xbmc.subtitles0 -v2.9.37
- fixed encoding again, thx taxigps
- fixed Shooter service. thx taxigps
- Update script for argenteam.net, thx Esteban Mendoza
- Updated Subtitles.gr service, thx lambda81
diff --git a/script.xbmc.subtitles/addon.xml b/script.xbmc.subtitles/addon.xml
index 3efc148..dfbbc4a 100755
--- 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.36"
+ version="2.9.37"
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 a8dce0a..47165ce 100644
--- a/script.xbmc.subtitles/changelog.txt
+++ b/script.xbmc.subtitles/changelog.txt
@@ -1,3 +1,9 @@
+2.9.37
+- fixed encoding again, thx taxigps
+- fixed Shooter service. thx taxigps
+- Update script for argenteam.net, thx Esteban Mendoza
+- Updated Subtitles.gr service, thx lambda81
+
2.9.36
- Added RegieLive.ro subtitles service, thx ThumbGen
- fixed Subtitles.gr service
diff --git a/script.xbmc.subtitles/default.py b/script.xbmc.subtitles/default.py
index bffe1a7..a92fe11 100644
--- a/script.xbmc.subtitles/default.py
+++ b/script.xbmc.subtitles/default.py
@@ -11,12 +11,12 @@ __scriptname__ = "XBMC Subtitles"
__addon__ = xbmcaddon.Addon(id='script.xbmc.subtitles')
-__cwd__ = __addon__.getAddonInfo('path').decode("utf-8")
+__cwd__ = xbmc.translatePath( __addon__.getAddonInfo('path')
).decode("utf-8")
__version__ = __addon__.getAddonInfo('version')
__language__ = __addon__.getLocalizedString
__profile__ = xbmc.translatePath( __addon__.getAddonInfo('profile')
).decode("utf-8")
-__resource__ = xbmc.translatePath( os.path.join( __cwd__, 'resources', 'lib'
) ).decode("utf-8")
+__resource__ = os.path.join( __cwd__, 'resources', 'lib' )
sys.path.append (__resource__)
@@ -30,12 +30,12 @@ if ( __name__ == "__main__" ):
ui = gui.GUI( "script-XBMC-Subtitles-main.xml" , __cwd__ , "Default")
movieFullPath = ui.set_allparam()
if (__addon__.getSetting( "auto_download" ) == "true") and
(__addon__.getSetting( "auto_download_file" ) != os.path.basename(
movieFullPath )):
- notification = UserNotificationNotifier(__scriptname__,
__language__(764).encode('utf-8'), 2000)
+ notification = UserNotificationNotifier(__scriptname__, __language__(764),
2000)
if not ui.Search_Subtitles(False):
__unpause__ = pause()
ui.doModal()
else:
- notification.close(__language__(765).encode('utf-8'), 1000)
+ notification.close(__language__(765), 1000)
else:
__unpause__ = pause()
ui.doModal()
diff --git a/script.xbmc.subtitles/resources/lib/gui.py
b/script.xbmc.subtitles/resources/lib/gui.py
index 7bb3acb..1d51d8f 100644
--- a/script.xbmc.subtitles/resources/lib/gui.py
+++ b/script.xbmc.subtitles/resources/lib/gui.py
@@ -107,7 +107,7 @@ class GUI( xbmcgui.WindowXMLDialog ):
else:
self.sub_folder = os.path.dirname( movieFullPath )
else:
- self.sub_folder = os.path.dirname( movieFullPath )
+ self.sub_folder = os.path.dirname( movieFullPath )
if self.episode.lower().find("s") > -1: #
Check if season is "Special"
self.season = "0" #
@@ -164,7 +164,7 @@ class GUI( xbmcgui.WindowXMLDialog ):
service = name
if len(self.tvshow) > 0:
- def_service = __addon__.getSetting( "deftvservice")
+ def_service = __addon__.getSetting( "deftvservice")
else:
def_service = __addon__.getSetting( "defmovieservice")
@@ -297,17 +297,17 @@ class GUI( xbmcgui.WindowXMLDialog ):
else:
file_name = "%s%s" % ( sub_name, sub_ext )
file_from = file.replace('\\','/')
- file_to = os.path.join(self.sub_folder.encode("utf-8"),
file_name).replace('\\','/')
+ file_to = os.path.join(self.sub_folder, file_name).replace('\\','/')
# Create a files list of from-to tuples so that multiple files may be
# copied (sub+idx etc')
files_list = [(file_from,file_to)]
# If the subtitle's extension sub, check if an idx file exists and if so
# add it to the list
- if ((sub_ext == ".sub") and (os.path.exists(unicode(file[:-3]+"idx",
'utf-8')))):
+ if ((sub_ext == ".sub") and (os.path.exists(file[:-3]+"idx"))):
log( __name__ ,"found .sub+.idx pair %s + %s" %
(file_from,file_from[:-3]+"idx"))
files_list.append((file_from[:-3]+"idx",file_to[:-3]+"idx"))
for cur_file_from, cur_file_to in files_list:
- subtitle_set,file_path = copy_files( cur_file_from, cur_file_to )
+ subtitle_set,file_path = copy_files( cur_file_from, cur_file_to )
# Choose the last pair in the list, second item (destination file)
if subtitle_set:
subtitle = files_list[-1][1]
diff --git a/script.xbmc.subtitles/resources/lib/services/Argenteam/service.py
b/script.xbmc.subtitles/resources/lib/services/Argenteam/service.py
index 14a2ae6..48de53b 100644
--- a/script.xbmc.subtitles/resources/lib/services/Argenteam/service.py
+++ b/script.xbmc.subtitles/resources/lib/services/Argenteam/service.py
@@ -6,14 +6,24 @@ from utilities import log
_ = sys.modules[ "__main__" ].__language__
-main_url = "http://buscador.argenteam.net/"
+main_url = "http://www.argenteam.net/search/"
debug_pretext = "argenteam"
#====================================================================================================================
# Regular expression patterns
#====================================================================================================================
-subtitle_pattern =
"<a\shref=\"http://www.argenteam.net/download/(.+?)/(.+?)\"\sclass=\"searchResultLink\">(.+?)</a>"
+'''
+<div class="search-item-desc">
+ <a href="/episode/29322/The.Mentalist.%282008%29.S01E01-Pilot">
+
+<div class="search-item-desc">
+ <a href="/movie/25808/Awake.%282007%29">
+'''
+
+search_results_pattern =
"<div\sclass=\"search-item-desc\">(.+?)<a\shref=\"/(episode|movie)/(.+?)/(.+?)\">(.+?)</a>"
+
+subtitle_pattern =
"<div\sclass=\"links\">(.+?)<strong>Descargado:</strong>(.+?)ve(ces|z)(.+?)<div>(.+?)<a\shref=\"/subtitles/(.+?)/(.+?)\">(.+?)</a>"
#====================================================================================================================
# Functions
@@ -23,34 +33,42 @@ subtitle_pattern =
"<a\shref=\"http://www.argenteam.net/download/(.+?)/(.+?)\"\s
def getallsubs(searchstring, languageshort, languagelong, file_original_path,
subtitles_list, tvshow, season, episode):
if languageshort == "es":
+ log( __name__ ,"TVShow: %s" % (tvshow))
if len(tvshow) > 0:
- url = main_url +
"?sourceid=xbmc-search&mode=results&search_keywords=" +
urllib.quote_plus(searchstring)
+ url = main_url + urllib.quote_plus(searchstring)
else:
searchstring = re.sub('\([0-9]{4}\)','',searchstring)
- url = main_url +
"?sourceid=xbmc-search&mode=results&search_keywords=" +
urllib.quote_plus(searchstring)
+ url = main_url + urllib.quote_plus(searchstring)
content = geturl(url)
#subtitles_list.append({'rating': '0', 'no_files': 1, 'filename':
searchstring, 'sync': False, 'id' : 1, 'language_flag': 'flags/' +
languageshort + '.gif', 'language_name': languagelong})
- for matches in re.finditer(subtitle_pattern, content, re.IGNORECASE |
re.DOTALL | re.MULTILINE | re.UNICODE):
- id = matches.group(1)
- filename=matches.group(3).replace('"','')
- filename=filename.replace('"','')
- server = "http://www.argenteam.net"
-
- if len(tvshow) > 0:
+ for matches in re.finditer(search_results_pattern, content,
re.IGNORECASE | re.DOTALL | re.MULTILINE | re.UNICODE):
+ log( __name__ ,"Resultado: %s" % (matches))
+ log( __name__ ,"Tipo: %s" % (matches.group(2)))
+ log( __name__ ,"ID: %s" % (matches.group(3)))
+ log( __name__ ,"Link: %s" % (matches.group(4)))
+
+ tipo = matches.group(2)
+ id = matches.group(3)
+ link = matches.group(4)
+
+ url_subtitle = "http://www.argenteam.net/" + tipo +"/"+ id
+"/"+link
+
+ content_subtitle = geturl(url_subtitle)
+ for matches in re.finditer(subtitle_pattern, content_subtitle,
re.IGNORECASE | re.DOTALL | re.MULTILINE | re.UNICODE):
+ log( __name__ ,"Descargas: %s" % (matches.group(2)))
- if int(episode) < 10:
- episode2 = "0"+str(episode)
- else:
- episode2 = episode
-
- episodeSerie = season+episode2
- if filename.find(episodeSerie) >= 0:
- filename = filename
- subtitles_list.append({'rating': '0',
'no_files': 1, 'filename': filename, 'server': server, 'sync': False, 'id' :
id, 'language_flag': 'flags/' + languageshort + '.gif', 'language_name':
languagelong})
- else:
- subtitles_list.append({'rating': '0', 'no_files': 1,
'filename': filename, 'server': server, 'sync': False, 'id' : id,
'language_flag': 'flags/' + languageshort + '.gif', 'language_name':
languagelong})
-
+ id = matches.group(6)
+ filename=urllib.unquote_plus(matches.group(7))
+ server = filename
+ downloads = int(matches.group(2)) / 1000
+ if (downloads > 10):
+ downloads=10
+ #server = matches.group(4).encode('ascii')
+ log( __name__ ,"Resultado SubtÃtulo 2: %s" %
(matches.group(6)))
+ subtitles_list.append({'rating': str(downloads),
'no_files': 1, 'filename': filename, 'server': server, 'sync': False, 'id' :
id, 'language_flag': 'flags/' + languageshort + '.gif', 'language_name':
languagelong})
+
+
def geturl(url):
class MyOpener(urllib.FancyURLopener):
version = ''
@@ -82,7 +100,7 @@ def search_subtitles( file_original_path, title, tvshow,
year, season, episode,
getallsubs(searchstring, "es", "Spanish", file_original_path,
subtitles_list, tvshow, season, episode)
if spanish == 0:
- msg = "Won't work, Subdivx is only for Spanish subtitles!"
+ msg = "Won't work, argenteam is only for Spanish subtitles!"
return subtitles_list, "", msg #standard output
@@ -91,8 +109,9 @@ def download_subtitles (subtitles_list, pos, zip_subs,
tmp_sub_dir, sub_folder,
id = subtitles_list[pos][ "id" ]
server = subtitles_list[pos][ "server" ]
language = subtitles_list[pos][ "language_name" ]
+
if string.lower(language) == "spanish":
- url = "http://www.argenteam.net/download/" + id + "/u=" + server
+ url = "http://www.argenteam.net/subtitles/" + id + "/"
content = geturl(url)
if content is not None:
diff --git a/script.xbmc.subtitles/resources/lib/services/Shooter/service.py
b/script.xbmc.subtitles/resources/lib/services/Shooter/service.py
index e056145..853e849 100644
--- a/script.xbmc.subtitles/resources/lib/services/Shooter/service.py
+++ b/script.xbmc.subtitles/resources/lib/services/Shooter/service.py
@@ -29,12 +29,11 @@ def getBlockHash(f, offset):
return hashlib.md5(grapBlock(f, offset, 4096)).hexdigest()
def genFileHash(fpath):
- upath = unicode(fpath, 'utf-8')
- ftotallen = os.stat(upath).st_size
+ ftotallen = os.stat(fpath).st_size
if ftotallen < 8192:
return ""
offset = [4096, ftotallen/3*2, ftotallen/3, ftotallen - 8192]
- f = open(upath, "rb")
+ f = open(fpath, "rb")
return ";".join(getBlockHash(f, i) for i in offset)
def getShortNameByFileName(fpath):
@@ -113,13 +112,13 @@ def downloadSubs(fpath, lang):
pathinfo = "E:\\" + pathinfo.replace(os.path.sep, "\\")
filehash = genFileHash(fpath)
shortname = getShortName(fpath)
- vhash = genVHash(SVP_REV_NUMBER, fpath, filehash)
+ vhash = genVHash(SVP_REV_NUMBER, fpath.encode("utf-8"), filehash)
formdata = []
- formdata.append(("pathinfo", pathinfo))
+ formdata.append(("pathinfo", pathinfo.encode("utf-8")))
formdata.append(("filehash", filehash))
if vhash:
formdata.append(("vhash", vhash))
- formdata.append(("shortname", shortname))
+ formdata.append(("shortname", shortname.encode("utf-8")))
if lang != "chn":
formdata.append(("lang", lang))
@@ -230,9 +229,8 @@ def download_subtitles (subtitles_list, pos, zip_subs,
tmp_sub_dir, sub_folder,
barename = subtitles_list[pos][ "filename" ].rsplit(".",1)[0]
language = subtitles_list[pos][ "language_name" ]
for file in subtitles_list[pos][ "filedata" ]:
- filename = os.path.join(tmp_sub_dir, ".".join([barename,
file.ExtName]).decode("utf-8")).encode('utf-8')
- fn = unicode(filename, 'utf-8')
- open(fn,"wb").write(file.FileData)
+ filename = os.path.join(tmp_sub_dir, ".".join([barename,
file.ExtName]))
+ open(filename,"wb").write(file.FileData)
if (file.ExtName in ["srt", "txt", "ssa", "smi", "sub"]):
subs_file = filename
return False, language, subs_file #standard output
diff --git
a/script.xbmc.subtitles/resources/lib/services/SubtitlesGr/service.py
b/script.xbmc.subtitles/resources/lib/services/SubtitlesGr/service.py
index 8affe5a..74a13d6 100644
--- a/script.xbmc.subtitles/resources/lib/services/SubtitlesGr/service.py
+++ b/script.xbmc.subtitles/resources/lib/services/SubtitlesGr/service.py
@@ -80,12 +80,14 @@ def download_subtitles (subtitles_list, pos, zip_subs,
tmp_sub_dir, sub_folder,
f = urllib.urlopen(url)
local_file.write(f.read())
local_file.close()
- tmp_new_dir = os.path.join( tmp_sub_dir ,"zipsubs" )
- tmp_new_dir_2 = os.path.join( tmp_new_dir ,"subs" )
+ tmp_new_dir = os.path.join( xbmc.translatePath(tmp_sub_dir) ,"zipsubs" )
+ tmp_new_dir_2 = os.path.join( xbmc.translatePath(tmp_new_dir) ,"subs" )
+ if not os.path.exists(tmp_new_dir): os.makedirs(tmp_new_dir)
+ if not os.path.exists(tmp_new_dir_2): os.makedirs(tmp_new_dir_2)
xbmc.executebuiltin("XBMC.Extract(" + zip_subs + "," + tmp_new_dir +")")
xbmc.sleep(1000)
- for file in os.listdir(tmp_new_dir_2): file=os.path.join(tmp_new_dir_2,
file)
- if re.search('.rar',file) is not None:
+ for file in os.listdir(tmp_new_dir_2): file = os.path.join(tmp_new_dir_2,
file)
+ if (file.endswith('.rar') or file.endswith('.zip')):
xbmc.executebuiltin("XBMC.Extract(" + file + "," + tmp_sub_dir +")")
xbmc.sleep(1000)
else: shutil.copy(file, tmp_sub_dir)
diff --git a/script.xbmc.subtitles/resources/lib/utilities.py
b/script.xbmc.subtitles/resources/lib/utilities.py
index f8f1b5b..0c1e372 100644
--- a/script.xbmc.subtitles/resources/lib/utilities.py
+++ b/script.xbmc.subtitles/resources/lib/utilities.py
@@ -97,13 +97,13 @@ REGEX_EXPRESSIONS = [
'[Ss]([0-9]+)[][._-]*[Ee]([0-9]+)([^\\\\/]*)$',
class UserNotificationNotifier:
def __init__(self, title, initialMessage, time = -1):
self.__title = title
- xbmc.executebuiltin("Notification(%s,%s,%i)" % (title, initialMessage,
time))
+ xbmc.executebuiltin((u"Notification(%s,%s,%i)" % (title, initialMessage,
time)).encode('utf-8'))
def update(self, message, time = -1):
- xbmc.executebuiltin("Notification(%s,%s,-1)" % (self.__title, message,
time))
+ xbmc.executebuiltin((u"Notification(%s,%s,-1)" % (self.__title, message,
time)).encode("utf-8"))
def close(self, message, time = -1):
- xbmc.executebuiltin("Notification(%s,%s,%i)" % (self.__title, message,
time))
+ xbmc.executebuiltin((u"Notification(%s,%s,%i)" % (self.__title, message,
time)).encode("utf-8"))
def log(module,msg):
@@ -166,19 +166,12 @@ def rem_files(directory):
for name in files:
os.remove(os.path.join(root, name))
except:
- try:
- for root, dirs, files in os.walk(directory, topdown=False):
- for items in dirs:
- shutil.rmtree(os.path.join(root, items).decode("utf-8"),
ignore_errors=True, onerror=None)
- for name in files:
- os.remove(os.path.join(root, name).decode("utf-8"))
- except:
- pass
+ pass
def copy_files( subtitle_file, file_path ):
subtitle_set = False
try:
- xbmcvfs.copy(subtitle_file.encode("utf-8"), file_path.encode("utf-8"))
+ xbmcvfs.copy(subtitle_file, file_path)
log( __name__ ,"vfs module copy %s -> %s" % (subtitle_file, file_path))
subtitle_set = True
except :
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/scripts;a=commit;h=853bfbecee4af2a39487ba51bc5f605a96b4b8a5
-----------------------------------------------------------------------
Summary of changes:
script.module.buggalo/LICENSE.txt | 22 +-
script.module.buggalo/README.md | 18 +-
script.module.buggalo/addon.xml | 3 +-
script.module.buggalo/changelog.txt | 7 +
script.module.buggalo/lib/buggalo.py | 46 ++-
.../resources/language/French/strings.xml | 9 +
.../resources/language/German/strings.xml | 9 +
script.xbmc.subtitles/addon.xml | 2 +-
script.xbmc.subtitles/changelog.txt | 6 +
script.xbmc.subtitles/default.py | 8 +-
script.xbmc.subtitles/resources/lib/gui.py | 10 +-
.../resources/lib/services/Argenteam/service.py | 69 ++-
.../resources/lib/services/Shooter/service.py | 16 +-
.../resources/lib/services/SubtitlesGr/service.py | 10 +-
script.xbmc.subtitles/resources/lib/utilities.py | 17 +-
.../LICENSE.txt | 0
weather.ozweather/addon.xml | 14 +
weather.ozweather/changelog.txt | 58 ++
weather.ozweather/default.py | 591 ++++++++++++++++++++
weather.ozweather/icon.png | Bin 0 -> 55267 bytes
.../resources/language/English/strings.xml | 22 +
weather.ozweather/resources/lib/utilities.py | 106 ++++
weather.ozweather/resources/settings.xml | 32 +
23 files changed, 993 insertions(+), 82 deletions(-)
create mode 100644 script.module.buggalo/resources/language/French/strings.xml
create mode 100644 script.module.buggalo/resources/language/German/strings.xml
copy {script.advanced.wol => weather.ozweather}/LICENSE.txt (100%)
create mode 100644 weather.ozweather/addon.xml
create mode 100644 weather.ozweather/changelog.txt
create mode 100644 weather.ozweather/default.py
create mode 100644 weather.ozweather/icon.png
create mode 100644 weather.ozweather/resources/language/English/strings.xml
create mode 100644 weather.ozweather/resources/lib/utilities.py
create mode 100644 weather.ozweather/resources/settings.xml
hooks/post-receive
--
Scripts
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Xbmc-addons mailing list
Xbmc-addons@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xbmc-addons