Update of /cvsroot/freevo/freevo/src/image
In directory sc8-pr-cvs1:/tmp/cvs-serv29454

Modified Files:
        __init__.py 
Log Message:
allow slideshows with relative path, fix background music

Index: __init__.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/image/__init__.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** __init__.py 13 Dec 2003 14:46:58 -0000      1.11
--- __init__.py 13 Dec 2003 18:18:02 -0000      1.12
***************
*** 10,13 ****
--- 10,16 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.12  2003/12/13 18:18:02  dischi
+ # allow slideshows with relative path, fix background music
+ #
  # Revision 1.11  2003/12/13 14:46:58  outlyer
  # Fix the example XML
***************
*** 56,59 ****
--- 59,64 ----
  #endif
  
+ import os
+ 
  # Add support for bins album files
  from mmpython.image import bins
***************
*** 155,159 ****
          </freevo>
          """
!         items = []
          children = fxd.get_children(node, 'files')
          if children:
--- 160,165 ----
          </freevo>
          """
!         items    = []
!         dirname  = os.path.dirname(fxd.getattr(None, 'filename', ''))
          children = fxd.get_children(node, 'files')
          if children:
***************
*** 163,175 ****
              try:
                  citems = []
                  if child.name == 'directory':
                      if fxd.getattr(child, 'recursive', 0):
!                         f = util.match_files_recursively(fxd.gettext(child), 
self.suffix())
                      else:
!                         f = util.match_files(fxd.gettext(child), self.suffix())
                      citems = self.get(None, f)
  
                  elif child.name == 'file':
!                     citems = self.get(None, [ fxd.gettext(child) ])
  
                  duration = fxd.getattr(child, 'duration', 0)
--- 169,182 ----
              try:
                  citems = []
+                 fname  = os.path.join(dirname, fxd.gettext(child))
                  if child.name == 'directory':
                      if fxd.getattr(child, 'recursive', 0):
!                         f = util.match_files_recursively(fname, self.suffix())
                      else:
!                         f = util.match_files(fname, self.suffix())
                      citems = self.get(None, f)
  
                  elif child.name == 'file':
!                     citems = self.get(None, [ fname ])
  
                  duration = fxd.getattr(child, 'duration', 0)
***************
*** 207,217 ****
          for child in children:
              try:
                  if child.name == 'directory':
                      if fxd.getattr(child, 'recursive', 0):
!                         files += util.match_files_recursively(fxd.gettext(child), 
suffix)
                      else:
!                         files += util.match_files(fxd.gettext(child), suffix)
                  elif child.name == 'file':
!                     files.append(fxd.gettext(child))
              except OSError, e:
                  print 'playlist error:'
--- 214,225 ----
          for child in children:
              try:
+                 fname  = os.path.join(dirname, fxd.gettext(child))
                  if child.name == 'directory':
                      if fxd.getattr(child, 'recursive', 0):
!                         files += util.match_files_recursively(fname, suffix)
                      else:
!                         files += util.match_files(fname, suffix)
                  elif child.name == 'file':
!                     files.append(fname)
              except OSError, e:
                  print 'playlist error:'
***************
*** 219,223 ****
  
          if files:
!             pl.background_playlist = Playlist(playlist=files, random = random)
  
          # add item to list
--- 227,232 ----
  
          if files:
!             pl.background_playlist = Playlist(playlist=files, random = random,
!                                               display_type='audio')
  
          # add item to list




-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to