/stdhome

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

« back to all changes in this revision

Viewing changes to lib/stdhome/config.py

  • Committer: Tim Marston
  • Date: 2016-02-13 14:21:53 UTC
  • Revision ID: tim@ed.am-20160213142153-68g7pzq0au6bejep
fixed init command

Show diffs side-by-side

added added

removed removed

43
43
                                lines = f.readlines()
44
44
                except IOError as e:
45
45
                        if e.errno != errno.ENOENT: raise
 
46
                        lines = list()
46
47
 
47
48
                # parse config
48
49
                config = dict();
73
74
                                        if( matches ):
74
75
                                                value = matches.group( 1 )
75
76
                                config[ "%s.%s" % ( section, name ) ] = value
76
 
                                print "  %s.%s = %s" % ( section, name, value )
 
77
                                #print "  %s.%s = %s" % ( section, name, value )
77
78
 
78
79
                # use config
79
80
                if 'stdhome.home-dir' in config:
86
87
 
87
88
        def to_bool( self, value ):
88
89
                value = value.lower()
89
 
                return value == 't' || value == 'true' || value == 'yes' || \
90
 
                        ( re.match( '[0-9]+$', value ) && int( value ) != 0 )
 
90
                return value == 't' or value == 'true' or value == 'yes' or \
 
91
                        ( re.match( '[0-9]+$', value ) and int( value ) != 0 )