Changeset b8d291d in osmose-backend


Ignore:
Timestamp:
Apr 6, 2015 8:14:58 PM (5 years ago)
Author:
Jocelyn Jaubert <jocelyn.jaubert@…>
Branches:
master
Children:
5582298
Parents:
f92c7ca
git-author:
Jocelyn Jaubert <jocelyn.jaubert@…> (06/04/2015 20:06:45)
git-committer:
Jocelyn Jaubert <jocelyn.jaubert@…> (06/04/2015 20:14:58)
Message:

Add version field to XML file sent to frontend

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • modules/OsmoseErrorFile.py

    ra25a091 rb8d291d  
    5555    def analyser(self, change=False): 
    5656        self.mode = "analyserChange" if change else "analyser" 
    57         self.outxml.startElement(self.mode, {"timestamp":time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime())}) 
     57        attrs = {} 
     58        attrs["timestamp"] = time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime()) 
     59        if self.config.version: 
     60            attrs["version"] = self.config.version 
     61        self.outxml.startElement(self.mode, attrs) 
    5862 
    5963    def analyser_end(self): 
  • osmose_run.py

    r433b880 rb8d291d  
    481481    err_code = 0 
    482482    country = conf.country 
     483    try: 
     484      version = get_version() 
     485    except: 
     486      version = None 
    483487 
    484488    if not check_database(conf, logger): 
     
    592596                    analyser_conf.dst_file += ".bz2" 
    593597                    analyser_conf.dst = os.path.join(conf.dir_results, analyser_conf.dst_file) 
     598                    analyser_conf.version = version 
    594599                    with obj(analyser_conf, logger.sub()) as analyser_obj: 
    595600                        if not options.change or not xml_change: 
Note: See TracChangeset for help on using the changeset viewer.