Mercurial > public > sg101
comparison gpp/legacy/management/commands/import_old_users.py @ 291:a6357f2bcbbc
Added a legacy command to import old news stories.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Fri, 24 Dec 2010 20:45:33 +0000 |
parents | 64c188a9d31f |
children | 254db4cb6a86 |
comparison
equal
deleted
inserted
replaced
290:64c188a9d31f | 291:a6357f2bcbbc |
---|---|
87 num_rows = 0 | 87 num_rows = 0 |
88 try: | 88 try: |
89 for row in self.reader: | 89 for row in self.reader: |
90 self.process_row(row) | 90 self.process_row(row) |
91 num_rows += 1 | 91 num_rows += 1 |
92 if num_rows % 20 == 0: | 92 if self.show_progress and num_rows % 20 == 0: |
93 sys.stdout.write('.') | 93 sys.stdout.write('.') |
94 sys.stdout.flush() | 94 sys.stdout.flush() |
95 except csv.Error, e: | 95 except csv.Error, e: |
96 raise CommandError("CSV error: %s %s %s" % ( | 96 raise CommandError("CSV error: %s %s %s" % ( |
97 filename, self.reader.line_num, e)) | 97 filename, self.reader.line_num, e)) |