/stdhome

To get this branch, use:
bzr branch http://bzr.ed.am/stdhome
9 by Tim Marston
changed use of python
1
#!/usr/bin/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
31
	# check for a development source directory and use that if it's there
32
	PACKAGE_DIR = join( abspath( sys.path[ 0 ] ), "..", "lib" )
2 by Tim Marston
added global objects (the.repo, the.program), deployment object and implemented
33
	if exists( join( PACKAGE_DIR, "stdhome", "the.py" ) ):
1 by Tim Marston
initial commit; basic app startup and initial command-line processing
34
		print >> sys.stderr, "!!! using development packages !!!"
35
		sys.path.insert( 0, PACKAGE_DIR )
36
	else:
37
		del PACKAGE_DIR
38
39
	# start main program
2 by Tim Marston
added global objects (the.repo, the.program), deployment object and implemented
40
	from stdhome import the
41
	from stdhome.program import Program
47 by Tim Marston
added bzr revno to version info, when available
42
	the.program = Program( "@PACKAGE_VERSION@@bzr_info@" )
2 by Tim Marston
added global objects (the.repo, the.program), deployment object and implemented
43
	the.program.run()