From mk2s at digitalcommute.com Fri May 2 04:21:40 2008 From: mk2s at digitalcommute.com (mk2s at digitalcommute.com) Date: Thu, 01 May 2008 22:21:40 -0400 Subject: [Mailman-Developers] How to get started with the REST server(was Re: Hello!! Help Needed) In-Reply-To: References: Message-ID: <20080501222140.typb0gofko8kowgs@mail.matrixgroup.net> This is a quick response to "How do you get started with the restserver?" question. https://code.launchpad.net/~mk2s/mailman/restserver All of this is very much work in progress, but server.py is probably where you want to start. There isn't much there, mostly because the routes package takes care of the disptach. I run my server as follows: $ cd ~/mailman22runtime $ PYTHONPATH=. python Mailman/rest/server.py listConroller.py is the only controller currently implemented it responds to a get request like the following: $ lynx http://localhost:8000/lists/makitest where makitest is the name of my test list that already exists. The response is a HTML representation of the attributes of the list. it also responds to a request like: lynx http://localhost:8000/lists/ with a list of all the lists the controller uses the .html file as templates for returning HTML representation responses. Currently I have the response hardwired to HTML, but in theory the json representation should also work. also see: http://www.makotemplates.org/ http://routes.groovie.org/manual.html Quoting aman parnami : > Hi Mike, > I was able to get your code from launchpad after some manipulations > and lots of patience. Now onwards downloads will be smooth for me. > > I just swept through the directory structure of restserver and got a > little confused. It would be grateful if you could tell me the > starting point and > if possible (will be highly appreciated) the order in which files > should be read to understand them better and sooner. > > Thanks, > -- > AMAN PARNAMI > CSE DEPTT > Indian Institute of Technology Bombay > ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. From iane at sussex.ac.uk Fri May 2 16:59:31 2008 From: iane at sussex.ac.uk (Ian Eiloart) Date: Fri, 02 May 2008 15:59:31 +0100 Subject: [Mailman-Developers] Intern Message-ID: <51043A076CCD3E8087F74D81@lewes.staff.uscs.susx.ac.uk> Hi, I have an intern coming to work for a couple of months in the summer. Neither of us will be python experts, but part of the point is to learn, right? I'd like him to work on some aspects of Mailman 3. I plan to get LMTP working to my taste, by (a) rejecting messages for non-existent lists at RCTP time, and (b) rejecting messages from unwanted sender addresses at RCPT time. I Think (a) will be easy to achieve, and (b) only slightly more challenging. So, I'm after ideas for what to do next. I'm vaguely thinking about (c) integration (which will probably begin from working up a specification for exactly what that means), and possibly (d) user interface design for end users and list admins. Any suggestions for (c) and (d) or alternative areas that need some focus would be useful. Also, can you give me pointers to a good place to learn about doctest, please? Finally, is there any overview documentation for developers new to the Mailman architecture? -- Ian Eiloart IT Services, University of Sussex x3148 From stephen at xemacs.org Fri May 2 20:43:02 2008 From: stephen at xemacs.org (Stephen J. Turnbull) Date: Sat, 03 May 2008 03:43:02 +0900 Subject: [Mailman-Developers] Intern In-Reply-To: <51043A076CCD3E8087F74D81@lewes.staff.uscs.susx.ac.uk> References: <51043A076CCD3E8087F74D81@lewes.staff.uscs.susx.ac.uk> Message-ID: <87od7ownrd.fsf@uwakimon.sk.tsukuba.ac.jp> Ian Eiloart writes: > Also, can you give me pointers to a good place to learn about doctest, > please? In public, please! Inquiring minds want to know ... From barry at list.org Sat May 3 04:19:42 2008 From: barry at list.org (Barry Warsaw) Date: Fri, 2 May 2008 22:19:42 -0400 Subject: [Mailman-Developers] Important Mailman 2.1.9 to 2.1.10 upgrade note. In-Reply-To: <4814CA2B.7050203@msapiro.net> References: <4814CA2B.7050203@msapiro.net> Message-ID: On Apr 27, 2008, at 2:47 PM, Mark Sapiro wrote: > > I would appreciate feedback on the 1074 and 1075 revisions from those > interested. Mark, these changes look pretty good. I have some minor comments about the formatting but that's it. -Barry -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: diff.txt URL: -------------- next part -------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 194 bytes Desc: This is a digitally signed message part URL: From mark at msapiro.net Sat May 3 18:15:34 2008 From: mark at msapiro.net (Mark Sapiro) Date: Sat, 03 May 2008 09:15:34 -0700 Subject: [Mailman-Developers] Important Mailman 2.1.9 to 2.1.10 upgrade note. In-Reply-To: References: <4814CA2B.7050203@msapiro.net> Message-ID: <481C8FA6.9080709@msapiro.net> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Barry Warsaw wrote: | On Apr 27, 2008, at 2:47 PM, Mark Sapiro wrote: |> |> I would appreciate feedback on the 1074 and 1075 revisions from those |> interested. | | Mark, these changes look pretty good. I have some minor comments about | the formatting but that's it. | | -Barry | | | ------------------------------------------------------------------------ [...] |> > + preserve=True | | There should be spaces around the = sign. Agreed. I must have been thinking ahead (or not thinking) to it's ultimate use as an argument in ~ self._switchboard.finish(filebase, preserve=preserve) [...] |> > + preserve=False | | Same here. Yep. [...] | + if (mlist._internal_name <> 'en' and mlist._internal_name not in | + os.listdir(mm_cfg.MESSAGES_DIR)): | | I would format this code like this: | | if (mlist._internal_name <> 'en' and | mlist._internal_name not in os.listdir(mm_cfg.MESSAGES_DIR)): | # It's okay to move the template. Yes, that's clearly better. It always helps to have someone else review stuff. Thanks. BTW, the above stuff all comes from changes I made on the 2.1 branch at revs 1072 and 1074. Did anyone look at the cull_bad_shunt cron and bin/update change at revs 1074 and 1075 of ? - -- Mark Sapiro The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (MingW32) iD8DBQFIHI+mVVuXXpU7hpMRAt3tAJ0TIj6tBaoK2n5IXqxDWC5COT0tQwCggy2h ITXy+VKlxj/Gd8HxKwuqYnc= =DVJz -----END PGP SIGNATURE----- From mk2s at digitalcommute.com Tue May 6 06:53:40 2008 From: mk2s at digitalcommute.com (mk2s at digitalcommute.com) Date: Tue, 06 May 2008 00:53:40 -0400 Subject: [Mailman-Developers] Using REST Interface and WADL In-Reply-To: <44853CF4-1B83-4527-B62E-2051A0D5FF27@list.org> References: <9DF8F405-6E17-4B4B-93F0-731B8B39A472@digitalcommute.com> <44853CF4-1B83-4527-B62E-2051A0D5FF27@list.org> Message-ID: <20080506005340.bbbscgs3kw08gwc8@mail.matrixgroup.net> Quoting Barry Warsaw : > On Apr 13, 2008, at 5:35 PM, Maki Kato wrote: [stuff deleted] >> - Documentation. I'm hoping the xHTML representation will have >> a way of being able to serve reasonable documentation. So one >> could point their browser to the REST interface and start browsing >> to learn how the server is implemented. We may want to distribute >> a static set of HTML pages that has documentation and test(dummy) >> data. > > Leonard Richardson is very hot on WADL. Will we be able to generate > that automatically or does that not have a place in the architecture > you're thinking about? I went to read up some more on WADL and ran into this: http://bitworking.org/news/193/Do-we-need-WADL I don't have any plans(yet) on auto generating the WADL, or did you mean auto generating the documentation from the WADL file? Are there tools that do that? I didn't find any such. Currently I'm returning human readable text containing something like documentation when you request the xHTML representation. I've seen this done before and figured it was a pretty good idea. It is of no use of course if you want to auto generate a client, as you would from a description file. Anyone else have any opinions or experiences with WADL? ....maki.... ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. From mk2s at digitalcommute.com Tue May 6 06:58:27 2008 From: mk2s at digitalcommute.com (mk2s at digitalcommute.com) Date: Tue, 06 May 2008 00:58:27 -0400 Subject: [Mailman-Developers] What do I need to do to add a package dependency in MM2.2? Message-ID: <20080506005827.tbktkg7yqs880ggc@mail.matrixgroup.net> I'm doing some work in mm2.2 and wanted to add some python package dependencies like routes, lxml, and simplejason. How do I go about declaring these dependencies so that the dependent packages will be installed for the end user who wants to run mm2.2? Can someone point me in the direction of the stuff that I need to read? ....maki.... ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. From barry at list.org Tue May 6 20:23:53 2008 From: barry at list.org (Barry Warsaw) Date: Tue, 6 May 2008 14:23:53 -0400 Subject: [Mailman-Developers] Intern In-Reply-To: <51043A076CCD3E8087F74D81@lewes.staff.uscs.susx.ac.uk> References: <51043A076CCD3E8087F74D81@lewes.staff.uscs.susx.ac.uk> Message-ID: <9BFAD07F-9EBA-4A36-9129-2F16629342D4@list.org> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On May 2, 2008, at 10:59 AM, Ian Eiloart wrote: > I have an intern coming to work for a couple of months in the > summer. Neither of us will be python experts, but part of the point > is to learn, right? Absolutely! > I'd like him to work on some aspects of Mailman 3. > > I plan to get LMTP working to my taste, by (a) rejecting messages > for non-existent lists at RCTP time, and (b) rejecting messages from > unwanted sender addresses at RCPT time. I Think (a) will be easy to > achieve, and (b) only slightly more challenging. This sounds great. With (b) there could be multiple list-specific policies, so we should make this pluggable. > So, I'm after ideas for what to do next. I'm vaguely thinking about > (c) integration (which will probably begin from working up a > specification for exactly what that means), and possibly (d) user > interface design for end users and list admins. > > Any suggestions for (c) and (d) or alternative areas that need some > focus would be useful. By user interface design do you mean the web u/i? None of that really works in MM3 right now. Some of the other work happening in the REST interface may allow us to separate the web u/i too. > Also, can you give me pointers to a good place to learn about > doctest, please? > > Finally, is there any overview documentation for developers new to > the Mailman architecture? Actually these two subjects go hand-in-hand, although there should be better overview documentation. I'm a big fan of separate file doctests (as opposed to docstring doctests which I'm not a fan of at all). The important thing to remember is that doctests are documentation first and tests second. Or another way of saying it is that doctests are testable documentation. This is important because you really want to take care to write the narrative of a doctest in a clear and concise way. I'm experimenting with this idea that all tests can be done using doctest, with two different audiences in mind. First is the developer (or user) who wants to understand a piece of the system, and the second is maybe a maintainer who wants to write comprehensive unit tests with total coverage. I don't know if I can achieve "all tests are doctests", but I'm trying. Although it's a bit centered on docstring doctests (which I don't like), the Python doctest module has some good background: http://www.python.org/doc/current/lib/module-doctest.html From there, search the Mailman 3 tree for 'doc/' subdirectories. All .txt files in those directories are doctests. There's a little bit of harness hooking in mailman/tests/test_documentation.py, including the doctest flags that I think are the most useful. A good (well, recent ;) example of a doctest that I like is mailman/doc/ chains.txt. I think it's better to have fewer magical globs in the doctest harness and do most of the work, including imports in the doctest. It's just a better way to explain how a particular subsystem works or how you would use it. Use ellipsis liberally but judiciously to improve readability. Always be as explicit as possible in showing return values. E.g. it's better to have something like this: >>> chain.name 'reject' than this: >>> chain.name == 'reject' True because when the latter fails, it's more difficult to figure the problem out. The one common exception is in printing the value None because None doesn't show up in the interactive prompt. E.g. instead of >>> chain.foobar = None >>> chain.foobar >>> chain.baz = 7 do this: >>> chain.foobar = None >>> print chain.foobar None >>> chain.baz = 7 I'm beginning to think that its better to print strings than return them because ascii strs and unicodes print with the same value, but have different reprs, and the u-prefixes are annoying. Does any of that help? You should definitely look at the Mailman 3 code and I'll be happy to answer any more questions you might have. - -Barry -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) iEYEARECAAYFAkggojkACgkQ2YZpQepbvXHOSACgnUcbW7CMi9mvLXfWgVAxzimv BhEAnj439jpogZTMm+h25uzq7pDE5HWq =evuZ -----END PGP SIGNATURE----- From iane at sussex.ac.uk Wed May 7 11:23:23 2008 From: iane at sussex.ac.uk (Ian Eiloart) Date: Wed, 07 May 2008 10:23:23 +0100 Subject: [Mailman-Developers] Intern In-Reply-To: <9BFAD07F-9EBA-4A36-9129-2F16629342D4@list.org> References: <51043A076CCD3E8087F74D81@lewes.staff.uscs.susx.ac.uk> <9BFAD07F-9EBA-4A36-9129-2F16629342D4@list.org> Message-ID: --On 6 May 2008 14:23:53 -0400 Barry Warsaw wrote: > >> I plan to get LMTP working to my taste, by (a) rejecting messages >> for non-existent lists at RCTP time, and (b) rejecting messages from >> unwanted sender addresses at RCPT time. I Think (a) will be easy to >> achieve, and (b) only slightly more challenging. > > This sounds great. With (b) there could be multiple list-specific > policies, so we should make this pluggable. > The intention is to get the policy from the list. The simplest way to do it would be to treat "reject" as an SMTP time reject, rather than a bounce. At my site, at least, I would not offer "bounce" as a choice if smtp rejection is available. Indeed, we currently recommend that list owners don't use "reject". -- Ian Eiloart IT Services, University of Sussex x3148 From iane at sussex.ac.uk Wed May 7 11:37:44 2008 From: iane at sussex.ac.uk (Ian Eiloart) Date: Wed, 07 May 2008 10:37:44 +0100 Subject: [Mailman-Developers] Intern In-Reply-To: <9BFAD07F-9EBA-4A36-9129-2F16629342D4@list.org> References: <51043A076CCD3E8087F74D81@lewes.staff.uscs.susx.ac.uk> <9BFAD07F-9EBA-4A36-9129-2F16629342D4@list.org> Message-ID: --On 6 May 2008 14:23:53 -0400 Barry Warsaw wrote: > > Does any of that help? You should definitely look at the Mailman 3 code > and I'll be happy to answer any more questions you might have. > I'm sure all of that will help when I get into the kitchen, but I'm having problems finding the right street. I thought I'd be able to leap right in, but the more I look, the more I find that I need a map. Perhaps something describing the lifecycle of a typical email, and which bits of top level code are responsible for handling it at which stage. Or maybe just a recommended order for reading the doctests would do the job. With that understanding, I can follow the API calls to get at the detail. -- Ian Eiloart IT Services, University of Sussex x3148 From ecsd at transpacific.net Sun May 4 00:31:26 2008 From: ecsd at transpacific.net (Eric Dynamic) Date: Sat, 03 May 2008 15:31:26 -0700 Subject: [Mailman-Developers] Errors in 2.1.10 and 2.1.10.rc1 Message-ID: <481CE7BE.7050806@transpacific.net> The error arose in 2.1.10rc1 and so I tried to downgrade the version to a stable one, 2.1.10. I get the same error: Updating mailing list: academicchoice Traceback (most recent call last): File "./update", line 789, in errors = main() File "./update", line 679, in main errors = errors + dolist(listname) File "./update", line 192, in dolist mlist = MailList.MailList(listname, lock=0) File "/usr/local/mailman/Mailman/MailList.py", line 130, in __init__ self.Load() File "/usr/local/mailman/Mailman/MailList.py", line 632, in Load dict, e = self.__load(file) File "/usr/local/mailman/Mailman/MailList.py", line 605, in __load dict = loadfunc(fp) ImportError: No module named e I had an older version (maybe 2.1.5) on machine A which was being blocked by AT&T, so I installed the later version 2.1.10rc1 on machine B and copied the "lists" and "archives" contents over to machine B. The system continues to produce references to machine A in the web code, and finally I see I have to run withlist -l -r fix_urls but that fails with the same "No module named e" error. We're running python 2.5 on FreeBSD 6.2. I desperately need to fix the lists as they are active and people are hosed until I can. I would make the changes manually if I knew what "fix_urls" does; I changed the domain name inside the files lists/*/config.pck but that didn't help. I'm not using any virtual-host stuff. From mark at msapiro.net Wed May 7 23:32:33 2008 From: mark at msapiro.net (Mark Sapiro) Date: Wed, 7 May 2008 14:32:33 -0700 Subject: [Mailman-Developers] Errors in 2.1.10 and 2.1.10.rc1 In-Reply-To: <481CE7BE.7050806@transpacific.net> Message-ID: Eric Dynamic wrote to mailman-developers and also similarly to mailman-users at : >The error arose in 2.1.10rc1 and so I tried to downgrade the version to >a stable one, 2.1.10. 2.1.10 is not a downgrade from 2.1.10rc1. >I get the same error: > >Updating mailing list: academicchoice >Traceback (most recent call last): > File "./update", line 789, in > errors = main() > File "./update", line 679, in main > errors = errors + dolist(listname) > File "./update", line 192, in dolist > mlist = MailList.MailList(listname, lock=0) > File "/usr/local/mailman/Mailman/MailList.py", line 130, in __init__ > self.Load() > File "/usr/local/mailman/Mailman/MailList.py", line 632, in Load > dict, e = self.__load(file) > File "/usr/local/mailman/Mailman/MailList.py", line 605, in __load > dict = loadfunc(fp) >ImportError: No module named e > >I had an older version (maybe 2.1.5) on machine A which was being >blocked by AT&T, >so I installed the later version 2.1.10rc1 on machine B and copied the >"lists" and "archives" contents over to machine B. The system continues >to produce references to machine A in the web code, and finally I see I >have to run > >withlist -l -r fix_urls > >but that fails with the same "No module named e" error. We're running >python 2.5 on FreeBSD 6.2. I desperately need to fix the lists as they are >active and people are hosed until I can. I would make the changes manually >if I knew what "fix_urls" does; I changed the domain name inside the files >lists/*/config.pck but that didn't help. I'm not using any virtual-host >stuff. As indicated in my reply on mailman-users and subsequent off-list correspondence, this is cause by some kind of corruption in the list's config.pck files. -- Mark Sapiro The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan From f.schubert at espresto.com Thu May 8 14:32:37 2008 From: f.schubert at espresto.com (Frank Schubert) Date: Thu, 08 May 2008 14:32:37 +0200 Subject: [Mailman-Developers] webui templates or not? Message-ID: <4822F2E5.1040409@espresto.com> Hi all, the plans in http://wiki.list.org/display/DEV/TemplatingNotes and http://wiki.list.org/display/DEV/StyledPages sound great, but mean a lot of work. For example there is options.py with functions for rendering output named options_page and loginpage. options_page supports the old template mechanism using options.html However loginpage has hard-coded tables including "BGCOLOR" and such ugly things. I don't know if someone is still working on the new template mechanism and I couldn't find any changes on options.py either. (What I think is fundamentally necessary for a complete template mechanism.) (I looked in http://bazaar.launchpad.net/~mailman-coders/mailman/2.2/files and http://bazaar.launchpad.net/~mailman-coders/mailman/3.0/files) So my plan is: For a customer I want to customize more than the standard pages (for example the function loginpage from options.py). I will use the old template system (like in function options_page in options.py), using new template names like