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

Modified Files:
        directory.py 
Log Message:
split usage of xml_file to folder_fxd and skin_fxd

Index: directory.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/directory.py,v
retrieving revision 1.91
retrieving revision 1.92
diff -C2 -d -r1.91 -r1.92
*** directory.py        9 Jan 2004 21:06:10 -0000       1.91
--- directory.py        10 Jan 2004 13:19:05 -0000      1.92
***************
*** 10,13 ****
--- 10,16 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.92  2004/01/10 13:19:05  dischi
+ # split usage of xml_file to folder_fxd and skin_fxd
+ #
  # Revision 1.91  2004/01/09 21:06:10  dischi
  # better skin_settings support. All the item variables need a cleanup/sort
***************
*** 16,34 ****
  # new vfs.listdir parameter
  #
- # Revision 1.89  2004/01/07 18:18:59  dischi
- # remove update info on build
- #
- # Revision 1.88  2004/01/06 19:27:03  dischi
- # use new mtime function to avoid crash
- #
  # Revision 1.87  2004/01/05 15:21:04  outlyer
  # I am seeing OSErrors not IOErrors for this, so we can just watch for both
  #
- # Revision 1.86  2004/01/04 17:18:50  dischi
- # also check OVERLAY_DIR for update
- #
- # Revision 1.85  2004/01/04 13:06:20  dischi
- # delete skin information on update
- #
  # Revision 1.84  2004/01/04 10:24:12  dischi
  # inherit config variables from parent if possible
--- 19,25 ----
***************
*** 40,73 ****
  # possible to change a fxd file and the directory will update.
  #
- # Revision 1.82  2004/01/01 19:48:42  dischi
- # fix dir playing
- #
  # Revision 1.81  2004/01/01 17:42:23  dischi
  # add FileInformation
  #
- # Revision 1.80  2003/12/31 16:40:24  dischi
- # small speed enhancements
- #
- # Revision 1.79  2003/12/30 15:33:01  dischi
- # remove unneeded copy function, make id a function
- #
- # Revision 1.78  2003/12/29 22:07:14  dischi
- # renamed xml_file to fxd_file
- #
- # Revision 1.77  2003/12/17 16:43:59  outlyer
- # Prevent a crash if the current directory is removed... just silently move
- # up to the previous directory.
- #
- # (This is identical to the previous 1.4 behaviour)
- #
- # Revision 1.74  2003/12/08 20:37:33  dischi
- # merged Playlist and RandomPlaylist into one class
- #
- # Revision 1.73  2003/12/07 14:45:57  dischi
- # make the busy icon thread save
- #
- # Revision 1.72  2003/12/07 12:26:55  dischi
- # add osd busy icon (work in progress)
- #
  # -----------------------------------------------------------------------
  # Freevo - A Home Theater PC framework
--- 31,37 ----
***************
*** 181,185 ****
          self.info          = {}
          self.mountpoint    = None
-         self.skin_settings = ''
          
          if add_args == None and hasattr(parent, 'add_args'): 
--- 145,148 ----
***************
*** 208,215 ****
              
          if vfs.isfile(directory+'/folder.fxd'): 
!             self.fxd_file = directory+'/folder.fxd'
! 
!         if self.fxd_file:
!             self.set_fxd_file(self.fxd_file)
              
          if self.DIRECTORY_SORT_BY_DATE == 2 and self.display_type != 'tv':
--- 171,178 ----
              
          if vfs.isfile(directory+'/folder.fxd'): 
!             self.folder_fxd = directory+'/folder.fxd'
!             self.set_fxd_file(self.folder_fxd)
!         else:
!             self.folder_fxd = ''
              
          if self.DIRECTORY_SORT_BY_DATE == 2 and self.display_type != 'tv':
***************
*** 220,234 ****
      def set_fxd_file(self, file):
          """
!         Set self.fxd_file and parse it
          """
!         self.fxd_file = file
!         if self.fxd_file and vfs.isfile(self.fxd_file):
              try:
!                 parser = util.fxdparser.FXD(self.fxd_file)
                  parser.set_handler('folder', self.read_folder_fxd)
                  parser.set_handler('skin', self.read_folder_fxd)
                  parser.parse()
              except:
!                 print "fxd file %s corrupt" % self.fxd_file
                  traceback.print_exc()
  
--- 183,197 ----
      def set_fxd_file(self, file):
          """
!         Set self.folder_fxd and parse it
          """
!         self.folder_fxd = file
!         if self.folder_fxd and vfs.isfile(self.folder_fxd):
              try:
!                 parser = util.fxdparser.FXD(self.folder_fxd)
                  parser.set_handler('folder', self.read_folder_fxd)
                  parser.set_handler('skin', self.read_folder_fxd)
                  parser.parse()
              except:
!                 print "fxd file %s corrupt" % self.folder_fxd
                  traceback.print_exc()
  
***************
*** 251,271 ****
  
          if node.name == 'skin':
!             self.skin_settings = self.fxd_file
              return
          
          global all_variables
-         set_all = self.fxd_file == self.dir+'/folder.fxd'
  
          # read attributes
!         if set_all:
!             self.name = fxd.getattr(node, 'title', self.name)
  
!             image = fxd.childcontent(node, 'cover-img')
!             if image and vfs.isfile(os.path.join(self.dir, image)):
!                 self.image = os.path.join(self.dir, image)
  
!             # parse <info> tag
!             fxd.parse_info(fxd.get_children(node, 'info', 1), self,
!                            {'description': 'content', 'content': 'content' })
  
          for child in fxd.get_children(node, 'setvar', 1):
--- 214,232 ----
  
          if node.name == 'skin':
!             self.folder_fxd = self.folder_fxd
              return
          
          global all_variables
  
          # read attributes
!         self.name = fxd.getattr(node, 'title', self.name)
  
!         image = fxd.childcontent(node, 'cover-img')
!         if image and vfs.isfile(os.path.join(self.dir, image)):
!             self.image = os.path.join(self.dir, image)
  
!         # parse <info> tag
!         fxd.parse_info(fxd.get_children(node, 'info', 1), self,
!                        {'description': 'content', 'content': 'content' })
  
          for child in fxd.get_children(node, 'setvar', 1):
***************
*** 399,403 ****
                         (self.play_recursive, _('Recursive play all items')) ]
  
!         items.append((self.configure, _('Configure directory'), 'configure'))
          return items
      
--- 360,365 ----
                         (self.play_recursive, _('Recursive play all items')) ]
  
!         if self.folder_fxd.endswith('folder.fxd'):
!             items.append((self.configure, _('Configure directory'), 'configure'))
          return items
      
***************
*** 605,610 ****
              if vfs.isdir(filename):
                  d = DirItem(filename, self, display_type = self.display_type)
-                 if not d.skin_settings:
-                     d.skin_settings = self.skin_settings
                  self.dir_items.append(d)
  
--- 567,570 ----
***************
*** 711,716 ****
                                    force_skin_layout = 
self.DIRECTORY_FORCE_SKIN_LAYOUT)
  
!             if self.skin_settings:
!                 item_menu.skin_settings = skin.load(self.skin_settings)
  
              if menuw:
--- 671,676 ----
                                    force_skin_layout = 
self.DIRECTORY_FORCE_SKIN_LAYOUT)
  
!             if self.skin_fxd:
!                 item_menu.skin_settings = skin.load(self.skin_fxd)
  
              if menuw:
***************
*** 811,823 ****
          item.name = item.name[:item.name.find('\t') + 1] + 
self.configure_set_name(arg)
  
-         # write folder.fxd
-         self.fxd_file = os.path.join(self.dir, 'folder.fxd')
- 
          try:
!             parser = util.fxdparser.FXD(self.fxd_file)
              parser.set_handler('folder', self.write_folder_fxd, 'w', True)
              parser.save()
          except:
!             print "fxd file %s corrupt" % self.fxd_file
              traceback.print_exc()
  
--- 771,780 ----
          item.name = item.name[:item.name.find('\t') + 1] + 
self.configure_set_name(arg)
  
          try:
!             parser = util.fxdparser.FXD(self.folder_fxd)
              parser.set_handler('folder', self.write_folder_fxd, 'w', True)
              parser.save()
          except:
!             print "fxd file %s corrupt" % self.folder_fxd
              traceback.print_exc()
  




-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to