7251
|
|
|
Barry Warsaw |
10 years ago
|
|
|
7152
|
|
|
Barry Warsaw |
12 years ago
|
|
|
7119
|
|
|
Barry Warsaw |
12 years ago
|
|
|
7037
|
|
|
Barry Warsaw |
12 years ago
|
|
|
7006
|
|
|
Barry Warsaw |
13 years ago
|
|
|
6940
|
|
|
Barry Warsaw |
13 years ago
|
|
|
6873
|
|
|
Barry Warsaw |
14 years ago
|
|
|
6793
|
|
|
Barry Warsaw |
14 years ago
|
|
|
6750
|
|
|
Barry Warsaw |
14 years ago
|
|
|
6661
|
|
|
Barry Warsaw |
15 years ago
|
|
|
6649
|
|
|
Barry Warsaw |
15 years ago
|
|
|
6601
|
|
|
Barry Warsaw |
16 years ago
|
|
|
6578
|
|
Convert to the Storm Python ORM <storm.canonical.com>. There were several reasons for this, but most importantly, the changes from SQLAlchemy/Elixir 0.3 to 0.4 were substantial and caused a lot of work. This work unfortunately did not result in a working branch due to very strange and inconsistent behavior with Unicode columns. Sometimes such columns would return Unicode, sometimes 8-bit strings, with no rhyme or reason. I gave up debugging this after many hours of head scratching.
Oh yeah, no more flush!
Storm enforces Unicode columns, which is very nice, though requires us to add lots of 'u's in places we didn't have them before. Ultimately, this is a good thing so that the core of Mailman will be Unicode consistent.
One thing I still want to clean up after this, is the function-scoped imports in the model code. Part of the reason for the separate model classes was to avoid this, but for now, we'll live with it. Storm's architecture requires us to maintain a database-table-class registry for simple clearing after tests in Database._reset(). This is made fairly simple by Storm allowing us to use our own metaclass for model classes.
Storm does require that we write our own SQL files, which is a downside, but I think our schema will be easy enough that this won't be a huge burden. Plus we have a head-start <wink>.
Another cool thing about Storm is the explicit use of stores for objects. This should eventually allow me to flesh out my idea of storage pillars for 1) lists, 2) users, 3) messages.
Some other changes:
- pylint and pyflakes cleanups - SQLALCHEMY_ENGINE_URL -> DEFAULT_DATABASE_URL - Don't import-* from Version in Defaults.py - Add interface method to Mailman.Message.Message so that __getitem__() and get_all() always return Unicode headers, even when the underlying objects are strings. This should generally be safe as headers are required by RFC to be within the ASCII range. - Fix bin/arch.py to use proper initialization.
|
Barry Warsaw |
16 years ago
|
|
|
6569
|
|
Much progress, though not perfect, on migrating to SQLAlchemy 0.4 and Elixir 0.4. Lots of things changes, which broke lots of our code. There are still a couple of failures in the test suite that I don't understand. It seems that for pending.txt and requests.txt, sometimes strings come back from the database as 8-bit strings and other times as unicodes. It's impossible to make these tests work both separately and together.
users.txt is also failing intermittently. Lots of different behavior between running the full test suite all together and running individual tests. Sigh.
Note also that actually, Elixir 0.4.0 doesn't work for us. There's a bug in that version that prevented zope.interfaces and Elixir working together. Get the latest 0.4.0 from source to fix this.
Other changes include:
- Remove Mailman/lockfile.py. While I haven't totally eliminated locking, I have released the lockfile as a separate Python package called locknix, which Mailman 3.0 now depends on.
- Renamed Mailman/interfaces/messagestore.py and added an IMessage interface.
- bin/testall raises turns on SQLALCHEMY_ECHO when the verbosity is above 3 (that's three -v's because the default verbosity is 1).
- add_domain() in config files now allows url_host to be optional. If not given, it defaults to email_host.
- Added a non-public interface IDatabase._reset() used by the test suite to zap the database between doctests. Added an implementation in the model which just runs through all rows in all entities, deleting them.
- [I]Pending renamed to [I]Pended
- Don't allow Pendings.add() to infloop.
- In the model's User impelementations, we don't need to append or remove the address when linking and unlinking. By setting the address.user attribute, SQLAlchemy appears to do the right thing, though I'm not 100% sure of that (see the above mentioned failures).
|
Barry Warsaw |
16 years ago
|
|
|
6539
|
|
|
Barry Warsaw |
16 years ago
|
|
|
6538
|
|
|
Barry Warsaw |
16 years ago
|
|
|
6537
|
|
Move the pending database into the SQLAlchemy/Elixir layer. The old Pending.py module is removed. Added an interface to this functionality such that any IPendable (essentially a key/value mapping) can be associated with a token, and that token can be confirmed and has a lifetime. Any keys and values can be stored, as long as both are unicodes.
Added a doctest.
Modified initialization of the database layer to support pluggability via setuptools. No longer is this layer initialized from a module, but now it's instantiated from a class that implements IDatabase. The StockDatabase class implements the SQLAchemy/Elixir layer, but this can be overridden in a setup.py. Bye bye MANAGERS_INIT_FUNCTION, we hardly knew ye.
Added a package Mailman.app which will contain certain application specific functionality. Right now, the only there there is an IRegistar implementation, which didn't seem to fit anywhere else.
Speaking of which, the IRegistrar interface implements all the logic related to registration and verification of email addresses. Think the equivalent of MailList.AddMember() except generalized out of a mailing list context. This latter will eventually go away. The IRegistrar sends the confirmation email.
Added an IDomain interface, though the only implementation of this so far lives in the registration.txt doctest. This defines the context necessary for domain-level things, like address confirmation.
A bunch of other cleanups in modules that are necessary due to the refactoring of Pending, but don't affect anything that's actually tested yet, so I won't vouch for them (except that they don't throw errors on import!).
Clean up Defaults.py; also turn the functions seconds(), minutes(), hours() and days() into their datetime.timedelta equivalents.
Consolidated the bogus email address exceptions.
In some places where appropriate, use email 4.0 module names instead of the older brand.
Switch from Mailman.Utils.unique_message_id() to email.utils.make_msgid() everywhere. This is because we need to allow sending not in the context of a mailing list (i.e. domain-wide address confirmation message). So we can't use a Message-ID generator that requires a mailing list. OTOH, this breaks Message-ID collision detection in the mail->news gateway. I'll fix that eventually.
Remove the 'verified' row on the Address table. Now verification is checked by Address.verified_on not being None.
|
Barry Warsaw |
16 years ago
|
|
|