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

Modified Files:
        item.py directory.py 
Log Message:
remove unneeded copy function, make id a function

Index: item.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/item.py,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** item.py     29 Dec 2003 22:31:10 -0000      1.37
--- item.py     30 Dec 2003 15:33:01 -0000      1.38
***************
*** 10,13 ****
--- 10,16 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.38  2003/12/30 15:33:01  dischi
+ # remove unneeded copy function, make id a function
+ #
  # Revision 1.37  2003/12/29 22:31:10  dischi
  # do not delete empty strings as file
***************
*** 191,221 ****
  
  
-     def copy(self, obj):
-         """
-         copy all known attributes from 'obj'
-         """
-         if not self.image:
-             self.image = obj.image
-         if not self.name:
-             self.name  = obj.name
-             
-         self.fxd_file     = obj.fxd_file
-         self.handle_type  = obj.handle_type
-         self.info         = obj.info
-         self.media        = obj.media
- 
-         # copy additional attributes if the item has an url, which
-         # means it also has attributes like mimetype
-         if hasattr(obj, 'url'):
-             self.url          = obj.url
-             self.network_play = obj.network_play
-             self.id           = obj.id
-             self.media_id     = obj.media_id
-             self.mimetype     = obj.mimetype
-             self.filename     = obj.filename
-             self.dirname      = obj.dirname
-             self.files        = obj.files
- 
- 
      def set_url(self, url, info=True):
          """
--- 194,197 ----
***************
*** 277,281 ****
                  self.name = self.url
  
-         self.id   = self.url
          self.mode = self.url[:self.url.find('://')]
  
--- 253,256 ----
***************
*** 291,294 ****
--- 266,279 ----
  
  
+     def id(self):
+         """
+         Return a unique id of the item. This id should be the same when the
+         item is rebuild later with the same informations
+         """
+         if hasattr(self, 'url'):
+             return self.url
+         return self.name
+ 
+     
      def translation(self, application):
          """

Index: directory.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/directory.py,v
retrieving revision 1.78
retrieving revision 1.79
diff -C2 -d -r1.78 -r1.79
*** directory.py        29 Dec 2003 22:07:14 -0000      1.78
--- directory.py        30 Dec 2003 15:33:01 -0000      1.79
***************
*** 10,13 ****
--- 10,16 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # 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
***************
*** 262,277 ****
  
  
-     def copy(self, obj):
-         """
-         Special copy value DirItem
-         """
-         Playlist.copy(self, obj)
-         if obj.type == 'dir':
-             self.dir           = obj.dir
-             self.display_type  = obj.display_type
-             self.info          = obj.info
-             self.skin_settings = obj.skin_settings
-             
- 
      def getattr(self, attr):
          """
--- 265,268 ----
***************
*** 687,696 ****
          # maybe change selected item
          if not selected in self.menu.choices:
!             if hasattr(selected, 'id'):
!                 id = selected.id
!                 for i in self.menu.choices:
!                     if hasattr(i, 'id') and i.id == selected.id:
!                         self.menu.selected = i
!                         break
                      
          # reload the menu
--- 678,686 ----
          # maybe change selected item
          if not selected in self.menu.choices:
!             id = selected.id()
!             for i in self.menu.choices:
!                 if i.id() == selected.id():
!                     self.menu.selected = i
!                     break
                      
          # reload the menu




-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to