1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 '''
23 configure-time variables for installed or uninstalled operation
24
25 Code should run
26 >>> from flumotion.configure import configure
27
28 and then access the variables from the configure module. For example:
29 >>> print configure.gladedir
30
31 The values are decided at ./configure time. They can be overridden at startup
32 by programs based on environment or options. This allows running with
33 different configdir, logdir and rundir.
34
35 @var isinstalled: whether an installed version is being run
36 @type isinstalled: boolean
37
38 @var cachedir: directory where cached code is stored
39 @type cachedir: string
40 @var configdir: directory where configuration files are stored
41 @type configdir: string
42 @var daemondir: directory where daemonized programs should run
43 @type daemondir: string
44 @var datadir: directory where data files are stored
45 @type datadir: string
46 @var gladedir: directory where glade files are stored
47 @type gladedir: string
48 @var logdir: directory where log files are stored
49 @type logdir: string
50 @var imagedir: directory where image files are stored
51 @type imagedir: string
52 @var pythondir: directory where the flumotion python files are stored
53 @type pythondir: string
54 @var registrydir: directory where the registry files are stored
55 @type registrydir: string
56 @var rundir: directory where the run/pid files are stored
57 @type rundir: string
58 @var bindir: directory where the flumotion executables live
59 @type bindir: string
60 @var sbindir: directory where the flumotion service program lives
61 @type sbindir: string
62
63 @var defaultTCPManagerPort: the default manager port for TCP communication
64 @type defaultTCPManagerPort: int
65 @var defaultSSLManagerPort: the default manager port for SSL communication
66 @type defaultSSLManagerPort: int
67 @var defaultStreamPortRange: the default range of external streaming ports
68 @type defaultStreamPortRange: list of ints
69 @var defaultGstPortRange: the default range of internal GStreamer ports
70 @type defaultGstPortRange: list of ints
71
72 @var version: Flumotion version number
73 @type version: string
74 @var versionTuple: Flumotion version number
75 @type versionTuple: 4-tuple of integers
76 '''
77
78
79
80
81
82
83
84 import os
85
86
87 __thisdir = os.path.dirname(os.path.abspath(__file__))
88
89 if os.path.exists(os.path.join(__thisdir, 'uninstalled.py')):
90 from flumotion.configure import uninstalled
91 _config = uninstalled.get()
92 else:
93 from flumotion.configure import installed
94 _config = installed.get()
95
96
97 _config['defaultTCPManagerPort'] = 8642
98 _config['defaultSSLManagerPort'] = 7531
99 _config['defaultStreamPortRange'] = range(8800, 8844 + 1)
100 _config['defaultGstPortRange'] = range(8600, 8639 + 1)
101
102
103
104 _config['processTermWait'] = 5
105 _config['processKillWait'] = 5
106
107
108 _config['heartbeatInterval'] = 5
109
111 t = tuple(map(int, versionString.split('.')))
112 if len (t) < 4:
113 t = t + (0,)
114 return t
115 _config['versionTuple'] = _versionStringToTuple(_config['version'])
116
117 for key, value in _config.items():
118 dictionary = locals()
119 dictionary[key] = value
120