summaryrefslogtreecommitdiff
path: root/Mailman/HTMLFormatter.py
Commit message (Collapse)AuthorAgeFilesLines
* Bite the bullet: rename the Mailman package to mailman.Barry Warsaw2008-02-271-437/+0
|
* Tweak copyright years.Barry Warsaw2008-02-071-1/+1
|
* More work on completing the transition to setuptools.Barry Warsaw2007-07-181-4/+3
| | | | | | | | | | | | | | | | | * Mailman/testing -> Mailman/test * Removed Mailman/testing/base.py * Fix mailmanctl by using a different way of calculating where the qrunner script is. The configuration file no longer knows what BIN_DIR is, but the mailmanctl script knows where it lives via sys.argv[0]. Also, PREFIX_DIR -> VAR_DIR. Also, * Since the overwhelmingly predominant use of ILanguageManager is to get the description, and since .get_language_data(code)[0] is not very readable, split the interface into .get_description() and .get_charset(). * In the setup, automatically add all Mailman.bin modules as command line scripts.
* Major surgery to get the setuptools based installation passing all theBarry Warsaw2007-07-161-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | existing unit tests. Here's a summary of the changes. - Removed all dependent third party packages, since the setup.py file now claims all package dependencies such that they can be automatically installed from the cheeseshop. - Moved the misc directory into the Mailman package as Mailman/data. Moved templates and messages to Mailman subpackages. - Added an ILanguageManager interface, plus an implementation, so that we don't use Defaults.LC_DESCRIPTIONS directly anymore. Added a doctest for this interface and implementation. Defaults.LANGUAGES is moved into mailman.cfg. Defaults.LANGUAGE_DICT is moved to _DEFAULT_LANGUAGE_DATA, and LC_DESCRIPTIONS is removed. The calculation of the available and enabled languages is moved to the Configuration class, but this will probably still need work. Utils.GetLanguageDescr() and Utils.IsLanguage() are removed. I'd like to remove GetCharSet() eventually too, but there are too many uses of this currently, so I'm deferring it. - Utils.findtext(): Hacks added so that templates can be retrieved from the language catalog. The hack is that the template contents are used to find the translation, but in the one test case where this is actually flexed, the trailing newline in the file contents has to be trimmed. This is probably not right. - No more Defaults.py.in or mm_cfg.py! Defaults.py.in is moved to Defaults.py and is no longer created from a template file. The script called make_instance is added which creates an etc/mailman.cfg file from mailman.cfg.in (previously, mailman.cfg.sample) and /that/ file now has the small number of calculated values. In general, make_instance will not touch mailman.cfg if it exists, unless the --force option is given. CGIEXT is made the empty string by default (i.e. not generated). make_instance grows a --var-dir option. Fleshed out the --languages opton. - Defaults.py grows a DEFAULT_VAR_DIRECTORY variable, which is the default location of the 'var' directory. The Configuration class uses this as one of the directories it searches for its landmark, i.e. etc/mailman.cfg. RUNTIME_DIR is gone, as is VAR_PREFIX. - testall needs to write MAILMAN_USER, MAILMAN_UID, MAILMAN_GROUP, MAILMAN_GID, and LANGUAGES run time variables. - bin/withlist no longer needs to add config.BIN_DIR to sys.path, because in fact that variable doesn't exist any more. - Tweak the French catalog to make a test work. This is needed because of the conversion from %-strings to $-strings. - The setup.py now generates the .mo files before it does its thing. This will have to be fixed, but for now we must generate these files on setup build time instead of installation time. - Removed an unused interface.
* Restoreing i18n in 2.2tkikuchi2007-03-011-2/+2
| | | | | | | | - As the default type of string in mailman-2.2 was set to 'unicode', i18n codes became need to be fixed. - Fixed: admin web interface. Other web interfaces needs more verification. - Fixed: non-digest delivery. Stil to go: digest and archive.
* Rework MailList.available_languages so that we don't need to use a PickleTypebwarsaw2007-01-181-20/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | column in the database for this list of strings. We use SQLAlchemy's many-to-many relationship, however because of this, you cannot simply append new unicodes to .available_languages. You need to wrap the language code in a Language instance and append that instance to the list. In order to handle this, I added a property MailList.language_codes which returns a list of the code strings (not Language instances). Also new are MailList.set_languages() for setting (i.e. overriding) the set of available languages for the list; and add_language() which takes a single language code, wraps it, and appends it. The code does not and should not use .available_languages directory any more. MailList.GetAvailableLanguages() is removed. The 'available_languages' column is removed from the Listdata table. Add a getValue() to Mailman.Gui.Language in order to unwrap the language codes stored in the database's association table. Modify _setValue() to do the wrapping. In dbcontext.py, don't import * from the sqlalchemy package. It contains a 'logging' name which is not the standard Python logging package. I also added essentially a bag of attributes class called Tables which will hold references to all the SA tables that are created. Update the make_table() API to take an instance of Tables. Added a close() method to DBContext. This is needed for the updated unit test suite. Changed bin/import.py so that when available_languages is being set, it calls MailList.set_languages() instead of trying to set that attribute directly. Updated some language idioms while I was at it. More eradication of mm_cfg in favor of the config object and the Defaults module. In testall.py, call initialize() instead of loginit.initialize(). Promote MAX_RESTARTS into a Defaults.py.in variable. This is because the unit tests will knock that value down to something not so annoying should one of the qrunner-required tests traceback. Several other important changes to the unit test suite (which now completely succeeds again!): - Set the uid and gid of the temporary mailman.cfg and tmp*.db files to the Mailman user and group as specified in the config object. - Make sure that all of the tests point to a SQLite database file that was created with the tempfile module. This way we don't pollute our main database with data that is getting created during the unit tests. - In the TestBase.setUp() method, be sure to close the existing dbcontext, clear out the mappers, and then reconnect the dbcontext with the new SQLALCHEMY_ENGINE_URL pointing to the tempfile. However, we don't need to reload the MailList instance any more. - Make all tests work, except for the tests that require crypt. That upgrade path will not be available in this version of Mailman.
* More work on the WSGI support. So far, I've tested most of the admin.py linksbwarsaw2006-10-151-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and some of the admindb.py links. There may still be breakage in other parts of the interface and I haven't gone back to verify that traditional CGI still works. Changes: - Add wsgiref-0.1.2-py2.4.egg so that we can still do WSGI in Python 2.4, which doesn't come with wsgiref. Of course this means we /also/ have to add setuptools-0.5c3 because eggs require setuptools. - Style cleanups in HTTPRunner.py and wsgi_app.py. Also, use cStringIO instead of StringIO. - All internal links within the listinfo and admin pages are (or at least should be ;) relative now. This should make other things better, such as running Mailman over https or alternative ports. It does kind of mean that web_page_url is obsolete, but I haven't looked at whether we can completely eradicate it. - ValidateEmail(): Use ' ' in s instead of s.count(' ') > 0. - GetPathPieces(): When path is false, return the empty list instead of None, so we can still len() it. - ScriptURL(): Much simpler. To support relative urls as the default, we change the API so that it only takes a 'target' argument (i.e. the script we want to link to). It no longer takes 'absolute' or 'web_page_url', and it constructs its link from GetPathPieces(), the target, and the cgi extension. - GetRequestURI(): code style updates. - Mailman/bin/show_config.py: De-DOS-line-ending-ification. - export.py: A few modifications, although this is likely still not final (I'm still working on the import script). First, for <option> elements, don't put the value in an attribute, put it in the text body of the element. Second, put the list <option> tags in a <configuration> element. Third, put the preferred language on an <option> tag with a 'preferred_language' name attribute value. - SecurityManager: Make sure that MakeCookie() and ZapCookie() use the same 'path' cookie value by refactoring that into a separate method. That method now returns just the SCRIPT_NAME and the full listname. web_page_url doesn't enter into it. - loginit.py: Add a 'debug' logger since it's just too useful to have :) - admin.py: Remove the extra / right before the query string in ?VARHELP urls. That extra / turns out to be problematic with the relative url scheme we're using now. - Auth.py: whitespace normalization and copyright years update. Also, remove a couple of unnecessary imports. Also, make sure that the actionurl is relative. - create.py: Typo. - private.py: mm_cfg -> config object - In MailList.py: GetScriptURL() can be written in terms of Utils.ScriptURL() now.
* FSF office has moved. chdcking in for MAIN branch.tkikuchi2005-08-271-1/+1
|
* FormatUsers(): The user portion of the link should honor the settingbwarsaw2003-09-291-9/+10
| | | | of self.obscure_addresses.
* FormatDisabledNotice(): I18n formatting improvement by Simonebwarsaw2002-12-071-1/+1
| | | | Piunno. Closes SF # 649158.
* RestrictedListMessage(), RosterOption(), GetStandardReplacements():bwarsaw2002-11-191-5/+6
| | | | | Applied patch #600368 by Simone Piunno to ease translations for some languages.
* ParseTags(): Python will barf when trying to string-join a sequence ifbwarsaw2002-09-171-1/+8
| | | | | | | all the strings aren't properly encoded. To make life as easy as possible, make sure that all the items in the split sequence are 8-bit strings, encoded if necessary in the charset of the language given in the argument list.
* FormatDisabledNotice(): Include in bounce reasons, the date of thebwarsaw2002-08-021-1/+5
| | | | last received bounce.
* GetStandardReplacements(): Patch by Juan Carlos Rey Anaya to fix i18nbwarsaw2002-07-031-1/+1
| | | | display when only one language is available.
* FormatSubscriptionMsg(): Fix missing space. Closes bug #555065 bybwarsaw2002-05-281-2/+4
| | | | Simone Piunno.
* GetStandardReplacements(), MailmanLogo(), IMAGE_LOGOS, SHORTCUT_ICON:bwarsaw2002-04-211-2/+4
| | | | | | | | | Clarify the semantics of all these settings. Setting IMAGE_LOGOS to 0 is the only way to suppress the sponsor images, but this also suppresses the favicon. You should now never set SHORTCUT_ICON to 0 (it should always be the string naming the favicon file). Closes SF bugs # 546421 and 546418.
* GetStandardReplacements(): If there's just one choice of language,bwarsaw2002-04-111-1/+1
| | | | return the lang description as a non-selectable string.
* GetAdminEmail() eradication campaign.bwarsaw2002-03-261-1/+1
| | | | | | | | GetStandardReplacements(): Expand <mm-owner> tags to the -owner address. This is more appropriate than the -bounces address because it reaches the human without going through the bounce processor. Since this ends up in a message that a human will act on, it's the correct address to use.
* Feedback from Guido...bwarsaw2002-03-231-1/+7
| | | | | | | | | | | | | | | | | | | | listinfo.py list_listinfo(): If the list only has one language enabled, omit the language choice box. It's a waste of screen real-estate. HTMLFormatter GetStandardReplacements(): ditto options.py loginpage(): ditto. Also omit the paragraph that talks about session cookies. It's probably over the heads of most users. main(): Don't print the "No address given" if we're traveling here from the listinfo page and they left the address field blank, as per the instructions.
* GetStandardReplacements(): Add <mm-favicon> for a url replacement inbwarsaw2002-03-221-0/+1
| | | | the head's LINK SHORTCUT ICON.
* Patches to support duplicate suppression for explicit recipients,bwarsaw2002-03-051-1/+2
| | | | | | | | | | | written by Ben Gertzfield, ported to MM2.1 by Marc MERLIN. Specifically, FormatOptionButton(): Add DontReceiveDuplicates to the list of options names. (Also, untabbification)
* GetStandardReplacements(): Be sure to pass the lang argument to thebwarsaw2002-02-051-2/+2
| | | | | | GetLangSelectBox() call for the <mm-list-langs> replacement, otherwise a user's option page will always reset the user's language to the list's preferred language.
* FormatDisabledNotice(): If the user has been disabled due to bounces,bwarsaw2001-12-271-0/+12
| | | | | | | they'll have a bounce info record, and if that record has a score above 0, we'll add a little bit of information to their options page explaining their current bounce score and some advice for fixing the problem.
* FormatUsers(), FormatOptionButton(), FormatDisabledNotice(): Usebwarsaw2001-12-191-8/+22
| | | | | | getDeliveryStatus() instead of getMemberOption(). Also, tailor the disable notification based on the actual status -- gives more detail about how the membership was actually disabled.
* FormatEditingOptions(): Let's actually /use/ the lang argument to addbwarsaw2001-11-301-14/+19
| | | | | | | | | | | | a hidden field so that the language choice can be propagated to the options page. RosterOption(): Same, for the roster page. GetLangSelectBox(): Factor out the creation of the language selection widget, since other code will need the same thing. GetStandardReplacements(): Use GetLangSelectBox().
* FormatEditingOptions(): Make the text box's name "email" so as to hookbwarsaw2001-10-121-1/+1
| | | | up with what options.py expects.
* GetMailmanFooter(): A fix by (I believe) Mikhail Sobolev to makebwarsaw2001-10-091-3/+4
| | | | Russian translation easier.
* FormatUsers(): Don't use string interpolation to pluralize the wordbwarsaw2001-10-011-13/+11
| | | | | | "member". This makes translation to some languages difficult. Instead, construct different messages based on whether num_concealed is == 1 or > 1.
* GetMailmanFooter(): Don't hyperlink each individual list owner with abwarsaw2001-08-291-8/+5
| | | | | | | mailto: to their personal email address. Instead, hyperlink the lot of them with a mailto: to the list's -owner address. That let's us do a spam detect on the message before forwarding on the owners.
* FormatSubscriptionMsg(): Use triple quoted strings instead ofbwarsaw2001-08-171-36/+25
| | | | multiline individual strings.
* GetMailmanFooter(): Add a link to the listinfo overview page for thebwarsaw2001-08-021-12/+16
| | | | | | | | | | domain. From there you can get to the admin overview. FormatEditingOption(): Remove the docstring. Also, rework the glomming up of the text local variable to be more efficient, and to emphasize that the same field/button should be used to quickly unsubscribe from the list. Also, indicate what happens if you leave the field blank.
* All membership related attribute access should use the MemberAdaptorbwarsaw2001-07-191-11/+13
| | | | | | | | | | | | | API instead, e.g. GetDigestMembers() -> getDigestMemberKeys() GetUserOption() -> getMemberOption() GetMembers() -> getRegularMemberKeys() FormatOptionButton(): Add ReceiveNonmatchingTopics flag. FormatBox(): Add optional `value' parameter, which if supplied is the default value for teh input box (default is the empty string).
* GetStandardReplacements(): When displaying the selected language,bwarsaw2001-06-271-2/+5
| | | | | first try to get the index of the explicit argument, falling back to the list's preferred language, and the server's default.
* RestrictedListMessage(): Fixed a typo (missing open paren), andbwarsaw2001-06-011-4/+5
| | | | converted to multiline strings for ease of translation.
* FormatOptionButton(): Formatting, but also change the 'passwdremind'bwarsaw2001-05-311-22/+20
| | | | | | | | value to 'remind'. FormatDisabledNotice(): Cleaned up the text message by using multi-line strings and string interpolation. This should also improve the ability for these messages to be translated into Japanese.
* FormatOptionButton(): Teach this about the SuppressPasswordReminderbwarsaw2001-05-251-9/+9
| | | | user option.
* Removed some unnecessary imports.bwarsaw2001-05-181-4/+1
|
* InitVars(): Removed, since self._template_dir is no longer necessarybwarsaw2001-05-181-43/+1
| | | | | | | | | | | | | | | | and all references to this volatile instance variable have been removed. SnarfHTMLTemplate(): Also removed, since maketext() does all this in a more general way. ParseTags(): Use Utils.maketext() instead of SnarfHTMLTemplate(). InitTemplates(): Because of the new support for expanded template searches, the only thing that's necessary for a list to support a language is for it to have a (possibly empty) directory named after the language code. Thus, the copying of template files done in this method are unnecessary.
* Porting forward from 2.0.4 a patch to replace the deprecated regsubbwarsaw2001-05-011-14/+13
| | | | | | module with re. This quiets a Python 2.1 warning. Also, de-string-module-ification.
* FormatUsers(): Use GetOptionsURL() instead of GetScriptURL() since thebwarsaw2001-03-031-2/+1
| | | | | | former does the proper urllib.quote()'ing of the email address. Close SF bug #214161 (old Jitterbug PR#198).
* InitTemplates(): Copy both the .html and the .txt files into thebwarsaw2001-03-021-2/+3
| | | | list-specific language templates directory.
* Untabification.bwarsaw2001-02-281-119/+119
|
* Next round of big i18n patches.bwarsaw2001-02-281-18/+19
| | | | | | Added some missing _() wrappers. Fix some _() wrappings to use local variables.
* SnarfHTMLTemplate(): Don't try to fall back to lists/<listname>/ tobwarsaw2001-02-231-11/+4
| | | | | | find the template if lists/<listname>/<lang> doesn't exist. The update script now creates the `en' language subdir and moves all the templates into it.
* InitTemplates(): Simply by using some Python 2.0-isms and the shutilbwarsaw2001-02-161-18/+22
| | | | | module. Also, default to getting the source templates out of $MM/templates if $MM/templates/<lang> doesn't exist.
* Some additional i18n markup, although I can't remember if this is Juanbwarsaw2001-02-151-25/+40
| | | | | | | | | | | | | | | | | | Carlos's contribution or not. Specifically, GetMailmanFooter(), FormatSubscriptionMsg(), FormatEditingOption(): Mark some strings as translatable, using the Mailman.i18n._ `auto-interpolating' function. SnarfHTMLTemplate(): Catch IOErrors which could result if a list was created in an older version of Mailman before the i18n support was added. GetStandardReplacements(): Watch out for missing list preferred language (can happen to an older list which hasn't been updated). Use DEFAULT_SERVER_LANGUAGE in that case. InitTemplates(): Some additional code reorg.
* Latest round of jcrey's I18N patches. Specifically,bwarsaw2000-12-261-100/+123
| | | | | | | | Mark lots of strings as translatable. SnarfHTMLTemplate(), FormatUsers(), FormatEditingOption(), FormatReminder(), GetStandardReplacements(), GetAllReplacements(), InitTemplates(): Accept optional `lang' argument.
* GetMailmanFooter(): Add a link to the administrative interface to eachbwarsaw2000-09-091-1/+5
| | | | | list footer. Makes it much easier to get to the admin pages from the normal user pages.
* InitVars(): Use self.internal_name()bwarsaw2000-08-011-7/+5
| | | | | GetMailmanFooter(), FormatUsers(), FormatFormStart(): GetRelativeScriptURL() => GetScriptURL()
* FormatFormStart(): Use GetScriptURL(relative=1) for calculating thebwarsaw2000-07-251-1/+1
| | | | action path. SF Patch #100556.