Author: duncan
Date: Fri Dec 21 06:18:32 2007
New Revision: 10230

Log:
Run through reindent.py


Modified:
   branches/rel-1-7/freevo/src/audio/plugins/mplayervis.py
   branches/rel-1-7/freevo/src/video/plugins/cinemovies_trailers.py
   branches/rel-1-7/freevo/src/video/plugins/moviecovers.py
   branches/rel-1/freevo/src/audio/plugins/mplayervis.py
   branches/rel-1/freevo/src/osd.py
   branches/rel-1/freevo/src/skin/models.py
   branches/rel-1/freevo/src/skins/main/info_area.py
   branches/rel-1/freevo/src/tv/programitem.py
   branches/rel-1/freevo/src/video/plugins/cinemovies_trailers.py
   branches/rel-1/freevo/src/video/plugins/moviecovers.py
   branches/rel-1/freevo/src/www/web_types.py
   branches/rel-1/testing/Duncan/pygoom-2k4/setup.py

Modified: branches/rel-1-7/freevo/src/audio/plugins/mplayervis.py
==============================================================================
--- branches/rel-1-7/freevo/src/audio/plugins/mplayervis.py     (original)
+++ branches/rel-1-7/freevo/src/audio/plugins/mplayervis.py     Fri Dec 21 
06:18:32 2007
@@ -6,7 +6,7 @@
 # $Id$
 #
 # Notes: - I'm no fan of all the skin.clear() being done :(
-# Todo:  - 
+# Todo:  -
 #
 # -----------------------------------------------------------------------
 # Freevo - A Home Theater PC framework

Modified: branches/rel-1-7/freevo/src/video/plugins/cinemovies_trailers.py
==============================================================================
--- branches/rel-1-7/freevo/src/video/plugins/cinemovies_trailers.py    
(original)
+++ branches/rel-1-7/freevo/src/video/plugins/cinemovies_trailers.py    Fri Dec 
21 06:18:32 2007
@@ -5,7 +5,7 @@
 #
 # Revision 0.3  -  Author Sylvain Fabre
 #
-# Notes: This code is still beta 
+# Notes: This code is still beta
 #
 #        Add "plugin.activate('video.ccinemovies_trailers')" in local_conf.py
 #        to activate it
@@ -70,12 +70,12 @@
         return [ (self.make_menu_week, 'Titres de films') ]
 
     def make_menu_week(self, arg=None, menuw=None):
-      items = generate_common_menu(self, "Recuperation des bandes annonces", 
"calendrier_fr-1-")
-      menuw.pushmenu(menu.Menu(_('Bandes annonces disponibles'), items))
+        items = generate_common_menu(self, "Recuperation des bandes annonces", 
"calendrier_fr-1-")
+        menuw.pushmenu(menu.Menu(_('Bandes annonces disponibles'), items))
 
     def play_video(self, arg=None, menuw=None):
-      items = generate_common_stream_list(self, arg[1] )
-      menuw.pushmenu(menu.Menu(arg[0], items))
+        items = generate_common_stream_list(self, arg[1] )
+        menuw.pushmenu(menu.Menu(arg[0], items))
 
 class DVDTrailers(Item):
     def __init__(self, parent):
@@ -87,13 +87,13 @@
         return [ (self.make_menu_week, 'Titres DVD') ]
 
     def make_menu_week(self, arg=None, menuw=None):
-      items = generate_common_menu(self, "Recuperation des bandes annonces 
DVD", "calendrier_dvd-8-")
-      menuw.pushmenu(menu.Menu(_('Bandes annonces DVD disponibles'), items))
+        items = generate_common_menu(self, "Recuperation des bandes annonces 
DVD", "calendrier_dvd-8-")
+        menuw.pushmenu(menu.Menu(_('Bandes annonces DVD disponibles'), items))
 
     def play_video(self, arg=None, menuw=None):
-      items = generate_common_stream_list(self, arg[1] )
-      menuw.pushmenu(menu.Menu(arg[0], items))
-      
+        items = generate_common_stream_list(self, arg[1] )
+        menuw.pushmenu(menu.Menu(arg[0], items))
+
 # headers for urllib2
 txdata = None
 txheaders = {
@@ -103,164 +103,162 @@
 
 #Generate a menu, whatever we are searching for DVD or movies
 def generate_common_menu(parent, title_box, page_prefix):
-  items = []
+    items = []
 
-  #Start grabbing from DVD/Movies of last week
-  current = datetime.date.today() - datetime.timedelta(days=7)
-  for week in [0, 1, 2, 3, 4, 5, 6]:
+    #Start grabbing from DVD/Movies of last week
+    current = datetime.date.today() - datetime.timedelta(days=7)
+    for week in [0, 1, 2, 3, 4, 5, 6]:
     # Compute a new date for the week
-    newdate = current + datetime.timedelta(days=(week*7))
-    # Show some progress
-    box = PopupBox(text=_(title_box+'\nSemaine du 
'+newdate.strftime("%d/%m/%Y")))
-    box.show()
-
-    filehtml = page_prefix + newdate.strftime("%Y") + \
-              newdate.strftime("%m") + newdate.strftime("%d") + ".html"
-    #print "URL to fetch : %s" % filehtml
-    trailers = get_movie_list_week(CAC_URL + filehtml)
-    for title, idfilm in trailers:
-      items.append(menu.MenuItem('%s' % (title + " (" + 
newdate.strftime("%d/%m/%Y") + ")"),
-                                       parent.play_video, (title, idfilm) ) )
-    box.destroy()
+        newdate = current + datetime.timedelta(days=(week*7))
+        # Show some progress
+        box = PopupBox(text=_(title_box+'\nSemaine du 
'+newdate.strftime("%d/%m/%Y")))
+        box.show()
+
+        filehtml = page_prefix + newdate.strftime("%Y") + \
+                  newdate.strftime("%m") + newdate.strftime("%d") + ".html"
+        #print "URL to fetch : %s" % filehtml
+        trailers = get_movie_list_week(CAC_URL + filehtml)
+        for title, idfilm in trailers:
+            items.append(menu.MenuItem('%s' % (title + " (" + 
newdate.strftime("%d/%m/%Y") + ")"),
+                                             parent.play_video, (title, 
idfilm) ) )
+        box.destroy()
 
-  return items
+    return items
 
 # Generate the list of streams of a specific movie
 def generate_common_stream_list( object, idfilm ):
-  items = []
-      
-  box = PopupBox(text=_('Recuperation des types de bande annonces 
disponibles'))
-  box.show()
-      
-  streamlist = get_movie_sheet( idfilm )
-  if streamlist:
-    for title, streamurl in streamlist:
-      items.append(TrailerVideoItem(title, streamurl, object))
-  else:
-    items.append( menu.MenuItem('Pas de bande annonce dispo', None, None) )
-        
-  box.destroy()
-  return items
-    
+    items = []
+
+    box = PopupBox(text=_('Recuperation des types de bande annonces 
disponibles'))
+    box.show()
+
+    streamlist = get_movie_sheet( idfilm )
+    if streamlist:
+        for title, streamurl in streamlist:
+            items.append(TrailerVideoItem(title, streamurl, object))
+    else:
+        items.append( menu.MenuItem('Pas de bande annonce dispo', None, None) )
+
+    box.destroy()
+    return items
+
 # Parse the 'player.php' file to get the stream URL
-def get_stream_url(idfilm, idba):  
-  # Get the URL
-  url = CAC_URL + "players/video.php?IDfilm=" + idfilm + "&IDBA=" + idba
-  req = urllib2.Request(url, txdata, txheaders)
-  try:
-    response = urllib2.urlopen(req)
-  except urllib2.HTTPError, error:
-    exit
-  
-  # Build the soup tree
-  links = SoupStrainer('script')
-  soup  = BeautifulSoup( response.read(), parseOnlyThese=links )
-  re_QT = re.compile('^QT_WriteOBJECT_XHTML\(\'(.*?)\',.*')
-  re_RM = re.compile('.*AC_RunRealContentX\(.*, \"SRC\", \"(.*?)\"\);')
-  re_WM = re.compile('.*name=\"filename\" value=\"(.*?)\".*')
-  
-  # Get the list of javascript tags to the streams
-  scriptlist = soup.findAll("script")
-  for script in scriptlist:
-    if script.string:
-      httpstr = re_QT.search(script.string)
-      if httpstr:
-        return httpstr.group(1)
-      else:
-        httpstr = re_RM.search(script.string)
-        if httpstr:
-          return httpstr.group(1)
-        else:
-          httpstr = re_WM.search(script.string)
-          if httpstr:
-            return  httpstr.group(1)
-  
-  return None
-    
+def get_stream_url(idfilm, idba):
+    # Get the URL
+    url = CAC_URL + "players/video.php?IDfilm=" + idfilm + "&IDBA=" + idba
+    req = urllib2.Request(url, txdata, txheaders)
+    try:
+        response = urllib2.urlopen(req)
+    except urllib2.HTTPError, error:
+        exit
+
+    # Build the soup tree
+    links = SoupStrainer('script')
+    soup  = BeautifulSoup( response.read(), parseOnlyThese=links )
+    re_QT = re.compile('^QT_WriteOBJECT_XHTML\(\'(.*?)\',.*')
+    re_RM = re.compile('.*AC_RunRealContentX\(.*, \"SRC\", \"(.*?)\"\);')
+    re_WM = re.compile('.*name=\"filename\" value=\"(.*?)\".*')
+
+    # Get the list of javascript tags to the streams
+    scriptlist = soup.findAll("script")
+    for script in scriptlist:
+        if script.string:
+            httpstr = re_QT.search(script.string)
+            if httpstr:
+                return httpstr.group(1)
+            else:
+                httpstr = re_RM.search(script.string)
+                if httpstr:
+                    return httpstr.group(1)
+                else:
+                    httpstr = re_WM.search(script.string)
+                    if httpstr:
+                        return  httpstr.group(1)
+
+    return None
+
 # Parse the 'fiche_multimedia' file to get the player URL
 def get_movie_sheet(idfilm):
-  # Get the URL
-  url = CAC_URL + 'fiche_multimedia.php?IDfilm=' + idfilm
-  req = urllib2.Request(url, txdata, txheaders)
-  try:
-    response = urllib2.urlopen(req)
-  except urllib2.HTTPError, error:
-    exit
-  
-  # Build the soup tree
-  links = SoupStrainer('td')
-  soup  = BeautifulSoup(response.read(), parseOnlyThese=links )
-  re_idba = re.compile('.*IDBA=([0-9]*).*', re.I)
-  re_res  = re.compile('haute r.*', re.I)
-  streams = []
-  
-  # Find the kind of trailer that are listed below
-  tdlist = soup.findAll("td", {"class" : ['arial8black', 
'tail_disclaimer_grey8point', 'arial9black3'] } )
-  title_part1 = "Bande annonce"
-  title_type  = "(Type de video inconnu)"
-  for td in tdlist:
-    # We have found the type of BA and the type of streams
-    if td['class'] == 'arial8black':
-      if td.a:
-        if td.a.string:
-          if re_res.search(td.a.string):
-            idba = re_idba.search(td.a['href'])
-            if idba:
-              streamurl = get_stream_url( idfilm, idba.group(1) )
-              streams += [ (title_part1 + " " + title_type, streamurl) ]
-              #print title_part1 + " " + title_type
-    # We have found the type of BA, search for the type of streams
-    if td['class'] == 'tail_disclaimer_grey8point':
-      if td.p:
-        if td.p.img:
-          if td.p.img['src'] == "images/data/ba/quicktime_ico.gif":
-            title_type = "(Quicktime)"
-          if td.p.img['src'] == "images/v2/div/player/real2.gif":
-            title_type = "(Real Media)"
-          if td.p.img['src'] == "images/data/ba/wmp_ico.gif":
-            title_type = "(Windows Media)"
-    # We are searching eventually a new type of BA
-    if td['class'] == 'arial9black3':
-      if td.b:
-        if td.b.string == "Bande annonce vf":
-          title_part1 = "Bande annonce VF"
-        if td.b.string == "Bande annonce vost":
-          title_part1 = "Bande annonce VOST"
-        if td.b.string == "Teaser vf":
-          title_part1 = "Teaser VF"
-        if td.b.string == "Teaser vost":
-          title_part1 = "Teaser VOST"
-      
-  return streams
-    
+    # Get the URL
+    url = CAC_URL + 'fiche_multimedia.php?IDfilm=' + idfilm
+    req = urllib2.Request(url, txdata, txheaders)
+    try:
+        response = urllib2.urlopen(req)
+    except urllib2.HTTPError, error:
+        exit
+
+    # Build the soup tree
+    links = SoupStrainer('td')
+    soup  = BeautifulSoup(response.read(), parseOnlyThese=links )
+    re_idba = re.compile('.*IDBA=([0-9]*).*', re.I)
+    re_res  = re.compile('haute r.*', re.I)
+    streams = []
+
+    # Find the kind of trailer that are listed below
+    tdlist = soup.findAll("td", {"class" : ['arial8black', 
'tail_disclaimer_grey8point', 'arial9black3'] } )
+    title_part1 = "Bande annonce"
+    title_type  = "(Type de video inconnu)"
+    for td in tdlist:
+        # We have found the type of BA and the type of streams
+        if td['class'] == 'arial8black':
+            if td.a:
+                if td.a.string:
+                    if re_res.search(td.a.string):
+                        idba = re_idba.search(td.a['href'])
+                        if idba:
+                            streamurl = get_stream_url( idfilm, idba.group(1) )
+                            streams += [ (title_part1 + " " + title_type, 
streamurl) ]
+                            #print title_part1 + " " + title_type
+        # We have found the type of BA, search for the type of streams
+        if td['class'] == 'tail_disclaimer_grey8point':
+            if td.p:
+                if td.p.img:
+                    if td.p.img['src'] == "images/data/ba/quicktime_ico.gif":
+                        title_type = "(Quicktime)"
+                    if td.p.img['src'] == "images/v2/div/player/real2.gif":
+                        title_type = "(Real Media)"
+                    if td.p.img['src'] == "images/data/ba/wmp_ico.gif":
+                        title_type = "(Windows Media)"
+        # We are searching eventually a new type of BA
+        if td['class'] == 'arial9black3':
+            if td.b:
+                if td.b.string == "Bande annonce vf":
+                    title_part1 = "Bande annonce VF"
+                if td.b.string == "Bande annonce vost":
+                    title_part1 = "Bande annonce VOST"
+                if td.b.string == "Teaser vf":
+                    title_part1 = "Teaser VF"
+                if td.b.string == "Teaser vost":
+                    title_part1 = "Teaser VOST"
+
+    return streams
+
 
 # Return the list of tupple movie title and URL to the stream
 def get_movie_list_week(url):
-  trailers = []
-  
-  req = urllib2.Request(url, txdata, txheaders)
-  try:
-    response = urllib2.urlopen(req)
-  except urllib2.HTTPError, error:
-    exit
-  
-  # Build the soup tree
-  links = SoupStrainer('a')
-  soup  = BeautifulSoup( response.read(), parseOnlyThese=links )
-  re_id = re.compile('.*IDfilm=([0-9]*)', re.I)
-  
-  # Search all the movie title in the page
-  titletag = soup.findAll("a", {"class" : "style6"} )
-  for title in titletag:
-    idfilm = re_id.search(title['href'])
-    # If the ID is found, then check if a trailer is available
-    if idfilm:
-        # If some trailers are available (because the like is present, then we 
push it in the list
-        fiche_tag = soup.find("a", {"href" : 
"fiche_multimedia.php?IDfilm="+idfilm.group(1)} )
-        if fiche_tag:
-          fiche_tag.extract()
-          trailers += [ (title.next.string, idfilm.group(1)) ]
+    trailers = []
 
-  return trailers
-    
+    req = urllib2.Request(url, txdata, txheaders)
+    try:
+        response = urllib2.urlopen(req)
+    except urllib2.HTTPError, error:
+        exit
+
+    # Build the soup tree
+    links = SoupStrainer('a')
+    soup  = BeautifulSoup( response.read(), parseOnlyThese=links )
+    re_id = re.compile('.*IDfilm=([0-9]*)', re.I)
+
+    # Search all the movie title in the page
+    titletag = soup.findAll("a", {"class" : "style6"} )
+    for title in titletag:
+        idfilm = re_id.search(title['href'])
+        # If the ID is found, then check if a trailer is available
+        if idfilm:
+                # If some trailers are available (because the like is present, 
then we push it in the list
+            fiche_tag = soup.find("a", {"href" : 
"fiche_multimedia.php?IDfilm="+idfilm.group(1)} )
+            if fiche_tag:
+                fiche_tag.extract()
+                trailers += [ (title.next.string, idfilm.group(1)) ]
 
+    return trailers

Modified: branches/rel-1-7/freevo/src/video/plugins/moviecovers.py
==============================================================================
--- branches/rel-1-7/freevo/src/video/plugins/moviecovers.py    (original)
+++ branches/rel-1-7/freevo/src/video/plugins/moviecovers.py    Fri Dec 21 
06:18:32 2007
@@ -12,8 +12,8 @@
 #          MOVIECOVERS_AUTOACCEPT_SINGLE_HIT = True
 #          It uses also directly the variables:
 #              - ALLOCINE_REMOVE_FROM_LABEL
-#              - ALLOCINE_REMOVE_FROM_SEARCHSTRING 
-#          as the same words shall be removed also for moviecovers. See 
allocine.py for a desription 
+#              - ALLOCINE_REMOVE_FROM_SEARCHSTRING
+#          as the same words shall be removed also for moviecovers. See 
allocine.py for a desription
 #          of these variables.
 #        You can also set allocine_search on a key (e.g. '1') by setting
 #        EVENTS['menu']['1'] = Event(MENU_CALL_ITEM_ACTION, 
arg='moviecovers_search_or_cover_search')
@@ -27,7 +27,7 @@
 # $Log$
 # -----------------------------------------------------------------------
 # Freevo - A Home Theater PC framework
-# Copyright (C) 2002 Krister Lagerstrom, et al. 
+# Copyright (C) 2002 Krister Lagerstrom, et al.
 # Please see the file freevo/Docs/CREDITS for a complete list of authors.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -144,29 +144,29 @@
         return self.moviecovers_id_list
 
     def guessMoviecovers(self, filename, label=False):
-      """Guess possible Moviecovers movies from filename. Same return as 
searchMoviecovers"""
-      name = filename
+        """Guess possible Moviecovers movies from filename. Same return as 
searchMoviecovers"""
+        name = filename
 
-      for r in config.ALLOCINE_REMOVE_FROM_LABEL:
-        name  = re.sub(r, '', name.lower())
+        for r in config.ALLOCINE_REMOVE_FROM_LABEL:
+            name  = re.sub(r, '', name.lower())
 
-      name  = vfs.basename(vfs.splitext(name)[0])
-      name  = re.sub('([a-z])([A-Z])', point_maker, name)
-      name  = re.sub('([a-zA-Z])([0-9])', point_maker, name)
-      name  = re.sub('([0-9])([a-zA-Z])', point_maker, name.lower())
-      name  = re.sub(',', ' ', name)
-
-      parts = re.split("[\._' -]", name)
-      name = ''
-
-      for p in parts:
-        if not p.lower() in config.ALLOCINE_REMOVE_FROM_SEARCHSTRING and \
-            not re.search('[^0-9A-Za-z]', p):
-          # originally: not re.search(p, '[A-Za-z]'):
-          # not sure what's meant with that
-          name += '%s ' % p
+        name  = vfs.basename(vfs.splitext(name)[0])
+        name  = re.sub('([a-z])([A-Z])', point_maker, name)
+        name  = re.sub('([a-zA-Z])([0-9])', point_maker, name)
+        name  = re.sub('([0-9])([a-zA-Z])', point_maker, name.lower())
+        name  = re.sub(',', ' ', name)
+
+        parts = re.split("[\._' -]", name)
+        name = ''
+
+        for p in parts:
+            if not p.lower() in config.ALLOCINE_REMOVE_FROM_SEARCHSTRING and \
+                not re.search('[^0-9A-Za-z]', p):
+                # originally: not re.search(p, '[A-Za-z]'):
+                # not sure what's meant with that
+                name += '%s ' % p
 
-      return self.searchMoviecovers(name)
+        return self.searchMoviecovers(name)
 
     def getMoviecoversPage(self, url):
         """url

Modified: branches/rel-1/freevo/src/audio/plugins/mplayervis.py
==============================================================================
--- branches/rel-1/freevo/src/audio/plugins/mplayervis.py       (original)
+++ branches/rel-1/freevo/src/audio/plugins/mplayervis.py       Fri Dec 21 
06:18:32 2007
@@ -6,7 +6,7 @@
 # $Id$
 #
 # Notes: - I'm no fan of all the skin.clear() being done :(
-# Todo:  - 
+# Todo:  -
 #
 # -----------------------------------------------------------------------
 # Freevo - A Home Theater PC framework
@@ -283,7 +283,7 @@
                 s.set_alpha(self.alpha)
                 _debug_('gooms.blit(s=%r, (x=%r, y=%r))' % (s, x, y), 2)
                 gooms.blit(s, (x, y))
-        
+
         # draw the info
         if not self.running:
             return self.running

Modified: branches/rel-1/freevo/src/osd.py
==============================================================================
--- branches/rel-1/freevo/src/osd.py    (original)
+++ branches/rel-1/freevo/src/osd.py    Fri Dec 21 06:18:32 2007
@@ -872,7 +872,7 @@
     def __drawstringframed_line__(self, string, max_width, font, hard,
                                   ellipses, word_splitter):
         """
-        calculate _one_ line for drawstringframed. 
+        calculate _one_ line for drawstringframed.
         @returns: a list
             - width used
             - string to draw

Modified: branches/rel-1/freevo/src/skin/models.py
==============================================================================
--- branches/rel-1/freevo/src/skin/models.py    (original)
+++ branches/rel-1/freevo/src/skin/models.py    Fri Dec 21 06:18:32 2007
@@ -52,7 +52,7 @@
 
     def __get_line__(self, string, max_width, font, word_splitter, hard):
         """
-        calculate _one_ line. 
+        calculate _one_ line.
         @returns: a list
             - string to draw
             - rest that didn't fit

Modified: branches/rel-1/freevo/src/skins/main/info_area.py
==============================================================================
--- branches/rel-1/freevo/src/skins/main/info_area.py   (original)
+++ branches/rel-1/freevo/src/skins/main/info_area.py   Fri Dec 21 06:18:32 2007
@@ -230,7 +230,7 @@
         traverse the list evaluating the expressions,
 
         @returns: a flat list with valid elements indexes only (false 'if' 
expressions
-        eliminated). 
+        eliminated).
 
         Also, text elements are in the list too in a tuple: ( index, 'text 
value' ) so
         you can check if it changed just comparing two lists (useful in music 
player,

Modified: branches/rel-1/freevo/src/tv/programitem.py
==============================================================================
--- branches/rel-1/freevo/src/tv/programitem.py (original)
+++ branches/rel-1/freevo/src/tv/programitem.py Fri Dec 21 06:18:32 2007
@@ -24,7 +24,7 @@
 # Public License for more details.
 #
 # You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc., 
+# with this program; if not, write to the Free Software Foundation, Inc.,
 # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 #
 # ----------------------------------------------------------------------
@@ -92,10 +92,10 @@
         self.favorite = False
 
         # start time
-        self.start = time.strftime(config.TV_DATETIME_FORMAT, 
+        self.start = time.strftime(config.TV_DATETIME_FORMAT,
                                    time.localtime(prog.start))
         # stop time
-        self.stop = time.strftime(config.TV_DATETIME_FORMAT, 
+        self.stop = time.strftime(config.TV_DATETIME_FORMAT,
                                        time.localtime(prog.stop))
 
     def actions(self):
@@ -118,7 +118,7 @@
         # check if this program is scheduled
         (got_schedule, schedule) = record_client.getScheduledRecordings()
         if got_schedule:
-            (result, message) = record_client.isProgScheduled(self.prog, 
+            (result, message) = record_client.isProgScheduled(self.prog,
                                                schedule.getProgramList())
             if result:
                 self.scheduled = True

Modified: branches/rel-1/freevo/src/video/plugins/cinemovies_trailers.py
==============================================================================
--- branches/rel-1/freevo/src/video/plugins/cinemovies_trailers.py      
(original)
+++ branches/rel-1/freevo/src/video/plugins/cinemovies_trailers.py      Fri Dec 
21 06:18:32 2007
@@ -5,7 +5,7 @@
 #
 # Revision 0.3  -  Author Sylvain Fabre
 #
-# Notes: This code is still beta 
+# Notes: This code is still beta
 #
 #        Add "plugin.activate('video.ccinemovies_trailers')" in local_conf.py
 #        to activate it
@@ -70,12 +70,12 @@
         return [ (self.make_menu_week, 'Titres de films') ]
 
     def make_menu_week(self, arg=None, menuw=None):
-      items = generate_common_menu(self, "Recuperation des bandes annonces", 
"calendrier_fr-1-")
-      menuw.pushmenu(menu.Menu(_('Bandes annonces disponibles'), items))
+        items = generate_common_menu(self, "Recuperation des bandes annonces", 
"calendrier_fr-1-")
+        menuw.pushmenu(menu.Menu(_('Bandes annonces disponibles'), items))
 
     def play_video(self, arg=None, menuw=None):
-      items = generate_common_stream_list(self, arg[1] )
-      menuw.pushmenu(menu.Menu(arg[0], items))
+        items = generate_common_stream_list(self, arg[1] )
+        menuw.pushmenu(menu.Menu(arg[0], items))
 
 class DVDTrailers(Item):
     def __init__(self, parent):
@@ -87,13 +87,13 @@
         return [ (self.make_menu_week, 'Titres DVD') ]
 
     def make_menu_week(self, arg=None, menuw=None):
-      items = generate_common_menu(self, "Recuperation des bandes annonces 
DVD", "calendrier_dvd-8-")
-      menuw.pushmenu(menu.Menu(_('Bandes annonces DVD disponibles'), items))
+        items = generate_common_menu(self, "Recuperation des bandes annonces 
DVD", "calendrier_dvd-8-")
+        menuw.pushmenu(menu.Menu(_('Bandes annonces DVD disponibles'), items))
 
     def play_video(self, arg=None, menuw=None):
-      items = generate_common_stream_list(self, arg[1] )
-      menuw.pushmenu(menu.Menu(arg[0], items))
-      
+        items = generate_common_stream_list(self, arg[1] )
+        menuw.pushmenu(menu.Menu(arg[0], items))
+
 # headers for urllib2
 txdata = None
 txheaders = {
@@ -103,164 +103,162 @@
 
 #Generate a menu, whatever we are searching for DVD or movies
 def generate_common_menu(parent, title_box, page_prefix):
-  items = []
+    items = []
 
-  #Start grabbing from DVD/Movies of last week
-  current = datetime.date.today() - datetime.timedelta(days=7)
-  for week in [0, 1, 2, 3, 4, 5, 6]:
+    #Start grabbing from DVD/Movies of last week
+    current = datetime.date.today() - datetime.timedelta(days=7)
+    for week in [0, 1, 2, 3, 4, 5, 6]:
     # Compute a new date for the week
-    newdate = current + datetime.timedelta(days=(week*7))
-    # Show some progress
-    box = PopupBox(text=_(title_box+'\nSemaine du 
'+newdate.strftime("%d/%m/%Y")))
-    box.show()
-
-    filehtml = page_prefix + newdate.strftime("%Y") + \
-              newdate.strftime("%m") + newdate.strftime("%d") + ".html"
-    #print "URL to fetch : %s" % filehtml
-    trailers = get_movie_list_week(CAC_URL + filehtml)
-    for title, idfilm in trailers:
-      items.append(menu.MenuItem('%s' % (title + " (" + 
newdate.strftime("%d/%m/%Y") + ")"),
-                                       parent.play_video, (title, idfilm) ) )
-    box.destroy()
+        newdate = current + datetime.timedelta(days=(week*7))
+        # Show some progress
+        box = PopupBox(text=_(title_box+'\nSemaine du 
'+newdate.strftime("%d/%m/%Y")))
+        box.show()
+
+        filehtml = page_prefix + newdate.strftime("%Y") + \
+                  newdate.strftime("%m") + newdate.strftime("%d") + ".html"
+        #print "URL to fetch : %s" % filehtml
+        trailers = get_movie_list_week(CAC_URL + filehtml)
+        for title, idfilm in trailers:
+            items.append(menu.MenuItem('%s' % (title + " (" + 
newdate.strftime("%d/%m/%Y") + ")"),
+                                             parent.play_video, (title, 
idfilm) ) )
+        box.destroy()
 
-  return items
+    return items
 
 # Generate the list of streams of a specific movie
 def generate_common_stream_list( object, idfilm ):
-  items = []
-      
-  box = PopupBox(text=_('Recuperation des types de bande annonces 
disponibles'))
-  box.show()
-      
-  streamlist = get_movie_sheet( idfilm )
-  if streamlist:
-    for title, streamurl in streamlist:
-      items.append(TrailerVideoItem(title, streamurl, object))
-  else:
-    items.append( menu.MenuItem('Pas de bande annonce dispo', None, None) )
-        
-  box.destroy()
-  return items
-    
+    items = []
+
+    box = PopupBox(text=_('Recuperation des types de bande annonces 
disponibles'))
+    box.show()
+
+    streamlist = get_movie_sheet( idfilm )
+    if streamlist:
+        for title, streamurl in streamlist:
+            items.append(TrailerVideoItem(title, streamurl, object))
+    else:
+        items.append( menu.MenuItem('Pas de bande annonce dispo', None, None) )
+
+    box.destroy()
+    return items
+
 # Parse the 'player.php' file to get the stream URL
-def get_stream_url(idfilm, idba):  
-  # Get the URL
-  url = CAC_URL + "players/video.php?IDfilm=" + idfilm + "&IDBA=" + idba
-  req = urllib2.Request(url, txdata, txheaders)
-  try:
-    response = urllib2.urlopen(req)
-  except urllib2.HTTPError, error:
-    exit
-  
-  # Build the soup tree
-  links = SoupStrainer('script')
-  soup  = BeautifulSoup( response.read(), parseOnlyThese=links )
-  re_QT = re.compile('^QT_WriteOBJECT_XHTML\(\'(.*?)\',.*')
-  re_RM = re.compile('.*AC_RunRealContentX\(.*, \"SRC\", \"(.*?)\"\);')
-  re_WM = re.compile('.*name=\"filename\" value=\"(.*?)\".*')
-  
-  # Get the list of javascript tags to the streams
-  scriptlist = soup.findAll("script")
-  for script in scriptlist:
-    if script.string:
-      httpstr = re_QT.search(script.string)
-      if httpstr:
-        return httpstr.group(1)
-      else:
-        httpstr = re_RM.search(script.string)
-        if httpstr:
-          return httpstr.group(1)
-        else:
-          httpstr = re_WM.search(script.string)
-          if httpstr:
-            return  httpstr.group(1)
-  
-  return None
-    
+def get_stream_url(idfilm, idba):
+    # Get the URL
+    url = CAC_URL + "players/video.php?IDfilm=" + idfilm + "&IDBA=" + idba
+    req = urllib2.Request(url, txdata, txheaders)
+    try:
+        response = urllib2.urlopen(req)
+    except urllib2.HTTPError, error:
+        exit
+
+    # Build the soup tree
+    links = SoupStrainer('script')
+    soup  = BeautifulSoup( response.read(), parseOnlyThese=links )
+    re_QT = re.compile('^QT_WriteOBJECT_XHTML\(\'(.*?)\',.*')
+    re_RM = re.compile('.*AC_RunRealContentX\(.*, \"SRC\", \"(.*?)\"\);')
+    re_WM = re.compile('.*name=\"filename\" value=\"(.*?)\".*')
+
+    # Get the list of javascript tags to the streams
+    scriptlist = soup.findAll("script")
+    for script in scriptlist:
+        if script.string:
+            httpstr = re_QT.search(script.string)
+            if httpstr:
+                return httpstr.group(1)
+            else:
+                httpstr = re_RM.search(script.string)
+                if httpstr:
+                    return httpstr.group(1)
+                else:
+                    httpstr = re_WM.search(script.string)
+                    if httpstr:
+                        return  httpstr.group(1)
+
+    return None
+
 # Parse the 'fiche_multimedia' file to get the player URL
 def get_movie_sheet(idfilm):
-  # Get the URL
-  url = CAC_URL + 'fiche_multimedia.php?IDfilm=' + idfilm
-  req = urllib2.Request(url, txdata, txheaders)
-  try:
-    response = urllib2.urlopen(req)
-  except urllib2.HTTPError, error:
-    exit
-  
-  # Build the soup tree
-  links = SoupStrainer('td')
-  soup  = BeautifulSoup(response.read(), parseOnlyThese=links )
-  re_idba = re.compile('.*IDBA=([0-9]*).*', re.I)
-  re_res  = re.compile('haute r.*', re.I)
-  streams = []
-  
-  # Find the kind of trailer that are listed below
-  tdlist = soup.findAll("td", {"class" : ['arial8black', 
'tail_disclaimer_grey8point', 'arial9black3'] } )
-  title_part1 = "Bande annonce"
-  title_type  = "(Type de video inconnu)"
-  for td in tdlist:
-    # We have found the type of BA and the type of streams
-    if td['class'] == 'arial8black':
-      if td.a:
-        if td.a.string:
-          if re_res.search(td.a.string):
-            idba = re_idba.search(td.a['href'])
-            if idba:
-              streamurl = get_stream_url( idfilm, idba.group(1) )
-              streams += [ (title_part1 + " " + title_type, streamurl) ]
-              #print title_part1 + " " + title_type
-    # We have found the type of BA, search for the type of streams
-    if td['class'] == 'tail_disclaimer_grey8point':
-      if td.p:
-        if td.p.img:
-          if td.p.img['src'] == "images/data/ba/quicktime_ico.gif":
-            title_type = "(Quicktime)"
-          if td.p.img['src'] == "images/v2/div/player/real2.gif":
-            title_type = "(Real Media)"
-          if td.p.img['src'] == "images/data/ba/wmp_ico.gif":
-            title_type = "(Windows Media)"
-    # We are searching eventually a new type of BA
-    if td['class'] == 'arial9black3':
-      if td.b:
-        if td.b.string == "Bande annonce vf":
-          title_part1 = "Bande annonce VF"
-        if td.b.string == "Bande annonce vost":
-          title_part1 = "Bande annonce VOST"
-        if td.b.string == "Teaser vf":
-          title_part1 = "Teaser VF"
-        if td.b.string == "Teaser vost":
-          title_part1 = "Teaser VOST"
-      
-  return streams
-    
+    # Get the URL
+    url = CAC_URL + 'fiche_multimedia.php?IDfilm=' + idfilm
+    req = urllib2.Request(url, txdata, txheaders)
+    try:
+        response = urllib2.urlopen(req)
+    except urllib2.HTTPError, error:
+        exit
+
+    # Build the soup tree
+    links = SoupStrainer('td')
+    soup  = BeautifulSoup(response.read(), parseOnlyThese=links )
+    re_idba = re.compile('.*IDBA=([0-9]*).*', re.I)
+    re_res  = re.compile('haute r.*', re.I)
+    streams = []
+
+    # Find the kind of trailer that are listed below
+    tdlist = soup.findAll("td", {"class" : ['arial8black', 
'tail_disclaimer_grey8point', 'arial9black3'] } )
+    title_part1 = "Bande annonce"
+    title_type  = "(Type de video inconnu)"
+    for td in tdlist:
+        # We have found the type of BA and the type of streams
+        if td['class'] == 'arial8black':
+            if td.a:
+                if td.a.string:
+                    if re_res.search(td.a.string):
+                        idba = re_idba.search(td.a['href'])
+                        if idba:
+                            streamurl = get_stream_url( idfilm, idba.group(1) )
+                            streams += [ (title_part1 + " " + title_type, 
streamurl) ]
+                            #print title_part1 + " " + title_type
+        # We have found the type of BA, search for the type of streams
+        if td['class'] == 'tail_disclaimer_grey8point':
+            if td.p:
+                if td.p.img:
+                    if td.p.img['src'] == "images/data/ba/quicktime_ico.gif":
+                        title_type = "(Quicktime)"
+                    if td.p.img['src'] == "images/v2/div/player/real2.gif":
+                        title_type = "(Real Media)"
+                    if td.p.img['src'] == "images/data/ba/wmp_ico.gif":
+                        title_type = "(Windows Media)"
+        # We are searching eventually a new type of BA
+        if td['class'] == 'arial9black3':
+            if td.b:
+                if td.b.string == "Bande annonce vf":
+                    title_part1 = "Bande annonce VF"
+                if td.b.string == "Bande annonce vost":
+                    title_part1 = "Bande annonce VOST"
+                if td.b.string == "Teaser vf":
+                    title_part1 = "Teaser VF"
+                if td.b.string == "Teaser vost":
+                    title_part1 = "Teaser VOST"
+
+    return streams
+
 
 # Return the list of tupple movie title and URL to the stream
 def get_movie_list_week(url):
-  trailers = []
-  
-  req = urllib2.Request(url, txdata, txheaders)
-  try:
-    response = urllib2.urlopen(req)
-  except urllib2.HTTPError, error:
-    exit
-  
-  # Build the soup tree
-  links = SoupStrainer('a')
-  soup  = BeautifulSoup( response.read(), parseOnlyThese=links )
-  re_id = re.compile('.*IDfilm=([0-9]*)', re.I)
-  
-  # Search all the movie title in the page
-  titletag = soup.findAll("a", {"class" : "style6"} )
-  for title in titletag:
-    idfilm = re_id.search(title['href'])
-    # If the ID is found, then check if a trailer is available
-    if idfilm:
-        # If some trailers are available (because the like is present, then we 
push it in the list
-        fiche_tag = soup.find("a", {"href" : 
"fiche_multimedia.php?IDfilm="+idfilm.group(1)} )
-        if fiche_tag:
-          fiche_tag.extract()
-          trailers += [ (title.next.string, idfilm.group(1)) ]
+    trailers = []
 
-  return trailers
-    
+    req = urllib2.Request(url, txdata, txheaders)
+    try:
+        response = urllib2.urlopen(req)
+    except urllib2.HTTPError, error:
+        exit
+
+    # Build the soup tree
+    links = SoupStrainer('a')
+    soup  = BeautifulSoup( response.read(), parseOnlyThese=links )
+    re_id = re.compile('.*IDfilm=([0-9]*)', re.I)
+
+    # Search all the movie title in the page
+    titletag = soup.findAll("a", {"class" : "style6"} )
+    for title in titletag:
+        idfilm = re_id.search(title['href'])
+        # If the ID is found, then check if a trailer is available
+        if idfilm:
+                # If some trailers are available (because the like is present, 
then we push it in the list
+            fiche_tag = soup.find("a", {"href" : 
"fiche_multimedia.php?IDfilm="+idfilm.group(1)} )
+            if fiche_tag:
+                fiche_tag.extract()
+                trailers += [ (title.next.string, idfilm.group(1)) ]
 
+    return trailers

Modified: branches/rel-1/freevo/src/video/plugins/moviecovers.py
==============================================================================
--- branches/rel-1/freevo/src/video/plugins/moviecovers.py      (original)
+++ branches/rel-1/freevo/src/video/plugins/moviecovers.py      Fri Dec 21 
06:18:32 2007
@@ -12,8 +12,8 @@
 #          MOVIECOVERS_AUTOACCEPT_SINGLE_HIT = True
 #          It uses also directly the variables:
 #              - ALLOCINE_REMOVE_FROM_LABEL
-#              - ALLOCINE_REMOVE_FROM_SEARCHSTRING 
-#          as the same words shall be removed also for moviecovers. See 
allocine.py for a desription 
+#              - ALLOCINE_REMOVE_FROM_SEARCHSTRING
+#          as the same words shall be removed also for moviecovers. See 
allocine.py for a desription
 #          of these variables.
 #        You can also set allocine_search on a key (e.g. '1') by setting
 #        EVENTS['menu']['1'] = Event(MENU_CALL_ITEM_ACTION, 
arg='moviecovers_search_or_cover_search')
@@ -27,7 +27,7 @@
 # $Log$
 # -----------------------------------------------------------------------
 # Freevo - A Home Theater PC framework
-# Copyright (C) 2002 Krister Lagerstrom, et al. 
+# Copyright (C) 2002 Krister Lagerstrom, et al.
 # Please see the file freevo/Docs/CREDITS for a complete list of authors.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -145,29 +145,29 @@
         return self.moviecovers_id_list
 
     def guessMoviecovers(self, filename, label=False):
-      """Guess possible Moviecovers movies from filename. Same return as 
searchMoviecovers"""
-      name = filename
+        """Guess possible Moviecovers movies from filename. Same return as 
searchMoviecovers"""
+        name = filename
 
-      for r in config.ALLOCINE_REMOVE_FROM_LABEL:
-        name  = re.sub(r, '', name.lower())
+        for r in config.ALLOCINE_REMOVE_FROM_LABEL:
+            name  = re.sub(r, '', name.lower())
 
-      name  = vfs.basename(vfs.splitext(name)[0])
-      name  = re.sub('([a-z])([A-Z])', point_maker, name)
-      name  = re.sub('([a-zA-Z])([0-9])', point_maker, name)
-      name  = re.sub('([0-9])([a-zA-Z])', point_maker, name.lower())
-      name  = re.sub(',', ' ', name)
-
-      parts = re.split("[\._' -]", name)
-      name = ''
-
-      for p in parts:
-        if not p.lower() in config.ALLOCINE_REMOVE_FROM_SEARCHSTRING and \
-            not re.search('[^0-9A-Za-z]', p):
-          # originally: not re.search(p, '[A-Za-z]'):
-          # not sure what's meant with that
-          name += '%s ' % p
+        name  = vfs.basename(vfs.splitext(name)[0])
+        name  = re.sub('([a-z])([A-Z])', point_maker, name)
+        name  = re.sub('([a-zA-Z])([0-9])', point_maker, name)
+        name  = re.sub('([0-9])([a-zA-Z])', point_maker, name.lower())
+        name  = re.sub(',', ' ', name)
+
+        parts = re.split("[\._' -]", name)
+        name = ''
+
+        for p in parts:
+            if not p.lower() in config.ALLOCINE_REMOVE_FROM_SEARCHSTRING and \
+                not re.search('[^0-9A-Za-z]', p):
+                # originally: not re.search(p, '[A-Za-z]'):
+                # not sure what's meant with that
+                name += '%s ' % p
 
-      return self.searchMoviecovers(name)
+        return self.searchMoviecovers(name)
 
     def getMoviecoversPage(self, url):
         """url

Modified: branches/rel-1/freevo/src/www/web_types.py
==============================================================================
--- branches/rel-1/freevo/src/www/web_types.py  (original)
+++ branches/rel-1/freevo/src/www/web_types.py  Fri Dec 21 06:18:32 2007
@@ -456,7 +456,7 @@
                 getNewSize();
             }
             var 
params="toolbar=no,location=no,status=no,menubar=yes,resizable=no,top=0,left=0,width="+width+",height="+height;
-           foto = Lightbox.show(''+loc+'', '', 'width='+width+', 
height='+height+'');
+            foto = Lightbox.show(''+loc+'', '', 'width='+width+', 
height='+height+'');
          }
 
          function getNewSize(){

Modified: branches/rel-1/testing/Duncan/pygoom-2k4/setup.py
==============================================================================
--- branches/rel-1/testing/Duncan/pygoom-2k4/setup.py   (original)
+++ branches/rel-1/testing/Duncan/pygoom-2k4/setup.py   Fri Dec 21 06:18:32 2007
@@ -45,4 +45,3 @@
         description = 'Goom-2k4 bindings for Python',
         ext_modules = [pympav_1]
         )
-

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to