The branch, eden has been updated
       via  348e27e024512d134f0bf1213766b2f4ba0a77b3 (commit)
      from  a2f0ac88298a5c90d3d257290d1397c8b778c39d (commit)

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

commit 348e27e024512d134f0bf1213766b2f4ba0a77b3
Author: ronie <[email protected]>
Date:   Tue Oct 2 21:21:45 2012 +0200

    [script.tv.show.next.aired] -v4.1.24
    
    make update time user-configurable

diff --git a/script.tv.show.next.aired/addon.xml 
b/script.tv.show.next.aired/addon.xml
index 40312b3..a6fbb36 100644
--- a/script.tv.show.next.aired/addon.xml
+++ b/script.tv.show.next.aired/addon.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <addon id="script.tv.show.next.aired"
        name="TV Show - Next Aired"
-       version="4.1.20"
+       version="4.1.24"
        provider-name="Ppic, Frost, ronie, `Black">
   <requires>
     <import addon="xbmc.python" version="2.0"/>
@@ -13,6 +13,7 @@
   </extension>
   <extension point="xbmc.addon.metadata">
     <platform>all</platform>
+    <language/>
     <summary lang="de">Erhalten Sie Infos über die nächsten 
Ausstrahlungstermine Ihrer Serien.</summary>
     <summary lang="en">Get info for TV Shows Next Aired.</summary>
     <summary lang="fr">Récupère les dates de diffusions de vos 
séries</summary>
diff --git a/script.tv.show.next.aired/changelog.txt 
b/script.tv.show.next.aired/changelog.txt
index 64d7fa5..547190d 100644
--- a/script.tv.show.next.aired/changelog.txt
+++ b/script.tv.show.next.aired/changelog.txt
@@ -1,3 +1,16 @@
+v4.1.24
+- use action.getId() instead of action
+
+v4.1.23
+- add scriptname to logging
+- fix update time logic
+
+v4.1.22
+- make update time user-configurable
+
+v4.1.21
+- added Portuguese (Brazil) language file
+
 v4.1.20
 - use title instead of label
 
diff --git a/script.tv.show.next.aired/default.py 
b/script.tv.show.next.aired/default.py
index a752f77..27400e6 100644
--- a/script.tv.show.next.aired/default.py
+++ b/script.tv.show.next.aired/default.py
@@ -1,4 +1,4 @@
-from time import strptime, time, mktime
+from time import strptime, time, mktime, localtime
 import os, sys, re, socket, urllib, unicodedata
 from traceback import print_exc
 from datetime import datetime, date, timedelta, tzinfo
@@ -12,7 +12,6 @@ else:
 import _strptime
 
 __addon__     = xbmcaddon.Addon()
-__settings__  = xbmcaddon.Addon( "script.tv.show.next.aired" )
 __addonid__   = __addon__.getAddonInfo('id')
 __addonname__ = __addon__.getAddonInfo('name')
 __cwd__       = __addon__.getAddonInfo('path')
@@ -35,8 +34,9 @@ elif DATE_FORMAT[0] == 'm':
 if not xbmcvfs.exists(DATA_PATH):
     xbmcvfs.mkdir(DATA_PATH)
 
-def log(msg):
-    xbmc.log( str( msg ),level=xbmc.LOGDEBUG )
+def log(txt):
+    message = '%s: %s' % (__addonid__, txt)
+    xbmc.log(msg=str(message), level=xbmc.LOGDEBUG)
 
 def footprints():
     log( "### %s starting ..." % __addonname__ )
@@ -86,9 +86,11 @@ class NextAired:
         self.weekday = date.today().weekday()
         self.days = 
['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday']
         self.ampm = xbmc.getCondVisibility('substring(System.Time,Am)') or 
xbmc.getCondVisibility('substring(System.Time,Pm)')
+        self.update_hour = __addon__.getSetting( "update_hour" )
+        self.update_minute = __addon__.getSetting( "update_minute" )
         self._parse_argv()
-        if __settings__.getSetting( "AddonVersion" ) != __version__:
-            __settings__.setSetting ( id = "AddonVersion", value = "%s" % 
__version__ )
+        if __addon__.getSetting( "AddonVersion" ) != __version__:
+            __addon__.setSetting ( id = "AddonVersion", value = "%s" % 
__version__ )
             self.FORCEUPDATE = True
         if self.BACKEND:
             self.run_backend()
@@ -97,15 +99,24 @@ class NextAired:
             if self.SILENT == "":
                 self.show_gui()
             else:
-                oldweekday = date.today().weekday()
                 while (not xbmc.abortRequested):
                     xbmc.sleep(1000)
-                    newweekday = date.today().weekday()
-                    if newweekday != oldweekday:
-                        oldweekday = newweekday
+                    current_time = localtime()
+                    current_hour = '%.2i' % current_time.tm_hour
+                    current_minute = '%.2i' % current_time.tm_min
+                    if (current_hour == self.update_hour) and (current_minute 
== self.update_minute):
                         self.FORCEUPDATE = True
-                        log( "### it's midnight, force update" )
+                        log( "### it's update time, force update" )
                         self.update_data()
+                        current_time = localtime()
+                        current_hour = '%.2i' % current_time.tm_hour
+                        current_minute = '%.2i' % current_time.tm_min
+                        while (current_hour == self.update_hour) and 
(current_minute == self.update_minute) and (not xbmc.abortRequested):
+                            xbmc.sleep(1000)
+                            current_time = localtime()
+                            current_hour = '%.2i' % current_time.tm_hour
+                            current_minute = '%.2i' % current_time.tm_min
+                        log( "### forced update finished" )
                 self.close("xbmc is closing, stop script")
 
     def _parse_argv( self ):
@@ -116,7 +127,7 @@ class NextAired:
         log( "### params: %s" % params )
         self.SILENT = params.get( "silent", "" )
         self.BACKEND = params.get( "backend", False )
-        self.FORCEUPDATE = params.get( "force", False ) or 
__settings__.getSetting("ForceUpdate") == "true"
+        self.FORCEUPDATE = params.get( "force", False ) or 
__addon__.getSetting("ForceUpdate") == "true"
 
     def update_data(self):
         self.nextlist = []
@@ -124,7 +135,7 @@ class NextAired:
         if xbmcvfs.exists(dbfile):
             if self.FORCEUPDATE:
                 log( "### update forced, rescanning..." )
-                __settings__.setSetting(id="ForceUpdate", value="false")
+                __addon__.setSetting(id="ForceUpdate", value="false")
                 self.scan_info()
             elif time() - os.path.getmtime(dbfile) > 86400:
                 log( "### db more than 24h old, rescanning..." )
@@ -167,7 +178,7 @@ class NextAired:
                 percent = int( float( self.count * 100 ) / self.total_show )
                 DIALOG_PROGRESS.update( percent , __language__(32102) , "%s" % 
show[0] )
                 if DIALOG_PROGRESS.iscanceled():
-                    __settings__.setSetting( id="ForceUpdate", value="true" ) 
+                    __addon__.setSetting( id="ForceUpdate", value="true" ) 
                     DIALOG_PROGRESS.close()
                     
xbmcgui.Dialog().ok(__language__(32103),__language__(32104))
                     break
diff --git a/script.tv.show.next.aired/resources/language/English/strings.xml 
b/script.tv.show.next.aired/resources/language/English/strings.xml
index 4545d18..3350282 100644
--- a/script.tv.show.next.aired/resources/language/English/strings.xml
+++ b/script.tv.show.next.aired/resources/language/English/strings.xml
@@ -13,5 +13,8 @@
        <string id="45005">Enable 16:9 preview thumbs</string>
        <string id="45006">Download 16:9 preview thumbs (Artwork Downloader 
required)</string>
        <string id="45007">Rescan tv guide data</string>
+       <string id="45008">Download next aired info every day at:</string>
+       <string id="45009">Hour</string>
+       <string id="45010">Minute</string>
 </strings>
 
diff --git a/script.tv.show.next.aired/resources/language/Portuguese 
(Brazil)/strings.xml b/script.tv.show.next.aired/resources/language/Portuguese 
(Brazil)/strings.xml
index 063a964..360473f 100644
--- a/script.tv.show.next.aired/resources/language/Portuguese 
(Brazil)/strings.xml      
+++ b/script.tv.show.next.aired/resources/language/Portuguese 
(Brazil)/strings.xml      
@@ -5,4 +5,12 @@
        <string id="32102">Pegando Informação...</string>
        <string id="32103">CANCELADO</string>
        <string id="32104">Operação cancelada pelo Usuário.</string>
+       <string id="45000">Exibir</string>
+       <string id="45001">Tipo de Miniatura</string>
+       <string id="45002">Download baners (Requer Artwork Downloader)</string>
+       <string id="45003">Download logos (Requer Artwork Downloader)</string>
+       <string id="45004">Ligar background fanart</string>
+       <string id="45005">Ligar visualização de miniaturas 16:9</string>
+       <string id="45006">Download visualização de miniaturas 16:9 (Requer 
Artwork Downloader)</string>
+       <string id="45007">Reescanear os dados do guia de tv</string>
 </strings>
diff --git a/script.tv.show.next.aired/resources/lib/next_aired_dialog.py 
b/script.tv.show.next.aired/resources/lib/next_aired_dialog.py
index 80bc8ba..5c46a8f 100644
--- a/script.tv.show.next.aired/resources/lib/next_aired_dialog.py
+++ b/script.tv.show.next.aired/resources/lib/next_aired_dialog.py
@@ -3,11 +3,13 @@ from time import mktime
 from datetime import date
 import xbmc, xbmcgui, xbmcaddon, time
 
-__addon__ = xbmcaddon.Addon()
-__cwd__ = __addon__.getAddonInfo('path')
+__addon__   = xbmcaddon.Addon()
+__addonid__ = __addon__.getAddonInfo('id')
+__cwd__     = __addon__.getAddonInfo('path')
 
-def log(msg):
-    xbmc.log( str( msg ),level=xbmc.LOGDEBUG )
+def log(txt):
+    message = '%s: %s' % (__addonid__, txt)
+    xbmc.log(msg=str(message), level=xbmc.LOGDEBUG)
 
 class Gui( xbmcgui.WindowXML ):
     def __init__(self, *args, **kwargs):
@@ -98,9 +100,9 @@ class Gui( xbmcgui.WindowXML ):
         pass
 
     def onAction( self, action ):
-        if action in ( 9, 10, 92, 216, 247, 257, 275, 61467, 61448, ):
+        if action.getId() in ( 9, 10, 92, 216, 247, 257, 275, 61467, 61448, ):
             self.close()
-        if action in ( 7, 10, 92, ) and self.settingsOpen:
+        if action.getId() in ( 7, 10, 92, ) and self.settingsOpen:
             num = int( __addon__.getSetting( "ThumbType" ) )
             xbmc.executebuiltin( "SetProperty(TVGuide.ThumbType,%i,Home)" % 
num )
             if __addon__.getSetting( "PreviewThumbs" ) == 'true':
diff --git a/script.tv.show.next.aired/resources/settings.xml 
b/script.tv.show.next.aired/resources/settings.xml
index 7ae11a4..5502eb8 100644
--- a/script.tv.show.next.aired/resources/settings.xml
+++ b/script.tv.show.next.aired/resources/settings.xml
@@ -1,11 +1,14 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <settings>
        <setting id="ReScan" type="action" label="45007" 
action="RunScript(script.tv.show.next.aired,force=True)"/>
-       <setting type="lsep" label="45000" />
-       <setting id="ThumbType" type="enum" label="45001" default="0" 
values="Thumb|Banner|Logo" />
-       <setting id="DownloadBanners" type="action" subsetting="true" 
label="45002" 
action="RunScript(script.artwork.downloader,mediatype=tvshow,mode=custom,banner)"
 visible="gt(-1,0) + lt(-1,2)" />
-       <setting id="DownloadLogos" type="action" subsetting="true" 
label="45003" 
action="RunScript(script.artwork.downloader,mediatype=tvshow,mode=custom,clearlogo)"
 visible="gt(-2,1) + lt(-2,3)" />
-       <setting id="BackgroundFanart" type="bool" label="45004" 
default="False" />
-       <setting id="PreviewThumbs" type="bool" label="45005" default="False" />
-       <setting id="DownloadPreviewThumbs" type="action" subsetting="true" 
label="45006" 
action="RunScript(script.artwork.downloader,mediatype=tvshow,mode=custom,tvthumb)"
 visible="eq(-1,true)" />
+       <setting type="lsep" label="45000"/>
+       <setting id="ThumbType" type="enum" label="45001" default="0" 
values="Thumb|Banner|Logo"/>
+       <setting id="DownloadBanners" type="action" subsetting="true" 
label="45002" 
action="RunScript(script.artwork.downloader,mediatype=tvshow,mode=custom,banner)"
 visible="gt(-1,0) + lt(-1,2)"/>
+       <setting id="DownloadLogos" type="action" subsetting="true" 
label="45003" 
action="RunScript(script.artwork.downloader,mediatype=tvshow,mode=custom,clearlogo)"
 visible="gt(-2,1) + lt(-2,3)"/>
+       <setting id="BackgroundFanart" type="bool" label="45004" 
default="False"/>
+       <setting id="PreviewThumbs" type="bool" label="45005" default="False"/>
+       <setting id="DownloadPreviewThumbs" type="action" subsetting="true" 
label="45006" 
action="RunScript(script.artwork.downloader,mediatype=tvshow,mode=custom,tvthumb)"
 visible="eq(-1,true)"/>
+       <setting type="lsep" label="45008"/>
+       <setting id="update_hour" type="labelenum" label="45009" 
subsetting="true" 
values="00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23"
 default="00"/>
+       <setting id="update_minute" type="labelenum" label="45010" 
subsetting="true" values="00|05|10|15|20|25|30|35|40|45|50|55" default="00"/>
 </settings>

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

Summary of changes:
 script.tv.show.next.aired/addon.xml                |    3 +-
 script.tv.show.next.aired/changelog.txt            |   13 +++++++
 script.tv.show.next.aired/default.py               |   39 +++++++++++++-------
 .../resources/language/English/strings.xml         |    3 ++
 .../language/Portuguese (Brazil)/strings.xml       |    8 ++++
 .../resources/lib/next_aired_dialog.py             |   14 ++++---
 script.tv.show.next.aired/resources/settings.xml   |   17 +++++----
 7 files changed, 69 insertions(+), 28 deletions(-)


hooks/post-receive
-- 
Scripts

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to