You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by jo...@apache.org on 2013/07/08 21:28:30 UTC
[18/25] git commit: [#4213] ticket:346 small refactoring for trac
export
[#4213] ticket:346 small refactoring for trac export
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/964c3d18
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/964c3d18
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/964c3d18
Branch: refs/heads/cj/4656
Commit: 964c3d1803292f87a1f30391c22b0f744bb7e26f
Parents: 8993951
Author: Yuriy Arhipov <yu...@yandex.ru>
Authored: Thu Jun 6 15:48:32 2013 +0400
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Sun Jul 7 06:09:58 2013 +0000
----------------------------------------------------------------------
scripts/trac_export.py | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/964c3d18/scripts/trac_export.py
----------------------------------------------------------------------
diff --git a/scripts/trac_export.py b/scripts/trac_export.py
index fcff048..4fcb27a 100755
--- a/scripts/trac_export.py
+++ b/scripts/trac_export.py
@@ -19,7 +19,6 @@
import sys
-from pprint import pprint
import csv
import urlparse
import urllib2
@@ -77,9 +76,9 @@ class TracExport(object):
# be get with single-ticket export (create/mod times is
# and example).
self.ticket_map = {}
- self.ticket_queue = []
self.start_id = start_id
self.page = (start_id - 1) / self.PAGE_SIZE + 1
+ self.ticket_queue = self.next_ticket_ids()
def remap_fields(self, dict):
"Remap fields to adhere to standard taxonomy."
@@ -238,8 +237,8 @@ class TracExport(object):
def next(self):
while True:
- if not self.ticket_queue:
- self.ticket_queue = self.next_ticket_ids()
+ if len(self.ticket_queue) == 0:
+ raise StopIteration
id, extra = self.ticket_queue.pop(0)
if id >= self.start_id:
break