summaryrefslogtreecommitdiff
path: root/Mailman/htmlformat.py
Commit message (Collapse)AuthorAgeFilesLines
* Bite the bullet: rename the Mailman package to mailman.Barry Warsaw2008-02-271-670/+0
|
* Tweak copyright years.Barry Warsaw2008-02-071-1/+1
|
* Restoreing i18n in 2.2tkikuchi2007-03-011-1/+1
| | | | | | | | - 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.
* Update copyright years.bwarsaw2007-01-191-1/+1
|
* Merged revisions 8113-8121 via svnmerge from bwarsaw2006-12-291-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://mailman.svn.sourceforge.net/svnroot/mailman/branches/tmp-sqlalchemy-branch ................ r8114 | bwarsaw | 2006-12-06 00:16:54 -0500 (Wed, 06 Dec 2006) | 44 lines Initial take on using SQLAlchemy to store list data in lieu of Python pickles. While all the list data (including OldStyleMemberships attributes) are stored in the database, many attributes are stored as PickleTypes binary data. This isn't idea but it gets things working until a more sophisticated schema can be developed. MailList class is now a new-style class, as is required by SQLAlchemy. This makes several things, er, interesting. Rip out all the low-level pickle reading and writing stuff. Hook SA transaction events into Lock() and Unlock(). Move the hooking of the _memberadaptor into InitTempVars(), which gets called by the SQLAlchemy hooks (MailList.__init__() never is). Add an initialize.py module which centralizes all the initialization bits that command line scripts have to do, including configuration, logging, and atabase initialization. This change also converts bin/withlist to mmshell wrapper. Update to SQLAlchemy 0.3.1. Revamp paths.py.in considerably. There were several problems with the old way. We no longer disable default loading of site-packages so we don't need to add Python's site-packages back to sys.path. Also, because site.addsitedir() causes things like .pth paths to be /appended/ to sys.path, they actually won't override any site-installed packages. E.g. if SQLAlchemy is installed in the system Python, our version will not override. IIUC, setuptools-based packages can be configured to work properly in the face of package versions, however not all packages we currently depend on are setuptools-based. So instead, we steal a bit of stuff from site.py but change things so the prepend .pth stuff to sys.path. Update several modules to use True/False and whitespace normalization. Convert from mm_cfg to config object. Modernize a few coding constructs. Add a couple of exceptions to handle database problems. In the export script, include the widget type in the elements. This helped in my stupid little throw away conversion script, but I think it will be more generally useful. Add an interact.py module which refactors interactive interpreter access. Mostly this is used by withlist -i, but it lets us import Mailman.interact and drop into a prompt just about anywhere (e.g. debugging). ................ r8115 | bwarsaw | 2006-12-07 09:13:56 -0500 (Thu, 07 Dec 2006) | 22 lines Start to flesh out more of the SQLAlchemy mechanisms. Added a MailList.__new__() which hooks instantiation to use a query on dbcontext to get an existing mailing list. A 'no-args' call means we're doing a Create(), though eventually that will change too. For now, disable the CheckVersion() call. Eventually this will be folded into schema migration. list_exists(): Rewrite to use the dbcontext query to determine if the named mailing list exists or not. Requires the fqdn_listname. Eradicate two failed member adaptors: BDBMemberAdaptor and SAMemberships. Change the way the DBContext holds onto tables. It now keeps a dictionary mapping the table's name to the SA Table instance. This makes it easier to look up and use the individual tables. Add 'web_page_url' as an attribute managed by SA, and remove a debugging print. ................ r8116 | bwarsaw | 2006-12-11 07:27:47 -0500 (Mon, 11 Dec 2006) | 29 lines Rework the whole dbcontext and transaction framework. SA already handles nested transactions so we don't have to worry about them. However, we do have the weird situation where some transactions are tied to MailList .Lock()/.Unlock()/.Save() and some are tied to non-mlist actions. So now we use an @txn decorator to put methods in a session transaction, but then we also hook into the above MailList methods as possibly sub-transactions. We use a weakref subclass to manage the MailList interface, with a dictionary mapping MailList fqdn_listnames against transactions. The weakrefs come in by giving us a callback when a MailList gets derefed such that we're guaranteed to rollback any outstanding transaction. Also, we have one global DBContext instance but rather than force the rest of Mailman to deal with context objects, instead we expose API methods on that object into the Mailman.database module, which the rest of the code will use. Such methods must be prepended with 'api_' to get exposed this way. bin/rmlist now works with the SA-backend. I refactored the code here so that other code (namely, the test suite) can more easily and consistently remove a mailing list. This isn't the best place for it ultimately, but it's good enough for now. New convenience functions Utils.split_listname(), .fqdn_listname(). Convert testall to use Mailman.initialize.initialize(). Not all tests work, but I'm down to only 8 failures and 7 errors. Also, do a better job of recovering from failures in setUp(). MailList.__new__() now takes keyword arguments. ................ r8117 | bwarsaw | 2006-12-11 22:58:06 -0500 (Mon, 11 Dec 2006) | 7 lines Unit test repairs; even though the unit tests are still pretty fragile, everything now passes with the SQLAlchemy storage of list data. Added missing 'personalize' column. Converted mailmanctl and qrunner to initialize() interface. Fixed _cookie_path() to not fail if SCRIPT_NAME is not in the environment. ................ r8118 | bwarsaw | 2006-12-27 18:45:41 -0500 (Wed, 27 Dec 2006) | 21 lines Utils.list_names(): Use a database query to get all the list names. dbcontext.py: Added api_get_list_names() to support Utils.list_names(). listdata.py: Added two additional MailList attributes which need to be stored in the database. The first is 'admin_member_chunksize' which isn't modifiable from the web. The second is 'password' which holds the list's password. HTMLFormatObject: item strings can now be unicodes. bin/list_lists.py: Must call initialize() to get the database properly initialized, not just config.load(). This will be a common theme. SecurityManager.py: - Remove md5 and crypt support - Added mailman.debug logger, though it will be only used during debugging. - The 'secret' can be a unicode now. - A few coding style updates; repr() instead of backticks, 'key in dict' instead of 'dict.has_key(key)' ................ r8119 | bwarsaw | 2006-12-27 19:13:09 -0500 (Wed, 27 Dec 2006) | 2 lines genaliases.py: config.load() -> initialize() ................ r8120 | bwarsaw | 2006-12-27 19:17:26 -0500 (Wed, 27 Dec 2006) | 9 lines Blocked revisions 8113 via svnmerge ........ r8113 | bwarsaw | 2006-12-05 23:54:30 -0500 (Tue, 05 Dec 2006) | 3 lines Initialized merge tracking via "svnmerge" with revisions "1-8112" from https://mailman.svn.sourceforge.net/svnroot/mailman/branches/tmp-sqlalchemy-branch ........ ................ r8121 | bwarsaw | 2006-12-28 23:34:52 -0500 (Thu, 28 Dec 2006) | 20 lines Remove SIGTERM handling from all the CGI scripts. This messes with HTTPRunner because when you issue "mailmanctl stop" after the signal handler has been installed, the process will get a SIGTERM, the signal handler will run, and the process will exit with a normal zero code. This will cause mailmanctl to try to restart the HTTPRunner. I don't think we need that stuff at all when running under wsgi with a SQLAlchemy backend. If mailmanctl kills the HTTPRunner in the middle of the process, I believe (but have not tested) that the transaction should get properly rolled back at process exit. We need to make sure about this, and also we need to test the signal handling functionality under traditional CGI environment (if we even still want to support that). Also, make sure that we don't try to initialize the loggers twice in qrunner. This was the cause of all the double entries in logs/qrunner. Fix a coding style nit in mailmanctl.py. De-DOS-ify line endings in loginit.py. ................
* Convert dumpdb to mmshell and configuration object. Convert htmlformat.pybwarsaw2006-11-041-30/+25
| | | | | | | | | from mm_cfg to the configuration object. In the config object, add an add_runner() function for extending the QRUNNERS variable. De-DOS-line-ending-ify configuration.py
* Remove most uses of the types module, in favor of isinstance checks againstbwarsaw2006-04-171-5/+3
| | | | | | the builtin types. Two still remain: a check against ClassType and a check against MethodType. Also, fix some hinky type comparisons to use isinstance() consistently.
* back porting from 2.1.6tkikuchi2005-08-281-27/+27
|
* FSF office has moved. chdcking in for MAIN branch.tkikuchi2005-08-271-1/+1
|
* Document.Format(): Fix typo so WEB_LINK_COLOR works. Reported bybwarsaw2003-06-091-1/+1
| | | | | | David Blomquist. Backport candidate.
* Document.Format(): Include a META tag with the content-typebwarsaw2002-12-071-7/+7
| | | | | | information. I found that with Mozilla 1.2.1, the only way to be sure to get the admin pages in the right charset was to include both the Content-Type: http header and this META tag.
* QuoteHyperChars() -> websafe()bwarsaw2002-05-221-1/+1
| | | | | Also, use Utils.websafe() consistently throughout, instead of the inconsistent calls to cgi.escape().
* GetStandardReplacements(), MailmanLogo(), IMAGE_LOGOS, SHORTCUT_ICON:bwarsaw2002-04-211-1/+1
| | | | | | | | | 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.
* Document.addError(): Make the default tag be "Error: " since that'sbwarsaw2002-02-281-1/+1
| | | | the most commonly used tag.
* Untabbification. :(bwarsaw2002-02-231-188/+188
|
* addError(): New method added to class Document, which is essentially abwarsaw2002-02-231-5/+18
| | | | | | | | | | | | replacement for the function in the admin.py module. This makes it much easier for gui component HandleForm() methods to add an error or warning to the admin page. TextArea.__init__(): Add a `readonly' argument, which translates to the TEXTAREA tag getting a READONLY attribute. We'll use this to turn the header and body excerpt text boxes in the admindb pages to read-only (avoiding the common misperception that you can edit the message before it's approved).
* Sigh. Copyright years.bwarsaw2002-01-301-1/+1
|
* Document.Format(): Add support for optional favicon.bwarsaw2002-01-301-0/+3
|
* Add CheckBoxArray, a new class which implements an array of checkbwarsaw2001-08-141-16/+46
| | | | | | | | boxes (i.e. multiple selections). Refactor RadioButtonArray class into new base class WidgetArray which contains most of the logic. RadioButtonArray and CheckBoxArray inherit from WidgetArray. map(None, ...) => zip(...)
* Classes Document and HeadlessDocument are almost identical, exceptbwarsaw2001-06-251-30/+29
| | | | | | | | | | | | | | | | | that the former adds <head><body> tags, while the latter suppresses them. Document should be used for pages that are created by the scripts out of whole cloth, while HeadlessDocument should be used for any template-based page (which must supply its own head & body tags, although not all of them do, I think). It turns out to be useful to transform a Document into a HeadlessDocument, so the trigger to output the head & body tags is the instance variable "suppress_head" which Document defaults to 0 and HeadlessDocument defaults to 1. All the real work is performed in Document.Format(). Document.get_content_type(): Add the extra newline here, for convenience.
* De-string-module-ification, and other import sanitizing.bwarsaw2001-06-071-13/+25
| | | | | | | Document(): WEB_BGCOLOR => WEB_BG_COLOR. Also, if WEB_VLINK_COLOR, WEB_ALINK_COLOR, or WEB_LINK_COLOR are defined in mm_cfg.py (as not false), use them in the document's BODY tag. This is an adaptation of David Champion's SF patch #401372.
* Document: Set the default background color of the document tobwarsaw2001-05-311-1/+5
| | | | | | | | | | | | mm_cfg.WEB_BGCOLOR. Document.set_bgcolor(): New method to set the bgcolor attribute. Document.Format(): Add self.bgcolor to the kws dictionary if it isn't already there (i.e. allow it to be overridden by the caller). This means that we don't need to pass the background color in the Format() call for most cases. Cleans up the code and parameterizes the background color for site customization.
* Added the Label widget/class, which is a Container that aligns itsbwarsaw2001-05-091-3/+16
| | | | | | | | | | elements on the right edge. PasswordBox: contructor now takes a size argument, which defaults to mm_cfg.TEXTFIELDWIDTH. TextBox: constructor's size argument now defaults to mm_cfg.TEXTFIELDWIDTH instead of 10.
* MailmanLogo(): Remove hyperlinks from logos (and also the links to thebwarsaw2001-05-011-17/+7
| | | | | | sponsor home pages). In practice, too many end-user list members were following those links out of desperation to get unsubscribed from deployed lists.
* Hidden(): New class for "hidden" input item.bwarsaw2001-04-091-0/+7
| | | | Form.set_action(): New method to retrospectively set the form action.
* Next round of big i18n patches.bwarsaw2001-02-281-9/+22
| | | | | | | | | | | Document class (and thus HeadlessDocument) grow a new method get_language() which is passed to Utils.GetCharSet() to get the right charset parameter on the Content-Type: header. They also grow get_content_type(). Fix some _() wrappings to use local variables. Added some missing _() wrappings.
* Latest round of jcrey's I18N patches. Specifically,bwarsaw2000-12-261-1/+49
| | | | | | HeadlessDocument(): Don't hardcode charset to us-ascii. SelectOptions: New class used for a popup options menu.
* First integration patch for Juan Carlos's translatable string changesbwarsaw2000-12-071-3/+3
|
* RadioButtonArray.Format(): Fix vertical layout so that the buttons arebwarsaw2000-09-121-12/+10
| | | | | still placed next to the names. This isn't used anywhere, but that's because it never worked before!
* HeadlessDocument.Format(): Oops! My last change removed one too manybwarsaw2000-07-221-1/+1
| | | | newlines.
* Document.Format(), HeadlessDocument.Format(): Remove thebwarsaw2000-07-221-9/+1
| | | | | Cache-control: and Expires: headers. These caused problems with the back button and didn't really solve an existing problem.
* Document.Format(), HeadlessDocument.Format(): We want to set a fewbwarsaw2000-07-201-23/+29
| | | | | | other HTTP headers to prevent caching of these dynamically generated, private pages. Setting "Cache-control: no-cache" and "Expires: 0" ought to do it.
* RadioButtonArray.__init__(): New optional argument `values' which canbwarsaw2000-06-201-8/+13
| | | | | | | | | be a sequence of values to assign to the buttons. Must be the same length as the `button_names' sequence. If not given, the values are the ordinal position of the button. RadioButtonArray.Format(): A more efficient way of generating the HTML text.
* Jim Tittsler finds more buglets with the generated HTML:bwarsaw2000-03-221-4/+4
| | | | | | | | | | | My /mailman/listinfo page was missing a </BODY> tag. It looks like it is missing from all pages generated by mailman/htmlformat.py As long as I was looking at the HTML source, I noticed that it quoted the attribute values for some of the tags (like for the BODY tag), but not those for table, table rows, and cells. That led to things like 100% and #99CCFF not being quoted literals.
* Update the copyright lines to include the years 1999 & 2000.bwarsaw2000-03-211-1/+1
|
* Changes to Mailman's default footer so that open source logos forbwarsaw2000-03-151-9/+49
| | | | | | | | | | | | Mailman, Python, and GNU are displayed. I'm not 100% sure I like this... Specifically, Container.Format(): More efficient text generator which uses [].append and string.join instead of operator add. MailmanLogo(): New definition of standard footer as described above.
* InputObj.Format(): When adding the keyword arguments as HTMLbwarsaw2000-03-031-10/+8
| | | | | | attributes, don't wrap the key in double quotes, otherwise browsers will ignore them. Also, use a slightly more efficient way of crafting the HTML (list.append + string.join).
* RadioButtonArray.__init__(): added an XXX comment about the horizontalbwarsaw2000-02-261-1/+3
| | | | flag (it doesn't work and isn't easy to use).
* FileUpload: New class which outputs an input object for file uploads.bwarsaw2000-02-251-3/+10
| | | | | | | | Form.__init__(): take an optional encoding string, which if set, becomes the value for the `enctype' attribute. This is a kludge to support file upload forms. Form.Format(): set the enctype attribute if given.
* Balazs Nagy <julian7@kva.hu> writes:bwarsaw1999-12-111-4/+4
| | | | | | | | | | | | | I did a little digging about entering text with accents. It's a bit curious that one can type accents in textarea but to textbox cannot. In the latter case you can see an escaped print of your input. In the end I came to htmlformat.py's InputObj. At this point I have a humble question: who put `-s around value? After a s/`value`/value/ in line #368, almost everything works fine, because this brings up a problem about quoting. Of course, the patch is here.
* New class: QuotedContainer(Container). It's Format() method returnshmeland1999-06-041-1/+11
| | | | | | | | | | contained objects representation after putting them through Utils.QuoteHyperChars(). Changed class Preformatted to be a subclass of the new QuotedContainer class. This hopefully will make the admindb pages display emails containing "<", ">" etc. characters correctly. It will lose if someone tries to use other HTML elements inside a Preformatted container.
* import mm_cfgbwarsaw1999-05-021-1/+3
|
* MailmanLogo(): New function to return Link object w/ Delivered bybwarsaw1999-05-021-0/+9
| | | | Mailman logo (or plain text).
* new class: DefinitionListbwarsaw1998-12-301-5/+14
|
* Removed RCS crudbwarsaw1998-06-191-4/+4
|
* Integrated Scott's cookie code into the distribution.viega1998-05-301-1/+6
| | | | | | Note that it does have one problem... If you have cookies off, you have to log in every time, plus your changes don't take effect! That definitely needs to be fixed.
* Fixed a typo in the zipcode.viega1998-05-261-2/+2
|
* Added copyright notices to all source files where I am legally entitled to ↵viega1998-05-251-1/+18
| | | | | | | do so. Added a copy of the GNU GPL. Added information about mailman-users in README, and reworded some text in there (made the credits less verbose... perhaps they should move to a credits file?)
* HeadlessDocument(): new variant of Document(), for templates that havemailman1998-04-101-1/+10
| | | | their own <head> section.
* Preparing to package a distribution - add a module docstring andmailman1998-04-091-0/+7
| | | | __version__ info.