Changeset 9559 for src/django_gheat/gheat/management
- Timestamp:
- Aug 25, 2011, 12:08:25 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/django_gheat/gheat/management/commands/import_droidstumbler.py
r9558 r9559 94 94 ssid, encryption = ap_pool[bssid] 95 95 # Special trick in SSID ts avoid escaping in later stage 96 value_str= str((bssid,ssid.replace('%','%%'),encryption))97 sql_values.append( value_str)96 item = str((bssid,ssid.replace('%','%%'),encryption)) 97 sql_values.append(item) 98 98 counters['ap_added'] = bulk_sql('gheat_accespoint (`mac`, `ssid`, `encryptie`)',sql_values) 99 99 … … 105 105 sql_values = [] 106 106 for (bssid,lat,lon),signal in meting_pool.iteritems(): 107 value_str= str((int(meetrondje.id),mac2id[bssid],float(lat),float(lon),int(signaal)))108 sql_values.append( value_str)107 item = str((int(meetrondje.id),mac2id[bssid],float(lat),float(lon),int(signaal))) 108 sql_values.append(item) 109 109 110 110 # Bulk Import data if possible … … 123 123 make_option('-d', '--datum', dest='datum', default=None, help="Provide date \ 124 124 in following format: %Y-%m-%d-%H%M%S, by default it will be generated from \ 125 the filename"),) 125 the filename"), 126 ) 126 127 127 128 def handle(self, *args, **options): … … 134 135 if not os.path.isfile(csv_file): 135 136 raise CommandError("csv file '%s' does not exists" % csv_file) 136 self.stdout.write("#INFO: Processing '%s'\n" % csv_file)137 logger.info("Processing '%s'" % csv_file) 137 138 138 139 # Meetrondje from filename if needed … … 151 152 raise CommandError("Invalid date '%s'" % options['datum']) 152 153 153 logger.info("Going to import '%s'" % (os.path.basename(csv_file)))154 154 # Create meetrondje object 155 155 g, created = Gebruiker.objects.get_or_create(naam=options['gebruiker'] , email=options['email']) … … 161 161 sys.exit(1) 162 162 counters = import_droidstumbler(csv_file,mr) 163 logger.info(" Summary accespoints: added:%(ap_added)-6s processed:%(ap_total)-6s" % counters)164 logger.info(" Summary metingen : added:%(meting_added)-6s processed:%(meting_total)-6s" % counters)163 logger.info("summary accespoints: added:%(ap_added)-6s processed:%(ap_total)-6s" % counters) 164 logger.info("summary metingen : added:%(meting_added)-6s processed:%(meting_total)-6s" % counters)
Note:
See TracChangeset
for help on using the changeset viewer.