예제 #1
0
    def __init__(self, *args, **kwargs):
        BaseProcessor.__init__(self, *args, **kwargs)

        self.build_args()

        self.city_map = {}
        self.build_city_map()
예제 #2
0
    def __init__(self, *args, **kwargs):
        BaseProcessor.__init__(self, *args, **kwargs)

        self.args = self.args_builder()

        # 初始化merger
        self.mergers = []
        merger_rules = load_yaml()['merger']

        name_list = self.args.merger if self.args.merger else [
            'LocalityAppender' if self.args.type == 'mdd' else 'PoiAppender', 'SetAdder', 'Overwriter', 'ImageMerger',
            'EditorMerger']

        for name in name_list:
            rule = merger_rules[name]
            m = globals()[rule['class']]()

            if 'fields' in rule and rule['fields']:
                m.add_fields(rule['fields'])

            if 'priority' in rule:
                m.priority = rule['priority']

            self.mergers.append(m)
        self.mergers = sorted(self.mergers, key=lambda v: v.priority)
예제 #3
0
    def __init__(self):
        BaseProcessor.__init__(self)

        self.priority = 30
        self.tick_to_packets = dict()
        self.flag_packets = list()
        self.start_tick = None
        self.last_tick = None
예제 #4
0
    def __init__(self, *args, **kwargs):
        BaseProcessor.__init__(self, *args, **kwargs)
        self.build_args()

        # 缓存的城市信息
        from gevent.lock import BoundedSemaphore

        self._city_cache = {}
        self._city_cache_lock = BoundedSemaphore(1)
예제 #5
0
 def __init__(self, *args, **kwargs):
     BaseProcessor.__init__(self, *args, **kwargs)
     self.bdurl = 'http://api.map.baidu.com/geoconv/v1/'
     self.gspurl = 'http://api.gpsspg.com/convert/latlng/'
     self.bdak = '7P5mAce1fZubQOahgDTCAWHo'
     self.gspak = 'EBA5F8F9D7E5CA7E8488EC7B99DFEA23'
     self.gspoid = 506
     self.mongoconn = None
     self.http_error_count = 0
     self.error_limit = 20
     self.to_do_list = []
예제 #6
0
    def __init__(self, name, desc, columns, notes=''):
        BaseProcessor.__init__(self)

        assert name and len(name) > 0, 'Award processor requires a name.'
        assert desc and len(desc) > 0, 'Award processor requires a description.'
        assert columns and len(columns) > 0, 'Award processor requires at least one column.'

        self.name = name
        self.desc = desc
        self.columns = columns
        self.notes = notes
        self.results = collections.Counter()
예제 #7
0
    def __init__(self, name, desc, columns, notes=""):
        BaseProcessor.__init__(self)

        assert name and len(name) > 0, "Award processor requires a name."
        assert desc and len(desc) > 0, "Award processor requires a description."
        assert columns and len(columns) > 0, "Award processor requires at least one column."

        self.name = name
        self.desc = desc
        self.columns = columns
        self.notes = notes
        self.results = collections.Counter()
예제 #8
0
    def __init__(self):
        BaseProcessor.__init__(self)

        self.priority = 20
예제 #9
0
 def __init__(self, *args, **kwargs):
     BaseProcessor.__init__(self, *args, **kwargs)
     self.args = self.args_builder()
예제 #10
0
    def __init__(self):
        BaseProcessor.__init__(self)

        self.priority = 20
        self.vehicles = dict()
        self.victims = dict()
예제 #11
0
 def __init__(self, *args, **kwargs):
     BaseProcessor.__init__(self, *args, **kwargs)
     BaiduSuggestion.__init__(self, *args, **kwargs)
예제 #12
0
    def __init__(self):
        BaseProcessor.__init__(self)

        self.priority = 30
        self.games = dict()
        self.game = None
예제 #13
0
    def __init__(self):
        BaseProcessor.__init__(self)

        self.priority = 20
예제 #14
0
    def __init__(self):
        BaseProcessor.__init__(self)

        self.priority = 20
        self.vehicles = dict()
예제 #15
0
 def __init__(self, *args, **kwargs):
     BaseProcessor.__init__(self, *args, **kwargs)
     MfwImageExtractor.__init__(self)
     self.args = self.args_builder()
예제 #16
0
    def __init__(self, *args, **kwargs):
        BaseProcessor.__init__(self, *args, **kwargs)

        self.args = self.args_builder()
        self.conn = None
        self.denom = None
예제 #17
0
 def __init__(self, *args, **kwargs):
     BaseProcessor.__init__(self, *args, **kwargs)