Changeset 9668 for src/django_gheat
- Timestamp:
- Sep 6, 2011, 1:09:58 PM (13 years ago)
- Location:
- src/django_gheat/gheat/dataimport
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/django_gheat/gheat/dataimport/__init__.py
r9664 r9668 162 162 } 163 163 164 if os.path.getsize(filename) == 0: 165 logger.error("Cannot parse empty files") 166 return counters 167 164 168 fh = open_file(filename) 165 if 'ns1' in filename: 166 (counters, ap_pool, client_pool, meting_pool) = netstumbler.process_ns1(fh, counters) 167 elif 'gpsxml' in filename: 168 (counters, ap_pool, client_pool, meting_pool) = kismet.process_gpsxml(fh, counters) 169 elif 'netxml' in filename: 170 (counters, ap_pool, client_pool, meting_pool) = kismet.process_netxml(fh, counters) 171 elif 'ScanResult' in filename: 172 (counters, ap_pool, client_pool, meting_pool) = droidstumbler.process_csv(fh, counters) 173 else: 174 (ap_pool, client_pool, meting_pool) = (None, None, None) 175 logger.error("file '%s' format not recognized") 169 try: 170 if 'ns1' in filename: 171 (counters, ap_pool, client_pool, meting_pool) = netstumbler.process_ns1(fh, counters) 172 elif 'gpsxml' in filename: 173 (counters, ap_pool, client_pool, meting_pool) = kismet.process_gpsxml(fh, counters) 174 elif 'netxml' in filename: 175 (counters, ap_pool, client_pool, meting_pool) = kismet.process_netxml(fh, counters) 176 elif 'ScanResult' in filename: 177 (counters, ap_pool, client_pool, meting_pool) = droidstumbler.process_csv(fh, counters) 178 else: 179 (ap_pool, client_pool, meting_pool) = (None, None, None) 180 logger.error("file '%s' format not recognized") 181 except IOError, e: 182 logger.error("File invalid: %s", e) 183 return counters 176 184 177 185 if ap_pool: -
src/django_gheat/gheat/dataimport/kismet.py
r9640 r9668 12 12 13 13 def process_netxml(fh,counters): 14 netxml_doc = etree.parse(fh) 14 try: 15 netxml_doc = etree.parse(fh) 16 except etree.XMLSyntaxError, e: 17 raise IOError(e) 15 18 16 19 # Prepare new accespoints and measurements … … 45 48 46 49 def process_gpsxml(fh,counters): 47 gpsxml_doc = etree.parse(fh) 50 try: 51 gpsxml_doc = etree.parse(fh) 52 except etree.XMLSyntaxError, e: 53 raise IOError(e) 48 54 49 55 bssid_failed = defaultdict(int)
Note:
See TracChangeset
for help on using the changeset viewer.