Update of /cvsroot/cvs-syncmail/syncmail
In directory sc8-pr-cvs1:/tmp/cvs-serv21033
Modified Files:
Tag: new-config-branch
syncmail
Log Message:
- move loading of the repository directory into Options.__init__()
- add check that we actually have email addresses to send to
- update and re-wrap a comment
Index: syncmail
===================================================================
RCS file: /cvsroot/cvs-syncmail/syncmail/syncmail,v
retrieving revision 1.36.2.11
retrieving revision 1.36.2.12
diff -u -d -r1.36.2.11 -r1.36.2.12
--- syncmail 10 Jul 2003 22:15:00 -0000 1.36.2.11
+++ syncmail 11 Jul 2003 17:21:39 -0000 1.36.2.12
@@ -602,7 +602,14 @@
self.people = string.join(args[1:], COMMASPACE)
else:
self.people = config.get("to")
- self.repodir = os.curdir
+
+ fn = os.path.join("CVS", "Repository")
+ if os.path.isfile(fn):
+ f = open(fn)
+ self.repodir = string.strip(f.readline())
+ f.close()
+ else:
+ self.repodir = os.curdir
def load_configuration(args, branch=None):
cmdline, args = load_cmdline(args)
@@ -622,13 +629,17 @@
def main():
# load the options
config = load_configuration(sys.argv[1:], load_branch_name())
- s = open(os.path.join("CVS", "Repository")).readline()
- config.repodir = string.strip(s)
- # args[0] is the specification containing the files that were
- # modified. The argument actually must be split, with the first component
- # containing the directory the checkin is being made in, relative to
- # $CVSROOT, followed by the list of files that are changing.
+ if not config.people:
+ # Nobody to send mail to!
+ print 'No email addresses provided; exiting.'
+ return
+
+ # config.cvsinfo is the specification containing the files that
+ # were modified. The argument actually must be split, with the
+ # first component containing the directory the checkin is being
+ # made in, relative to $CVSROOT, followed by the list of files
+ # that are changing.
specs = string.split(config.cvsinfo)
if specs[-3:] == ['-', 'Imported', 'sources']:
|