~sakuag333/mailman/lmtp-duplicate-id

« back to all changes in this revision

Viewing changes to mailman/Archiver/Archiver.py

  • Committer: Barry Warsaw
  • Date: 2009-01-05 00:41:05 UTC
  • Revision ID: barry@list.org-20090105004105-rip8cilgzb99z9mv
PickingĀ someĀ (py)lint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
"""
25
25
 
26
26
import os
27
 
import re
28
27
import errno
29
28
import logging
30
 
import traceback
31
29
 
32
30
from cStringIO import StringIO
33
31
from string import Template
35
33
from mailman import Mailbox
36
34
from mailman import Utils
37
35
from mailman.config import config
38
 
from mailman.i18n import _
39
36
 
40
37
log = logging.getLogger('mailman.error')
41
38
 
81
78
        # the private directory, pointing directly to the private/listname
82
79
        # which has o+rx permissions.  Private archives do not have the
83
80
        # symbolic links.
84
 
        archdir = archive_dir(self.fqdn_listname)
 
81
        archdir = self.archive_dir(self.fqdn_listname)
85
82
        omask = os.umask(0)
86
83
        try:
87
84
            try:
88
85
                os.mkdir(archdir+'.mbox', 02775)
89
86
            except OSError, e:
90
 
                if e.errno <> errno.EEXIST: raise
 
87
                if e.errno <> errno.EEXIST:
 
88
                    raise
91
89
                # We also create an empty pipermail archive directory into
92
90
                # which we'll drop an empty index.html file into.  This is so
93
91
                # that lists that have not yet received a posting have
95
93
            try:
96
94
                os.mkdir(archdir, 02775)
97
95
            except OSError, e:
98
 
                if e.errno <> errno.EEXIST: raise
 
96
                if e.errno <> errno.EEXIST:
 
97
                    raise
99
98
            # See if there's an index.html file there already and if not,
100
99
            # write in the empty archive notice.
101
100
            indexfile = os.path.join(archdir, 'index.html')
103
102
            try:
104
103
                fp = open(indexfile)
105
104
            except IOError, e:
106
 
                if e.errno <> errno.ENOENT: raise
 
105
                if e.errno <> errno.ENOENT:
 
106
                    raise
107
107
                omask = os.umask(002)
108
108
                try:
109
109
                    fp = open(indexfile, 'w')
163
163
        cmd = Template(ar).safe_substitute(
164
164
            listname=self.fqdn_listname,
165
165
            hostname=self.host_name)
166
 
        cmd = ar % d
167
166
        extarch = os.popen(cmd, 'w')
168
167
        extarch.write(txt)
169
168
        status = extarch.close()