Index: src/django_gheat/gheat/management/commands/import_droidstumbler.py
===================================================================
--- src/django_gheat/gheat/management/commands/import_droidstumbler.py	(revision 9169)
+++ src/django_gheat/gheat/management/commands/import_droidstumbler.py	(revision 9170)
@@ -2,27 +2,10 @@
 # -*- coding: utf-8 -*-
 #
-###########################################
-#
 # Script for importing DroidStumbler .csv files
 #
-# In theory, only the -f option is needed, but for overview's sake, please use the others aswell.
-# -f = location of the .netxml, e.g. '/home/test.csv'
-# -m = name of the dataset, e.g. 'Walk in park' or 'Trip with boat'
-# -g = your name
-# -e = your email address
+# Original by Dennis Wagenaar <d.wagenaar@gmail.com>
 #
-# (Run from project root)
-# ./manage.py import_droidstumbler -f <file location> -m <dataset name> -g <username> -e <email>
+# Rick van der Zwet <info@rickvanderzwet.nl>
 #
-# Make sure the variables in this script match the column numbers in your file e.g.;
-# Lat is read from the first column [0], if the lat in your file is in the 4th column, change
-# 'lat = row[0]' to 'lat = row[3]'.
-# Also, take note of the 'replace()' and 'strip()' functions. These should probably be edited aswell.
-#
-# Dennis Wagenaar
-# d.wagenaar@gmail.com
-#
-###########################################
-
 from django.core.management import setup_environ
 from django.core.management.base import BaseCommand, CommandError
@@ -31,4 +14,5 @@
 import csv
 import datetime
+import gzip
 import os
 import sys
@@ -40,5 +24,9 @@
   mr = MeetRondje.objects.create(datum=datetime.datetime.now() , naam=meetrondje , gebruiker=g , apparatuur=a)
 
-  csvfile = csv.reader(open(location, 'rb'), delimiter=',')
+  if location.endswith('.gz'):
+    fh = gzip.open(location,'rb')
+  else:
+    fh = open(location,'rb')
+  csvfile = csv.reader(fh, delimiter=',')
   count = 0
   ap_cache = {}
@@ -68,5 +56,5 @@
 
 class Command(BaseCommand):
-  args = '<csvfile>'
+  args = '<csvfile>[.gz]'
   option_list = BaseCommand.option_list + (
     make_option('-m', '--meetrondje', dest='meetrondje', default='rondje'),
