Ejemplo n.º 1
0
    def __init__(self, *args, **kwargs):
        BaseProcessor.__init__(self, *args, **kwargs)

        self.build_args()

        self.city_map = {}
        self.build_city_map()
Ejemplo n.º 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)
Ejemplo n.º 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
Ejemplo n.º 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)
Ejemplo n.º 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 = []
Ejemplo n.º 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()
Ejemplo n.º 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()
Ejemplo n.º 8
0
    def __init__(self):
        BaseProcessor.__init__(self)

        self.priority = 20
Ejemplo n.º 9
0
 def __init__(self, *args, **kwargs):
     BaseProcessor.__init__(self, *args, **kwargs)
     self.args = self.args_builder()
Ejemplo n.º 10
0
    def __init__(self):
        BaseProcessor.__init__(self)

        self.priority = 20
        self.vehicles = dict()
        self.victims = dict()
Ejemplo n.º 11
0
 def __init__(self, *args, **kwargs):
     BaseProcessor.__init__(self, *args, **kwargs)
     BaiduSuggestion.__init__(self, *args, **kwargs)
Ejemplo n.º 12
0
    def __init__(self):
        BaseProcessor.__init__(self)

        self.priority = 30
        self.games = dict()
        self.game = None
Ejemplo n.º 13
0
    def __init__(self):
        BaseProcessor.__init__(self)

        self.priority = 20
Ejemplo n.º 14
0
    def __init__(self):
        BaseProcessor.__init__(self)

        self.priority = 20
        self.vehicles = dict()
Ejemplo n.º 15
0
 def __init__(self, *args, **kwargs):
     BaseProcessor.__init__(self, *args, **kwargs)
     MfwImageExtractor.__init__(self)
     self.args = self.args_builder()
Ejemplo n.º 16
0
    def __init__(self, *args, **kwargs):
        BaseProcessor.__init__(self, *args, **kwargs)

        self.args = self.args_builder()
        self.conn = None
        self.denom = None
Ejemplo n.º 17
0
 def __init__(self, *args, **kwargs):
     BaseProcessor.__init__(self, *args, **kwargs)