Changeset 210c55c in osmose-backend


Ignore:
Timestamp:
Oct 7, 2014 11:28:27 PM (5 years ago)
Author:
Jocelyn Jaubert <jocelyn.jaubert@…>
Branches:
master
Children:
954dd43
Parents:
c7c9ec4 (diff), 1b438a8 (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:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • osmose_config.py

    r4654e00 r1b438a8  
    327327france_local_db.analyser["merge_police_FR"] = "xxx" 
    328328france_local_db.analyser["merge_fuel_FR"] = "xxx" 
     329france_local_db.analyser["merge_pharmacy_FR"] = "xxx" 
    329330 
    330331######################################################################### 
  • plugins/Source.py

    r4eb9d06 rae30a2f  
    3030        self.errors[706] = { "item": 3020, "level": 1, "tag": ["source", "fix:chair"], "desc": T_(u"Illegal or incomplete source tag") } 
    3131        self.errors[707] = { "item": 2040, "level": 3, "tag": ["source", "fix:chair"], "desc": T_(u"Missing source tag") } 
     32        self.Country = self.father.config.options.get("country") 
    3233 
    3334    def check(self, tags): 
    3435        source = tags[u"source"].lower() 
    35         if u"google" in source: 
     36        if u"google" in source and not self.Country == "HT": # Google made drone imagery for after-earthquake in Haiti 
    3637            return [(706,2,{"en":u"Google"})] 
    3738 
     
    5859    def test(self): 
    5960        a = Source(None) 
     61        class _config: 
     62            options = {"country": "MD"} 
     63        class father: 
     64            config = _config() 
     65        a.father = father() 
    6066        a.init(None) 
    6167        for d in [{u"source":u"Free"}, 
  • plugins/Structural_Restriction.py

    r6a27639 r89cb6e2  
    3838            for member in members: 
    3939                if member['role'] == 'from': 
    40                     from_.add(member['id']) 
     40                    from_.add(member['ref']) 
    4141                elif member['role'] == 'to': 
    42                     to.add(member['id']) 
     42                    to.add(member['ref']) 
    4343            if from_ == to: 
    4444                return [(31801, 0, {})] 
     
    5353        a.init(None) 
    5454 
    55         assert not a.relation(None, {'type': 'restriction', 'restriction': 'no_u_turn'}, [{'role':'from', 'id': 1}, {'role': 'to', 'id': 2}]) 
    56         assert not a.relation(None, {'type': 'restriction', 'restriction': 'text'}, [{'role':'from', 'id': 1}, {'role': 'to', 'id': 1}]) 
     55        assert not a.relation(None, {'type': 'restriction', 'restriction': 'no_u_turn'}, [{'role': 'to', 'ref': 229614650, 'type': 'way'}, {'role': 'via', 'ref': 160840160, 'type': 'way'}, {'role': 'from', 'ref': 229614674, 'type': 'way'}]) 
     56        assert not a.relation(None, {'type': 'restriction', 'restriction': 'no_u_turn'}, [{'role':'from', 'ref': 1}, {'role': 'to', 'ref': 2}]) 
     57        assert not a.relation(None, {'type': 'restriction', 'restriction': 'text'}, [{'role':'from', 'ref': 1}, {'role': 'to', 'ref': 1}]) 
    5758 
    58         self.check_err(a.relation(None, {'type': 'restriction', 'restriction': 'no_u_turn'}, [{'role':'from', 'id': 1}, {'role': 'to', 'id': 1}])) 
     59        self.check_err(a.relation(None, {'type': 'restriction', 'restriction': 'no_u_turn'}, [{'role':'from', 'ref': 1}, {'role': 'to', 'ref': 1}])) 
  • tools/analyse-log.py

    r27d4d8a rc7c9ec4  
    33import fileinput 
    44import datetime 
     5import re 
     6 
     7re_timestamp = re.compile("^[0-9]{4}-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]") 
    58 
    69def convert_time(string): 
     
    2528 
    2629for line in fileinput.input(): 
     30  if not re_timestamp.match(line): 
     31    continue 
     32 
    2733  if cur_filename is None: 
    2834    cur_filename = fileinput.filename() 
     
    4349    first_task_timestamp = line[:19] 
    4450 
     51  elif line[19] == " " and line[20] != " " and line[20] != "": 
     52    if cur_task != None: 
     53      end_task() 
     54    cur_task = line[20:].strip() 
     55    first_task_timestamp = line[:19] 
     56 
    4557end_file() 
Note: See TracChangeset for help on using the changeset viewer.