diff options
| author | root <root@viserion.(none)> | 2013-04-30 15:27:34 +0000 |
|---|---|---|
| committer | root <root@viserion.(none)> | 2013-04-30 15:27:34 +0000 |
| commit | 03f21b1abbae8962c81f46c01f1bb972fc7b2395 (patch) | |
| tree | 5f5652a1fb2027bbf4dd1dc26d6e28cbc04ea8fb /archaeological_operations/management/commands/import_operations.py | |
| parent | 16e1f93de47184e52765f950e39cb04f6ed93dd8 (diff) | |
| parent | eadca6ca09b823da4596b7b904420e6314383b50 (diff) | |
| download | Ishtar-03f21b1abbae8962c81f46c01f1bb972fc7b2395.tar.bz2 Ishtar-03f21b1abbae8962c81f46c01f1bb972fc7b2395.zip | |
Merge branch 'master' of lysithea.proxience.net:/home/proxience/git/ishtar
Diffstat (limited to 'archaeological_operations/management/commands/import_operations.py')
| -rwxr-xr-x | archaeological_operations/management/commands/import_operations.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/archaeological_operations/management/commands/import_operations.py b/archaeological_operations/management/commands/import_operations.py index 3cf4a569d..acc43a591 100755 --- a/archaeological_operations/management/commands/import_operations.py +++ b/archaeological_operations/management/commands/import_operations.py @@ -28,7 +28,7 @@ IMPORTERS = {'csv':import_from_csv, 'vfp':import_from_dbf} class Command(BaseCommand): - args = '<filename> [<update> <csv|dbf>]' + args = '<filename> [<update> <csv|dbf> <lines>]' help = "Import archaelogical operations" def handle(self, *args, **options): @@ -36,7 +36,8 @@ class Command(BaseCommand): raise CommandError("No file provided.") filename = args[0] update = len(args) > 1 and args[1] - file_type = len(args) > 1 and args[2] + file_type = len(args) > 2 and args[2] + lines = len(args) > 3 and args[3] if not file_type: suffix = filename.split('.')[-1].lower() if suffix in IMPORTERS.keys(): @@ -48,7 +49,8 @@ class Command(BaseCommand): raise CommandError("This file type is not managed.") nb_ops, errors = IMPORTERS[file_type](filename, update=update, - stdout=self.stdout) + stdout=self.stdout, + lines=lines) self.stdout.write('\n* %d operation treated\n' % nb_ops) if errors: self.stderr.write('\n'.join(errors)) |
