Package flumotion :: Package configure :: Module installed
[hide private]

Source Code for Module flumotion.configure.installed

 1  # -*- Mode: Python; test-case-name: flumotion.test.test_flumotion_config -*- 
 2  # vi:si:et:sw=4:sts=4:ts=4 
 3  # 
 4  # Flumotion - a streaming media server 
 5  # Copyright (C) 2004,2005,2006,2007 Fluendo, S.L. (www.fluendo.com). 
 6  # All rights reserved. 
 7   
 8  # This file may be distributed and/or modified under the terms of 
 9  # the GNU General Public License version 2 as published by 
10  # the Free Software Foundation. 
11  # This file is distributed without any warranty; without even the implied 
12  # warranty of merchantability or fitness for a particular purpose. 
13  # See "LICENSE.GPL" in the source distribution for more information. 
14   
15  # Licensees having purchased or holding a valid Flumotion Advanced 
16  # Streaming Server license may use this file in accordance with the 
17  # Flumotion Advanced Streaming Server Commercial License Agreement. 
18  # See "LICENSE.Flumotion" in the source distribution for more information. 
19   
20  # Headers in this file shall remain intact. 
21   
22  import os 
23   
24 -def get():
25 try: 26 homedir = os.environ['HOME'] 27 registrydir = os.path.join(homedir, '.flumotion') 28 cachedir = os.path.join(homedir, '.flumotion') 29 daemondir = homedir 30 def ensure(path): 31 try: 32 os.listdir(path) 33 except: 34 os.makedirs(path)
35 ensure(registrydir) 36 ensure(cachedir) 37 except KeyError: 38 registrydir = os.path.join('/var', 'cache', 'flumotion', 39 '.flumotion') 40 cachedir = os.path.join('/var', 'cache', 'flumotion', 41 '.flumotion') 42 daemondir = os.path.join('/var', 'cache', 'flumotion') 43 except OSError, e: 44 print 'Error making dir %s: %s' % (e.filename, e.strerror) 45 print 'Things are probably going to break!' 46 47 return { 48 'isinstalled': True, 49 'cachedir': cachedir, 50 'configdir': os.path.join('/etc', 'flumotion'), 51 'daemondir': daemondir, 52 'datadir': os.path.join('/usr/share', 'flumotion'), 53 'gladedir': os.path.join('/usr/share', 'flumotion', 'glade'), 54 'imagedir': os.path.join('/usr/share', 'flumotion', 'image'), 55 'localedatadir': os.path.join('/usr/share'), 56 'logdir': os.path.join('/var', 'log', 'flumotion'), 57 'pythondir': os.path.join('/usr/lib', 'flumotion', 'python'), 58 'registrydir': registrydir, 59 'rundir': os.path.join('/var', 'run', 'flumotion'), 60 'bindir': '@BINDIR@', 61 'sbindir': '/usr/sbin', 62 'version': '0.4.2', 63 } 64