Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/buildbot/buildbot/test/mail/syncmail.1
blob: eb35e25ad83ed5dfb9a7ecca7099feb639c2e718 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
Return-Path: <warner@users.sourceforge.net>
Delivered-To: warner-sourceforge@luther.lothar.com
Received: (qmail 23758 invoked by uid 1000); 28 Jul 2003 07:22:14 -0000
Delivered-To: warner-sourceforge@lothar.com
Received: (qmail 62715 invoked by uid 13574); 28 Jul 2003 07:22:03 -0000
Received: from unknown (HELO sc8-sf-list1.sourceforge.net) ([66.35.250.206]) (envelope-sender <warner@users.sourceforge.net>)
          by 130.94.181.6 (qmail-ldap-1.03) with SMTP
          for <warner-sourceforge@lothar.com>; 28 Jul 2003 07:22:03 -0000
Received: from sc8-sf-sshgate.sourceforge.net ([66.35.250.220] helo=sc8-sf-netmisc.sourceforge.net)
	by sc8-sf-list1.sourceforge.net with esmtp 
	(Cipher TLSv1:DES-CBC3-SHA:168) (Exim 3.31-VA-mm2 #1 (Debian))
	id 19h2KY-0004Nr-00
	for <warner@users.sourceforge.net>; Mon, 28 Jul 2003 00:22:02 -0700
Received: from sc8-pr-cvs1-b.sourceforge.net ([10.5.1.7] helo=sc8-pr-cvs1.sourceforge.net)
	by sc8-sf-netmisc.sourceforge.net with esmtp (Exim 3.36 #1 (Debian))
	id 19h2KY-0001rv-00
	for <warner@users.sourceforge.net>; Mon, 28 Jul 2003 00:22:02 -0700
Received: from localhost ([127.0.0.1] helo=sc8-pr-cvs1.sourceforge.net)
	by sc8-pr-cvs1.sourceforge.net with esmtp (Exim 3.22 #1 (Debian))
	id 19h2KY-0003r4-00
	for <warner@users.sourceforge.net>; Mon, 28 Jul 2003 00:22:02 -0700
From: warner@users.sourceforge.net
To: warner@users.sourceforge.net
Subject: buildbot/buildbot/changes freshcvsmail.py,1.2,1.3
Message-Id: <E19h2KY-0003r4-00@sc8-pr-cvs1.sourceforge.net>
Date: Mon, 28 Jul 2003 00:22:02 -0700
Status:   

Update of /cvsroot/buildbot/buildbot/buildbot/changes
In directory sc8-pr-cvs1:/tmp/cvs-serv14795/buildbot/changes

Modified Files:
	freshcvsmail.py 
Log Message:
remove leftover code, leave a temporary compatibility import. Note! Start
importing FCMaildirSource from changes.mail instead of changes.freshcvsmail


Index: freshcvsmail.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/changes/freshcvsmail.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** freshcvsmail.py	27 Jul 2003 18:54:08 -0000	1.2
--- freshcvsmail.py	28 Jul 2003 07:22:00 -0000	1.3
***************
*** 1,96 ****
  #! /usr/bin/python
  
! from buildbot.interfaces import IChangeSource
! from buildbot.changes.maildirtwisted import MaildirTwisted
! from buildbot.changes.changes import Change
! from rfc822 import Message
! import os, os.path
! 
! def parseFreshCVSMail(fd, prefix=None):
!     """Parse mail sent by FreshCVS"""
!     # this uses rfc822.Message so it can run under python2.1 . In the future
!     # it will be updated to use python2.2's "email" module.
! 
!     m = Message(fd)
!     # FreshCVS sets From: to "user CVS <user>", but the <> part may be
!     # modified by the MTA (to include a local domain)
!     name, addr = m.getaddr("from")
!     if not name:
!         return None # no From means this message isn't from FreshCVS
!     cvs = name.find(" CVS")
!     if cvs == -1:
!         return None # this message isn't from FreshCVS
!     who = name[:cvs]
! 
!     # we take the time of receipt as the time of checkin. Not correct,
!     # but it avoids the out-of-order-changes issue
!     #when = m.getdate() # and convert from 9-tuple, and handle timezone
! 
!     files = []
!     comments = ""
!     isdir = 0
!     lines = m.fp.readlines()
!     while lines:
!         line = lines.pop(0)
!         if line == "Modified files:\n":
!             break
!     while lines:
!         line = lines.pop(0)
!         if line == "\n":
!             break
!         line = line.rstrip("\n")
!         file, junk = line.split(None, 1)
!         if prefix:
!             # insist that the file start with the prefix: FreshCVS sends
!             # changes we don't care about too
!             bits = file.split(os.sep)
!             if bits[0] == prefix:
!                 file = apply(os.path.join, bits[1:])
!             else:
!                 break
!         if junk == "0 0":
!             isdir = 1
!         files.append(file)
!     while lines:
!         line = lines.pop(0)
!         if line == "Log message:\n":
!             break
!     # message is terminated by "ViewCVS links:" or "Index:..." (patch)
!     while lines:
!         line = lines.pop(0)
!         if line == "ViewCVS links:\n":
!             break
!         if line.find("Index: ") == 0:
!             break
!         comments += line
!     comments = comments.rstrip() + "\n"
! 
!     if not files:
!         return None
!     
!     change = Change(who, files, comments, isdir)
! 
!     return change
!     
!         
!         
! class FCMaildirSource(MaildirTwisted):
!     """This source will watch a maildir that is subscribed to a FreshCVS
!     change-announcement mailing list.
!     """
! 
!     __implements__ = IChangeSource,
  
!     def __init__(self, maildir, prefix=None):
!         MaildirTwisted.__init__(self, maildir)
!         self.changemaster = None # filled in when added
!         self.prefix = prefix
!     def describe(self):
!         return "FreshCVS mailing list in maildir %s" % self.maildir.where
!     def messageReceived(self, filename):
!         path = os.path.join(self.basedir, "new", filename)
!         change = parseFreshCVSMail(open(path, "r"), self.prefix)
!         if change:
!             self.changemaster.addChange(change)
!         os.rename(os.path.join(self.basedir, "new", filename),
!                   os.path.join(self.basedir, "cur", filename))
--- 1,5 ----
  #! /usr/bin/python
  
! # leftover import for compatibility
  
! from buildbot.changes.mail import FCMaildirSource