1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 '''
19 configure-time variables for installed or uninstalled operation
20
21 Code should run
22 >>> from flumotion.configure import configure
23
24 and then access the variables from the configure module. For example:
25 >>> print configure.gladedir
26
27 The values are decided at ./configure time. They can be overridden at startup
28 by programs based on environment or options. This allows running with
29 different configdir, logdir and rundir.
30
31 @var isinstalled: whether an installed version is being run
32 @type isinstalled: boolean
33
34 @var cachedir: directory where cached code is stored
35 @type cachedir: stringed
36 @var configdir: directory where configuration files are stored
37 @type configdir: string
38 @var daemondir: directory where daemonized programs should run
39 @type daemondir: string
40 @var datadir: directory where data files are stored
41 @type datadir: string
42 @var gladedir: directory where glade files are stored
43 @type gladedir: string
44 @var logdir: directory where log files are stored
45 @type logdir: string
46 @var imagedir: directory where image files are stored
47 @type imagedir: string
48 @var pythondir: directory where the flumotion python files are stored
49 @type pythondir: string
50 @var registrydir: directory where the registry files are stored
51 @type registrydir: string
52 @var rundir: directory where the run/pid files are stored
53 @type rundir: string
54 @var bindir: directory where the flumotion executables live
55 @type bindir: string
56 @var sbindir: directory where the flumotion service program lives
57 @type sbindir: string
58
59 @var defaultTCPManagerPort: the default manager port for TCP communication
60 @type defaultTCPManagerPort: int
61 @var defaultSSLManagerPort: the default manager port for SSL communication
62 @type defaultSSLManagerPort: int
63 @var defaultHTTPStreamPort: the default external http streaming port
64 @type defaultHTTPStreamPort: int
65 @var defaultGstPortRange: the default range of internal GStreamer ports
66 @type defaultGstPortRange: list of ints
67
68 @var PACKAGE: Flumotion package
69 @type PACKAGE: string
70 @var version: Flumotion version number
71 @type version: string
72 @var versionTuple: Flumotion version number
73 @type versionTuple: 4-tuple of integers
74 @var branchName: Flumotion branch name
75 @type branchName: string
76
77 # default values for service-related stuff
78
79 @var processTermWait: how long to wait before timing out term signals
80 @type processTermWait int
81 @var processKillWait: how long to wait before timing out kill signals
82 @type processKillWait int
83 @var heartbeatInterval: component heartbeat interval, in seconds
84 @type heartbeatInterval: int
85 @var pingTimeoutMultiplier: how long to wait before assuming a lost
86 connection, specified as a multiple of the
87 heartbeatInterval
88 @type pingTimeoutMultiplier: float
89 '''
90
91
92
93
94
95 import os
96
97 __version__ = "$Rev$"
98
99
100 __thisdir = os.path.dirname(os.path.abspath(__file__))
101
102 if os.path.exists(os.path.join(__thisdir, 'uninstalled.py')):
103 from flumotion.configure import uninstalled
104 _config = uninstalled.get()
105 else:
106 from flumotion.configure import installed
107 _config = installed.get()
108
109
111 versionString = versionString.split('-')[0]
112 t = tuple(map(int, versionString.split('.')))
113 if len(t) < 4:
114 t = t + (0, )
115 return t
116
117 isinstalled = _config['isinstalled']
118
119 cachedir = _config['cachedir']
120 configdir = _config['configdir']
121 daemondir = _config['daemondir']
122 datadir = _config['datadir']
123 gladedir = _config['gladedir']
124 imagedir = _config['imagedir']
125 logdir = _config['logdir']
126 localedatadir = _config['localedatadir']
127 pythondir = _config['pythondir']
128 registrydir = _config['registrydir']
129 rundir = _config['rundir']
130 bindir = _config['bindir']
131 sbindir = _config['sbindir']
132
133 defaultTCPManagerPort = 8642
134 defaultSSLManagerPort = 7531
135 defaultHTTPStreamPort = 8800
136 defaultGstPortRange = range(8600, 8639 + 1)
137
138 PACKAGE = 'flumotion'
139 version = _config['version']
140 versionTuple = _versionStringToTuple(version)
141 branchName = 'trunk'
142
143 processTermWait = 20
144 processKillWait = 10
145 heartbeatInterval = 5
146
147
148
149 pingTimeoutMultiplier = 6.0
150