~unidistro/unidistro/unidistro

« back to all changes in this revision

Viewing changes to framework/unidistro/configModule.py

  • Committer: Enrique Hernández Bello
  • Date: 2009-06-25 19:02:23 UTC
  • Revision ID: quique@osl.ull.es-20090625190223-lutikl73d2uikw4s
Removed spaces before brackets in all functions and methods.

Show diffs side-by-side

added added

removed removed

Lines of Context:
89
89
 
90
90
        _the_config = tags 
91
91
 
92
 
        def __init__ (self, conf_file):
 
92
        def __init__(self, conf_file):
93
93
                try:
94
94
                        doc = xml.dom.minidom.parse(conf_file)
95
95
                except IOError, e:
96
96
                        print "Error reading xml config file:"
97
97
                        print e
98
 
                        sys.exit (0)
 
98
                        sys.exit(0)
99
99
                        
100
100
                xmlHelper = xmlUtils.xmlUtils() # defined in unidistro/xmlUtils.py
101
101
                for node in doc.getElementsByTagName("configuration"):
111
111
                        self._the_config['project_name'] = os.path.splitext(os.path.basename(conf_file))[0];
112
112
 
113
113
                try:
114
 
                        self._the_config['build_repositories'] = xmlHelper.get_tags (
 
114
                        self._the_config['build_repositories'] = xmlHelper.get_tags(
115
115
                                        doc.getElementsByTagName('build_repositories')[0], 
116
116
                                        'repository'
117
117
                                )
127
127
                        except IOError, e:
128
128
                                print "Error reading xml config file:" + pkg_file
129
129
                                print e
130
 
                                sys.exit (0)
 
130
                                sys.exit(0)
131
131
 
132
132
                        for tag_node in doc.getElementsByTagName('live'):
133
133
                                pkgs = xmlHelper.get_tags(tag_node, "pkg")
174
174
                                self._the_config['packages'][pkg_fields['name']] = pkg_fields
175
175
 
176
176
                cp = ConfigParser.ConfigParser()
177
 
                cp.read(os.path.join (os.getenv ('HOME'), '.unidistro'))
 
177
                cp.read(os.path.join(os.getenv('HOME'), '.unidistro'))
178
178
                for parameter in [ 'tmp_dir', 'project_dir', 'repository_remote_base', 'arch', 'base_distribution', 'live_extra_content_dir' ]:
179
179
                        try:
180
180
                                self._the_config[parameter] = cp.get('global', parameter)
193
193
                # Path related to project_file_dir
194
194
                self._the_config['project_dir'] = os.path.join(self._the_config['project_file_dir'], self._the_config['project_dir'])
195
195
 
196
 
                self.printConfig ()
 
196
                self.printConfig()
197
197
 
198
 
        def printConfig (self):
 
198
        def printConfig(self):
199
199
                for tag in self.tags:
200
200
                        print tag + ":",
201
201
                        if tag == "packages":