From 12e02e8b3f0bf6782fb4084c36f9f74884d16bcf Mon Sep 17 00:00:00 2001 From: klm Date: Tue, 7 Apr 1998 04:19:25 +0000 Subject: .FormatRosterOptionForUser(), .RosterOption() - extracted creation and formatting of roster object into separate functions, so the object could be used elsewhere. --- modules/mm_html.py | 52 ++++++++++++++++++++++++---------------------------- 1 file changed, 24 insertions(+), 28 deletions(-) (limited to 'modules') diff --git a/modules/mm_html.py b/modules/mm_html.py index 0d9773166..625df296a 100644 --- a/modules/mm_html.py +++ b/modules/mm_html.py @@ -173,8 +173,6 @@ class HTMLFormatter: " subscribers list (see above).") return text - def FormatRosterOptionForAdmin(self): - return "Admin subscriber list would require admin password." def RestrictedListMessage(self, which, restriction): if not restriction: return "" @@ -185,16 +183,16 @@ class HTMLFormatter: return ("The %s is only available to the list" " administrator." % which) def FormatRosterOptionForUser(self): + return self.RosterOption().Format() + def RosterOption(self): "Provide avenue to subscribers roster, contingent to .private_roster." - text = "" + container = htmlformat.Container() if not self.private_roster: - text = (text + - "Click here for the list of " - + self.real_name - + " subscribers: " - + htmlformat.SubmitButton('SubscriberRoster', - 'Visit Subscriber list' - ).Format()) + container.AddItem("Click here for the list of " + + self.real_name + + " subscribers: ") + container.AddItem(htmlformat.SubmitButton('SubscriberRoster', + 'Visit Subscriber list')) else: if self.private_roster == 1: only = 'members' @@ -203,24 +201,22 @@ class HTMLFormatter: only = 'the list administrator' whom = 'Admin address:' # Solicit the user and password. - text = (text - + self.RestrictedListMessage('subscriber list', - self.private_roster) - + "
Enter your " - + string.lower(whom[:-1]) - + " address and password to visit" - " the subscriber's list:
Enter your " + + string.lower(whom[:-1]) + + " address and password to visit" + " the subscriber's list: