/stdhome

To get this branch, use:
bzr branch http://bzr.ed.am/stdhome

« back to all changes in this revision

Viewing changes to src/stdhome.in

  • Committer: Tim Marston
  • Date: 2021-07-05 19:14:32 UTC
  • Revision ID: tim@ed.am-20210705191432-243ayb7s2nmussvi
python3ification

Show diffs side-by-side

added added

removed removed

1
 
#!/usr/bin/python
 
1
#!/usr/bin/python3
2
2
#
3
3
# stdhome
4
4
#
21
21
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
22
 
23
23
 
24
 
# @PACKAGE_NAME@ version @PACKAGE_VERSION@
25
 
 
 
24
# @PACKAGE_NAME@ version @PACKAGE_VERSION@@bzr_info@
26
25
 
27
26
if __name__ == "__main__":
28
27
 
29
28
        import sys
30
29
        from os.path import join, abspath, exists
31
30
 
 
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
 
32
36
        # check for a development source directory and use that if it's there
33
37
        PACKAGE_DIR = join( abspath( sys.path[ 0 ] ), "..", "lib" )
34
38
        if exists( join( PACKAGE_DIR, "stdhome", "the.py" ) ):
35
 
                print >> sys.stderr, "!!! using development packages !!!"
 
39
                print("!!! using development packages !!!", file=sys.stderr)
36
40
                sys.path.insert( 0, PACKAGE_DIR )
37
41
        else:
38
42
                del PACKAGE_DIR
39
 
 
 
43
        
40
44
        # start main program
41
45
        from stdhome import the
42
46
        from stdhome.program import Program
43
 
        the.program = Program( "@PACKAGE_VERSION@" )
 
47
        the.program = Program( "@PACKAGE_VERSION@@bzr_info@" )
44
48
        the.program.run()