Author: dmeyer
Date: Fri Feb  2 20:19:40 2007
New Revision: 9130

Modified:
   trunk/core/src/conf.py
   trunk/core/src/distribution.py
   trunk/ui/src/config.py
   trunk/ui/src/gui/theme.py
   trunk/ui/src/setup.py
   trunk/ui/src/video/plugins/bookmarker.py

Log:
even more config cleanup

Modified: trunk/core/src/conf.py
==============================================================================
--- trunk/core/src/conf.py      (original)
+++ trunk/core/src/conf.py      Fri Feb  2 20:19:40 2007
@@ -48,14 +48,13 @@
 # Application name. This name is used to locate the config file.
 # Possible locations are ., ~/application, /etc/application and
 # /usr/local/etc/application. The name of the config file is
-# application.conf. It not defined, the variables vfs, encoding and
-# cachedir are added to the resulting struct to have all needed informations.
+# application.conf.
 application = 'freevo'
 
 
 # That's it, you shouldn't need to make changes after this point
 
-__all__ = [ 'cachefile', 'datafile', 'SHAREDIR', 'DATADIR', 'ENCODING' ]
+__all__ = [ 'datafile', 'SHAREDIR', 'cfgfilepath' ]
 
 # Python imports
 import os
@@ -105,13 +104,6 @@
 
 SHAREDIR = ''
 
-# set default cachedir
-if os.uname()[0] == 'FreeBSD':
-    OS_CACHEDIR = '/var/db'
-else:
-    OS_CACHEDIR = '/var/cache'
-
-CACHEDIR = OS_CACHEDIR + '/' + application
 DATADIR  = '/var/lib/' + application
 LOGDIR   = '/var/log/' + application
 
@@ -133,15 +125,6 @@
 # create needed directories.
 # FIXME: make sure we can write to them
 
-# create cachedir
-if not os.path.isdir(CACHEDIR):
-    try:
-        os.makedirs(CACHEDIR)
-    except OSError:
-        CACHEDIR = os.path.expanduser('~/.' + application + '/cache')
-        if not os.path.isdir(CACHEDIR):
-            os.makedirs(CACHEDIR)
-
 # create datadir
 if not os.path.isdir(DATADIR):
     try:
@@ -212,26 +195,8 @@
 Timer(garbage_collect).start(5)
 
 
-def cachefile(name, uid=False):
-    """
-    Return a cachefile based on the name. The result is an absolute path.
-    If uid is True, the uid will be added to the name.
-    """
-    if uid:
-        return os.path.join(CACHEDIR, name + '-' + str(os.getuid()))
-    else:
-        return os.path.join(CACHEDIR, name)
-
-
 def datafile(name):
     """
     Return a datafile based on the name. The result is an absolute path.
     """
     return os.path.join(DATADIR, name)
-
-
-def logfile(name):
-    """
-    Return a datafile based on the name. The result is an absolute path.
-    """
-    return os.path.join(LOGDIR, name)

Modified: trunk/core/src/distribution.py
==============================================================================
--- trunk/core/src/distribution.py      (original)
+++ trunk/core/src/distribution.py      Fri Feb  2 20:19:40 2007
@@ -80,25 +80,6 @@
     return result
 
 
-def check_libs(libs):
-    """
-    check for python libs installed
-    """
-    # ok, this can't be done by setup it seems, so we have to do it
-    # manually
-    if len(sys.argv) > 1 and sys.argv[1].lower() == 'install':
-        # check for needed libs
-        for module, url in libs:
-            print 'checking for %-13s' % (module+'...'),
-            try:
-                exec('import %s' % module)
-                print 'found'
-            except:
-                print 'not found'
-                print 'please download it from %s and install it' % url
-                sys.exit(1)
-            
-
 def i18n_mo(app):
     print 'updating mo files'
     for file in ([ os.path.join('i18n', fname) for \

Modified: trunk/ui/src/config.py
==============================================================================
--- trunk/ui/src/config.py      (original)
+++ trunk/ui/src/config.py      Fri Feb  2 20:19:40 2007
@@ -56,7 +56,7 @@
 import freevo.conf
 
 # freevo imports
-from freevo.ui import setup, input, plugin
+from freevo.ui import input, plugin
 
 # import event names
 from freevo.ui.event import *
@@ -119,15 +119,6 @@
 
 
 #
-# search missing programs at runtime
-#
-for program, valname, needed in setup.EXTERNAL_PROGRAMS:
-    if not hasattr(CONF, valname) or not getattr(CONF, valname):
-        setup.check_program(CONF, program, valname, needed, verbose=0)
-    if not hasattr(CONF, valname) or not getattr(CONF, valname):
-        setattr(CONF, valname, '')
-
-#
 # Load freevo_config.py:
 #
 FREEVO_CONFIG = os.path.join(freevo.conf.SHAREDIR, 'freevo_config.py')
@@ -193,10 +184,3 @@
 #
 if len(sys.argv) >= 2 and sys.argv[1] == '--force-fs':
     GUI_FULLSCREEN = 1
-
-
-# make sure USER and HOME are set
-os.environ['USER'] = pwd.getpwuid(os.getuid())[0]
-os.environ['HOME'] = pwd.getpwuid(os.getuid())[5]
-
-cfgfilepath = freevo.conf.cfgfilepath

Modified: trunk/ui/src/gui/theme.py
==============================================================================
--- trunk/ui/src/gui/theme.py   (original)
+++ trunk/ui/src/gui/theme.py   Fri Feb  2 20:19:40 2007
@@ -1430,7 +1430,7 @@
 
     # search for personal skin settings additions
     # (this feature needs more doc outside this file)
-    for dir in config.cfgfilepath:
+    for dir in freevo.conf.cfgfilepath:
         local_skin = '%s/local_skin.fxd' % dir
         if os.path.isfile(local_skin):
             log.debug('add local config %s to skin' % local_skin)

Modified: trunk/ui/src/setup.py
==============================================================================
--- trunk/ui/src/setup.py       (original)
+++ trunk/ui/src/setup.py       Fri Feb  2 20:19:40 2007
@@ -11,23 +11,6 @@
 # Todo:        
 #
 # -----------------------------------------------------------------------
-# $Log$
-# Revision 1.2  2005/06/25 08:52:24  dischi
-# switch to new style python classes
-#
-# Revision 1.1  2005/05/30 18:01:02  dischi
-# move setup_freevo to config/setup
-#
-# Revision 1.19  2005/05/30 17:46:38  dischi
-# remove runtime
-#
-# Revision 1.18  2004/07/10 12:33:36  dischi
-# header cleanup
-#
-# Revision 1.17  2004/07/08 12:44:40  rshortt
-# Add directfb as a display option.
-#
-# -----------------------------------------------------------------------
 # Freevo - A Home Theater PC framework
 # Copyright (C) 2002-2005 Krister Lagerstrom, Dirk Meyer, et al. 
 # Please see the file doc/CREDITS for a complete list of authors.
@@ -59,25 +42,6 @@
 
 CONFIG_VERSION = 2.1
 
-EXTERNAL_PROGRAMS = (("mplayer", "mplayer", 1),
-                     ("mencoder", "mencoder", 0),
-                     ("tvtime", "tvtime", 0),
-                     ("xine", "xine", 0),
-                     ("fbxine", "fbxine", 0),
-                     ("jpegtran", "jpegtran", 0),
-                     ("xmame.x11", "xmame", 0),
-                     ("xmame.SDL", "xmame", 0),
-                     ("xmame","xmame",0),
-                     ("ssnes9x", "snes", 0),
-                     ("zsnes", "snes", 0 ),
-                     ("lame", "lame",0),
-                     ("flac","flac",0),
-                     ("cdparanoia","cdparanoia",0),
-                     ("oggenc","oggenc",0),
-                     ("renice","renice",0),
-                     ("setterm", "setterm", 0),
-                     ("mpav", "mpav", 0))
-
 # Help text
 def print_usage():
     usage = _('''\
@@ -108,16 +72,6 @@
 
 
 
-def match_files_recursively_helper(result, dirname, names):
-    if dirname == '.' or dirname[:5].upper() == './WIP':
-        return result
-    for name in names:
-        if os.path.splitext(name)[1].lower()[1:] == 'py':
-            fullpath = os.path.join(dirname, name)
-            result.append(fullpath)
-    return result
-
-
 def check_config(conf):
     vals_geometry = ['800x600', '768x576', '640x480']
     vals_display = ['x11', 'fbdev', 'directfb', 'dfbmga', 'mga']
@@ -157,37 +111,6 @@
     print 'wrote %s' % outfile
 
 
-def check_program(conf, name, variable, necessary, verbose=1):
-
-    search_dirs = os.environ['PATH'].split(':')
-        
-    if verbose:
-        print _('checking for %-13s') % (name+'...'),
-
-    for dirname in search_dirs:
-        filename = os.path.join(dirname, name)
-        if os.path.exists(filename) and os.path.isfile(filename):
-            if verbose:
-                print filename
-            conf.__dict__[variable] = filename
-            break
-    else:
-        if necessary:
-            print
-            print 
"********************************************************************"
-            print _('ERROR: can\'t find %s') % name
-            print _('Please install the application respectively put it in 
your path.')
-            print _('Freevo won\'t work without it.')
-            print 
"********************************************************************"
-            print
-            print
-            sys.exit(1)
-        elif verbose:
-            print _('not found (deactivated)')
-
-
-
-
 def run_as_main():
     # Default opts
 
@@ -222,9 +145,6 @@
             conf.tv = a
 
 
-    for program, valname, needed in EXTERNAL_PROGRAMS:
-        check_program(conf, program, valname, needed)
-
     check_config(conf)
 
     # set geometry for display/tv combinations without a choice

Modified: trunk/ui/src/video/plugins/bookmarker.py
==============================================================================
--- trunk/ui/src/video/plugins/bookmarker.py    (original)
+++ trunk/ui/src/video/plugins/bookmarker.py    Fri Feb  2 20:19:40 2007
@@ -75,7 +75,7 @@
         Get the bookmark file for the given filename.
         """
         myfile = os.path.basename(filename)
-        myfile = freevo.conf.cachefile(myfile + '.bookmark')
+        myfile = freevo.conf.datafile(myfile + '.bookmark')
         return myfile
 
 

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to