예제 #1
0
 def loadRegions(self):
     del(self.regions[:])
     try:
         regionsJson = json.load(open(os.path.join(self.base_dir, 'resource', 'settings', 'geo_regions.json')))
         regionsNode = regionsJson.get('regions')
         if regionsNode:
             for regionNode in regionsNode: 
                 region = Region()
                 region.fromJson(regionNode)
                 self.regions.append(region)
     except Exception as detail:
         Logger.warning('TrackManager: Error loading regions data ' + traceback.format_exc())
예제 #2
0
 def loadRegions(self):
     del (self.regions[:])
     try:
         regionsJson = json.load(open('resource/settings/geo_regions.json'))
         regionsNode = regionsJson.get('regions')
         if regionsNode:
             for regionNode in regionsNode:
                 region = Region()
                 region.fromJson(regionNode)
                 self.regions.append(region)
     except Exception as detail:
         print('Error loading regions data ' + traceback.format_exc())
 def load_regions(self):
     """Regions are an array of lat/long points that make a bounding box. Usually around a country or continent
     """
     del(self.regions[:])
     try:
         regions_json = json.load(open(os.path.join(self.base_dir, 'resource', 'settings', 'geo_regions.json')))
         regions_node = regions_json.get('regions')
         if regions_node:
             for region_node in regions_node:
                 region = Region()
                 region.fromJson(region_node)
                 self.regions.append(region)
     except Exception as detail:
         Logger.warning('TrackManager: Error loading regions data ' + traceback.format_exc())
예제 #4
0
 def load_regions(self):
     """Regions are an array of lat/long points that make a bounding box. Usually around a country or continent
     """
     del(self.regions[:])
     try:
         regions_json = json.load(open(os.path.join(self.base_dir, 'resource', 'settings', 'geo_regions.json')))
         regions_node = regions_json.get('regions')
         if regions_node:
             for region_node in regions_node:
                 region = Region()
                 region.fromJson(region_node)
                 self.regions.append(region)
     except Exception as detail:
         Logger.warning('TrackManager: Error loading regions data ' + traceback.format_exc())
예제 #5
0
 def loadRegions(self):
     del (self.regions[:])
     try:
         regionsJson = json.load(
             open(
                 os.path.join(self.base_dir, 'resource', 'settings',
                              'geo_regions.json')))
         regionsNode = regionsJson.get('regions')
         if regionsNode:
             for regionNode in regionsNode:
                 region = Region()
                 region.fromJson(regionNode)
                 self.regions.append(region)
     except Exception as detail:
         Logger.warning('TrackManager: Error loading regions data ' +
                        traceback.format_exc())