summaryrefslogtreecommitdiff
path: root/chimere/management/commands/chimere_export.py
diff options
context:
space:
mode:
Diffstat (limited to 'chimere/management/commands/chimere_export.py')
-rw-r--r--chimere/management/commands/chimere_export.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/chimere/management/commands/chimere_export.py b/chimere/management/commands/chimere_export.py
index 4e91956..09271cf 100644
--- a/chimere/management/commands/chimere_export.py
+++ b/chimere/management/commands/chimere_export.py
@@ -35,7 +35,7 @@ class Command(BaseCommand):
self.stdout.write(' %d - %s\n' % (subcat.pk, subcat.name))
self.stdout.write('\nSub-category ID: ')
self.stdout.flush()
- v = raw_input()
+ v = input()
try:
subcat = SubCategory.objects.get(pk=v)
except (ValueError, ObjectDoesNotExist) as e:
@@ -51,7 +51,7 @@ class Command(BaseCommand):
frmat = args[1]
while frmat not in ('CSV', 'KML', 'SHP'):
self.stdout.write('Choose a format (CSV, KML or SHP): ')
- frmat = raw_input().replace('\n', '')
+ frmat = input().replace('\n', '')
exporter = EXPORTER[frmat]
cls = None
if args and args[2]:
@@ -67,7 +67,7 @@ class Command(BaseCommand):
while not cls:
self.stdout.write('Choose an item type:\n 1 - marker\n 2 - route\n')
self.stdout.write('Number: ')
- v = raw_input()
+ v = input()
if v == '1':
cls = Marker
elif v == '2':
@@ -77,10 +77,10 @@ class Command(BaseCommand):
filename = args[3]
else:
self.stdout.write('Filename: ')
- filename = raw_input()
+ filename = input()
response = exporter(None, None, cls.objects.filter(categories=subcat))
try:
- with open(filename, 'w+') as fl:
+ with open(filename, 'wb+') as fl:
fl.write(response.content)
except IOError as e:
raise CommandError(e)