- Timestamp:
- Aug 23, 2011, 8:33:34 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/django_gheat/gheat/management/commands/import_kismet.py
r9176 r9548 5 5 6 6 from django.core.management.base import BaseCommand,CommandError 7 from django.db.utils import IntegrityError 7 8 from optparse import OptionParser, make_option 8 9 from gheat.models import * … … 76 77 # TODO: This also saves semi-duplicates; multiple entries with the same values, except 77 78 # the signal strength is different. Should get an AVG or something. 78 meting= Meting.objects.create(meetrondje=mr, accespoint=ap_cache[bssid], 79 latitude=point.attrib['lat'], longitude=point.attrib['lon'], 80 signaal=signaal) 79 try: 80 meting= Meting.objects.create(meetrondje=mr, accespoint=ap_cache[bssid], 81 latitude=point.attrib['lat'], longitude=point.attrib['lon'], 82 signaal=signaal) 83 except IntegrityError, e: 84 continue 81 85 # Give some feedback to the user 82 86 count += 1
Note:
See TracChangeset
for help on using the changeset viewer.