|
26 | 26 |
|
27 | 27 | from roundup import instance, hyperdb, date, support, password |
28 | 28 |
|
| 29 | +today = date.Date('.') |
| 30 | + |
29 | 31 | DL_URL = 'http://sourceforge.net/tracker/download.php?group_id=%(group_id)s&atid=%(atid)s&aid=%(aid)s' |
30 | 32 |
|
31 | 33 | def get_url(aid): |
32 | 34 | """ so basically we have to jump through hoops, given an artifact id, to |
33 | 35 | figure what the URL should be to access that artifact, and hence any |
34 | 36 | attached files.""" |
| 37 | + # first we hit this URL... |
35 | 38 | conn = httplib.HTTPConnection("sourceforge.net") |
36 | 39 | conn.request("GET", "/support/tracker.php?aid=%s"%aid) |
37 | 40 | response = conn.getresponse() |
| 41 | + # which should respond with a redirect to the correct url which has the |
| 42 | + # magic "group_id" and "atid" values in it that we need |
38 | 43 | assert response.status == 302, 'response code was %s'%response.status |
39 | 44 | location = response.getheader('location') |
40 | 45 | query = urlparse.urlparse(response.getheader('location'))[-2] |
@@ -263,6 +268,13 @@ def to_date(ts): |
263 | 268 | actor = authid |
264 | 269 | if d['status'] == unread: |
265 | 270 | d['status'] = chatting |
| 271 | + |
| 272 | + message_id += 1 |
| 273 | + m = {'content': 'IMPORT FROM SOURCEFORGE', 'author': '1', |
| 274 | + 'date': today, 'id': str(message_id), 'creation': today } |
| 275 | + message_data.append(m) |
| 276 | + messages.append(message_id) |
| 277 | + |
266 | 278 | d['messages'] = messages |
267 | 279 | d['nosy'] = list(nosy) |
268 | 280 |
|
@@ -325,7 +337,6 @@ def convert_message(content, id): |
325 | 337 | class colon_separated(csv.excel): |
326 | 338 | delimiter = ':' |
327 | 339 |
|
328 | | -today = date.Date('.') |
329 | 340 | def write_csv(klass, data): |
330 | 341 | props = klass.getprops() |
331 | 342 | if not os.path.exists('/tmp/imported'): |
|
0 commit comments