rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
self.AddToResponse("\n")
def ParseMailCommands(self):
self.AddToResponse("\n>>>> %s" % line)
def ParseMailCommands(self):
self.AddError("End of commands.")
self.AddToResponse('\n***** End: ' + line) self.AddToResponse('\nThe rest of the message is ignored:') for line in lines[linecount+1:]: self.AddToResponse('> ' + line, 0)
def ParseMailCommands(self):
if not self._cmd_dispatch.has_key(cmd): self.AddError("%s: Command UNKNOWN." % cmd)
if not self.__dispatch.has_key(cmd): self.AddError(line, prefix='Command? ') if self.__errors >= MAXERRORS: self.AddToResponse('') self.AddError('''\ Too many errors encountered; the rest of the message is ignored:''') for line in lines[linecount+1:]: self.AddToResponse('> ' + line, 0) break
def ParseMailCommands(self):
self._cmd_dispatch[cmd](args, line, mail)
self.AddToResponse('\n***** ' + line) try: self.__dispatch[cmd](args, line, msg) except: admin = self.GetAdminEmail() sfp = StringIO() traceback.print_exc(file=sfp) tbmsg = sfp.getvalue() errmsg = Utils.wrap( '''An unexpected Mailman error has occurred. Please forward your request to the human list administrator ...
def ParseMailCommands(self):
self.SendMailCmdResponse(mail)
if self.__errors > 0: header = Utils.wrap('''This is an automated response. There were problems with the email commands you sent to Mailman via the administrative address %(sender)s. If you want to reach the human being that manages this mailing list, please send your message to %(admin)s. The following is a detaile...
def ParseMailCommands(self):
self.SendTextToUser(subject = 'Mailman results for %s' % self.real_name,
subject = 'Mailman results for %s' % self.real_name self.SendTextToUser(subject = subject,
def SendMailCmdResponse(self, mail):
sender = self.GetRequestEmail(), text = self._response_buffer) self._response_buffer = ''
sender = self.GetRequestEmail(), text = self.__respbuf) self.__respbuf = '' self.__errors = 0 self.__NoMailCmdResponse = 0
def SendMailCmdResponse(self, mail):
except: exc = sys.exc_info() self.AddError("An unknown Mailman error occured.") self.AddError("Please forward on your request to %s" % self.GetAdminEmail()) self.LogMsg("error", "MailCommandHandler.ProcessPasswordCmd():\n%s%s, %s", string.join(traceback.format_tb(exc[2])), exc[0], exc[1])
def ProcessPasswordCmd(self, args, cmd, mail):
self.AddError("%s is not a member of the list." % mail.GetSender()) return options = option_info.keys() options.sort() value = '' for option in options: if self.GetUserOption(sender, option_info[option]): value = 'on' else: value = 'off' self.AddToResponse("%s: %s" % (option, value))
self.AddError("%s is not a member of the list." % mail.GetSender()) return for option in options: if self.GetUserOption(sender, option_info[option]): value = 'on' else: value = 'off' self.AddToResponse('%8s: %s' % (option, value))
def ProcessOptionsCmd(self, args, cmd, mail):
self.AddToResponse("%s:" % option) self.AddToResponse(option_descs[option])
self.AddToResponse(option + ':') self.AddToResponse(Utils.wrap(option_descs[option]), trunc=0)
def ProcessOptionsCmd(self, args, cmd, mail):
s.AddError("%s: %s" % (option, od[option]))
s.AddError(" %8s: %s" % (option, od[option]))
def ShowSetUsage(s=self, od = option_descs): options = od.keys() options.sort() s.AddError("Usage: set <option> <on|off> <password>") s.AddError("Valid options are:") for option in options: s.AddError("%s: %s" % (option, od[option]))
except: self.AddError("An unknown Mailman error occured.") self.AddError("Please forward on your request to %s" % self.GetAdminEmail()) self.AddError("%s" % sys.exc_type) elif option_info.has_key(args[0]): try: self.SetUserOption(sender, option_info[args[0]], value) self.AddToResponse("Succeeded.") except: self.AddErr...
elif not option_info.has_key(args[0]): ShowSetUsage() return if args[0] == 'norcv': args[0] = 'notmetoo' self.SetUserOption(sender, option_info[args[0]], value) self.AddToResponse("Succeeded.")
def ShowSetUsage(s=self, od = option_descs): options = od.keys() options.sort() s.AddError("Usage: set <option> <on|off> <password>") s.AddError("Valid options are:") for option in options: s.AddError("%s: %s" % (option, od[option]))
self.AddToResponse("** Public mailing lists run by Mailman@%s:" % self.host_name) for list in lists: if list == self._internal_name:
self.AddToResponse("\nPublic mailing lists run by mailman@%s" % self.host_name, trunc=0) for listname in lists: if listname == self._internal_name:
def ProcessListsCmd(self, args, cmd, mail):
try: import MailList listob = MailList.MailList(list) except: continue
try: listob = MailList.MailList(listname, lock=0) except Errors.MMUnknownListError: continue
def ProcessListsCmd(self, args, cmd, mail):
self.AddToResponse("%s (requests to %s):\n\t%s" % (listob.real_name, listob.GetRequestEmail(), listob.description))
self.AddToResponse(listob.real_name + ':') self.AddToResponse('\trequests to: ' + listob.GetRequestEmail()) if listob.description: self.AddToResponse('\tdescription: ' + listob.description, trunc=0)
def ProcessListsCmd(self, args, cmd, mail):
self.AddToResponse("\nFor more complete info about %s, including" " background" % self.real_name) self.AddToResponse("and instructions for subscribing to and" " using it, visit:\n\n\t%s\n" % self.GetAbsoluteScriptURL('listinfo'))
msg = Utils.wrap(''' For more complete info about the %(listname)s mailing list, including background and instructions for subscribing to and using it, visit: %(url)s ''' % {'listname': self.real_name, 'url' : self.GetAbsoluteScriptURL('listinfo'), }) self.AddToResponse(msg, trunc=0)
def ProcessInfoCmd(self, args, cmd, mail):
self.AddToResponse("No other details about %s are available." % self.real_name)
self.AddToResponse("No other details are available.")
def ProcessInfoCmd(self, args, cmd, mail):
self.AddToResponse("Here is the specific description of %s:\n" % self.real_name) self.AddToResponse(string.join(string.split(self.info, "\n"), "\n\n"))
self.AddToResponse(Utils.wrap(self.info), trunc=0)
def ProcessInfoCmd(self, args, cmd, mail):
except: self.AddError("An unknown Mailman error occured.") self.AddError("Please forward on your request to %s" % self.GetAdminEmail()) self.AddError("%s %s" % (sys.exc_type, sys.exc_value)) self.AddError("%s" % sys.exc_traceback)
def ProcessUnsubscribeCmd(self, args, cmd, mail):
if not mlist.topics:
if not mlist.topics_enabled:
def process(mlist, msg, msgdata): if not mlist.topics: return # Extract the Subject:, Keywords:, and possibly body text matchlines = [] matchlines.append(msg.get('subject', None)) matchlines.append(msg.get('keywords', None)) if mlist.topics_bodylines_limit == 0: # Don't scan any body lines pass elif mlist.topics_bodyli...
def maketext(templatefile, dict=None, raw=False, lang=None, mlist=None):
def findtext(templatefile, dict=None, raw=False, lang=None, mlist=None):
def maketext(templatefile, dict=None, raw=False, lang=None, mlist=None): # Make some text from a template file. The order of searches depends on # whether mlist and lang are provided. Once the templatefile is found, # string substitution is performed by interpolation in `dict'. If `raw' # is false, the resulting tex...
fp = open(os.path.join(mm_cfg.TEMPLATE_DIR, 'en', templatefile))
filename = os.path.join(mm_cfg.TEMPLATE_DIR, 'en', templatefile) fp = open(filename)
def maketext(templatefile, dict=None, raw=False, lang=None, mlist=None): # Make some text from a template file. The order of searches depends on # whether mlist and lang are provided. Once the templatefile is found, # string substitution is performed by interpolation in `dict'. If `raw' # is false, the resulting tex...
return text return wrap(text)
return text, filename return wrap(text), filename def maketext(templatefile, dict=None, raw=False, lang=None, mlist=None): return findtext(templatefile, dict, raw, lang, mlist)[0]
def maketext(templatefile, dict=None, raw=False, lang=None, mlist=None): # Make some text from a template file. The order of searches depends on # whether mlist and lang are provided. Once the templatefile is found, # string substitution is performed by interpolation in `dict'. If `raw' # is false, the resulting tex...
relevant_text = string.split(msg.body, '--%s' % boundry)[1]
relevant_text = string.split(msg.body, '--%s' % boundry) if len(relevant_text) >= 2: relevant_text = relevant_text[1] else: relevant_text = relevant_text[0]
def ScanMessage(self, msg):
def PollNewsGroup(self, watermark): if (not self.gateway_to_mail or not self.nntp_host or not self.linked_newsgroup): return 0
def PollNewsGroup(self, conn, wm, first, last):
def GetConfigInfo(self): return [ 'Mail-to-News and News-to-Mail gateway services.', ('nntp_host', mm_cfg.String, 50, 0, 'The Internet address of the machine your News server ' 'is running on.', 'The News server is not part of Mailman proper. You have to ' 'already have access to a NNTP server, and that NNTP server ' ...
con = nntplib.NNTP(self.nntp_host) r,c,f,l,n = con.group(self.linked_newsgroup) c = int(c) f = int(f) l = int(l) if watermark == 0: return l for num in range(max(watermark+1, f, l+1)):
for num in range(max(wm+1, first), last+1):
def PollNewsGroup(self, watermark): if (not self.gateway_to_mail or not self.nntp_host or not self.linked_newsgroup): return 0 import nntplib con = nntplib.NNTP(self.nntp_host) r,c,f,l,n = con.group(self.linked_newsgroup) # the (estimated)count, first, and last are numbers returned as # string. We use them as numbers t...
headers = con.head(`num`)[3]
headers = conn.head(`num`)[3]
def PollNewsGroup(self, watermark): if (not self.gateway_to_mail or not self.nntp_host or not self.linked_newsgroup): return 0 import nntplib con = nntplib.NNTP(self.nntp_host) r,c,f,l,n = con.group(self.linked_newsgroup) # the (estimated)count, first, and last are numbers returned as # string. We use them as numbers t...
body = con.body(`num`)[3]
body = conn.body(`num`)[3]
def PollNewsGroup(self, watermark): if (not self.gateway_to_mail or not self.nntp_host or not self.linked_newsgroup): return 0 import nntplib con = nntplib.NNTP(self.nntp_host) r,c,f,l,n = con.group(self.linked_newsgroup) # the (estimated)count, first, and last are numbers returned as # string. We use them as numbers t...
except "QuickEscape":
except QuickEscape:
def PollNewsGroup(self, watermark): if (not self.gateway_to_mail or not self.nntp_host or not self.linked_newsgroup): return 0 import nntplib con = nntplib.NNTP(self.nntp_host) r,c,f,l,n = con.group(self.linked_newsgroup) # the (estimated)count, first, and last are numbers returned as # string. We use them as numbers t...
return l
def PollNewsGroup(self, watermark): if (not self.gateway_to_mail or not self.nntp_host or not self.linked_newsgroup): return 0 import nntplib con = nntplib.NNTP(self.nntp_host) r,c,f,l,n = con.group(self.linked_newsgroup) # the (estimated)count, first, and last are numbers returned as # string. We use them as numbers t...
table.AddRow([Label(_('Receive digests?')), RadioButtonArray('digests', (_('No'), _('Yes')), checked=digest, values=(0, 1))])
if mlist.nondigestable and mlist.digestable: table.AddRow([Label(_('Receive digests?')), RadioButtonArray('digests', (_('No'), _('Yes')), checked=digest, values=(0, 1))])
def subscription_prompt(mlist, doc, cookie, userdesc): email = userdesc.address name = userdesc.fullname password = userdesc.password digest = userdesc.digest lang = userdesc.language title = _('Confirm subscription request') doc.SetTitle(title) i18n.set_language(lang) doc.set_language(lang) form = Form(mlist.GetScrip...
+ Utils.maketext('headfoot.html', raw=1)),
+ Utils.maketext('headfoot.html', lang=self.preferred_language, raw=1)),
def GetConfigInfo(self): WIDTH = mm_cfg.TEXTFIELDWIDTH
bucket = 'a'
bucket = None qs = {}
def membership_options(mlist, subcat, cgidata, doc, form): # Show the main stuff adminurl = mlist.GetScriptURL('admin', absolute=1) container = Container() header = Table(width="100%") # If we're in the list subcategory, show the membership list if subcat == 'add': header.AddRow([Center(Header(2, _('Mass Subscriptions'...
if qs.has_key('letter'): bucket = qs['letter'][0].lower() if bucket not in digits + lowercase: bucket = None if not bucket or not buckets.has_key(bucket): keys = buckets.keys() keys.sort() bucket = keys[0] members = buckets[bucket] action = adminurl + '/members?letter=%s' % bucket if len(members) <= chunksz: form.set_a...
bucket = qs.get('letter', 'a')[0].lower() if bucket not in digits + lowercase: bucket = None if not bucket or not buckets.has_key(bucket): keys = buckets.keys() keys.sort() bucket = keys[0] members = buckets[bucket] action = adminurl + '/members?letter=%s' % bucket if len(members) <= chunksz: form.set_action(action) el...
def membership_options(mlist, subcat, cgidata, doc, form): # Show the main stuff adminurl = mlist.GetScriptURL('admin', absolute=1) container = Container() header = Table(width="100%") # If we're in the list subcategory, show the membership list if subcat == 'add': header.AddRow([Center(Header(2, _('Mass Subscriptions'...
def checkout(tagname):
def checkout(tagname, tail):
def checkout(tagname): print 'checking out...', # watch out for dots in the name table = string.maketrans('.', '_') # To be done from writeable repository relname = '"Release_' + string.translate(tagname, table) + '"' cvsdo('export -k kv -r %s -d %s mailman' % (relname, releasedir())) os.rename('%s/doc' % releasedir(),...
cvsdo('export -k kv -r %s -d %s mailman' % (relname, releasedir())) os.rename('%s/doc' % releasedir(), 'mailman-doc')
cvsdo('export -k kv -r %s -d %s mailman' % (relname, tail)) os.rename('%s/doc' % tail, 'mailman-doc')
def checkout(tagname): print 'checking out...', # watch out for dots in the name table = string.maketrans('.', '_') # To be done from writeable repository relname = '"Release_' + string.translate(tagname, table) + '"' cvsdo('export -k kv -r %s -d %s mailman' % (relname, releasedir())) os.rename('%s/doc' % releasedir(),...
print 'Creating release dir', releasedir(tagname), '...'
dir = releasedir(tagname) print 'Creating release dir', dir, '...' if not os.path.isdir(dir): os.mkdir(dir) head, tail = os.path.split(dir)
def make_pkg(tagname): print 'Creating release dir', releasedir(tagname), '...' # this can't be done from a working directory curdir = os.getcwd() try: os.chdir(tempfile.gettempdir()) checkout(tagname) print 'making tarball...' tarball = releasedir() + '.tgz' os.system('tar cvf - %s | gzip -c > %s' % ('mailman-' + tagn...
os.chdir(tempfile.gettempdir()) checkout(tagname)
os.chdir(head) checkout(tagname, tail)
def make_pkg(tagname): print 'Creating release dir', releasedir(tagname), '...' # this can't be done from a working directory curdir = os.getcwd() try: os.chdir(tempfile.gettempdir()) checkout(tagname) print 'making tarball...' tarball = releasedir() + '.tgz' os.system('tar cvf - %s | gzip -c > %s' % ('mailman-' + tagn...
tarball = releasedir() + '.tgz' os.system('tar cvf - %s | gzip -c > %s' % ('mailman-' + tagname, tarball)) os.system('tar cvf - mailman-doc | gzip -c > mailman-doc.gz')
relname = 'mailman-' + tagname os.system('tar cvzf %s --exclude .cvsignore %s' % (relname + '.tgz', relname)) os.system('tar cvzf mailman-doc.tgz --exclude .cvsignore mailman-doc')
def make_pkg(tagname): print 'Creating release dir', releasedir(tagname), '...' # this can't be done from a working directory curdir = os.getcwd() try: os.chdir(tempfile.gettempdir()) checkout(tagname) print 'making tarball...' tarball = releasedir() + '.tgz' os.system('tar cvf - %s | gzip -c > %s' % ('mailman-' + tagn...
' list run by ', owners_html,
_(' list run by '), owners_html,
def GetMailmanFooter(self):
'%s administrative interface' % self.real_name),
_('%s administrative interface') % self.real_name),
def GetMailmanFooter(self):
def SnarfHTMLTemplate(self, file):
def SnarfHTMLTemplate(self, file, lang=None):
def SnarfHTMLTemplate(self, file): # XXX: hack, blech, yuk HTMLFormatter.InitVars(self)
filename = os.path.join(self._template_dir, file)
filename = os.path.join(self._template_dir, lang, file)
def SnarfHTMLTemplate(self, file): # XXX: hack, blech, yuk HTMLFormatter.InitVars(self)
def FormatUsers(self, digest):
def FormatUsers(self, digest, lang=None): if lang is None: lang = self.preferred_language
def FormatUsers(self, digest): conceal_sub = mm_cfg.ConcealSubscription people = []
concealed = ("<em>(%d private member%s not shown)</em>"
concealed = (_("<em>(%d private member%s not shown)</em>")
def FormatUsers(self, digest): conceal_sub = mm_cfg.ConcealSubscription people = []
text = Center(Header(3, "Note - your list delivery is currently" " disabled.")).Format()
text = Center(Header(3, _( "Note - your list delivery is currently disabled."))).Format()
def FormatDisabledNotice(self, user):
text = text + ("You may have set non-delivery deliberately, or" " it may have been triggered by bounces from your" " delivery address. In either case, to reenable " " delivery, change the ")
text = text + _("You may have set non-delivery deliberately, or" " it may have been triggered by bounces from your" " delivery address. In either case, to reenable " " delivery, change the ")
def FormatDisabledNotice(self, user):
"Disable mail delivery").Format() text = text + " option. Contact "
_("Disable mail delivery")).Format() text = text + _(" option. Contact ")
def FormatDisabledNotice(self, user):
'your list administrator').Format() text = text + " if you have questions."
_("your list administrator")).Format() text = text + _(" if you have questions.")
def FormatDisabledNotice(self, user):
return ("(Note - you are subscribing to a list of mailing lists," " so the %s notice will be sent to the admin address" " for your membership, %s.)<p>" % (type, self.GetMemberAdminEmail(user)))
return _("(Note - you are subscribing to a list of mailing lists," " so the %s notice will be sent to the admin address" " for your membership, %s.)<p>") % ( type, self.GetMemberAdminEmail(user))
def FormatUmbrellaNotice(self, user, type): if self.umbrella_list: return ("(Note - you are subscribing to a list of mailing lists," " so the %s notice will be sent to the admin address" " for your membership, %s.)<p>" % (type, self.GetMemberAdminEmail(user)))
msg = msg + ("You will be sent email requesting confirmation, " "to prevent others from gratuitously subscribing " "you. ")
msg = msg + _("You will be sent email requesting confirmation, " "to prevent others from gratuitously subscribing " "you. ")
def FormatSubscriptionMsg(self): "Tailor to approval, roster privacy, and web vetting requirements." msg = "" also = "" if self.subscribe_policy == 1: msg = msg + ("You will be sent email requesting confirmation, " "to prevent others from gratuitously subscribing " "you. ") if self.subscribe_policy == 2: msg = msg + (...
msg = msg + ("This is a closed list, which means your " "subscription will be held for approval. You will " "be notified of the administrator's decision by " "email. ") also = "also "
msg = msg + _("This is a closed list, which means your " "subscription will be held for approval. You will " "be notified of the administrator's decision by " "email. ") also = _("also ")
def FormatSubscriptionMsg(self): "Tailor to approval, roster privacy, and web vetting requirements." msg = "" also = "" if self.subscribe_policy == 1: msg = msg + ("You will be sent email requesting confirmation, " "to prevent others from gratuitously subscribing " "you. ") if self.subscribe_policy == 2: msg = msg + (...
msg = msg + ("You will be sent email requesting confirmation, " "to prevent others from gratuitously subscribing " "you. Once confirmation is received, your " "request will be held for approval by the list " "administrator. You will be notified of the " "administrator's decision by email. ") also = "also "
msg = msg + _("You will be sent email requesting confirmation, " "to prevent others from gratuitously subscribing " "you. Once confirmation is received, your " "request will be held for approval by the list " "administrator. You will be notified of the " "administrator's decision by email. ") also = _("also ")
def FormatSubscriptionMsg(self): "Tailor to approval, roster privacy, and web vetting requirements." msg = "" also = "" if self.subscribe_policy == 1: msg = msg + ("You will be sent email requesting confirmation, " "to prevent others from gratuitously subscribing " "you. ") if self.subscribe_policy == 2: msg = msg + (...
msg = msg + ("This is %sa private list, which means that " "the members list is not available to non-" "members. " % also)
msg = msg + _("This is %sa private list, which means that " "the members list is not available to non-" "members. ") % also
def FormatSubscriptionMsg(self): "Tailor to approval, roster privacy, and web vetting requirements." msg = "" also = "" if self.subscribe_policy == 1: msg = msg + ("You will be sent email requesting confirmation, " "to prevent others from gratuitously subscribing " "you. ") if self.subscribe_policy == 2: msg = msg + (...
msg = msg + ("This is %sa hidden list, which means that " "the members list is available only to the " "list administrator. " % also) else: msg = msg + ("This is %sa public list, which means that the " "members list is openly available" % also)
msg = msg + _("This is %sa hidden list, which means that " "the members list is available only to the " "list administrator. ") % also else: msg = msg + _("This is %sa public list, which means that the " "members list is openly available") % also
def FormatSubscriptionMsg(self): "Tailor to approval, roster privacy, and web vetting requirements." msg = "" also = "" if self.subscribe_policy == 1: msg = msg + ("You will be sent email requesting confirmation, " "to prevent others from gratuitously subscribing " "you. ") if self.subscribe_policy == 2: msg = msg + (...
msg = msg + (" (but we obscure the addresses so they are " "not easily recognizable by spammers). ")
msg = msg + _(" (but we obscure the addresses so they are " "not easily recognizable by spammers). ")
def FormatSubscriptionMsg(self): "Tailor to approval, roster privacy, and web vetting requirements." msg = "" also = "" if self.subscribe_policy == 1: msg = msg + ("You will be sent email requesting confirmation, " "to prevent others from gratuitously subscribing " "you. ") if self.subscribe_policy == 2: msg = msg + (...
msg = msg + ("<p>(Note that this is an umbrella list, intended to" " have only other mailing lists as members. Among" " other things, this means that your confirmation" " request will be sent to the '%s' account for" " your address.)" % self.umbrella_member_suffix)
msg = msg + _("<p>(Note that this is an umbrella list, intended to" " have only other mailing lists as members. Among" " other things, this means that your confirmation" " request will be sent to the '%s' account for" " your address.)") % self.umbrella_member_suffix
def FormatSubscriptionMsg(self): "Tailor to approval, roster privacy, and web vetting requirements." msg = "" also = "" if self.subscribe_policy == 1: msg = msg + ("You will be sent email requesting confirmation, " "to prevent others from gratuitously subscribing " "you. ") if self.subscribe_policy == 2: msg = msg + (...
def FormatEditingOption(self):
def FormatEditingOption(self, lang):
def FormatEditingOption(self): "Present editing options, according to list privacy."
text = ('To change your subscription (set options like digest' ' and delivery modes, get a reminder of your password,' ' or unsubscribe from '
text = (_('To change your subscription (set options like digest' ' and delivery modes, get a reminder of your password,' ' or unsubscribe from ')
def FormatEditingOption(self): "Present editing options, according to list privacy."
+ '), %senter your subscription email address:<p><center> ')
+ _('), %senter your subscription email address:') + '<p><center> ')
def FormatEditingOption(self): "Present editing options, according to list privacy."
text = text % "<b><i>either</i></b> "
text = text % _("<b><i> either</i></b> ")
def FormatEditingOption(self): "Present editing options, according to list privacy."
+ SubmitButton('UserOptions', 'Edit Options').Format()
+ SubmitButton('UserOptions', _('Edit Options')).Format()
def FormatEditingOption(self): "Present editing options, according to list privacy."
text = text + ("<p>... <b><i>or</i></b> select your entry from the" " subscribers list (see above).")
text = text + _("<p>... <b><i>or</i></b> select your entry from " " the subscribers list (see above).")
def FormatEditingOption(self): "Present editing options, according to list privacy."
return ("<i>The %s is only available to the list members.</i>"
return (_("<i>The %s is only available to the list members.</i>)")
def RestrictedListMessage(self, which, restriction): if not restriction: return "" elif restriction == 1: return ("<i>The %s is only available to the list members.</i>" % which) else: return ("<i>The %s is only available to the list" " administrator.</i>" % which)
return ("<i>The %s is only available to the list" " administrator.</i>" % which) def FormatRosterOptionForUser(self): return self.RosterOption().Format() def RosterOption(self):
return (_("<i>The %s is only available to the list" " administrator.</i>") % which) def FormatRosterOptionForUser(self, lang): return self.RosterOption(lang).Format() def RosterOption(self, lang):
def RestrictedListMessage(self, which, restriction): if not restriction: return "" elif restriction == 1: return ("<i>The %s is only available to the list members.</i>" % which) else: return ("<i>The %s is only available to the list" " administrator.</i>" % which)
container.AddItem("Click here for the list of "
container.AddItem(_("Click here for the list of ")
def RosterOption(self): "Provide avenue to subscribers roster, contingent to .private_roster." container = Container() if not self.private_roster: container.AddItem("Click here for the list of " + self.real_name + " subscribers: ") container.AddItem(SubmitButton('SubscriberRoster', 'Visit Subscriber list')) else: if se...
+ " subscribers: ")
+ _(" subscribers: "))
def RosterOption(self): "Provide avenue to subscribers roster, contingent to .private_roster." container = Container() if not self.private_roster: container.AddItem("Click here for the list of " + self.real_name + " subscribers: ") container.AddItem(SubmitButton('SubscriberRoster', 'Visit Subscriber list')) else: if se...
'Visit Subscriber list'))
_("Visit Subscriber list")))
def RosterOption(self): "Provide avenue to subscribers roster, contingent to .private_roster." container = Container() if not self.private_roster: container.AddItem("Click here for the list of " + self.real_name + " subscribers: ") container.AddItem(SubmitButton('SubscriberRoster', 'Visit Subscriber list')) else: if se...
only = 'members' whom = 'Address:'
only = _('members') whom = _('Address:')
def RosterOption(self): "Provide avenue to subscribers roster, contingent to .private_roster." container = Container() if not self.private_roster: container.AddItem("Click here for the list of " + self.real_name + " subscribers: ") container.AddItem(SubmitButton('SubscriberRoster', 'Visit Subscriber list')) else: if se...
only = 'the list administrator' whom = 'Admin address:'
only = _('the list administrator') whom = _('Admin address:')
def RosterOption(self): "Provide avenue to subscribers roster, contingent to .private_roster." container = Container() if not self.private_roster: container.AddItem("Click here for the list of " + self.real_name + " subscribers: ") container.AddItem(SubmitButton('SubscriberRoster', 'Visit Subscriber list')) else: if se...
container.AddItem(self.RestrictedListMessage('subscribers list',
container.AddItem(self.RestrictedListMessage(_('subscribers list'),
def RosterOption(self): "Provide avenue to subscribers roster, contingent to .private_roster." container = Container() if not self.private_roster: container.AddItem("Click here for the list of " + self.real_name + " subscribers: ") container.AddItem(SubmitButton('SubscriberRoster', 'Visit Subscriber list')) else: if se...
+ " <p>Enter your "
+ _(" <p>Enter your ")
def RosterOption(self): "Provide avenue to subscribers roster, contingent to .private_roster." container = Container() if not self.private_roster: container.AddItem("Click here for the list of " + self.real_name + " subscribers: ") container.AddItem(SubmitButton('SubscriberRoster', 'Visit Subscriber list')) else: if se...
+ " and password to visit" " the subscribers list: <p><center> "
+ _(" and password to visit" " the subscribers list: <p><center> ")
def RosterOption(self): "Provide avenue to subscribers roster, contingent to .private_roster." container = Container() if not self.private_roster: container.AddItem("Click here for the list of " + self.real_name + " subscribers: ") container.AddItem(SubmitButton('SubscriberRoster', 'Visit Subscriber list')) else: if se...
container.AddItem(" Password: "
container.AddItem(_("Password: ")
def RosterOption(self): "Provide avenue to subscribers roster, contingent to .private_roster." container = Container() if not self.private_roster: container.AddItem("Click here for the list of " + self.real_name + " subscribers: ") container.AddItem(SubmitButton('SubscriberRoster', 'Visit Subscriber list')) else: if se...
'Visit Subscriber List'))
_('Visit Subscriber List')))
def RosterOption(self): "Provide avenue to subscribers roster, contingent to .private_roster." container = Container() if not self.private_roster: container.AddItem("Click here for the list of " + self.real_name + " subscribers: ") container.AddItem(SubmitButton('SubscriberRoster', 'Visit Subscriber list')) else: if se...
def FormatReminder(self):
def FormatReminder(self, lang):
def FormatReminder(self):
return 'Once a month, your password will be emailed to you as a reminder.'
return _('Once a month, your password will be emailed to you as' ' a reminder.')
def FormatReminder(self):
def ParseTags(self, template, replacements): text = self.SnarfHTMLTemplate(template)
def ParseTags(self, template, replacements, lang=None): if lang is None: lang = self.preferred_language text = self.SnarfHTMLTemplate(template, lang)
def ParseTags(self, template, replacements):
def GetStandardReplacements(self):
def GetStandardReplacements(self, lang=None): if lang is None: lang = self.preferred_language
def GetStandardReplacements(self): dmember_len = len(self.GetDigestMembers()) member_len = len(self.GetMembers())
self.RestrictedListMessage('current archive',
self.RestrictedListMessage(_('current archive'),
def GetStandardReplacements(self): dmember_len = len(self.GetDigestMembers()) member_len = len(self.GetMembers())
'<mm-reminder>' : self.FormatReminder(),
'<mm-reminder>' : self.FormatReminder(self.preferred_language),
def GetStandardReplacements(self): dmember_len = len(self.GetDigestMembers()) member_len = len(self.GetMembers())
def GetAllReplacements(self):
def GetAllReplacements(self, lang=None):
def GetAllReplacements(self): """ returns standard replaces plus formatted user lists in a dict just like GetStandardReplacements. """ d = self.GetStandardReplacements() d.update({"<mm-regular-users>": self.FormatUsers(0), "<mm-digest-users>": self.FormatUsers(1)}) return d
d = self.GetStandardReplacements() d.update({"<mm-regular-users>": self.FormatUsers(0), "<mm-digest-users>": self.FormatUsers(1)})
if lang is None: lang = self.preferred_language d = self.GetStandardReplacements(lang) d.update({"<mm-regular-users>": self.FormatUsers(0, lang), "<mm-digest-users>": self.FormatUsers(1, lang)})
def GetAllReplacements(self): """ returns standard replaces plus formatted user lists in a dict just like GetStandardReplacements. """ d = self.GetStandardReplacements() d.update({"<mm-regular-users>": self.FormatUsers(0), "<mm-digest-users>": self.FormatUsers(1)}) return d
def InitTemplates(self):
def InitTemplates(self, langs=None):
def InitTemplates(self):
files = filter(ExtensionFilter, os.listdir(mm_cfg.TEMPLATE_DIR)) Utils.MakeDirTree(self._template_dir) for filename in files: file1 = open(os.path.join(mm_cfg.TEMPLATE_DIR, filename), 'r') text = file1.read() file1.close() file2 = open(os.path.join(self._template_dir, filename), 'w+') file2.write(text) file2.close()
if not langs: langs = [mm_cfg.DEFAULT_SERVER_LANGUAGE] for L in langs: files = filter(ExtensionFilter, os.listdir(os.path.join(mm_cfg.TEMPLATE_DIR, L))) Utils.MakeDirTree(os.path.join(self._template_dir, L)) for filename in files: file1 = open(os.path.join(mm_cfg.TEMPLATE_DIR, L, filename)) text = file1.read() file1....
def ExtensionFilter(item): return item[-5:] == '.html'
def validp(addr):
addrs = [] for addr in [s.strip() for s in val.split(NL)]: if not addr: continue
def validp(addr): try: Utils.ValidateEmail(addr) except Errors.EmailAddressError: if wtype == mm_cfg.EmailListEx and addr.startswith('^'): # It's interpreted as a regular expression pass raise ValueError
pass raise ValueError return [addr for addr in [s.strip() for s in val.split(NL)] if validp(addr)]
try: re.compile(addr) except re.error: raise ValueError else: raise addrs.append(addr) return addrs
def validp(addr): try: Utils.ValidateEmail(addr) except Errors.EmailAddressError: if wtype == mm_cfg.EmailListEx and addr.startswith('^'): # It's interpreted as a regular expression pass raise ValueError
if not msg:
if msg: fp.seek(0) msg = Message.Message(fp) else:
def __handlepost(self, record, value, comment, preserve, forward, addr): # For backwards compatibility with pre 2.0beta3 if len(record) == 5: ptime, sender, subject, reason, filename = record msgdata = {} else: # New format of record ptime, sender, subject, reason, filename, msgdata = record path = os.path.join(mm_cfg....
self.LogMsg("MailList.Save(): error getting archive mode for %s!: %s\n",
self.LogMsg("error", "MailList.Save(): error getting archive mode for %s!: %s\n",
def CheckHTMLArchiveDir(self): # # we need to make sure that the archive # directory has the right perms for public vs # private. If it doesn't exist, or some weird # permissions errors prevent us from stating # the directory, it's pointless to try to # fix the perms, so we just return -scott # try: st = os.stat(self...
self.LogMsg("CheckHTMLArchiveDir: error getting archive mode for %s!: %s\n",
self.LogMsg("error", "CheckHTMLArchiveDir: error getting archive mode for %s!: %s\n",
def CheckHTMLArchiveDir(self): # # we need to make sure that the archive # directory has the right perms for public vs # private. If it doesn't exist, or some weird # permissions errors prevent us from stating # the directory, it's pointless to try to # fix the perms, so we just return -scott # try: st = os.stat(self...
if mode != 0770:
if mode != 02770:
def CheckHTMLArchiveDir(self): # # we need to make sure that the archive # directory has the right perms for public vs # private. If it doesn't exist, or some weird # permissions errors prevent us from stating # the directory, it's pointless to try to # fix the perms, so we just return -scott # try: st = os.stat(self...
if mode != 0775:
if mode != 02775:
def CheckHTMLArchiveDir(self): # # we need to make sure that the archive # directory has the right perms for public vs # private. If it doesn't exist, or some weird # permissions errors prevent us from stating # the directory, it's pointless to try to # fix the perms, so we just return -scott # try: st = os.stat(self...
_logfile = StampedLogger('locks', manual_reprime=1)
_logfile = StampedLogger('locks')
def __writelog(self, msg): global _logfile if self.__withlogging: if not _logfile: _logfile = StampedLogger('locks', manual_reprime=1) head, tail = os.path.split(self.__lockfile) _logfile.write('%s %s\n' % (tail, msg))
elif prefix and not re.match(re.escape(self.subject_prefix), subj, re.I):
elif prefix and not re.search(re.escape(self.subject_prefix), subj, re.I):
def Post(self, msg, approved=0):
reflist = varref.split('/')
reflist = varhelp.split('/')
def option_help(mlist, varhelp): # The html page document doc = Document() doc.set_language(mlist.preferred_language) # Find out which category and variable help is being requested for. item = None reflist = varref.split('/') if len(reflist) == 2: category, varname = reflist options = get_config_options(mlist, category...
elaboration = desc
elaboration = description
def option_help(mlist, varhelp): # The html page document doc = Document() doc.set_language(mlist.preferred_language) # Find out which category and variable help is being requested for. item = None reflist = varref.split('/') if len(reflist) == 2: category, varname = reflist options = get_config_options(mlist, category...
doc.AddItem("<b>%s</b> (%s): %s<p>" % (varname, category, descr))
doc.AddItem("<b>%s</b> (%s): %s<p>" % (varname, category, description))
def option_help(mlist, varhelp): # The html page document doc = Document() doc.set_language(mlist.preferred_language) # Find out which category and variable help is being requested for. item = None reflist = varref.split('/') if len(reflist) == 2: category, varname = reflist options = get_config_options(mlist, category...
lang = mlist.preferred_language
lang = self.preferred_language
def _UpdateRecords(self): # Subscription records have changed since MM2.0.x. In that family, # the records were of length 4, containing the request time, the # address, the password, and the digest flag. In MM2.1a2, they grew # an additional language parameter at the end. In MM2.1a4, they grew # a fullname slot afte...
self.nntp_host = ''
self.nntp_host = mm_cfg.DEFAULT_NNTP_HOST
def InitVars(self): # Configurable self.nntp_host = '' self.linked_newsgroup = '' self.gateway_to_news = 0 self.gateway_to_mail = 0