- Timestamp:
- Aug 24, 2011, 7:43:40 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/django_gheat/gheat/management/commands/import_droidstumbler.py
r9183 r9552 31 31 32 32 33 def import_droidstumbler(location, meetrondje, gebruiker, email, datum,show_progres=False,output=sys.stdout,bulk_import=True):33 def import_droidstumbler(location, meetrondje, gebruiker, kaart, email, datum,show_progres=False,output=sys.stdout,bulk_import=True): 34 34 """ Import all points, return tuple with summary""" 35 35 g, created = Gebruiker.objects.get_or_create(naam=gebruiker , email=email) 36 a, created = Apparatuur.objects.get_or_create( antenne='buildin' , kaart='mobilePhone')36 a, created = Apparatuur.objects.get_or_create(kaart=kaart) 37 37 mr, created = MeetRondje.objects.get_or_create(datum=datum , naam=meetrondje , gebruiker=g , apparatuur=a) 38 if not created: 39 logging.error("Meetrondje '%s' already imported" % mr) 40 sys.exit(1) 38 41 39 42 meting_count = 0 … … 114 117 make_option('-g', '--gebruiker', dest='gebruiker', default=os.environ['USER']), 115 118 make_option('-e', '--email', dest='email', default=os.environ['USER'] + '@example.org'), 119 make_option('-k', '--kaart', dest='kaart', default='onbekend', help="Kaart gebruikt"), 116 120 make_option('-d', '--datum', dest='datum', default=None, help="Provide date \ 117 121 in following format: %Y-%m-%d-%H%M%S, by default it will be generated from \ … … 146 150 self.stdout.write('#INFO: Meetrondje: %s @ %s\n' % (meetrondje, datum)) 147 151 self.stdout.write("#INFO: Going to import '%s' for gebruiker '%s <%s>'\n" % (os.path.basename(csv_file), options['gebruiker'], options['email'])) 148 (ap_count, new_ap_count, meting_count, meting_error_count) = import_droidstumbler(csv_file,meetrondje,options[' gebruiker'],options['email'], datum, True)152 (ap_count, new_ap_count, meting_count, meting_error_count) = import_droidstumbler(csv_file,meetrondje,options['kaart'],options['gebruiker'],options['email'], datum, True) 149 153 self.stdout.write("#INFO: Import summary accespoints: added:%s processed:%s\n" % (new_ap_count, ap_count)) 150 154 self.stdout.write("#INFO: Import summary metingen: added:%s error:%s\n" % (meting_count, meting_error_count))
Note:
See TracChangeset
for help on using the changeset viewer.