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 '''
90
91
92
93
94
95 import os
96
97 __version__ = "$Rev: 7081 $"
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
110 t = tuple(map(int, versionString.split('.')))
111 if len(t) < 4:
112 t = t + (0,)
113 return t
114
115 isinstalled = _config['isinstalled']
116
117 cachedir = _config['cachedir']
118 configdir = _config['configdir']
119 daemondir = _config['daemondir']
120 datadir = _config['datadir']
121 gladedir = _config['gladedir']
122 imagedir = _config['imagedir']
123 logdir = _config['logdir']
124 localedatadir = _config['localedatadir']
125 pythondir = _config['pythondir']
126 registrydir = _config['registrydir']
127 rundir = _config['rundir']
128 bindir = _config['bindir']
129 sbindir = _config['sbindir']
130
131 defaultTCPManagerPort = 8642
132 defaultSSLManagerPort = 7531
133 defaultHTTPStreamPort = 8800
134 defaultGstPortRange = range(8600, 8639 + 1)
135
136 PACKAGE = 'flumotion'
137 version = _config['version']
138 versionTuple = _versionStringToTuple(version)
139 branchName = 'trunk'
140
141 processTermWait = 10
142 processKillWait = 5
143 heartbeatInterval = 5
144