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: stringed
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 defaultHTTPStreamPort: the default external http streaming port
68 @type defaultHTTPStreamPort: int
69 @var defaultGstPortRange: the default range of internal GStreamer ports
70 @type defaultGstPortRange: list of ints
71
72 @var PACKAGE: Flumotion package
73 @type PACKAGE: string
74 @var version: Flumotion version number
75 @type version: string
76 @var versionTuple: Flumotion version number
77 @type versionTuple: 4-tuple of integers
78 @var branchName: Flumotion branch name
79 @type branchName: string
80
81 # default values for service-related stuff
82
83 @var processTermWait: how long to wait before timing out term signals
84 @type processTermWait int
85 @var processKillWait: how long to wait before timing out kill signals
86 @type processKillWait int
87 @var heartbeatInterval: component heartbeat interval, in seconds
88 @type heartbeatInterval: int
89 @var pingTimeoutMultiplier: how long to wait before assuming a lost
90 connection, specified as a multiple of the
91 heartbeatInterval
92 @type pingTimeoutMultiplier: float
93 '''
94
95
96
97
98
99 import os
100
101 __version__ = "$Rev: 8521 $"
102
103
104 __thisdir = os.path.dirname(os.path.abspath(__file__))
105
106 if os.path.exists(os.path.join(__thisdir, 'uninstalled.py')):
107 from flumotion.configure import uninstalled
108 _config = uninstalled.get()
109 else:
110 from flumotion.configure import installed
111 _config = installed.get()
112
113
115 versionString = versionString.split('-')[0]
116 t = tuple(map(int, versionString.split('.')))
117 if len(t) < 4:
118 t = t + (0, )
119 return t
120
121 isinstalled = _config['isinstalled']
122
123 cachedir = _config['cachedir']
124 configdir = _config['configdir']
125 daemondir = _config['daemondir']
126 datadir = _config['datadir']
127 gladedir = _config['gladedir']
128 imagedir = _config['imagedir']
129 logdir = _config['logdir']
130 localedatadir = _config['localedatadir']
131 pythondir = _config['pythondir']
132 registrydir = _config['registrydir']
133 rundir = _config['rundir']
134 bindir = _config['bindir']
135 sbindir = _config['sbindir']
136
137 defaultTCPManagerPort = 8642
138 defaultSSLManagerPort = 7531
139 defaultHTTPStreamPort = 8800
140 defaultGstPortRange = range(8600, 8639 + 1)
141
142 PACKAGE = 'flumotion'
143 version = _config['version']
144 versionTuple = _versionStringToTuple(version)
145 branchName = 'trunk'
146
147 processTermWait = 20
148 processKillWait = 10
149 heartbeatInterval = 5
150
151
152
153 pingTimeoutMultiplier = 6.0
154