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

Modified Files:
        directory.py 
Log Message:
remove all fxd item stuff, it's in fxditem now

Index: directory.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/directory.py,v
retrieving revision 1.64
retrieving revision 1.65
diff -C2 -d -r1.64 -r1.65
*** directory.py        23 Nov 2003 19:21:55 -0000      1.64
--- directory.py        24 Nov 2003 19:23:49 -0000      1.65
***************
*** 10,13 ****
--- 10,16 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.65  2003/11/24 19:23:49  dischi
+ # remove all fxd item stuff, it's in fxditem now
+ #
  # Revision 1.64  2003/11/23 19:21:55  dischi
  # some cleanup
***************
*** 67,71 ****
  import traceback
  import re
- import codecs
  import stat
  import copy
--- 70,73 ----
***************
*** 78,81 ****
--- 80,86 ----
  import skin
  import plugin
+ 
+ # make this easier like
+ # load on startup
  import video
  import audio
***************
*** 84,89 ****
  
  from item import Item
  from playlist import Playlist, RandomPlaylist
- from video.xml_parser import parseMovieFile
  from event import *
  
--- 89,94 ----
  
  from item import Item
+ import fxditem
  from playlist import Playlist, RandomPlaylist
  from event import *
  
***************
*** 233,238 ****
                                                      vfs.basename(directory).lower()))
  
!             if config.TV_SHOW_INFORMATIONS.has_key(vfs.basename(directory).lower()):
!                 tvinfo = config.TV_SHOW_INFORMATIONS[vfs.basename(directory).lower()]
                  self.info = tvinfo[1]
                  if not self.image:
--- 238,243 ----
                                                      vfs.basename(directory).lower()))
  
!             if video.tv_show_informations.has_key(vfs.basename(directory).lower()):
!                 tvinfo = video.tv_show_informations[vfs.basename(directory).lower()]
                  self.info = tvinfo[1]
                  if not self.image:
***************
*** 287,308 ****
          # read attributes
          if set_all:
!             if node.attrs.has_key(('', 'title')):
!                 self.name = node.attrs[('', 'title')].encode(config.LOCALE)
! 
!             if node.attrs.has_key(('', 'cover-img')):
!                 image = node.attrs[('', 'cover-img')].encode(config.LOCALE)
!                 if image and vfs.isfile(vfs.join(self.dir, image)):
!                     self.image = vfs.join(self.dir, image)
  
!             if node.attrs.has_key(('', 'import')):
!                 import_xml = node.attrs[('', 'import')].encode(config.LOCALE)
!                 if vfs.isfile(vfs.join(self.dir, import_xml + '.fxd')):
!                     info = parseMovieFile(vfs.join(self.dir, import_xml + '.fxd'), 
self, [])
!                     if info:
!                         self.name      = info[0].name
!                         self.image     = info[0].image
!                         self.info_type = info[0].type
!                         for key in info[0].info:
!                             self.info[key] = info[0].info[key]
  
              # parse <info> tag
--- 292,300 ----
          # read attributes
          if set_all:
!             self.name = fxd.getattr(node, 'title', self.name)
  
!             image = fxd.childcontent(node, 'cover-img')
!             if image and vfs.isfile(vfs.join(self.dir, image)):
!                 self.image = vfs.join(self.dir, image)
  
              # parse <info> tag
***************
*** 447,482 ****
  
  
-     def fxd_handler(self, fxd_files, duplicate_check, display_type):
-         """
-         return a list of items that belong to a fxd files
-         """
-         items = []
-         for fxd_file in fxd_files:
-             try:
-                 # create a basic fxd parser
-                 parser = util.fxdparser.FXD(fxd_file)
- 
-                 # create an object that can parse the special infos
-                 # from the fxd
-                 handler = []
-                 for t in possible_display_types:
-                     if not display_type or display_type == t and \
-                            hasattr(eval(t), 'FXDHandler'):
-                         h = eval(t).FXDHandler(parser, fxd_file, self, 
duplicate_check)
-                         handler.append(h)
- 
-                 # start the parsing
-                 parser.parse()
- 
-                 # get this informations back
-                 for h in handler:
-                     items += h.items
- 
-             except:
-                 print "fxd file %s corrupt" % fxd_file
-                 traceback.print_exc()
-         return items
-     
-         
      def cwd(self, arg=None, menuw=None):
          """
--- 439,442 ----
***************
*** 609,628 ****
  
          # 
!         # PHASE II: parse fxd files
!         #
! 
!         fxd_files = util.find_matches(files, ['fxd'])
!         for d in copy.copy(files):
!             if vfs.isdir(d) and vfs.isfile(vfs.join(d, vfs.basename(d) + '.fxd')):
!                 fxd_files.append(vfs.join(d, vfs.basename(d) + '.fxd'))
!                 files.remove(d)
! 
!         play_items += self.fxd_handler(fxd_files, files, display_type)
! 
! 
!         # 
!         # PHASE III: add normal files
          #
  
          for t in possible_display_types:
              if not display_type or display_type == t:
--- 569,576 ----
  
          # 
!         # PHASE II: add normal files
          #
  
+         play_items += fxditem.cwd(self, files)
          for t in possible_display_types:
              if not display_type or display_type == t:
***************
*** 631,635 ****
  
          # 
!         # PHASE IV: sort play items
          #
  
--- 579,583 ----
  
          # 
!         # PHASE III: sort play items
          #
  
***************
*** 653,657 ****
  
          # 
!         # PHASE V: add subdirs
          #
  
--- 601,605 ----
  
          # 
!         # PHASE IV: add subdirs
          #
  
***************
*** 672,676 ****
  
          # 
!         # PHASE VI: add playlists
          #
  
--- 620,624 ----
  
          # 
!         # PHASE V: add playlists
          #
  
***************
*** 690,694 ****
  
          # 
!         # PHASE VII: finalize
          #
  
--- 638,642 ----
  
          # 
!         # PHASE VI: finalize
          #
  
***************
*** 721,725 ****
  
          # 
!         # PHASE VIII: action!
          #
  
--- 669,673 ----
  
          # 
!         # PHASE VII: action!
          #
  
***************
*** 778,808 ****
  
  
!         # a fxd files may be removed, 'free' covered files
!         for fxd_file in util.find_matches(del_files, ['fxd']):
!             for i in self.play_items:
!                 if i.xml_file == fxd_file and hasattr(i, '_fxd_covered_'):
!                     for covered in i._fxd_covered_:
!                         if not covered in del_files:
!                             new_files.append(covered)
!                     del_items.append(i)
!                     del_files.remove(fxd_file)
! 
!             
!         # a new fxd file may cover items
!         fxd_files = util.find_matches(new_files, ['fxd'])
!         if fxd_files:
!             for f in fxd_files:
!                 new_files.remove(f)
!             copy_all = copy.copy(all_files)
!             new_items += self.fxd_handler(fxd_files, copy_all, display_type)
!             for f in all_files:
!                 if not f in copy_all:
!                     # covered by fxd now
!                     if not f in new_files:
!                         del_files.append(f)
!                     else:
!                         new_files.remove(f)
  
-                     
          # check modules if they know something about the deleted/new files
          for t in possible_display_types:
--- 726,732 ----
  
  
!         # check fxd files
!         fxditem.update(self, new_files, del_files, new_items, del_items, 
self.play_items)
  
          # check modules if they know something about the deleted/new files
          for t in possible_display_types:




-------------------------------------------------------
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