Author: dmeyer
Date: Mon Feb 19 20:07:29 2007
New Revision: 9251
Modified:
trunk/ui/src/application/handler.py
trunk/ui/src/audio/audioitem.py
trunk/ui/src/config.py
trunk/ui/src/event.py
trunk/ui/src/fxditem.py
trunk/ui/src/gui/compat.py
Log:
some cosmetic changes
Modified: trunk/ui/src/application/handler.py
==============================================================================
--- trunk/ui/src/application/handler.py (original)
+++ trunk/ui/src/application/handler.py Mon Feb 19 20:07:29 2007
@@ -198,11 +198,6 @@
self.applications.insert(0, self.applications.pop())
self.set_focus()
- elif event == FUNCTION_CALL:
- # event is a direct function call, call it and do not
- # pass it on the the normal handling
- event.arg()
-
elif event.handler:
# event has it's own handler function, call this
# function and do not pass it on the the normal
Modified: trunk/ui/src/audio/audioitem.py
==============================================================================
--- trunk/ui/src/audio/audioitem.py (original)
+++ trunk/ui/src/audio/audioitem.py Mon Feb 19 20:07:29 2007
@@ -58,10 +58,10 @@
def __init__(self, url, parent):
MediaItem.__init__(self, parent, type='audio')
self.set_url(url)
- self.start = 0
- self.elapsed = 0
- self.remain = 0
- self.pause = 0
+ self.start = 0
+ self.elapsed = 0
+ self.remain = 0
+ self.pause = 0
try:
self.length = int(self.info['length'])
except:
Modified: trunk/ui/src/config.py
==============================================================================
--- trunk/ui/src/config.py (original)
+++ trunk/ui/src/config.py Mon Feb 19 20:07:29 2007
@@ -6,9 +6,9 @@
#
# -----------------------------------------------------------------------------
# Freevo - A Home Theater PC framework
-# Copyright (C) 2002 Krister Lagerstrom, 2003-2007 Dirk Meyer, et al.
+# Copyright (C) 2007 Dirk Meyer, et al.
#
-# First Edition: Krister Lagerstrom <[EMAIL PROTECTED]>
+# First Edition: Dirk Meyer <[EMAIL PROTECTED]>
# Maintainer: Dirk Meyer <[EMAIL PROTECTED]>
#
# Please see the file AUTHORS for a complete list of authors.
@@ -34,23 +34,24 @@
import os
import logging
+# kaa imports
import kaa.popcorn
from kaa.config import set_default
+# freevo core imports
import freevo.conf
from freevo.xmlconfig import xmlconfig
-# freevo imports
+# freevo ui imports
from freevo.ui import plugin
-# get logging object
-log = logging.getLogger('config')
-
# generate config
pycfgfile = freevo.conf.datafile('freevo_config.py')
cfgdir = os.path.join(freevo.conf.SHAREDIR, 'config')
cfgsource = [ os.path.join(cfgdir, f) for f in os.listdir(cfgdir) ]
xmlconfig(pycfgfile, cfgsource)
+
+# load config structure
execfile(pycfgfile)
# add external stuff
@@ -58,6 +59,9 @@
# load config
cfgfile = os.path.expanduser('~/.freevo/freevo2.conf')
+if '-c' in sys.argv:
+ cfgfile = sys.argv[sys.argv.index('-c')+1]
+
if not os.path.isfile(cfgfile):
print '%s does not exist' % cfgfile
print 'The file is now created and Freevo will stop so you can'
@@ -74,8 +78,11 @@
sys.exit(0)
if config.debug:
+ # FIXME: make it possible to set debug for specific parts.
+ # Maybe use an environment variable and hock it into freevo.core
+ # or kaa.base.
logging.getLogger().setLevel(logging.INFO)
-
+
# plugins ist a list of known plugins
for p in plugins:
c = config
Modified: trunk/ui/src/event.py
==============================================================================
--- trunk/ui/src/event.py (original)
+++ trunk/ui/src/event.py Mon Feb 19 20:07:29 2007
@@ -206,10 +206,6 @@
INPUT_ALL_NUMBERS = (INPUT_0, INPUT_1, INPUT_2, INPUT_3, INPUT_4, INPUT_5,
INPUT_6, INPUT_7, INPUT_8, INPUT_9, INPUT_0 )
-
-# Call the function specified in event.arg
-FUNCTION_CALL = Event('FUNCTION_CALL')
-
#
# Internal events, don't map any button on them
#
@@ -217,6 +213,3 @@
PLAY_END = Event('PLAY_END')
PLAY_START = Event('PLAY_START')
OSD_MESSAGE = Event('OSD_MESSAGE')
-
-# FIXME: delete this
-RECORD = Event('RECORD')
Modified: trunk/ui/src/fxditem.py
==============================================================================
--- trunk/ui/src/fxditem.py (original)
+++ trunk/ui/src/fxditem.py Mon Feb 19 20:07:29 2007
@@ -4,29 +4,14 @@
# -----------------------------------------------------------------------------
# $Id$
#
-# If you want to expand the fxd file with a new tag below <freevo>, you
-# can register a callback here. Create a class based on FXDItem (same
-# __init__ signature). The 'parser' is something from freevo.fxdparser, which
-# gets the real callback. After parsing, the variable 'items' from the
-# objects will be returned.
-#
-# Register your handler with the register function. 'types' is a list of
-# display types (e.g. 'audio', 'video', 'images'), handler is the class
-# (not an object of this class) which is a subclass of FXDItem.
-#
-# If the fxd files 'covers' a real item like the movie information cover
-# real movie files, please do
-# a) add the fxd file as 'fxd_file' memeber variable to the new item
-# b) add the files as list _fxd_covered_ to the item
-#
# -----------------------------------------------------------------------------
# Freevo - A Home Theater PC framework
-# Copyright (C) 2002-2005 Krister Lagerstrom, Dirk Meyer, et al.
+# Copyright (C) 2002 Krister Lagerstrom, 2003-2007 Dirk Meyer, et al.
#
# First Edition: Dirk Meyer <[EMAIL PROTECTED]>
# Maintainer: Dirk Meyer <[EMAIL PROTECTED]>
#
-# Please see the file doc/CREDITS for a complete list of authors.
+# Please see the file AUTHORS for a complete list of authors.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -50,30 +35,54 @@
import logging
import os
+# freevo core imports
import freevo.fxdparser
-import util
+# freevo imports
import plugin
-
from menu import Item, Action, Menu, MediaPlugin
# get logging object
log = logging.getLogger()
-# the parser for fxd nodes
-_callbacks = []
-def add_parser(types, node, callback):
+class Container(Item):
"""
- Add a node parser for fxd files.
+ A simple container containing for items parsed from the fxd
"""
- _callbacks.append((types, node, callback))
+ def __init__(self, title, image, info, parent):
+ Item.__init__(self, parent)
+ self.items = []
+ self.name = title
+ self.image = image
+ self.display_type = parent.display_type
+
+
+ def actions(self):
+ """
+ Actions for this item
+ """
+ return [ Action(_('Browse list'), self.browse) ]
+
+
+ def browse(self):
+ """
+ Show all items
+ """
+ self.pushmenu(Menu(self.name, self.items, type=self.display_type))
+
+
-
class PluginInterface(MediaPlugin):
"""
Class to handle fxd files in directories
"""
+
+ def __init__(self):
+ MediaPlugin.__init__(self)
+ self._callbacks = []
+
+
def get(self, parent, listing):
"""
Return a list of items based on the listing
@@ -111,13 +120,20 @@
return len(self.get(parent, listing))
+ def add_parser(self, types, node, callback):
+ """
+ Add a node parser for fxd files.
+ """
+ self._callbacks.append((types, node, callback))
+
+
def _parse(self, doc, node, parent, listing, display_type):
"""
Internal parser function
"""
items = []
for c in doc.get_content(node):
- for types, tag, handler in _callbacks:
+ for types, tag, handler in self._callbacks:
if display_type and types and not display_type in types:
# wrong type
continue
@@ -134,34 +150,7 @@
-class Container(Item):
- """
- a simple container containing for items parsed from the fxd
- """
- def __init__(self, title, image, info, parent):
- Item.__init__(self, parent)
- self.items = []
- self.name = title
- self.image = image
- self.display_type = parent.display_type
-
-
- def actions(self):
- """
- actions for this item
- """
- return [ Action(_('Browse list'), self.browse) ]
-
-
- def browse(self):
- """
- show all items
- """
- moviemenu = Menu(self.name, self.items, type=self.display_type)
- self.pushmenu(moviemenu)
-
-
-
# load the MediaPlugin
interface = PluginInterface()
+add_parser = interface.add_parser
plugin.activate(interface, level=0)
Modified: trunk/ui/src/gui/compat.py
==============================================================================
--- trunk/ui/src/gui/compat.py (original)
+++ trunk/ui/src/gui/compat.py Mon Feb 19 20:07:29 2007
@@ -124,7 +124,9 @@
def get_window(self):
return self.engine.canvas._window
-
+
+_Tvplayer = _Videoplayer
+
def Application(name):
return eval('_' + name.capitalize())()
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog