OLD | NEW |
| (Empty) |
1 Return-Path: <warner@users.sourceforge.net> | |
2 Delivered-To: warner-sourceforge@luther.lothar.com | |
3 Received: (qmail 23758 invoked by uid 1000); 28 Jul 2003 07:22:14 -0000 | |
4 Delivered-To: warner-sourceforge@lothar.com | |
5 Received: (qmail 62715 invoked by uid 13574); 28 Jul 2003 07:22:03 -0000 | |
6 Received: from unknown (HELO sc8-sf-list1.sourceforge.net) ([66.35.250.206]) (en
velope-sender <warner@users.sourceforge.net>) | |
7 by 130.94.181.6 (qmail-ldap-1.03) with SMTP | |
8 for <warner-sourceforge@lothar.com>; 28 Jul 2003 07:22:03 -0000 | |
9 Received: from sc8-sf-sshgate.sourceforge.net ([66.35.250.220] helo=sc8-sf-netmi
sc.sourceforge.net) | |
10 by sc8-sf-list1.sourceforge.net with esmtp | |
11 (Cipher TLSv1:DES-CBC3-SHA:168) (Exim 3.31-VA-mm2 #1 (Debian)) | |
12 id 19h2KY-0004Nr-00 | |
13 for <warner@users.sourceforge.net>; Mon, 28 Jul 2003 00:22:02 -0700 | |
14 Received: from sc8-pr-cvs1-b.sourceforge.net ([10.5.1.7] helo=sc8-pr-cvs1.source
forge.net) | |
15 by sc8-sf-netmisc.sourceforge.net with esmtp (Exim 3.36 #1 (Debian)) | |
16 id 19h2KY-0001rv-00 | |
17 for <warner@users.sourceforge.net>; Mon, 28 Jul 2003 00:22:02 -0700 | |
18 Received: from localhost ([127.0.0.1] helo=sc8-pr-cvs1.sourceforge.net) | |
19 by sc8-pr-cvs1.sourceforge.net with esmtp (Exim 3.22 #1 (Debian)) | |
20 id 19h2KY-0003r4-00 | |
21 for <warner@users.sourceforge.net>; Mon, 28 Jul 2003 00:22:02 -0700 | |
22 From: warner@users.sourceforge.net | |
23 To: warner@users.sourceforge.net | |
24 Subject: buildbot/buildbot/changes freshcvsmail.py,1.2,1.3 | |
25 Message-Id: <E19h2KY-0003r4-00@sc8-pr-cvs1.sourceforge.net> | |
26 Date: Mon, 28 Jul 2003 00:22:02 -0700 | |
27 Status: | |
28 | |
29 Update of /cvsroot/buildbot/buildbot/buildbot/changes | |
30 In directory sc8-pr-cvs1:/tmp/cvs-serv14795/buildbot/changes | |
31 | |
32 Modified Files: | |
33 freshcvsmail.py | |
34 Log Message: | |
35 remove leftover code, leave a temporary compatibility import. Note! Start | |
36 importing FCMaildirSource from changes.mail instead of changes.freshcvsmail | |
37 | |
38 | |
39 Index: freshcvsmail.py | |
40 =================================================================== | |
41 RCS file: /cvsroot/buildbot/buildbot/buildbot/changes/freshcvsmail.py,v | |
42 retrieving revision 1.2 | |
43 retrieving revision 1.3 | |
44 diff -C2 -d -r1.2 -r1.3 | |
45 *** freshcvsmail.py 27 Jul 2003 18:54:08 -0000 1.2 | |
46 --- freshcvsmail.py 28 Jul 2003 07:22:00 -0000 1.3 | |
47 *************** | |
48 *** 1,96 **** | |
49 #! /usr/bin/python | |
50 | |
51 ! from buildbot.interfaces import IChangeSource | |
52 ! from buildbot.changes.maildirtwisted import MaildirTwisted | |
53 ! from buildbot.changes.changes import Change | |
54 ! from rfc822 import Message | |
55 ! import os, os.path | |
56 ! | |
57 ! def parseFreshCVSMail(fd, prefix=None): | |
58 ! """Parse mail sent by FreshCVS""" | |
59 ! # this uses rfc822.Message so it can run under python2.1 . In the future | |
60 ! # it will be updated to use python2.2's "email" module. | |
61 ! | |
62 ! m = Message(fd) | |
63 ! # FreshCVS sets From: to "user CVS <user>", but the <> part may be | |
64 ! # modified by the MTA (to include a local domain) | |
65 ! name, addr = m.getaddr("from") | |
66 ! if not name: | |
67 ! return None # no From means this message isn't from FreshCVS | |
68 ! cvs = name.find(" CVS") | |
69 ! if cvs == -1: | |
70 ! return None # this message isn't from FreshCVS | |
71 ! who = name[:cvs] | |
72 ! | |
73 ! # we take the time of receipt as the time of checkin. Not correct, | |
74 ! # but it avoids the out-of-order-changes issue | |
75 ! #when = m.getdate() # and convert from 9-tuple, and handle timezone | |
76 ! | |
77 ! files = [] | |
78 ! comments = "" | |
79 ! isdir = 0 | |
80 ! lines = m.fp.readlines() | |
81 ! while lines: | |
82 ! line = lines.pop(0) | |
83 ! if line == "Modified files:\n": | |
84 ! break | |
85 ! while lines: | |
86 ! line = lines.pop(0) | |
87 ! if line == "\n": | |
88 ! break | |
89 ! line = line.rstrip("\n") | |
90 ! file, junk = line.split(None, 1) | |
91 ! if prefix: | |
92 ! # insist that the file start with the prefix: FreshCVS sends | |
93 ! # changes we don't care about too | |
94 ! bits = file.split(os.sep) | |
95 ! if bits[0] == prefix: | |
96 ! file = apply(os.path.join, bits[1:]) | |
97 ! else: | |
98 ! break | |
99 ! if junk == "0 0": | |
100 ! isdir = 1 | |
101 ! files.append(file) | |
102 ! while lines: | |
103 ! line = lines.pop(0) | |
104 ! if line == "Log message:\n": | |
105 ! break | |
106 ! # message is terminated by "ViewCVS links:" or "Index:..." (patch) | |
107 ! while lines: | |
108 ! line = lines.pop(0) | |
109 ! if line == "ViewCVS links:\n": | |
110 ! break | |
111 ! if line.find("Index: ") == 0: | |
112 ! break | |
113 ! comments += line | |
114 ! comments = comments.rstrip() + "\n" | |
115 ! | |
116 ! if not files: | |
117 ! return None | |
118 ! | |
119 ! change = Change(who, files, comments, isdir) | |
120 ! | |
121 ! return change | |
122 ! | |
123 ! | |
124 ! | |
125 ! class FCMaildirSource(MaildirTwisted): | |
126 ! """This source will watch a maildir that is subscribed to a FreshCVS | |
127 ! change-announcement mailing list. | |
128 ! """ | |
129 ! | |
130 ! __implements__ = IChangeSource, | |
131 | |
132 ! def __init__(self, maildir, prefix=None): | |
133 ! MaildirTwisted.__init__(self, maildir) | |
134 ! self.changemaster = None # filled in when added | |
135 ! self.prefix = prefix | |
136 ! def describe(self): | |
137 ! return "FreshCVS mailing list in maildir %s" % self.maildir.where | |
138 ! def messageReceived(self, filename): | |
139 ! path = os.path.join(self.basedir, "new", filename) | |
140 ! change = parseFreshCVSMail(open(path, "r"), self.prefix) | |
141 ! if change: | |
142 ! self.changemaster.addChange(change) | |
143 ! os.rename(os.path.join(self.basedir, "new", filename), | |
144 ! os.path.join(self.basedir, "cur", filename)) | |
145 --- 1,5 ---- | |
146 #! /usr/bin/python | |
147 | |
148 ! # leftover import for compatibility | |
149 | |
150 ! from buildbot.changes.mail import FCMaildirSource | |
151 | |
152 | |
OLD | NEW |