Changeset 9157 for src/django_gheat/gheat/management
- Timestamp:
- May 6, 2011, 4:04:18 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/django_gheat/gheat/management/commands/import_csv.py
r9142 r9157 6 6 # 7 7 # In theory, only the -f option is needed, but for overview's sake, please use the others aswell. 8 # -f = location of the . netxml, e.g. '/home/test.csv'8 # -f = location of the .csv, e.g. '/home/test.csv' 9 9 # -m = name of the dataset, e.g. 'Walk in park' or 'Trip with boat' 10 10 # -g = your name 11 11 # -e = your email address 12 # -a = antenna 13 # -k = network card 12 14 # 13 15 # (Run from project root) 14 # ./manage.py import_csv -f <file location> -m <dataset name> -g <username> -e <email> 16 # ./manage.py import_csv -f <file location> -m <dataset name> -g <username> -e <email> - a <antenna> -k <network card> 15 17 # 16 18 # Make sure the variables in this script match the column numbers in your file e.g.; … … 59 61 print lat, lon, ssid, bssid, enc, sig 60 62 63 # Simple check for bad values 64 if lat.startswith('0.'): 65 print 'Bad lat' 66 continue 67 elif lon.startswith('0.'): 68 print 'Bad lon' 69 continue 70 elif sig not in range(1,101): 71 print 'Bad sig' 72 continue 73 else: 74 print 'No bad values' 75 61 76 # Creating accespoint objects. Avoiding duplicates. 62 77 ap, created = Accespoint.objects.get_or_create(mac=bssid, ssid=ssid, encryptie=enc)
Note:
See TracChangeset
for help on using the changeset viewer.