Changeset ae30a2f in osmose-backend


Ignore:
Timestamp:
Oct 7, 2014 5:25:29 PM (5 years ago)
Author:
Frédéric Rodrigo <fred.rodrigo@…>
Branches:
master
Children:
89cb6e2
Parents:
b26f40c
Message:

Blacklist Google source in Haiti

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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"}, 
Note: See TracChangeset for help on using the changeset viewer.