Changeset 9819 for src/django_gheat/gheat/dataimport
- Timestamp:
- Dec 23, 2011, 8:31:50 AM (13 years ago)
- Location:
- src/django_gheat/gheat/dataimport
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/django_gheat/gheat/dataimport/__init__.py
r9818 r9819 74 74 75 75 76 def import_acces points(ap_pool, counters):77 # Determine which Acces points to add78 bssid_list_present = Acces point.objects.filter(mac__in=ap_pool.keys()).\76 def import_accesspoints(ap_pool, counters): 77 # Determine which Accesspoints to add 78 bssid_list_present = Accesspoint.objects.filter(mac__in=ap_pool.keys()).\ 79 79 values_list('mac', flat=True) 80 80 bssid_list_insert = set(ap_pool.keys()) - set(bssid_list_present) … … 85 85 for bssid in bssid_list_insert: 86 86 ssid, encryption = ap_pool[bssid] 87 type = Acces point.get_type_by_ssid(ssid)87 type = Accesspoint.get_type_by_ssid(ssid) 88 88 # Special trick in SSID ts avoid escaping in later stage 89 89 item = str((bssid.upper(),ssid.replace('%','%%'),encryption, 90 Acces point.get_type_by_ssid(ssid),90 Accesspoint.get_type_by_ssid(ssid), 91 91 get_organization_id_by_ssid(ssid))) 92 92 sql_values.append(item) 93 counters['ap_added'] = bulk_sql('gheat_acces point (`mac`, `ssid`,\93 counters['ap_added'] = bulk_sql('gheat_accesspoint (`mac`, `ssid`,\ 94 94 `encryptie`, `type`, `organization_id`)',sql_values) 95 95 return counters … … 104 104 # Build mapping for meting import 105 105 mac2id = {} 106 for mac,id in Acces point.objects.filter(mac__in=bssid_list).\106 for mac,id in Accesspoint.objects.filter(mac__in=bssid_list).\ 107 107 values_list('mac','id'): 108 108 mac2id[mac] = int(id) … … 134 134 if sql_values: 135 135 counters['meting_added'] = bulk_sql('gheat_meting (`meetrondje_id`,\ 136 `acces point_id`, `latitude`, `longitude`, `signaal`)',sql_values)136 `accesspoint_id`, `latitude`, `longitude`, `signaal`)',sql_values) 137 137 return counters 138 138 … … 186 186 187 187 if ap_pool: 188 counters = import_acces points(ap_pool, counters)188 counters = import_accesspoints(ap_pool, counters) 189 189 if client_pool: 190 190 counters = import_clients(client_pool, counters) … … 192 192 counters = import_metingen(meetrondje, meting_pool, counters) 193 193 194 logger.debug("summary acces points: total:%(ap_total)-6s added:%(ap_added)-6s failed:%(ap_failed)-6s ignored:%(ap_ignored)-6s" % counters)194 logger.debug("summary accesspoints: total:%(ap_total)-6s added:%(ap_added)-6s failed:%(ap_failed)-6s ignored:%(ap_ignored)-6s" % counters) 195 195 logger.debug("summary client : total:%(client_total)-6s added:%(client_added)-6s failed:%(client_failed)-6s ignored:%(client_ignored)-6s" % counters) 196 196 logger.debug("summary metingen : total:%(meting_total)-6s added:%(meting_added)-6s failed:%(meting_failed)-6s ignored:%(meting_ignored)-6s" % counters) -
src/django_gheat/gheat/dataimport/kismet.py
r9668 r9819 17 17 raise IOError(e) 18 18 19 # Prepare new acces points and measurements19 # Prepare new accesspoints and measurements 20 20 wnetworks = netxml_doc.findall('wireless-network') 21 21 … … 55 55 bssid_failed = defaultdict(int) 56 56 57 # Prepare new acces points and measurements57 # Prepare new accesspoints and measurements 58 58 points = gpsxml_doc.findall('gps-point') 59 59
Note:
See TracChangeset
for help on using the changeset viewer.