/stdhome

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