The branch, eden-pre has been updated
       via  2f884749e5318a850a40d0cfc944763367d4e0b7 (commit)
      from  1df6b7b5072212590af8fd796f7975c7e44670e6 (commit)

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

commit 2f884749e5318a850a40d0cfc944763367d4e0b7
Author: ronie <[email protected]>
Date:   Thu Oct 27 22:05:46 2011 +0200

    [script.tv.show.next.aired] -v4.1.1
    
    added localization for date formats

diff --git a/script.tv.show.next.aired/README.txt 
b/script.tv.show.next.aired/README.txt
index fd4fe92..cfe6ec7 100644
--- a/script.tv.show.next.aired/README.txt
+++ b/script.tv.show.next.aired/README.txt
@@ -45,7 +45,7 @@ Total         (number of running shows)
 TodayTotal     (number of shows aired today)
 TodayShow      (list of shows aired today)
 
-use !IsEmpty(Window(Home).Property(NextAired.Label)) as a visible condition!
+use !IsEmpty(Window(Home).Property(NextAired.NextDate)) as a visible condition!
 
 
 example code:
@@ -83,13 +83,17 @@ a list of required id's:
 204 - container / shows aired on friday
 205 - container / shows aired on saturday
 206 - container / shows aired on sunday
-
+8 - in case all the containers above are empty, we set focus to this id
 
 a list of available infolabels:
 ListItem.Label         (tv show name)
 ListItem.Thumb         (tv show thumb)
 ListItem.Property(*)   (see above)
 
+totals are available using the window properties listed above.
+
+Window(home).Property(NextAired.TodayDate)             (todays date)
+Window(home).Property(NextAired.%d.Date)               (date for the lists, eg 
NextAired.1.Date will show the date for monday)
 
 a list of available infolabels, related to the available add-on settings:
 Window(home).Property(TVGuide.ThumbType)               (thumb type selected by 
the user: 0=poster, 1=banner, 2=logo)
diff --git a/script.tv.show.next.aired/addon.xml 
b/script.tv.show.next.aired/addon.xml
index d734186..b80091e 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.0.1"
+       version="4.1.1"
        provider-name="Ppic, Frost, ronie, `Black">
   <requires>
     <import addon="xbmc.python" version="2.0"/>
diff --git a/script.tv.show.next.aired/changelog.txt 
b/script.tv.show.next.aired/changelog.txt
index d0fa7fe..7f20338 100644
--- a/script.tv.show.next.aired/changelog.txt
+++ b/script.tv.show.next.aired/changelog.txt
@@ -1,3 +1,19 @@
+v4.1.1
+- update readme
+
+v4.1.0
+- added canceled show info
+- added localization for date formats
+- added date properties for each weekday
+- updated tv guide showing only shows running in the current week
+- bugfixes
+
+v4.0.2
+- fixed issue when shows aires on multiple days
+- fixed issue when certain info is unavailable on tvrage
+- fixed issue where 16:9 showthumb would stick if no landscape.jpg was found
+- fixed TodayTotal would return empty
+
 v4.0.1
 - added readme for skinners
 
diff --git a/script.tv.show.next.aired/default.py 
b/script.tv.show.next.aired/default.py
index 3c7dce2..a8ee2f5 100644
--- a/script.tv.show.next.aired/default.py
+++ b/script.tv.show.next.aired/default.py
@@ -1,9 +1,12 @@
 import os, sys, re, time, socket, urllib
 from traceback import print_exc
-from datetime import date
-import xbmc, xbmcgui, xbmcaddon, xbmcvfs
+from datetime import datetime, date, timedelta, tzinfo
+from dateutil import tz
+from time import mktime
+import xbmc, xbmcgui, xbmcaddon, xbmcvfs, locale
 
 __addon__     = xbmcaddon.Addon()
+__settings__  = xbmcaddon.Addon( "script.tv.show.next.aired" )
 __addonid__   = __addon__.getAddonInfo('id')
 __addonname__ = __addon__.getAddonInfo('name')
 __cwd__       = __addon__.getAddonInfo('path')
@@ -16,6 +19,9 @@ DATA_PATH = os.path.join( xbmc.translatePath( 
"special://profile/addon_data/" ),
 RESOURCES_PATH = xbmc.translatePath( os.path.join( __cwd__, 'resources' ) )
 sys.path.append( os.path.join( RESOURCES_PATH, "lib" ) )
 
+# Does not work properly on OS X
+locale.setlocale(locale.LC_ALL, "")
+
 if not xbmcvfs.exists(DATA_PATH):
     xbmcvfs.mkdir(DATA_PATH)
 
@@ -52,15 +58,22 @@ class NextAired:
         footprints()
         self.WINDOW = xbmcgui.Window( 10000 )
         self.date = date.today()
+        self.datestr = str(self.date)
+        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._parse_argv()
+        if __settings__.getSetting( "AddonVersion" ) != __version__:
+            __settings__.setSetting ( id = "AddonVersion", value = "%s" % 
__version__ )
+            self.FORCEUPDATE = True
         if self.BACKEND:
             self.run_daemon()
         else:
             self.update_data()
-            if self.SILENT == "True":
-                self._set_alarm()
-            else:
+            if self.SILENT == "":
                 self.show_gui()
+            else:
+                self._set_alarm()
 
     def _parse_argv( self ):
         try:
@@ -69,24 +82,29 @@ class NextAired:
             params = {}
         log( "### params: %s" % params )
         self.SILENT = params.get( "silent", "" )
-        self.BACKEND = params.get("backend", False )
+        self.BACKEND = params.get( "backend", False )
+        self.FORCEUPDATE = params.get( "force", False ) or 
__settings__.getSetting("ForceUpdate") == "true"
 
     def update_data(self):
         self.nextlist = []
         dbfile = os.path.join( DATA_PATH , "next_aired.db" )
         if xbmcvfs.exists(dbfile):
-            if time.time() - os.path.getmtime(dbfile) > 86400:
-                log( "### db old more than 24h, rescanning..." )
+            if self.FORCEUPDATE:
+                log( "### scanning was previously canceled, rescanning..." )
+                __settings__.setSetting(id="ForceUpdate", value="false")
                 self.scan_info()
-            else : 
-                log( "### db less than 24, fetch local data..." )
+            elif time.time() - os.path.getmtime(dbfile) > 86400:
+                log( "### db more than 24h old, rescanning..." )
+                self.scan_info()
+            else: 
+                log( "### db less than 24h old, fetch local data..." )
                 self.current_show_data = self.get_list("next_aired.db")
                 if self.current_show_data == "[]":
                     self.scan_info()
         else:
             log( "### db doesn't exist, scanning for data..." )
             self.scan_info()
-        if self.current_show_data: 
+        if self.current_show_data:
             log( "### data available" )
             for show in self.current_show_data:
                 if show.get("Next Episode" , False):
@@ -105,11 +123,10 @@ class NextAired:
         socket.setdefaulttimeout(10)
         self.count = 0
         self.current_show_data = []
-        self.canceled = self.get_list("canceled.db")
+        self.canceled = []
         if not self.listing():
             self.close("error listing")
         self.total_show = len(self.TVlist)
-        log( "### canceled list: %s " % self.canceled )
         for show in self.TVlist:
             current_show = {}
             self.count += 1
@@ -117,6 +134,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" ) 
                     DIALOG_PROGRESS.close()
                     
xbmcgui.Dialog().ok(__language__(32103),__language__(32104))
                     break
@@ -125,15 +143,13 @@ class NextAired:
             current_show["path"] = show[1]
             current_show["thumbnail"] = show[2]
             current_show["fanart"] = show[3]
-            if show[0] in self.canceled:
-                log( "### %s canceled/Ended" % show[0] )
+            self.get_show_info( current_show )
+            self.update_show_datetime( current_show )
+            log( current_show )
+            if current_show.get("Status") == "Canceled/Ended":
+                self.canceled.append(current_show)
             else:
-                self.get_show_info( current_show )
-                log( current_show )
-                if current_show.get("Status") == "Canceled/Ended":
-                    self.canceled.append(current_show["localname"])
-                else:
-                    self.current_show_data.append(current_show)
+                self.current_show_data.append(current_show)
         self.save_file( self.canceled , "canceled.db")
         self.save_file( self.current_show_data , "next_aired.db")
         if self.SILENT == "":
@@ -142,10 +158,9 @@ class NextAired:
     def listing(self):
         json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": 
"VideoLibrary.GetTVShows", "params": {"properties": ["file", "thumbnail", 
"fanart"], "sort": { "method": "label" } }, "id": 1}')
         json_response = re.compile( "{(.*?)}", re.DOTALL ).findall(json_query)
-        log( json_response )
+        log("### %s" % json_response)
         self.TVlist = []
         for tvshowitem in json_response:
-            log( tvshowitem )
             findtvshowname = re.search( '"label": ?"(.*?)",["\n]', tvshowitem )
             if findtvshowname:
                 tvshowname = ( findtvshowname.group(1) )
@@ -170,7 +185,6 @@ class NextAired:
 
     def get_show_info( self , current_show ):
         log( "### get info %s" % current_show["localname"] )
-        # get info for show with exact name
         log( "### searching for %s" % current_show["localname"] )
         log( "### search url: 
http://services.tvrage.com/tools/quickinfo.php?show=%s"; % urllib.quote_plus( 
current_show["localname"] ) )
         result_info = get_html_source( 
"http://services.tvrage.com/tools/quickinfo.php?show=%s"; % urllib.quote_plus( 
current_show["localname"]))
@@ -178,18 +192,76 @@ class NextAired:
         result = re.findall("(?m)(.*)@(.*)", result_info)
         current_show["ep_img"] = current_show["thumbnail"]
         if result:
-            # get short tvshow info and next aired episode
             for item in result:
                 current_show[item[0].replace("<pre>" , "")] = item[1]
+                
+    def update_show_datetime(self, current_show):
+        nextdate = current_show.get( "RFC3339" , "" )
+        process = True
+        if len(nextdate) > 23:
+            try:
+                strdate, timezone = nextdate.rsplit( "-", 1 )
+                offset = -1
+            except:
+                log( "### error splitting next date (1)" )
+                process = False
+            if process == False or len(timezone) < 3 or len(timezone) > 6:
+                try:
+                    strdate, timezone = nextdate.rsplit( "+", 1 )
+                    offset = 1
+                except:
+                    log( "### error splitting next date (2)" )
+                    process = False
+        else:
+            process = False
+        if process == True:
+            try:
+                timezone = timezone.split( ":" )
+            except:
+                log( "### error splitting next date (2)" )
+            timeoffset = timedelta( hours = offset * int( timezone[0] ), 
minutes = offset * int ( timezone[1] ) )
+            date = datetime.fromtimestamp( mktime( time.strptime( strdate, 
'%Y-%m-%dT%H:%M:%S' ) ) )
+            date = date.replace(tzinfo=tz.tzoffset(None, ( offset * 3600 * 
int( timezone[0] ) ) + ( offset * 60 * int ( timezone[1] ) )))
+            log( '### nextdate %s' % date.isoformat() )
+            datelocal = date.astimezone(tz.tzlocal())
+            log( '### nextdate with local time zone %s' % 
datelocal.isoformat() )
+            current_show["RFC3339"] = datelocal.isoformat()
+            weekdaydiff = datelocal.weekday() - date.weekday()
+            try:
+                airday = current_show.get("Airtime").split(" at ")[0]
+            except:
+                airday = ""
+                log( "### error splitting airtime" )
+            if weekdaydiff != 0 and airday != "":
+                try:
+                    airdays = airday.split( " ," )
+                except:
+                    log( "### error splitting airtime" )
+                for count, day in enumerate (airdays):
+                    index = self.days.index(day)
+                    airdays[count] = self.days[index + weekdaydiff]
+                airday = ', '.join(airdays)
+            if self.ampm:
+                current_show["Airtime"] = airday + " at " + 
datelocal.strftime('%I:%M %p')
+            else:
+                current_show["Airtime"] = airday + " at " + 
datelocal.strftime('%H:%M')
+            try:
+                next = current_show.get("Next Episode").split("^")
+                next.extend(['',''])
+            except:
+                next = ['','','']
+            current_show["NextNumber"] = next[0]
+            current_show["NextTitle"] = next[1]
+            current_show["NextDate"] = datelocal.strftime('%x')
 
     def check_today_show(self):
         self.todayshow = 0
         self.todaylist = []
-        log( self.date )
+        log( self.datestr )
         for show in self.nextlist:
             log( "################" )
             log( "### %s" % show.get("localname") )
-            if show.get("RFC3339" , "" )[:10] == self.date:
+            if show.get("RFC3339" , "" )[:10] == self.datestr:
                 self.todayshow = self.todayshow + 1
                 self.todaylist.append(show.get("localname"))
                 log( "TODAY" )
@@ -226,24 +298,29 @@ class NextAired:
             log( "### ERROR could not save file %s" % DATA_PATH )
 
     def push_data(self):
-        self.WINDOW.setProperty("NextAired.Total" , str(len(self.nextlist)) )
-        self.WINDOW.setProperty("NextAired.TodayTotal" , str(self.todayshow) )
-        self.WINDOW.setProperty("NextAired.TodayShow" , 
str(self.todaylist).strip("[]") )
+        self.WINDOW.setProperty("NextAired.Total" , str(len(self.nextlist)))
+        self.WINDOW.setProperty("NextAired.TodayTotal" , str(self.todayshow))
+        self.WINDOW.setProperty("NextAired.TodayShow" , 
str(self.todaylist).strip("[]"))
+        for count in range(0, 7):
+            if count - self.weekday == 0:
+                self.WINDOW.setProperty("NextAired.TodayDate", 
self.date.strftime('%x'))
+                self.WINDOW.setProperty("NextAired.%d.Date" % ( count + 1 ), 
self.date.strftime('%x'))
+            elif count - self.weekday > 0:
+                self.WINDOW.setProperty("NextAired.%d.Date" % ( count + 1 ), ( 
self.date + timedelta( days = ( count - self.weekday ) ) ).strftime('%x'))
+            else:
+                self.WINDOW.setProperty("NextAired.%d.Date" % ( count + 1 ), ( 
self.date + timedelta( days = ( ( 7 - self.weekday ) + count ) ) 
).strftime('%x'))        
         # DEPRECATED
         for count in range( len(self.nextlist) ):
             self.WINDOW.clearProperty("NextAired.%d.ShowTitle" % ( count + 1, 
))
         for count, current_show in enumerate( self.nextlist ):
             self.WINDOW.setProperty("NextAired.%d.Today" % ( count + 1, ), 
current_show.get( "Today" , "False"))
             self.WINDOW.setProperty("NextAired.%d.ShowTitle" % ( count + 1, ), 
current_show.get( "localname", ""))
-            try:
-                next = current_show.get("Next Episode","").split("^")
-                self.WINDOW.setProperty("NextAired.%d.NextDate" % ( count + 1, 
), next[2] or "")
-                self.WINDOW.setProperty("NextAired.%d.NextTitle" % ( count + 
1, ), next[1] or "")
-                self.WINDOW.setProperty("NextAired.%d.NextNumber" % ( count + 
1, ), next[0] or "")
-            except:
-                print_exc()
+            self.WINDOW.setProperty("NextAired.%d.NextDate" % ( count + 1, ), 
current_show.get( "NextDate", ""))
+            self.WINDOW.setProperty("NextAired.%d.NextTitle" % ( count + 1, ), 
current_show.get( "NextTitle", ""))
+            self.WINDOW.setProperty("NextAired.%d.NextNumber" % ( count + 1, 
), current_show.get( "NextNumber", ""))
             try:
                 latest = current_show.get("Latest Episode","").split("^")
+                latest.extend(['',''])
                 self.WINDOW.setProperty("NextAired.%d.LatestDate" % ( count + 
1, ), latest[2] or "")
                 self.WINDOW.setProperty("NextAired.%d.LatestTitle" % ( count + 
1, ), latest[1] or "")
                 self.WINDOW.setProperty("NextAired.%d.LatestNumber" % ( count 
+ 1, ), latest[0] or "")
@@ -274,22 +351,23 @@ class NextAired:
 
     def _set_alarm( self ):
         log( "### Alarm enabled" )
-        command = "XBMC.RunScript(%s,silent=True&alarm=1200)" % ( 
os.path.join( __cwd__, __file__ ) )
+        command = "XBMC.RunScript(%s,silent=True)" % ( os.path.join( __cwd__, 
__file__ ) )
         xbmc.executebuiltin( "AlarmClock(NextAired,%s,1200,true)" % command )
 
     def run_daemon(self):
         self._stop = False
         self.previousitem = ''
-        self.current_show_data = self.get_list("next_aired.db")
-        if self.current_show_data == "[]":
+        self.complete_show_data = self.get_list("next_aired.db")
+               self.complete_show_data.extend(self.get_list("canceled.db"))
+        if self.complete_show_data == "[]":
             self._stop = True
         while not self._stop:
             self.selecteditem = xbmc.getInfoLabel("ListItem.TVShowTitle")
             if self.selecteditem != self.previousitem:
                 self.WINDOW.clearProperty("NextAired.Label")
                 self.previousitem = self.selecteditem
-                for item in self.current_show_data:
-                    if self.selecteditem == item.get("localname", "") and 
item.get("Next Episode" , False):
+                for item in self.complete_show_data:
+                    if self.selecteditem == item.get("localname", ""):
                         self.set_labels('windowproperty', item)
                         break
             xbmc.sleep(100)
@@ -319,32 +397,24 @@ class NextAired:
         label.setProperty(prefix + "Country", item.get("Country", ""))
         label.setProperty(prefix + "Runtime", item.get("Runtime", ""))
         label.setProperty(prefix + "Fanart", item.get("fanart", ""))
-        if item.get("RFC3339" , "" )[:10] == self.date:
+        if item.get("RFC3339" , "" )[:10] == self.datestr:
             label.setProperty(prefix + "Today", "True")
         else:
             label.setProperty(prefix + "Today", "False")
-        try:
-            next = item.get("Next Episode","").split("^")
-            label.setProperty(prefix + "NextDate", next[2] or "")
-            label.setProperty(prefix + "NextTitle", next[1] or "")
-            label.setProperty(prefix + "NextNumber", next[0] or "")
-        except:
-            print_exc()
-        try:
-            latest = item.get("Latest Episode","").split("^")
-            label.setProperty(prefix + "LatestDate", latest[2] or "")
-            label.setProperty(prefix + "LatestTitle", latest[1] or "")
-            label.setProperty(prefix + "LatestNumber", latest[0] or "")
-        except:
-            print_exc()
-        try:
-            airday, shorttime = item.get("Airtime", "  at  ").split(" at ")
-            label.setProperty(prefix + "AirDay", airday)
-            label.setProperty(prefix + "ShortTime", shorttime)
-        except:
-            log( "### %s" % item.get("Airtime", "  at  "))
+        label.setProperty(prefix + "NextDate", item.get("NextDate", ""))
+        label.setProperty(prefix + "NextTitle", item.get("NextTitle", ""))
+        label.setProperty(prefix + "NextNumber", item.get("NextNumber", ""))
+        latest = item.get("Latest Episode","").split("^")
+        latest.extend(['',''])
+        label.setProperty(prefix + "LatestDate", latest[2])
+        label.setProperty(prefix + "LatestTitle", latest[1])
+        label.setProperty(prefix + "LatestNumber", latest[0])
+        daytime = item.get("Airtime","").split(" at ")
+        daytime.extend([''])
+        label.setProperty(prefix + "AirDay", daytime[0])
+        label.setProperty(prefix + "ShortTime", daytime[1])
         if return_items:
-            return label, airday
+            return label
 
     def close(self , msg ):
         log( "### %s" % msg )
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 b6f0360..ef5cf08 100644
--- a/script.tv.show.next.aired/resources/language/English/strings.xml
+++ b/script.tv.show.next.aired/resources/language/English/strings.xml
@@ -11,6 +11,7 @@
        <string id="45003">Download logos (Logo Downloader required)</string>
        <string id="45004">Enable background fanart</string>
        <string id="45005">Enable 16:9 preview thumbs</string>
-       <string id="45006">Download 16:9 preview thumbs (Logo Downloader 
required)</string>
+    <string id="45006">Download 16:9 preview thumbs (Logo Downloader 
required)</string>
+    <string id="45007">Rescan tv guide data</string>
 </strings>
 
diff --git a/script.tv.show.next.aired/resources/language/German/strings.xml 
b/script.tv.show.next.aired/resources/language/German/strings.xml
index 2f9dd0b..104cf63 100644
--- a/script.tv.show.next.aired/resources/language/German/strings.xml
+++ b/script.tv.show.next.aired/resources/language/German/strings.xml
@@ -12,5 +12,6 @@
        <string id="45004">Hintergrund Fanart aktivieren</string>
        <string id="45005">16:9 Vorschaubiler aktivieren</string>
        <string id="45006">16:9 Vorschaubilder herunterladen (Logo Downloader 
erforderlich)</string>
+       <string id="45007">TV Guide Daten neu laden</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 2210c19..c72347f 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
@@ -1,10 +1,14 @@
-from datetime import date
 from traceback import print_exc
-import xbmc, xbmcgui, xbmcaddon
+from time import mktime
+from datetime import date
+import xbmc, xbmcgui, xbmcaddon, time
 
 __addon__ = xbmcaddon.Addon()
 __cwd__ = __addon__.getAddonInfo('path')
 
+def log(msg):
+    xbmc.log( str( msg ),level=xbmc.LOGDEBUG )
+
 class Gui( xbmcgui.WindowXML ):
     def __init__(self, *args, **kwargs):
         xbmcgui.WindowXML.__init__( self )
@@ -25,18 +29,41 @@ class Gui( xbmcgui.WindowXML ):
         self.settingsOpen = False
         self.listitems = 
{'Monday':[],'Tuesday':[],'Wednesday':[],'Thursday':[],'Friday':[],'Saturday':[],'Sunday':[]}
         self.days = 
['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday']
-        self.weekday = date.today().weekday()
+        self.today = date.today()
+        self.weekday = self.today.weekday()
         self.dayname = self.days[self.weekday]
         self.set_properties()
         self.fill_containers()
         self.set_focus()
-
+                    
     def set_properties(self):
         for item in self.nextlist:
-            listitem, airday = self.setLabels('listitem', item, True)
-            airdays = airday.split(', ')
+            try:
+                airdays = item.get("Airtime").split(" at ")[0].split(', ')
+            except:
+                continue
             for day in airdays:
-                self.listitems[day].append(listitem)
+                listitem = self.setLabels('listitem', item, True)
+                nextdate = item.get("RFC3339" , "" )[:10]
+                if len(nextdate) == 10:
+                    if self.is_in_current_week(nextdate):
+                        self.listitems[day].append(listitem)
+                else:
+                    nextdate = listitem.getProperty('NextDate')
+                    if len(nextdate) == 11:
+                        if self.is_in_current_week(nextdate, True):
+                            self.listitems[day].append(listitem)
+                
+    def is_in_current_week(self, strdate, alt = False):
+        if alt:
+            showdate = date.fromtimestamp( mktime( time.strptime( strdate, 
'%b/%d/%Y' ) ) )
+        else:
+            showdate = date.fromtimestamp( mktime( time.strptime( strdate, 
'%Y-%m-%d' ) ) )
+        weekrange = int( ( showdate - self.today ).days )
+        if weekrange >= 0 and weekrange <= 6:
+            return True
+        else:
+            return False
 
     def fill_containers(self):
         for count, day in enumerate (self.days):
@@ -52,7 +79,7 @@ class Gui( xbmcgui.WindowXML ):
                     dayFound = True
                     break
             if dayFound == False:
-                self.setFocus( self.getControl( 9000 ) )
+                self.setFocus( self.getControl( 8 ) )
         else:
             self.setFocus( self.getControl( 200 + self.weekday ) )
 
diff --git a/script.tv.show.next.aired/resources/settings.xml 
b/script.tv.show.next.aired/resources/settings.xml
index 3d95a29..6db4e56 100644
--- a/script.tv.show.next.aired/resources/settings.xml
+++ b/script.tv.show.next.aired/resources/settings.xml
@@ -1,5 +1,6 @@
 <?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.logo-downloader,mode=bulk,clearart=False,logo=False,showthumb=False,poster=False,banner=banner.jpg)"
 visible="gt(-1,0) + lt(-1,2)" />
diff --git 
a/script.tv.show.next.aired/resources/skins/Default/720p/script-NextAired-TVGuide.xml
 
b/script.tv.show.next.aired/resources/skins/Default/720p/script-NextAired-TVGuide.xml
index 11ff288..e5f7e9f 100644
--- 
a/script.tv.show.next.aired/resources/skins/Default/720p/script-NextAired-TVGuide.xml
+++ 
b/script.tv.show.next.aired/resources/skins/Default/720p/script-NextAired-TVGuide.xml
@@ -29,6 +29,7 @@
                                        <aspectratio>scale</aspectratio>
                                        <texture 
background="true">$INFO[Container(200).ListItem.Property(Fanart)]</texture>
                                        <visible>Control.HasFocus(200) | 
!IsEmpty(Window(Home).property(TVGuide.MondayList))</visible>
+                                       <fadetime>600</fadetime>
                                        <animation effect="fade" 
time="600">Visible</animation>
                                        <animation effect="fade" 
time="600">Hidden</animation>
                                </control>
@@ -40,6 +41,7 @@
                                        <aspectratio>scale</aspectratio>
                                        <texture 
background="true">$INFO[Container(201).ListItem.Property(Fanart)]</texture>
                                        <visible>Control.HasFocus(201) | 
!IsEmpty(Window(Home).property(TVGuide.TuesdayList))</visible>
+                                       <fadetime>600</fadetime>
                                        <animation effect="fade" 
time="600">Visible</animation>
                                        <animation effect="fade" 
time="600">Hidden</animation>
                                </control>
@@ -51,6 +53,7 @@
                                        <aspectratio>scale</aspectratio>
                                        <texture 
background="true">$INFO[Container(202).ListItem.Property(Fanart)]</texture>
                                        <visible>Control.HasFocus(202) | 
!IsEmpty(Window(Home).property(TVGuide.WednesdayList))</visible>
+                                       <fadetime>600</fadetime>
                                        <animation effect="fade" 
time="600">Visible</animation>
                                        <animation effect="fade" 
time="600">Hidden</animation>
                                </control>
@@ -62,6 +65,7 @@
                                        <aspectratio>scale</aspectratio>
                                        <texture 
background="true">$INFO[Container(203).ListItem.Property(Fanart)]</texture>
                                        <visible>Control.HasFocus(203) | 
!IsEmpty(Window(Home).property(TVGuide.ThursdayList))</visible>
+                                       <fadetime>600</fadetime>
                                        <animation effect="fade" 
time="600">Visible</animation>
                                        <animation effect="fade" 
time="600">Hidden</animation>
                                </control>
@@ -73,6 +77,7 @@
                                        <aspectratio>scale</aspectratio>
                                        <texture 
background="true">$INFO[Container(204).ListItem.Property(Fanart)]</texture>
                                        <visible>Control.HasFocus(204) | 
!IsEmpty(Window(Home).property(TVGuide.FridayList))</visible>
+                                       <fadetime>600</fadetime>
                                        <animation effect="fade" 
time="600">Visible</animation>
                                        <animation effect="fade" 
time="600">Hidden</animation>
                                </control>
@@ -95,6 +100,7 @@
                                        <aspectratio>scale</aspectratio>
                                        <texture 
background="true">$INFO[Container(206).ListItem.Property(Fanart)]</texture>
                                        <visible>Control.HasFocus(206) | 
!IsEmpty(Window(Home).property(TVGuide.SundayList))</visible>
+                                       <fadetime>600</fadetime>
                                        <animation effect="fade" 
time="600">Visible</animation>
                                        <animation effect="fade" 
time="600">Hidden</animation>
                                </control>
@@ -1414,6 +1420,7 @@
                                        <width>302</width>
                                        <height>170</height>
                                        <aspectratio>stretch</aspectratio>
+                                       <fadetime>600</fadetime>
                                        <texture 
background="true">$INFO[Container(200).ListItem.Property(Fanart)]</texture>
                                        <visible>![Control.IsVisible(2001) + 
!stringcompare(Control.GetLabel(2001),empty.png)]</visible>
                                </control>
@@ -1423,6 +1430,7 @@
                                        <width>302</width>
                                        <height>170</height>
                                        <aspectratio>stretch</aspectratio>
+                                       <fadetime>600</fadetime>
                                        <texture background="true" 
fallback="empty.png">$INFO[Container(200).ListItem.Property(Path),,landscape.jpg]</texture>
                                        
<visible>!IsEmpty(Window(Home).Property(TVGuide.PreviewThumbs))</visible>
                                </control>
@@ -1519,6 +1527,7 @@
                                        <width>302</width>
                                        <height>170</height>
                                        <aspectratio>stretch</aspectratio>
+                                       <fadetime>600</fadetime>
                                        <texture 
background="true">$INFO[Container(201).ListItem.Property(Fanart)]</texture>
                                        <visible>![Control.IsVisible(2011) + 
!stringcompare(Control.GetLabel(2011),empty.png)]</visible>
                                </control>
@@ -1528,6 +1537,7 @@
                                        <width>302</width>
                                        <height>170</height>
                                        <aspectratio>stretch</aspectratio>
+                                       <fadetime>600</fadetime>
                                        <texture background="true" 
fallback="empty.png">$INFO[Container(201).ListItem.Property(Path),,landscape.jpg]</texture>
                                        
<visible>!IsEmpty(Window(Home).Property(TVGuide.PreviewThumbs))</visible>
                                </control>
@@ -1624,6 +1634,7 @@
                                        <width>302</width>
                                        <height>170</height>
                                        <aspectratio>stretch</aspectratio>
+                                       <fadetime>600</fadetime>
                                        <texture 
background="true">$INFO[Container(202).ListItem.Property(Fanart)]</texture>
                                        <visible>![Control.IsVisible(2021) + 
!stringcompare(Control.GetLabel(2021),empty.png)]</visible>
                                </control>
@@ -1633,6 +1644,7 @@
                                        <width>302</width>
                                        <height>170</height>
                                        <aspectratio>stretch</aspectratio>
+                                       <fadetime>600</fadetime>
                                        <texture background="true" 
fallback="empty.png">$INFO[Container(202).ListItem.Property(Path),,landscape.jpg]</texture>
                                        
<visible>!IsEmpty(Window(Home).Property(TVGuide.PreviewThumbs))</visible>
                                </control>
@@ -1730,6 +1742,7 @@
                                        <height>170</height>
                                        <aspectratio>stretch</aspectratio>
                                        <texture 
background="true">$INFO[Container(203).ListItem.Property(Fanart)]</texture>
+                                       <fadetime>600</fadetime>
                                        <visible>![Control.IsVisible(2031) + 
!stringcompare(Control.GetLabel(2031),empty.png)]</visible>
                                </control>
                                <control type="image" id="2031">
@@ -1738,6 +1751,7 @@
                                        <width>302</width>
                                        <height>170</height>
                                        <aspectratio>stretch</aspectratio>
+                                       <fadetime>600</fadetime>
                                        <texture background="true" 
fallback="empty.png">$INFO[Container(203).ListItem.Property(Path),,landscape.jpg]</texture>
                                        
<visible>!IsEmpty(Window(Home).Property(TVGuide.PreviewThumbs))</visible>
                                </control>
@@ -1834,6 +1848,7 @@
                                        <width>302</width>
                                        <height>170</height>
                                        <aspectratio>stretch</aspectratio>
+                                       <fadetime>600</fadetime>
                                        <texture 
background="true">$INFO[Container(204).ListItem.Property(Fanart)]</texture>
                                        <visible>![Control.IsVisible(2041) + 
!stringcompare(Control.GetLabel(2041),empty.png)]</visible>
                                </control>
@@ -1843,6 +1858,7 @@
                                        <width>302</width>
                                        <height>170</height>
                                        <aspectratio>stretch</aspectratio>
+                                       <fadetime>600</fadetime>
                                        <texture background="true" 
fallback="empty.png">$INFO[Container(204).ListItem.Property(Path),,landscape.jpg]</texture>
                                        
<visible>!IsEmpty(Window(Home).Property(TVGuide.PreviewThumbs))</visible>
                                </control>
@@ -1939,6 +1955,7 @@
                                        <width>302</width>
                                        <height>170</height>
                                        <aspectratio>stretch</aspectratio>
+                                       <fadetime>600</fadetime>
                                        <texture 
background="true">$INFO[Container(205).ListItem.Property(Fanart)]</texture>
                                        <visible>![Control.IsVisible(2051) + 
!stringcompare(Control.GetLabel(2051),empty.png)]</visible>
                                </control>
@@ -1948,6 +1965,7 @@
                                        <width>302</width>
                                        <height>170</height>
                                        <aspectratio>stretch</aspectratio>
+                                       <fadetime>600</fadetime>
                                        <texture background="true" 
fallback="empty.png">$INFO[Container(205).ListItem.Property(Path),,landscape.jpg]</texture>
                                        
<visible>!IsEmpty(Window(Home).Property(TVGuide.PreviewThumbs))</visible>
                                </control>
@@ -2044,6 +2062,7 @@
                                        <width>302</width>
                                        <height>170</height>
                                        <aspectratio>stretch</aspectratio>
+                                       <fadetime>600</fadetime>
                                        <texture 
background="true">$INFO[Container(206).ListItem.Property(Fanart)]</texture>
                                        <visible>![Control.IsVisible(2061) + 
!stringcompare(Control.GetLabel(2021),empty.png)]</visible>
                                </control>
@@ -2053,6 +2072,7 @@
                                        <width>302</width>
                                        <height>170</height>
                                        <aspectratio>stretch</aspectratio>
+                                       <fadetime>600</fadetime>
                                        <texture background="true" 
fallback="empty.png">$INFO[Container(206).ListItem.Property(Path),,landscape.jpg]</texture>
                                        
<visible>!IsEmpty(Window(Home).Property(TVGuide.PreviewThumbs))</visible>
                                </control>

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

Summary of changes:
 script.tv.show.next.aired/README.txt               |    8 +-
 script.tv.show.next.aired/addon.xml                |    2 +-
 script.tv.show.next.aired/changelog.txt            |   16 +
 script.tv.show.next.aired/dateutil/__init__.py     |    9 +
 script.tv.show.next.aired/dateutil/easter.py       |   92 ++
 script.tv.show.next.aired/dateutil/parser.py       |  886 ++++++++++++++++
 .../dateutil/relativedelta.py                      |  432 ++++++++
 script.tv.show.next.aired/dateutil/rrule.py        | 1097 ++++++++++++++++++++
 script.tv.show.next.aired/dateutil/tz.py           |  951 +++++++++++++++++
 script.tv.show.next.aired/dateutil/tzwin.py        |  180 ++++
 .../dateutil/zoneinfo/__init__.py                  |   87 ++
 .../dateutil/zoneinfo/zoneinfo-2010g.tar.gz        |  Bin 0 -> 171995 bytes
 script.tv.show.next.aired/default.py               |  198 +++--
 .../resources/language/English/strings.xml         |    3 +-
 .../resources/language/German/strings.xml          |    1 +
 .../resources/lib/next_aired_dialog.py             |   43 +-
 script.tv.show.next.aired/resources/settings.xml   |    1 +
 .../Default/720p/script-NextAired-TVGuide.xml      |   20 +
 .../resources/skins/Default/media/empty.png        |  Bin 2822 -> 2787 bytes
 19 files changed, 3950 insertions(+), 76 deletions(-)
 create mode 100644 script.tv.show.next.aired/dateutil/__init__.py
 create mode 100644 script.tv.show.next.aired/dateutil/easter.py
 create mode 100644 script.tv.show.next.aired/dateutil/parser.py
 create mode 100644 script.tv.show.next.aired/dateutil/relativedelta.py
 create mode 100644 script.tv.show.next.aired/dateutil/rrule.py
 create mode 100644 script.tv.show.next.aired/dateutil/tz.py
 create mode 100644 script.tv.show.next.aired/dateutil/tzwin.py
 create mode 100644 script.tv.show.next.aired/dateutil/zoneinfo/__init__.py
 create mode 100644 
script.tv.show.next.aired/dateutil/zoneinfo/zoneinfo-2010g.tar.gz
 copy 
script.gmail.checker/resources/skins/Default/media/default-list-nofocus.png => 
script.tv.show.next.aired/resources/skins/Default/media/empty.png (93%)


hooks/post-receive
-- 
Scripts

------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to