Switch to unified view
a/scripts/trac_export.py | b/scripts/trac_export.py | ||
---|---|---|---|
1 | #!/usr/bin/env python |
||
2 | |||
1 | import sys |
3 | import sys |
2 | from pprint import pprint |
4 | from pprint import pprint |
3 | import csv |
5 | import csv |
4 | import urlparse |
6 | import urlparse |
5 | import urllib2 |
7 | import urllib2 |
... |
... |
||
197 | try: |
199 | try: |
198 | f = self.csvopen(url) |
200 | f = self.csvopen(url) |
199 | except urllib2.HTTPError, e: |
201 | except urllib2.HTTPError, e: |
200 | if 'emulated' in e.msg: |
202 | if 'emulated' in e.msg: |
201 | body = e.fp.read() |
203 | body = e.fp.read() |
202 | if 'beyond the number of pages in the query' in body: |
204 | if 'beyond the number of pages in the query' in body or 'Log in with a SourceForge account' in body: |
203 | raise StopIteration |
205 | raise StopIteration |
204 | raise |
206 | raise |
205 | reader = csv.reader(f) |
207 | reader = csv.reader(f) |
206 | cols = reader.next() |
208 | cols = reader.next() |
207 | for r in reader: |
209 | for r in reader: |