Changeset 8fe9cb8 in osmose-backend


Ignore:
Timestamp:
Jun 8, 2014 10:35:55 PM (5 years ago)
Author:
Jocelyn Jaubert <jocelyn.jaubert@…>
Branches:
master
Children:
4fa8af6
Parents:
a3a7bf4 (diff), 8ecd1e4 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge remote-tracking branch 'frodrigo/master'

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • analysers/analyser_merge_recycling_FR_cub.py

    rd53a9cf r8ecd1e4  
    2727    def __init__(self, config, logger = None): 
    2828        self.missing_official = {"item":"8120", "class": 1, "level": 3, "tag": ["merge", "recycling"], "desc": T_(u"CUB glass recycling not integrated") } 
    29         self.possible_merge   = {"item":"8121", "class": 1, "level": 3, "tag": ["merge", "recycling"], "desc": T_(u"CUB glass recycling, integration suggestion") } 
     29        self.possible_merge   = {"item":"8121", "class": 3, "level": 3, "tag": ["merge", "recycling"], "desc": T_(u"CUB glass recycling, integration suggestion") } 
    3030        Analyser_Merge.__init__(self, config, logger, 
    3131            Source( 
  • analysers/Analyser.py

    rf6117b7 r642beae  
    7777        sys.path.append(".") 
    7878        import modules.OsmoseLog 
    79         if not hasattr(__builtin__, "logger"): 
    80             __builtin__.logger = modules.OsmoseLog.logger(sys.stdout, True) 
     79        if not hasattr(cls, "logger"): 
     80            cls.logger = modules.OsmoseLog.logger(sys.stdout, True) 
    8181 
    8282    @classmethod 
  • analysers/Analyser_Osmosis.py

    r104b49d r642beae  
    250250            from nose import SkipTest 
    251251            try: 
    252                 if not osmose_run.check_database(conf): 
     252                if not osmose_run.check_database(conf, cls.logger): 
    253253                    raise SkipTest("database not present") 
    254254            except: 
    255255                raise SkipTest("database not present") 
    256             osmose_run.init_database(conf) 
     256            osmose_run.init_database(conf, cls.logger) 
    257257 
    258258        analyser_conf = osmose_run.analyser_config() 
     
    289289        conf.download["osmosis"] = "test" 
    290290        conf.init() 
    291         osmose_run.clean_database(conf, False) 
     291        osmose_run.clean_database(conf, cls.logger, False) 
    292292 
    293293        # clean results file 
  • analysers/analyser_osmosis_roundabout_reverse.py

    rb755753 r642beae  
    6969    def test_left(self): 
    7070        self.conf.options["driving_side"] = "left" 
    71         with Analyser_Osmosis_Roundabout_Reverse(self.conf, logger) as a: 
     71        with Analyser_Osmosis_Roundabout_Reverse(self.conf, self.logger) as a: 
    7272            a.analyser() 
    7373 
     
    7878    def test_right(self): 
    7979        self.conf.options["driving_side"] = "right" 
    80         with Analyser_Osmosis_Roundabout_Reverse(self.conf, logger) as a: 
     80        with Analyser_Osmosis_Roundabout_Reverse(self.conf, self.logger) as a: 
    8181            a.analyser() 
    8282 
  • osmose_run.py

    r818fd31 r642beae  
    8888########################################################################### 
    8989 
    90 def check_database(conf): 
     90def check_database(conf, logger): 
    9191 
    9292    if "osmosis" in conf.download: 
     
    130130    return True 
    131131 
    132 def init_database(conf): 
     132def init_database(conf, logger): 
    133133 
    134134    # import posgis 
     
    221221        del osmosis_lock 
    222222 
    223 def clean_database(conf, no_clean): 
     223def clean_database(conf, logger, no_clean): 
    224224 
    225225    if set(("osm2pgsql", "osmosis")).isdisjoint(conf.download.keys()): 
     
    263263########################################################################### 
    264264 
    265 def check_osmosis_diff(conf): 
     265def check_osmosis_diff(conf, logger): 
    266266 
    267267    logger.log("check osmosis replication") 
     
    277277    return True 
    278278 
    279 def init_osmosis_diff(conf): 
     279def init_osmosis_diff(conf, logger): 
    280280 
    281281    logger.log(logger.log_av_r+"init osmosis replication for diff"+logger.log_ap) 
     
    318318                    min_file_size=10) 
    319319 
    320 def run_osmosis_diff(conf): 
     320def run_osmosis_diff(conf, logger): 
    321321 
    322322    logger.log(logger.log_av_r+"run osmosis replication"+logger.log_ap) 
     
    401401########################################################################### 
    402402 
    403 def check_osmosis_change(conf): 
    404  
    405     if not check_osmosis_diff(conf): 
     403def check_osmosis_change(conf, logger): 
     404 
     405    if not check_osmosis_diff(conf, logger): 
    406406        return False 
    407407 
     
    411411 
    412412 
    413 def init_osmosis_change(conf): 
    414  
    415     init_osmosis_diff(conf) 
     413def init_osmosis_change(conf, logger): 
     414 
     415    init_osmosis_diff(conf, logger) 
    416416 
    417417    logger.log(logger.log_av_r+"init osmosis replication for database"+logger.log_ap) 
     
    434434        logger.execute_out(cmd) 
    435435 
    436 def run_osmosis_change(conf): 
     436def run_osmosis_change(conf, logger): 
    437437 
    438438    logger.log(logger.log_av_r+"run osmosis replication"+logger.log_ap) 
     
    488488    country = conf.country 
    489489 
    490     if not check_database(conf): 
     490    if not check_database(conf, logger): 
    491491        logger.log(logger.log_av_r+u"error in database initialisation"+logger.log_ap) 
    492492        return 0x10 
     
    506506        pass 
    507507    
    508     elif options.change and check_osmosis_change(conf) and not options.change_init: 
    509         xml_change = run_osmosis_change(conf) 
     508    elif options.change and check_osmosis_change(conf, logger) and not options.change_init: 
     509        xml_change = run_osmosis_change(conf, logger) 
    510510 
    511511    elif "url" in conf.download: 
    512512        xml_change = None 
    513         if options.diff and check_osmosis_diff(conf) and os.path.exists(conf.download["dst"]): 
    514             xml_change = run_osmosis_diff(conf) 
     513        if options.diff and check_osmosis_diff(conf, logger) and os.path.exists(conf.download["dst"]): 
     514            xml_change = run_osmosis_diff(conf, logger) 
    515515            newer = True  # TODO 
    516516 
     
    526526            return 0 
    527527 
    528         init_database(conf) 
     528        init_database(conf, logger) 
    529529 
    530530        if options.change: 
    531             init_osmosis_change(conf) 
     531            init_osmosis_change(conf, logger) 
    532532        elif options.diff and not xml_change: 
    533             init_osmosis_diff(conf) 
     533            init_osmosis_diff(conf, logger) 
    534534 
    535535    if hasattr(conf, "sql_post_scripts"): 
     
    633633        pass 
    634634    else: 
    635         clean_database(conf, options.no_clean or not conf.clean_at_end) 
     635        clean_database(conf, logger, options.no_clean or not conf.clean_at_end) 
    636636 
    637637    if options.diff: 
Note: See TracChangeset for help on using the changeset viewer.