Update of /cvsroot/freevo/freevo/src
In directory sc8-pr-cvs1:/tmp/cvs-serv14178
Modified Files:
directory.py main.py item.py osd.py playlist.py
Log Message:
cleanup, reduce cache size
Index: directory.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/directory.py,v
retrieving revision 1.98
retrieving revision 1.99
diff -C2 -d -r1.98 -r1.99
*** directory.py 18 Jan 2004 21:10:51 -0000 1.98
--- directory.py 19 Jan 2004 20:29:11 -0000 1.99
***************
*** 10,13 ****
--- 10,16 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.99 2004/01/19 20:29:11 dischi
+ # cleanup, reduce cache size
+ #
# Revision 1.98 2004/01/18 21:10:51 dischi
# first load fxd file, than call plugins
***************
*** 272,294 ****
! def getattr(self, attr):
"""
! return the specific attribute as string or an empty string
"""
! if attr == 'type':
if self.media:
return _('Directory on disc [%s]') % self.media.label
return _('Directory')
! if attr in ( 'freespace', 'totalspace' ):
if self.media:
return None
! space = eval('util.%s(self.dir)' % attr) / 1000000
if space > 1000:
space='%s,%s' % (space / 1000, space % 1000)
return space
! return Item.getattr(self, attr)
--- 275,297 ----
! def __getitem__(self, key):
"""
! return the specific attribute
"""
! if key == 'type':
if self.media:
return _('Directory on disc [%s]') % self.media.label
return _('Directory')
! if key in ( 'freespace', 'totalspace' ):
if self.media:
return None
! space = eval('util.%s(self.dir)' % key) / 1000000
if space > 1000:
space='%s,%s' % (space / 1000, space % 1000)
return space
! return Item.__getitem__(self, key)
***************
*** 348,352 ****
num_subdirs = self.info['num_subdirs']
num_files = self.info['num_files']
-
else:
num_subdirs = 0
--- 351,354 ----
Index: main.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/main.py,v
retrieving revision 1.107
retrieving revision 1.108
diff -C2 -d -r1.107 -r1.108
*** main.py 18 Jan 2004 16:49:39 -0000 1.107
--- main.py 19 Jan 2004 20:29:11 -0000 1.108
***************
*** 11,14 ****
--- 11,17 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.108 2004/01/19 20:29:11 dischi
+ # cleanup, reduce cache size
+ #
# Revision 1.107 2004/01/18 16:49:39 dischi
# check cache on startup
***************
*** 26,60 ****
# add mmpython warning
#
- # Revision 1.102 2004/01/03 17:43:14 dischi
- # OVERLAY_DIR is always used
- #
- # Revision 1.101 2004/01/01 12:27:38 dischi
- # bugfix and add config.TIME_DEBUG to trace the needed time
- #
- # Revision 1.100 2003/12/30 15:34:02 dischi
- # o move the shutdown function to plugins/shutdown
- # o merge the two parts of the main function
- #
- # Revision 1.99 2003/12/10 19:01:29 dischi
- # changes to the new Event.handler and Childapp2
- #
- # Revision 1.98 2003/12/07 19:40:30 dischi
- # convert OVERSCAN variable names
- #
- # Revision 1.97 2003/12/07 15:42:20 dischi
- # cleanup
- #
- # Revision 1.96 2003/12/06 13:46:11 dischi
- # changes to the new draw function in skin
- #
- # Revision 1.95 2003/12/04 21:50:20 dischi
- # include Splashscreen here
- #
- # Revision 1.94 2003/12/03 21:52:07 dischi
- # rename some skin function calls
- #
- # Revision 1.93 2003/11/30 14:39:54 dischi
- # load the fxditem
- #
# -----------------------------------------------------------------------
# Freevo - A Home Theater PC framework
--- 29,32 ----
***************
*** 420,424 ****
while 1:
-
# Get next command
while 1:
--- 392,395 ----
Index: item.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/item.py,v
retrieving revision 1.52
retrieving revision 1.53
diff -C2 -d -r1.52 -r1.53
*** item.py 18 Jan 2004 16:50:10 -0000 1.52
--- item.py 19 Jan 2004 20:29:11 -0000 1.53
***************
*** 10,13 ****
--- 10,16 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.53 2004/01/19 20:29:11 dischi
+ # cleanup, reduce cache size
+ #
# Revision 1.52 2004/01/18 16:50:10 dischi
# (re)move unneeded variables
***************
*** 431,452 ****
def __getitem__(self, attr):
"""
! return the specific attribute as string or an empty string
"""
if attr == 'runtime':
length = None
! if hasattr(self.info,'length') and self.info['length'] == 'None':
! self.info['length'] = None
! if hasattr(self.info,'runtime') and self.info['runtime'] == 'None':
! # For some reason it's the string None, instead of the
! # NoneType
! self.info['runtime'] = None
!
! if self.info and hasattr(self.info, 'runtime') and self.info['runtime']:
length = self.info['runtime']
! if not length and self.info and hasattr(self.info, 'length'):
length = self.info['length']
! if not length and self.info and hasattr(self.info, 'video') and \
! self.info['video']:
length = self.info['video'][0]['length']
if not length and hasattr(self, 'length'):
--- 434,447 ----
def __getitem__(self, attr):
"""
! return the specific attribute
"""
if attr == 'runtime':
length = None
! if self.info['runtime'] and self.info['runtime'] != 'None':
length = self.info['runtime']
! elif self.info['length'] and self.info['length'] != 'None':
length = self.info['length']
! elif hasattr(self.info.mmdata, 'video') and self.info.mmdata.video:
length = self.info['video'][0]['length']
if not length and hasattr(self, 'length'):
***************
*** 454,457 ****
--- 449,453 ----
if not length:
return ''
+
if isinstance(length, int) or isinstance(length, float) or \
isinstance(length, long):
***************
*** 488,497 ****
if attr[:4] == 'len(' and attr[-1] == ')':
r = None
! if self.info and self.info.has_key(attr[4:-1]):
r = self.info[attr[4:-1]]
! if not r and hasattr(self, attr[4:-1]):
r = getattr(self,attr[4:-1])
-
if r != None:
return len(r)
--- 484,492 ----
if attr[:4] == 'len(' and attr[-1] == ')':
r = None
! if self.info.has_key(attr[4:-1]):
r = self.info[attr[4:-1]]
! if (r == None or r == '') and hasattr(self, attr[4:-1]):
r = getattr(self,attr[4:-1])
if r != None:
return len(r)
***************
*** 502,508 ****
if self.info.has_key(attr):
r = self.info[attr]
! if not r:
! if hasattr(self, attr):
! r = getattr(self,attr)
if r != None:
return r
--- 497,502 ----
if self.info.has_key(attr):
r = self.info[attr]
! if (r == None or r == '') and hasattr(self, attr):
! r = getattr(self,attr)
if r != None:
return r
***************
*** 512,516 ****
def getattr(self, attr):
"""
! wrapper for __getitem__
"""
if attr[:4] == 'len(' and attr[-1] == ')':
--- 506,511 ----
def getattr(self, attr):
"""
! wrapper for __getitem__ to return the attribute as string or
! an empty string if the value is 'None'
"""
if attr[:4] == 'len(' and attr[-1] == ')':
Index: osd.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/osd.py,v
retrieving revision 1.126
retrieving revision 1.127
diff -C2 -d -r1.126 -r1.127
*** osd.py 18 Jan 2004 16:49:22 -0000 1.126
--- osd.py 19 Jan 2004 20:29:11 -0000 1.127
***************
*** 11,14 ****
--- 11,17 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.127 2004/01/19 20:29:11 dischi
+ # cleanup, reduce cache size
+ #
# Revision 1.126 2004/01/18 16:49:22 dischi
# more verbose
***************
*** 371,375 ****
self.app_list = []
! self.bitmapcache = util.objectcache.ObjectCache(10, desc='bitmap')
self.font_info_cache = {}
--- 374,378 ----
self.app_list = []
! self.bitmapcache = util.objectcache.ObjectCache(5, desc='bitmap')
self.font_info_cache = {}
Index: playlist.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/playlist.py,v
retrieving revision 1.58
retrieving revision 1.59
diff -C2 -d -r1.58 -r1.59
*** playlist.py 15 Jan 2004 21:15:28 -0000 1.58
--- playlist.py 19 Jan 2004 20:29:11 -0000 1.59
***************
*** 10,13 ****
--- 10,16 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.59 2004/01/19 20:29:11 dischi
+ # cleanup, reduce cache size
+ #
# Revision 1.58 2004/01/15 21:15:28 outlyer
# Fixed to use proper audio context buttons.
***************
*** 471,479 ****
"""
if event == PLAY_END:
if (self.current_item.type == 'audio'):
rc.post_event(Event(AUDIO_LOG, arg=self.current_item.filename))
! if event in (INPUT_1, INPUT_2, INPUT_3, INPUT_4, INPUT_5) and event.arg and
hasattr(self.current_item,'type'):
if (self.current_item.type == 'audio'):
rc.post_event(Event(RATING,(event.arg,self.current_item.filename)))
--- 474,484 ----
"""
+ # That doesn't belong here! It should be part of the player!!!
if event == PLAY_END:
if (self.current_item.type == 'audio'):
rc.post_event(Event(AUDIO_LOG, arg=self.current_item.filename))
! if event in (INPUT_1, INPUT_2, INPUT_3, INPUT_4, INPUT_5) and \
! event.arg and hasattr(self.current_item,'type'):
if (self.current_item.type == 'audio'):
rc.post_event(Event(RATING,(event.arg,self.current_item.filename)))
***************
*** 490,498 ****
if pos or self.repeat:
if hasattr(self.current_item, 'stop'):
! try:
! self.current_item.stop()
! except OSError:
! _debug_('ignore playlist event', 1)
! return True
self.current_item = self.playlist[pos]
self.play(menuw=menuw, arg='next')
--- 495,499 ----
if pos or self.repeat:
if hasattr(self.current_item, 'stop'):
! self.current_item.stop()
self.current_item = self.playlist[pos]
self.play(menuw=menuw, arg='next')
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog