summaryrefslogtreecommitdiff
path: root/scripts
Commit message (Collapse)AuthorAgeFilesLines
* Clean up the manifest so that the sdist runs and passes all the tests.Barry Warsaw2009-11-291-314/+0
|
* The start of a setuptools conversion. All the Makefile.in and autoconfBarry Warsaw2007-07-131-84/+0
| | | | artifacts are removed, as is the C files which we will no longer need.
* Update copyright years.bwarsaw2007-01-192-2/+2
|
* Merged revisions 8113-8121 via svnmerge from bwarsaw2006-12-291-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. ................
* As Mark discovered, we need to load the configuration in the driver script forbwarsaw2006-09-241-0/+2
| | | | | | | | the web u/i to work. This also fixes the use of Utils.list_names() in the list and admin overviews. This API now returns a set, but the CGIs want to sort them, so we need to turn them back into lists. This change also elaborates an exception so that the list name is reported.
* Set package name and version number in AC_INIT macro in configure.in. Also,bwarsaw2006-05-159-500/+38
| | | | | | | | | | | | | | | | | | | require Python to be at least 2.3.0 Convert all scripts/* scripts (except driver) to use the symlink-to-bin/mmshell trick. For now (since we're debugging more often than releasing), set STEALTH_MODE to False in scripts/driver. We need to remember to turn this back to True when we start getting closer to releases! In the various scripts, er, Mailman/bin scripts, convert them to $-strings for i18n substitution, and clean up imports. Also, get rid of the crufty Emacs -*- line, which is no longer needed now that the files end in .py. Get rid of lots of unnecessary svn:executable properties. Remove an unnecessary import from Mailman/bin/disabled.py
* - fixed misspelling of propagate in loginit.initialize call in cron/disabled.msapiro2006-05-097-22/+60
| | | | | (should the cron scripts propagate log messages to stderr?) - updated scripts/* scripts to use new logging rather than stderr writes.
* More logging updates:bwarsaw2006-04-287-83/+70
| | | | | | | | | | | - Remove the LogStdErr() calls from all the scripts/* scripts. - Convert the LockFile.py code to use the logging logs. Also do general code cleanup in this module. Note that the 'withlogging' argument to __init__() has been removed, as we can use logging's mechanisms to control how much of LockFile will get logged (by default, not much). - Add the 'mailman.locks' logger to loginit.py - Remove Mailman/Handlers/Sendmail.py once and for all - Remove LIST_LOCK_DEBUGGING from Defaults.py.in
* - Convert all logging to Python's standard logging module. Get rid of allbwarsaw2006-04-171-54/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | traces of our crufty old Syslog. Most of this work was purely mechanical, except for: 1) Initializing the loggers. For this, there's a new module Mailman/loginit.py (yes all modules from now on will use PEP 8 names). We can't call this 'logging.py' because that will interfere with importing the stdlib module of the same name (can you say Python 2.5 and absolute imports?). If you want to write log messages both to the log file and to stderr, pass True to loginit.initialize(). This will turn on propagation of log messages to the parent 'mailman' logger, which is set up to print to stderr. This is how bin/qrunner works when not running as a subprocess of mailmanctl. 2) The driver script. I had to untwist the StampedLogger stuff and implement differently printing exceptions and such to log/error because standard logging objects don't have a write() method. So we write to a cStringIO and then pass that to the logger. 3) SMTPDirect.py because of the configurability of the log messages. This required changing SafeDict into a dict subclass (which is better than using UserDicts anyway -- yay Python 2.3!). It's probably still possible to flummox things up if you change the name of the loggers in the SMTP_LOG_* variables in mm_cfg.py. However, the worst you can do is cause output to go to stderr and not go to a log file. Note too that all entry points into the Mailman system must call Mailman.loginit.initialize() or the log output will go to stderr (which may occasionally be what you want). Currently all CGIs and qrunners should be working properly. I wish I could have tested all code paths that touch the logger, but that's infeasible. I have tested this, but it's possible that there were some mistakes in the translation. - Mailman.Bouncers.BounceAPI.Stop is a singleton, but not a class instance any more. - True/False code cleanup, PEP 8 import restructuring, whitespace normalization, and copyright year updates, as appropriate.
* Now that we've converted from CVS to Subversion, remove CVS cruft frombwarsaw2006-04-151-1/+0
| | | | | the trunk. This serves also to test write permission to the svn repository, and tests email notifications.
* backport from 2.1.6.tkikuchi2005-08-281-16/+36
|
* FSF office has moved. chdcking in for MAIN branch.tkikuchi2005-08-279-9/+9
|
* Promote STEALTH_MODE to a Defaults.py/mm_cfg.py variable and defaultbwarsaw2003-10-101-14/+12
| | | | it to On.
* run_main(): Application of Richard Barrett's patch # 668685 whichbwarsaw2003-04-191-6/+7
| | | | | closes bug # 716754. Must output any accumulated output to stdout when a SystemExit is raised.
* Update copyright yearsbwarsaw2003-03-111-1/+1
|
* SF patch #683906, add $DESTDIR to install target, by Ademar de Souza Reistwouters2003-03-111-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Jr, after much checking and rechecking (and some massaging) by me. Checking in now before I fall asleep and forget what all this was for. This patch adds the ability to 'make DESTDIR=/some/dir/tree install' that doesn't influence the paths stored in e.g. Defaults.py at all, which is of good use for various package managers. It is not all that package managers must do, however! Running make install with DESTDIR set means bin/update is never run, and mm_cfg.py is always written; package managers should make sure the appropriate post-installation is done, and that mm_cfg.py is treated as a config file. This patch inadvertently fixes some bogus whitespace: 8-spaces where surrounding code used tabs. The difference was harmless because the 8-spaces were used inside shell-continued-oneliners, but it is confusing and could lead to future harm. I'm too tired to make those two or three changes in a separate checkin, sorry. This patch also assumes the various packages that are installed using distutils do not record (or rather, use) their installation paths anywhere, but this seems to hold true at least for the moment. Also, I've done so many slow cvs diff's, I'm wondering when we'll switch to Subversion. Unfortunately, I've also done so many 'cvs diff -c > file; patch -p0 -R < file's to switch back and forth between patches and change sets, I'm wondering when we'll switch to Aegis as well. :-P
* Donn Cave's patch #602087 to honor configure's --srcdir switch.bwarsaw2002-12-121-4/+4
|
* run_main(): When running the cgi, redirect stdout to a cStringIO, andbwarsaw2002-10-011-0/+7
| | | | | | | only if the cgi script runs to completion successfully do we write the entire output to the real stdout (connected to the web server). This way, if any exception occurs during the rendering of the page (e.g. in "print doc.Format()") we won't mess up the diagnostics page.
* OWNER_PIPELINE: Moved to Defaults.py.inbwarsaw2002-08-091-8/+1
|
* main(): Add the `toowner' key to the message metadata so the Replybotbwarsaw2002-05-221-1/+2
| | | | handler will autorespond to -owner emails. Closes SF bug #558909.
* Update copyright years.bwarsaw2002-03-165-5/+5
|
* A new confirm script for the -confirm address.bwarsaw2002-03-142-1/+63
|
* install: subscribe and unsubscribe are now aliases for join and leave.bwarsaw2002-02-231-0/+5
|
* Bump the copyright years.bwarsaw2002-02-141-1/+1
|
* Copy the bounces script to the admin script. This is for backwardsbwarsaw2002-02-141-0/+1
| | | | compatibility.
* run_main(): Because the site-packages path hacking no longer happensbwarsaw2002-02-121-6/+2
| | | | | | | | in Defaults.py, we need to arrange for this script to import paths.py to pick up the correct site-packages prefixed sys.path. Because we do this, we can delete the sys.path.insert() call, which was redundant.
* run_main(): A simplification -- I want to try to not pre-loadbwarsaw2001-12-311-10/+0
| | | | | | | | | Mailman/pythonlib/cgi.py because I'd like for Mailman to start using the default Python module now that we require at least Python 2.0 (or should that be Python 2.1?). I'm sure any disparity between the cgi.py modules will show up in beta testing. But if it looks okay, I'll remove our copy of cgi.py.
* In order to make the list alias -> script mapping more consistent,bwarsaw2001-11-304-254/+1
| | | | | | | | | | | | | | | | | | | we've renamed mailcmd to request and mailowner to owner (through some SF-assisted CVS repo magic). We've also moved scripts/auto to contrib/auto since it's an obsolete way of doing the auto-aliasing in Postfix. We need to update mail-wrapper.c for the new list of acceptable script names. Note that there are still two abberations: - messages posted to just `listname' go to the post script - messages posted to listname-admin go to the bounces script The latter, listname-admin may eventually go away. Note that this requires you to regenerate your aliases!
* Because the CommandRunner no longer processes -owner messages, we needbwarsaw2001-11-202-34/+40
| | | | | | | | | to do a little more work here. Specifically, we need to add an explicit pipeline to the message's metadata, then we can send the message through the normal incoming queue (i.e. we override the incoming queue's default pipeline). We also set the envsender attribute to point to the -bounces address for the list so we can handle any bounces to the list's owners.
* Code cleaningbwarsaw2001-11-202-2/+6
|
* The script that listens on the -bounces address for a list.bwarsaw2001-11-201-0/+61
|
* SCRIPTS: add the bounces script.bwarsaw2001-11-201-1/+1
|
* Since these scripts are always run from the wrapper, they don't need abwarsaw2001-09-078-8/+8
| | | | #! line.
* Get rid of answer_majordomo_mail. It's seriously broken in MM2.1, andbwarsaw2001-08-042-42/+1
| | | | of limited value, IMO. Haven't we already taken over the world? :)
* main(): Be sure to set the _plaintext message metadata key to informbwarsaw2001-06-278-9/+16
| | | | | the Switchboard that it should save the message as plain text and not as a pickle.
* run_main(): Don't stick Mailman.i18n._ in the builtins.bwarsaw2001-06-271-11/+2
|
* main(): Don't set the `received_time' metadata here; it's set in thebwarsaw2001-05-141-3/+1
| | | | queue runner.
* Add the join and leave scripts.bwarsaw2001-05-111-2/+4
|
* coding stylebwarsaw2001-05-112-4/+2
|
* intermediatebwarsaw2001-05-111-0/+61
|
* intermediatebwarsaw2001-05-111-0/+61
|
* main(): Set the message metadata `received_time' to the current time.bwarsaw2001-05-012-2/+10
| | | | | Note that ToArchive.py will set this if it isn't present in the metadata already, however that might incur hold and other delays.
* Lots of updates to the New Order.bwarsaw2001-03-012-64/+42
| | | | | | | | | main(): Convert to the new Switchboard mechanisms. This means we neither need to instantiate the mailing list, nor create a Message object from stdin. A side effect of this change is that we can't efficiently determine whether this message was destined for the -owner or -admin address (since this script bogusly handles both). We defer this decision to the CommandRunner.
* Update copyright yearsbwarsaw2001-02-282-2/+2
|
* Next round of big i18n patches.bwarsaw2001-02-282-44/+30
| | | | | | | main(): Change the error messages; removed old cruft (we never need to create the MailList object, we just need a valid listname -- we also don't ever need to create a Message object, stdin is fine); change the enqueuing code to use the new Switchboard mechanism.
* import Mailman.i18n._bwarsaw2001-02-161-0/+1
|
* Convert to using the new switchboard interface.bwarsaw2001-02-152-49/+18
|
* main(): Explicitly queue the message to INQUEUE_DIR (see changesbwarsaw2000-12-205-7/+7
| | | | described in qrunner for details).
* main(): Some fixes to handle situations such as sending directly tobwarsaw2000-12-201-8/+27
| | | | | | the non-extension address, and for handling listnames with dashes in them. Also, do better matching of incoming message's target domain with the list's domain.
* Add `auto' script.bwarsaw2000-12-081-1/+1
|