bzr branch
http://bzr.ed.am/stdhome
87
by Tim Marston
fix debian dist-package installation |
1 |
#!/usr/bin/python3 |
9
by Tim Marston
changed use of python |
2 |
# |
1
by Tim Marston
initial commit; basic app startup and initial command-line processing |
3 |
# stdhome |
4 |
# |
|
5 |
# Copyright (C) 2013 Tim Marston <tim@edm.am> |
|
6 |
# |
|
7 |
# This file is part of stdhome (hereafter referred to as "this program"). |
|
8 |
# See http://ed.am/dev/stdhome for more information. |
|
9 |
# |
|
10 |
# This program is free software: you can redistribute it and/or modify |
|
11 |
# it under the terms of the GNU General Public License as published by |
|
12 |
# the Free Software Foundation, either version 3 of the License, or |
|
13 |
# (at your option) any later version. |
|
14 |
# |
|
15 |
# This program is distributed in the hope that it will be useful, |
|
16 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
17 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
18 |
# GNU General Public License for more details. |
|
19 |
# |
|
20 |
# You should have received a copy of the GNU General Public License |
|
21 |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
22 |
||
23 |
||
47
by Tim Marston
added bzr revno to version info, when available |
24 |
# @PACKAGE_NAME@ version @PACKAGE_VERSION@@bzr_info@ |
1
by Tim Marston
initial commit; basic app startup and initial command-line processing |
25 |
|
26 |
if __name__ == "__main__": |
|
27 |
||
28 |
import sys |
|
29 |
from os.path import join, abspath, exists |
|
30 |
||
87
by Tim Marston
fix debian dist-package installation |
31 |
# add regular site-package directories (for debian) |
32 |
for path in sys.path: |
|
33 |
if path.endswith('dist-packages'): |
|
34 |
sys.path.append( path[:-13] + 'site-packages' ) |
|
35 |
||
1
by Tim Marston
initial commit; basic app startup and initial command-line processing |
36 |
# check for a development source directory and use that if it's there |
37 |
PACKAGE_DIR = join( abspath( sys.path[ 0 ] ), "..", "lib" ) |
|
2
by Tim Marston
added global objects (the.repo, the.program), deployment object and implemented |
38 |
if exists( join( PACKAGE_DIR, "stdhome", "the.py" ) ): |
87
by Tim Marston
fix debian dist-package installation |
39 |
print("!!! using development packages !!!", file=sys.stderr) |
1
by Tim Marston
initial commit; basic app startup and initial command-line processing |
40 |
sys.path.insert( 0, PACKAGE_DIR ) |
41 |
else: |
|
42 |
del PACKAGE_DIR |
|
87
by Tim Marston
fix debian dist-package installation |
43 |
|
1
by Tim Marston
initial commit; basic app startup and initial command-line processing |
44 |
# start main program |
2
by Tim Marston
added global objects (the.repo, the.program), deployment object and implemented |
45 |
from stdhome import the |
46 |
from stdhome.program import Program |
|
47
by Tim Marston
added bzr revno to version info, when available |
47 |
the.program = Program( "@PACKAGE_VERSION@@bzr_info@" ) |
2
by Tim Marston
added global objects (the.repo, the.program), deployment object and implemented |
48 |
the.program.run() |