2007-07-22T00:01:55  <CIA-27> moin: Thomas Waldmann <tw AT waldmann-edv DOT de> * 2457:e0b1fc786797 1.7/MoinMoin/wikiutil.py: ParameterParser: cleanup: avoid using builtins as names, cosmetic changes
2007-07-22T00:02:21  <xorAxAx> of course ThomasWaldmann doesnt seem to care :)
2007-07-22T00:03:13  <ThomasWaldmann> as I told, i just finished what I began
2007-07-22T00:03:28  <xorAxAx> ye
2007-07-22T00:03:29  <xorAxAx> s
2007-07-22T00:03:45  <xorAxAx> do you think that johill's code can replace the current PP?
2007-07-22T00:03:53  <ThomasWaldmann> what code?
2007-07-22T00:04:03  <xorAxAx> moving to the added calling interface would be a second step, regardless of the parser involved
2007-07-22T00:04:09  <xorAxAx> http://johannes.sipsolutions.net/patches/moin/macro-args.patch
2007-07-22T00:08:44  <johill> I think the difference is mainly that the PP takes types and my code doesn't
2007-07-22T00:08:55  <johill> the latter is more suited to doing the *args, **kw magic :)
2007-07-22T00:10:18  <xorAxAx> hmm
2007-07-22T00:10:25  <xorAxAx> does it convert the types?
2007-07-22T00:11:55  <ThomasWaldmann> johill: the fn() call is wrapped in a try/except and you catch UnicodeEncodeError and give some specific error msg
2007-07-22T00:11:59  <johill> no, as I said previously I expect the callee to just convert them and raise a typeerror if necessary
2007-07-22T00:12:09  <johill> ThomasWaldmann: yeah, laziness
2007-07-22T00:12:16  <johill> ThomasWaldmann: it should only be around the dict conversion
2007-07-22T00:12:51  <johill> anyway, I want to have a shower and get sleep :)
2007-07-22T00:13:25  <xorAxAx> that sounds like chinese showering habits :)
2007-07-22T00:13:28  <xorAxAx> i learned today
2007-07-22T00:17:29  <ThomasWaldmann> johill: maybe you want to have the quoted check first in any expression
2007-07-22T00:18:17  <ThomasWaldmann> (or even do them one level above?)
2007-07-22T00:24:41  <ThomasWaldmann> johill: please add at least one sample macro and a bunch of tests (see the current ParameterParser tests)
2007-07-22T01:10:07  <grzywacz> xorAxAx, how do I get a default request in test class?
2007-07-22T01:11:02  <xorAxAx> self.request
2007-07-22T01:11:30  <xorAxAx> grzywacz:
2007-07-22T01:11:41  <grzywacz> Does this object persist for a long time?
2007-07-22T01:11:49  <grzywacz> Or is there a new request for every test method?
2007-07-22T01:13:13  <xorAxAx> its usually created once per test run
2007-07-22T01:13:33  <grzywacz> I see...
2007-07-22T01:15:48  <grzywacz> xorAxAx, http://rafb.net/p/FWMDpT35.html
2007-07-22T01:18:33  <xorAxAx> yes, looks ok
2007-07-22T01:18:53  <grzywacz> Ok, thanks.
2007-07-22T01:19:29  <grzywacz> xorAxAx, I saw something about the failing test_packages, is that my fault, or should I leave that for now?
2007-07-22T01:27:21  <xorAxAx> no, dreimark wanted to have a look at it
2007-07-22T01:27:33  <xorAxAx> you might need to help him to reproduce it, though
2007-07-22T01:27:58  <xorAxAx> good night
2007-07-22T01:28:56  <grzywacz> night
2007-07-22T02:00:20  <CIA-27> moin: Thomas Waldmann <tw AT waldmann-edv DOT de> * 2458:01f2921e5fa4 1.7/MoinMoin/ (5 files in 5 dirs): tests: convert some more tests to py.test
2007-07-22T02:08:48  <ThomasWaldmann> grzywacz: did you write events.xapian_index?
2007-07-22T02:09:40  <ThomasWaldmann> (if yes, see MoinMoin/_template.py for how the header should look like :)
2007-07-22T02:13:42  <grzywacz> ThomasWaldmann, yes, I did.
2007-07-22T02:13:52  <grzywacz> I'll take a look in a moment, when I pull a fresh update.
2007-07-22T02:14:18  <grzywacz> Note to self: and I forgot that AttachFile still does that by itself and I must update it.
2007-07-22T03:24:11  <ThomasWaldmann> http://de.uncyclopedia.org/wiki/Gnu (german satire)
2007-07-22T03:31:26  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2481:509cde9e567f 1.7-jabber-knowak/MoinMoin/_tests/test_PageEditor.py: Fix test of Abort in PageEditor so that it restores the event handler list.
2007-07-22T03:31:30  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2482:c707250dca17 1.7-jabber-knowak/jabberbot/xmppbot.py: Keep contact entries longer (with ttl) to keep lang settings.
2007-07-22T03:31:31  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2483:fabbb4dbd99e 1.7-jabber-knowak/ (MoinMoin/_tests/test_PageEditor.py jabberbot/xmppbot.py): Merge devel.
2007-07-22T04:00:20  <grzywacz> ThomasWaldmann, you don't use python 2.3, do you? 8)
2007-07-22T04:01:26  <ThomasWaldmann> no, why? :)
2007-07-22T04:03:09  <grzywacz> Because you committed a line which doesn't work with 2.3 ;)
2007-07-22T04:03:30  <ThomasWaldmann> which?
2007-07-22T04:04:21  <grzywacz> You use `set` in password checker. This goes boom in 2.3 without an import. I've already fixed that, so just wait till xorAxAx merges my branch with 1.7 ;)
2007-07-22T04:06:40  <ThomasWaldmann> right, multiconfig needs same magic as test_multiconfig. I noticed the set problem, but only fixed one place.
2007-07-22T04:07:27  <grzywacz> Hm, looks like I should remove the request parameter from basic Event's constructor.
2007-07-22T04:07:46  <grzywacz> Assuming that a request is always available may be a too big assumption in general.
2007-07-22T04:10:36  <grzywacz> On the other hand, this is very useful in further event handling...
2007-07-22T04:11:24  <grzywacz> blah, too lat for such ideas x)
2007-07-22T04:21:40  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2484:111868e5cb21 1.7-jabber-knowak/MoinMoin/ (action/AttachFile.py events/xapian_index.py): Regenerate xapian index on added attachment, fix PageDeletedEvent, fix header
2007-07-22T04:21:52  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2485:41669a7a60ad 1.7-jabber-knowak/MoinMoin/config/multiconfig.py: Import set if it's unknown (python 2.3 compatibility)
2007-07-22T04:21:55  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2486:5b8e8e7db56f 1.7-jabber-knowak/MoinMoin/ (_tests/test_PageEditor.py events/__init__.py): Whitespace fixes.
2007-07-22T04:22:01  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2487:f3e3ffa68a7f 1.7-jabber-knowak/MoinMoin/ (action/newaccount.py user.py): Send UserCreatedEvent from user.save(), not the newaccount action.
2007-07-22T04:22:11  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2488:7283062fce1a 1.7-jabber-knowak/MoinMoin/events/jabbernotify.py: Fix a stupid bug in jabber notification about user creation.
2007-07-22T04:22:19  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2489:b9e0a8a1f14c 1.7-jabber-knowak/MoinMoin/ (8 files in 5 dirs): Merge devel.
2007-07-22T04:22:25  <CIA-27> moin: Thomas Waldmann <tw AT waldmann-edv DOT de> * 2490:adf5ec4874ed 1.7-jabber-knowak/MoinMoin/ (_tests/test_wikiutil.py macro/Hits.py wikiutil.py): fix ParameterParser, rewrite ParameterParser tests for py.test (and add more tests), refactor Hits macro
2007-07-22T04:22:34  <CIA-27> moin: Thomas Waldmann <tw AT waldmann-edv DOT de> * 2491:18c71299e2bb 1.7-jabber-knowak/MoinMoin/_tests/test_wikiutil.py: convert test_wikiutil to py.test
2007-07-22T04:22:43  <CIA-27> moin: Thomas Waldmann <tw AT waldmann-edv DOT de> * 2492:fe71235f1f7c 1.7-jabber-knowak/MoinMoin/ (_tests/test_wikiutil.py macro/Hits.py wikiutil.py): ParameterParser: changed to return fixed_count, arg_dict, putting positional args into arg_dict[pos], more tests
2007-07-22T04:22:52  <CIA-27> moin: Thomas Waldmann <tw AT waldmann-edv DOT de> * 2493:15502589ece6 1.7-jabber-knowak/MoinMoin/ (_tests/test_wikiutil.py wikiutil.py): ParameterParser: check types, remove unused code, tests
2007-07-22T04:22:58  <CIA-27> moin: Thomas Waldmann <tw AT waldmann-edv DOT de> * 2494:e0b1fc786797 1.7-jabber-knowak/MoinMoin/wikiutil.py: ParameterParser: cleanup: avoid using builtins as names, cosmetic changes
2007-07-22T04:23:05  <CIA-27> moin: Thomas Waldmann <tw AT waldmann-edv DOT de> * 2495:01f2921e5fa4 1.7-jabber-knowak/MoinMoin/ (5 files in 5 dirs): tests: convert some more tests to py.test
2007-07-22T04:23:16  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2496:d9e112066a9e 1.7-jabber-knowak/MoinMoin/ (8 files in 8 dirs): Merge 1.7.
2007-07-22T04:51:38  <grzywacz> O_o;
2007-07-22T05:15:20  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2497:e3bb982b4011 1.7-jabber-knowak/MoinMoin/xmlrpc/_tests/ (test_xmlrpc.py test_multicall.py): s/test_multicall.py/test_xmlrpc.py/
2007-07-22T05:15:22  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2498:3b3b76b2225c 1.7-jabber-knowak/MoinMoin/xmlrpc/_tests/test_xmlrpc.py: Add a test case for XmlRpcBase._generate_auth_token
2007-07-22T05:15:25  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2499:b5a711a9ec09 1.7-jabber-knowak/MoinMoin/xmlrpc/__init__.py: Fix generation of auth tokens in xmlrpc code.
2007-07-22T05:15:31  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2500:7203f7cc4201 1.7-jabber-knowak/jabberbot/xmppbot.py: Fix a typo.
2007-07-22T05:15:37  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2501:de573a7f49ce 1.7-jabber-knowak/jabberbot/commands.py: A small comment improvement.
2007-07-22T05:15:50  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2502:d9aef892fda8 1.7-jabber-knowak/jabberbot/xmlrpcbot.py: Fix xmlrpc commands. How come I've never noticed how b0rked it was?!
2007-07-22T05:15:56  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2503:09afb8020b20 1.7-jabber-knowak/ (6 files in 3 dirs): Merge devel.
2007-07-22T05:18:42  <grzywacz> xorAxAx, push my branch to main, please, if these commits look ok. I fixed some really silly (and important) bugs of mine. :S
2007-07-22T05:21:52  <grzywacz> xorAxAx, johill: I see a todo item on my JabberSupport page about using a 'name' attribute instead of class name for subscribed_events list. Are both of you ok with this?
2007-07-22T05:47:25  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2504:c27ee67397f0 1.7-jabber-knowak/jabberbot/ (i18n.py xmlrpcbot.py xmppbot.py): Make pylint happy where it made sense, fix a few minor bugs.
2007-07-22T05:47:26  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2505:0a90c1bad60f 1.7-jabber-knowak/MoinMoin/events/ (emailnotify.py jabbernotify.py notification.py): Again, some fixes suggested by pylint.
2007-07-22T05:47:30  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2506:426a8cb8e44c 1.7-jabber-knowak/ (6 files in 2 dirs): Merge with devel.
2007-07-22T05:50:43  <grzywacz> good night :D
2007-07-22T10:32:43  <johill> grzywacz: yeah, we discussed that
2007-07-22T10:35:35  <johill> ThomasWaldmann: not sure I understand? quoted check one level above?
2007-07-22T11:02:43  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2459:8ae20e588337 1.7/MoinMoin/action/_tests/test_attachfile.py: Add a test for AttachFile action.
2007-07-22T11:02:47  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2460:99b6222544c3 1.7/MoinMoin/userprefs/prefs.py: Fix a silly bug in userprefs thanks to johill.
2007-07-22T11:02:48  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2461:f456dc2048d1 1.7/ (8 files in 4 dirs): i18n should now work. First step, no caching yet.
2007-07-22T11:02:54  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2462:8ce2afa469a7 1.7/ (9 files in 7 dirs): Merge main.
2007-07-22T11:03:02  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2463:920089399dfa 1.7/MoinMoin/i18n/jabberbot/pl.JabberBot.po: Initial Polish translation for the notification bot.
2007-07-22T11:03:15  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2464:3c5b329afe4b 1.7/MoinMoin/events/__init__.py: Add a pseudo-getText function to that strings can get into .po files
2007-07-22T11:03:23  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2465:474b7a1fc031 1.7/MoinMoin/ (14 files in 7 dirs): Merge main.
2007-07-22T11:03:35  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2466:474448e88c24 1.7/MoinMoin/ (14 files in 7 dirs): Merge main.
2007-07-22T11:03:41  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2467:31b3d03bd1ea 1.7/MoinMoin/events/__init__.py: s/An/A/
2007-07-22T11:03:51  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2468:4a199a4c5d31 1.7/MoinMoin/userprefs/notification.py: Pull some more johill's changes from main.
2007-07-22T11:04:03  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2469:663867be4afc 1.7/MoinMoin/ (4 files in 2 dirs): Add a separate TrivialPageChangedEvent users can subscribe to.
2007-07-22T11:04:09  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2470:f15b9bf952d4 1.7/MoinMoin/ (5 files in 3 dirs): Merge devel.
2007-07-22T11:04:19  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2471:572f8ce1adff 1.7/ (7 files in 5 dirs): Merge main.
2007-07-22T11:04:27  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2472:4e9370e2e8f1 1.7/MoinMoin/xmlrpc/__init__.py: Move xmlrpc_getBotTranslations() out of warning's scope.
2007-07-22T11:04:33  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2473:754e3eedb9e5 1.7/jabberbot/i18n.py: Remove stray code and comment left from a mix of refactoring and copypasta.
2007-07-22T11:04:41  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2474:d08d65a19718 1.7/jabberbot/xmppbot.py: Make _. This assumes that all commands have jid attr, which makes sense here.
2007-07-22T11:04:49  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2475:639a122cbc54 1.7/ (3 files in 2 dirs): Merge devel.
2007-07-22T11:04:55  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2476:8a118b01df5a 1.7/ (11 files in 9 dirs): Merge main.
2007-07-22T11:05:03  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2477:76f87ae87759 1.7/jabberbot/xmppbot.py: Initialize _ later, as NotificationCommand doesn't have `jid` attr
2007-07-22T11:05:13  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2478:0242ded135e9 1.7/jabberbot/xmppbot.py: Merge devel.
2007-07-22T11:05:19  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2479:7131fda5e82d 1.7/MoinMoin/ (40 files in 23 dirs): Merge main.
2007-07-22T11:05:27  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2480:b0185066e802 1.7/jabberbot/xmlrpcbot.py: Handle exceptions in get_language_by_jid
2007-07-22T11:05:33  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2481:4030f9321319 1.7/jabberbot/xmlrpcbot.py: Fix local variable reference prior to assignment.
2007-07-22T11:05:41  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2482:33eb7652cc0a 1.7/jabberbot/xmppbot.py: Actually fix what 76f87ae87759 tried. Finally work around pyxmpp problems (?).
2007-07-22T11:05:49  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2483:41e79a4df6b6 1.7/jabberbot/ (xmlrpcbot.py xmppbot.py): Whitespace fixes.
2007-07-22T11:05:54  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2484:fe625067fa0f 1.7/MoinMoin/ (events/_tests/test_events.py _tests/test_events.py): Move test_events to MoinMoin/events/_tests
2007-07-22T11:06:03  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2485:0c66cfd93cd9 1.7/ (54 files in 30 dirs): Merge main.
2007-07-22T11:06:08  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2486:8fb3dc91df77 1.7/ (5 files in 4 dirs): Merge devel.
2007-07-22T11:06:17  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2487:509cde9e567f 1.7/MoinMoin/_tests/test_PageEditor.py: Fix test of Abort in PageEditor so that it restores the event handler list.
2007-07-22T11:06:23  <CIA-27> moin: Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl> * 2488:c707250dca17 1.7/jabberbot/xmppbot.py: Keep contact entries longer (with ttl) to keep lang settings.
2007-07-22T11:06:28  <CIA-27> (18 lines omitted)
2007-07-22T11:08:05  <johill> I wonder
2007-07-22T11:08:14  <johill> is there any way to figure out if a certain callable has keyword arguments?
2007-07-22T11:08:20  <johill> oh wait, never mind
2007-07-22T11:13:58  <xorAxAx> grzywacz: +            getpageinfo_result = self.multicall()[0]
2007-07-22T11:14:01  <xorAxAx> grzywacz: isnt it [1]?
2007-07-22T11:17:43  <johill> xorAxAx: any good idea how to pass the trailing positional parameters into the call?
2007-07-22T11:17:53  <johill> like if you have [[(a=1,b=2,3,4)]]
2007-07-22T11:18:46  <xorAxAx> well
2007-07-22T11:19:05  <xorAxAx> either like it was before in your parser or in a kwarg named something like trailing_args
2007-07-22T11:19:21  <johill> ah, but that means everybody needs that kwarg
2007-07-22T11:19:34  <johill> hm, or I just catch the exception and try without again
2007-07-22T11:19:41  <xorAxAx> yes, or it will fail
2007-07-22T11:19:44  <xorAxAx> and thats the goal
2007-07-22T11:19:53  <johill> most macros don't want trailing args
2007-07-22T11:20:10  <johill> hence, requiring all to have that kwarg is not nice
2007-07-22T11:20:22  <johill> because if you have it you definitely need to check if it's a list
2007-07-22T11:20:37  <johill> ah no scratch that
2007-07-22T11:23:12  <xorAxAx> no, i dont require it
2007-07-22T11:23:20  <xorAxAx> i want that the call would fail
2007-07-22T11:23:37  <johill> ah, wait, I get it now
2007-07-22T11:23:40  <johill> yes that makes sense
2007-07-22T11:24:01  <johill> thanks )
2007-07-22T11:24:03  <johill> :)
2007-07-22T11:25:02  <xorAxAx> but getting the error message right is not easy
2007-07-22T11:26:30  <johill> depending on how precise you want it ;)
2007-07-22T11:26:58  <xorAxAx> something easy to understand for wiki users :)
2007-07-22T11:44:51  <vpv> damn I hate doing complete backups for system upgrades ;)
2007-07-22T11:47:32  <xorAxAx> haha, a fedora user
2007-07-22T11:47:48  <xorAxAx> :-)
2007-07-22T12:04:02  <ThomasWaldmann> johill: if quoted: <everything that checks quoted now> else: <everything that checks not quoted now>
2007-07-22T12:04:43  <johill> ThomasWaldmann: ah
2007-07-22T12:04:56  <grzywacz> xorAxAx, [1]? No, why? It's the case when no getAuthToken*() call has been made.
2007-07-22T12:05:06  <johill> yeah might be easier to read that way
2007-07-22T12:05:33  <johill> ok, added some test: http://johannes.sipsolutions.net/patches/moin/macro-args.patch
2007-07-22T12:07:33  <ThomasWaldmann> the fn call triggers UnicodeError invalid arg name?
2007-07-22T12:08:29  <johill> nah, forgot to remove that
2007-07-22T12:10:26  <xorAxAx> grzywacz: ah
2007-07-22T12:10:34  <xorAxAx> grzywacz: but dont you need to apply the auth token?
2007-07-22T12:11:06  <grzywacz> xorAxAx, it's done in the decorator
2007-07-22T12:11:33  <johill> fixed, more tests
2007-07-22T12:14:17  <johill> now implemented xorAxAx's suggestion about trailing args
2007-07-22T12:16:03  <johill> hm
2007-07-22T12:16:09  <johill> that string conversion is bogus
2007-07-22T12:17:32  <johill> some macros might take **kw and then expect anything to come in
2007-07-22T12:18:22  <ThomasWaldmann> johill: maybe your error msgs could include err somehow?
2007-07-22T12:21:06  <johill> I'll think in a sec, just found a bug
2007-07-22T12:32:34  <johill> ThomasWaldmann: yes, I can, but that won't be translatable
2007-07-22T12:33:37  <ThomasWaldmann> better having some english hint than none at all
2007-07-22T12:36:43  <johill> ok, reload
2007-07-22T12:43:18  <johill> I suppose we could translate the common errors by somehow including them in the po file
2007-07-22T12:43:27  <johill> ah no, it contains variable things
2007-07-22T12:45:36  <ThomasWaldmann> TypeError doesnt need macro_name?
2007-07-22T12:46:31  <xorAxAx> grzywacz: ?
2007-07-22T12:46:41  <xorAxAx> grzywacz: and why is it 0 then?
2007-07-22T12:47:46  <ThomasWaldmann> johill: please add some docstrings
2007-07-22T12:49:01  <johill> sure
2007-07-22T12:49:27  <johill> ThomasWaldmann: heh, I decided to require that the function has the same name as the macro
2007-07-22T12:49:35  <johill> i.e. macro test.py contains def test(...)
2007-07-22T12:49:51  <johill> and then python already tells you about the macro/function name
2007-07-22T12:51:04  <ThomasWaldmann> then you should name macro modules like builtins
2007-07-22T12:51:11  <ThomasWaldmann> +not
2007-07-22T12:51:12  <johill> hm?
2007-07-22T12:51:19  <johill> right
2007-07-22T12:51:22  <johill> is that bad?
2007-07-22T12:51:39  <ThomasWaldmann> well, unexpected maybe
2007-07-22T12:51:58  <johill> point was that python says
2007-07-22T12:52:03  <ThomasWaldmann> max, min, filter, map, ... lots of stuff people tend to forget
2007-07-22T12:52:07  <johill> 'test() takes exactly 4 arguments (1 given)'
2007-07-22T12:52:19  <johill> or rather 'call() takes exactly 4 arguments (1 given)'
2007-07-22T12:52:29  <johill> and I didn't want to try parsing out the call() to substitute test()
2007-07-22T12:52:34  <ThomasWaldmann> how about macro_xxx?
2007-07-22T12:52:35  <johill> (well, macro_name())
2007-07-22T12:52:47  <johill> then it'll say macro_xx(): takes 4 args
2007-07-22T12:52:56  <johill> sounds ok, still understandable
2007-07-22T12:53:09  <ThomasWaldmann> yeah, and it wont collide
2007-07-22T12:53:14  <johill> right
2007-07-22T12:53:16  * johill changes
2007-07-22T12:53:43  <johill> first I tried setting fn.__name__
2007-07-22T12:53:48  <johill> or fn.func_name
2007-07-22T12:53:52  <johill> but that didn't work, not sure why
2007-07-22T12:54:41  <ThomasWaldmann> btw, your stuff just wraps plugin macros. how about builtin macros?
2007-07-22T12:54:52  <johill> yeah, haven't thought about that yet really
2007-07-22T12:55:41  <ThomasWaldmann> for performance reasons, I would like to keep the cheap, but often used macros in a single file.
2007-07-22T12:56:12  <johill> should be easy enough, but a separate patch sincce it touches all existing macros
2007-07-22T12:56:17  <grzywacz> xorAxAx, because multicall() returns an iterator, and I want to get the first item.
2007-07-22T12:56:41  <xorAxAx> grzywacz: you cannot use the sequence protocol on iterators
2007-07-22T12:56:49  <xorAxAx> grzywacz: and the first item would be auth token, no?
2007-07-22T12:57:54  <ThomasWaldmann> btw, we have ~10 places doing that from sets import Set as set magic - how about just injecting set and frozenset into builtins early, if it is not there?
2007-07-22T12:58:12  <grzywacz> xorAxAx, I can, MultiCallIterator supports __getitem__, a NO, because i use [0] only in the case when token is not applied.
2007-07-22T12:59:10  <xorAxAx> grzywacz: yes, but iterators dont :)
2007-07-22T13:01:09  <xorAxAx> well
2007-07-22T13:01:19  <xorAxAx> grzywacz: e.g. get_page
2007-07-22T13:01:26  <xorAxAx> grzywacz: i dont see the apply auth token call
2007-07-22T13:01:30  <xorAxAx> am i blind?
2007-07-22T13:02:55  <johill> ThomasWaldmann: added some docs
2007-07-22T13:03:12  <grzywacz> xorAxAx, line 112
2007-07-22T13:03:46  <xorAxAx> grzywacz: welll
2007-07-22T13:03:59  <xorAxAx> grzywacz: you might want to think about wrapping that stuff as well
2007-07-22T13:04:17  <xorAxAx> so warn_no_credentials is not called in the methods
2007-07-22T13:04:28  <grzywacz> Hm.
2007-07-22T13:04:39  <grzywacz> Yes, that can be done. Thanks,
2007-07-22T13:06:33  <ThomasWaldmann> johill: what's the purpose of name_value=False?
2007-07-22T13:06:46  <lanius_> grzywacz: how can i subscribe to events?
2007-07-22T13:06:54  <johill> ThomasWaldmann: oh, I initially wanted to convert split_wiki to use this
2007-07-22T13:07:11  <johill> ThomasWaldmann: turned out that the "pagename"link text syntax isn't really possible
2007-07-22T13:08:03  <grzywacz> lanius_, you should have a recent clone on 1.7, then you'll have notification options in preferences if you have either email or jabber notifications enabled in wikiconfig
2007-07-22T13:08:42  <lanius_> grzywacz: but there is no internal notification, so i can subscribe my own handler?
2007-07-22T13:09:58  <johill> ThomasWaldmann: oh and doing if quoted/notquoted before isn't possible because then I'd have to duplicate the else branch
2007-07-22T13:10:24  <xorAxAx> grzywacz: he means how he can write an event handler
2007-07-22T13:10:54  <ThomasWaldmann> johill: the _wrap return type should be unicode
2007-07-22T13:11:13  <johill> oh right
2007-07-22T13:17:09  <ThomasWaldmann> seplimit maybe should be called parsedlimit?
2007-07-22T13:17:46  <lanius_> grzywacz: and what about a UserChangedEvent
2007-07-22T13:18:41  <johill> ThomasWaldmann: could be
2007-07-22T13:19:26  <johill> though it doesn't limit parsing, it limits separating
2007-07-22T13:19:37  <johill> you still get all the rest of the string out, just as a single arg
2007-07-22T13:19:50  <ThomasWaldmann> johill: and you still could move the (not) quoted term to the (common) first place in every expr
2007-07-22T13:19:53  <grzywacz> lanius_, there's no such event, feel free to add it :)
2007-07-22T13:19:58  <johill> yeah
2007-07-22T13:20:05  <grzywacz> lanius_, if you ask about handlers, then look in MoinMoin/events
2007-07-22T13:20:17  <lanius_> grzywacz: ok
2007-07-22T13:20:28  <grzywacz> lanius_, you need a plugin with a handler() method which accepts one argument: an event
2007-07-22T13:20:34  <grzywacz> It will be loaded automatically.
2007-07-22T13:20:41  <grzywacz> gah, storm...
2007-07-22T13:21:24  <grzywacz> I'm going offline again. Lightnings and radio antenna on my roof don't play together :S
2007-07-22T13:22:13  <xorAxAx> and his last words were "OMG, its near the house"
2007-07-22T13:22:38  <ThomasWaldmann> johill: aside from that if/elif.... thing being a bit long, that stuff looks really neat and if we don't find any undiscovered issues, I guess this should be the std argparser in moin, making macro writing much easier than it is now
2007-07-22T13:25:53  <ThomasWaldmann> johill: if you commit this to main, add a comment to ParameterParser pointing to and recommending your way
2007-07-22T13:26:36  <CIA-27> moin: Heinrich Wendel <h_wendel@cojobo.net> * 2544:3a8e5e0b1d1f 1.7-storage-hwendel/MoinMoin/ (4 files in 4 dirs): more index work
2007-07-22T13:26:48  <CIA-27> moin: Heinrich Wendel <h_wendel@cojobo.net> * 2545:10c375296cf0 1.7-storage-hwendel/MoinMoin/storage/fs_moin16.py: fix locking code
2007-07-22T13:26:55  <johill> ThomasWaldmann: I just reordered the if/elif thing, but I don't think I can make it shorted
2007-07-22T13:27:04  <CIA-27> moin: Heinrich Wendel <h_wendel@cojobo.net> * 2546:c6eecf67d4b4 1.7-storage-hwendel/MoinMoin/storage/ (_tests/test_fs_moin16.py external.py fs_moin16.py): make DELETED metadata also be False if it is not available
2007-07-22T13:27:10  <CIA-27> moin: Heinrich Wendel <h_wendel@cojobo.net> * 2547:684827f36a9b 1.7-storage-hwendel/MoinMoin/storage/fs_moin16.py: cleanups
2007-07-22T13:27:12  <johill> but the advantage is that it's single-pass parsing :)
2007-07-22T13:27:24  <CIA-27> moin: Thomas Waldmann <tw AT waldmann-edv DOT de> * 2548:d268d5467cfe 1.7-storage-hwendel/MoinMoin/server/server_standalone.py: standalone server: fix AttributeError when not using cProfileProfile
2007-07-22T13:27:30  <CIA-27> moin: Johannes Berg <johannes AT sipsolutions DOT net> * 2549:059054049961 1.7-storage-hwendel/MoinMoin/auth/openidrp.py: don't use parenthesised imports in openid code
2007-07-22T13:27:37  <ThomasWaldmann> johill: yeah
2007-07-22T13:27:42  <CIA-27> moin: Johannes Berg <johannes AT sipsolutions DOT net> * 2550:2142eea37033 1.7-storage-hwendel/MoinMoin/ (action/userprefs.py userprefs/__init__.py): fix userpreferences links
2007-07-22T13:27:50  <CIA-27> moin: Johannes Berg <johannes AT sipsolutions DOT net> * 2551:76bf8b6b3061 1.7-storage-hwendel/MoinMoin/userprefs/ (changepass.py oid.py prefs.py suid.py): use formatted=False for userprefs titles
2007-07-22T13:27:56  <CIA-27> moin: Johannes Berg <johannes AT sipsolutions DOT net> * 2552:26fe624bdbd6 1.7-storage-hwendel/MoinMoin/ (config/multiconfig.py userprefs/prefs.py): remove notification settings from userprefs, will add back as a new plugin
2007-07-22T13:28:05  <CIA-27> moin: Johannes Berg <johannes AT sipsolutions DOT net> * 2553:c1592d799c53 1.7-storage-hwendel/MoinMoin/userprefs/prefs.py: remove more event stuff from prefs.py
2007-07-22T13:28:16  <CIA-27> moin: Johannes Berg <johannes AT sipsolutions DOT net> * 2554:5d1c31b0c6b5 1.7-storage-hwendel/MoinMoin/ (6 files in 4 dirs): make jabber/email notification types configurable orthogonally
2007-07-22T13:28:24  <CIA-27> moin: Johannes Berg <johannes AT sipsolutions DOT net> * 2555:dd138b728c1f 1.7-storage-hwendel/MoinMoin/userprefs/notification.py: initial cut at a notification prefs dialog
2007-07-22T13:28:36  <CIA-27> moin: Johannes Berg <johannes AT sipsolutions DOT net> * 2556:3ddef6c321b1 1.7-storage-hwendel/MoinMoin/userprefs/notification.py: small fixes to notification userprefs
2007-07-22T13:28:42  <CIA-27> moin: Johannes Berg <johannes AT sipsolutions DOT net> * 2557:0cd1152b8da5 1.7-storage-hwendel/MoinMoin/ (config/multiconfig.py user.py): default to email notification of all events to ease migration from old scheme
2007-07-22T13:28:51  <CIA-27> moin: Johannes Berg <johannes AT sipsolutions DOT net> * 2558:c7bb078d3318 1.7-storage-hwendel/MoinMoin/config/multiconfig.py: commit b8b87daf7cc4 broke farms because one dict was shared, fix it
2007-07-22T13:28:52  <ThomasWaldmann> grzywacz: the nice thing about a notebook is that just your battery time has to be longer than the usual lightning duration :)
2007-07-22T13:29:04  <CIA-27> moin: Thomas Waldmann <tw AT waldmann-edv DOT de> * 2559:58260d360f5c 1.7-storage-hwendel/ (4 files in 4 dirs): password_checker (simple builtin test, optionally using python-crack lib)
2007-07-22T13:29:14  <CIA-27> moin: Thomas Waldmann <tw AT waldmann-edv DOT de> * 2560:81afe010284f 1.7-storage-hwendel/MoinMoin/ (config/multiconfig.py user.py userprefs/notification.py): merged main
2007-07-22T13:29:24  <CIA-27> moin: Thomas Waldmann <tw AT waldmann-edv DOT de> * 2561:738c0c3d001c 1.7-storage-hwendel/MoinMoin/userprefs/prefs.py: fix exception when saving userprefs with empty jabber id
2007-07-22T13:29:32  <CIA-27> moin: Johannes Berg <johannes AT sipsolutions DOT net> * 2562:b4aa8a40f754 1.7-storage-hwendel/MoinMoin/userprefs/suid.py: clean up suid a bit
2007-07-22T13:29:38  <CIA-27> moin: Johannes Berg <johannes AT sipsolutions DOT net> * 2563:5742ec1cbb37 1.7-storage-hwendel/ (5 files in 4 dirs): merge main
2007-07-22T13:29:46  <CIA-27> moin: Johannes Berg <johannes AT sipsolutions DOT net> * 2564:c8a3a74953f6 1.7-storage-hwendel/MoinMoin/userprefs/changepass.py: remove bogus {SHA} check from changepass
2007-07-22T13:29:54  <CIA-27> moin: Johannes Berg <johannes AT sipsolutions DOT net> * 2565:0b2a95feb672 1.7-storage-hwendel/MoinMoin/wikidicts.py: wikidicts surely doesn't need copy
2007-07-22T13:30:00  <CIA-27> moin: Johannes Berg <johannes AT sipsolutions DOT net> * 2566:609ef7393a14 1.7-storage-hwendel/MoinMoin/request/__init__.py: remove bogus copy statements
2007-07-22T13:30:10  <CIA-27> moin: Johannes Berg <johannes AT sipsolutions DOT net> * 2567:08f64645042e 1.7-storage-hwendel/MoinMoin/support/copy.py: we no longer use copy.deepcopy() so no need to have a fixed version of that
2007-07-22T13:30:16  <CIA-27> (68 lines omitted)
2007-07-22T13:30:27  * ThomasWaldmann sings "spam,spam,spam" :)
2007-07-22T13:31:43  <johill> heh
2007-07-22T13:31:51  <johill> ok I ported all builtin-macros
2007-07-22T13:31:53  <johill> code looks much nicer
2007-07-22T13:32:18  <ThomasWaldmann> and it still works? ;)
2007-07-22T13:32:55  <johill> it doens't find the Anchor macro any more for some reason
2007-07-22T13:33:18  <johill> oh stupid typo
2007-07-22T13:34:18  <johill> yeah still works
2007-07-22T13:35:01  <johill> http://johannes.sipsolutions.net/patches/moin/internal-macros.patch
2007-07-22T13:38:43  <Fabi> moin
2007-07-22T13:40:25  <johill> ThomasWaldmann: parameter parser is only used by Hits()
2007-07-22T13:40:28  <johill> I could just port that
2007-07-22T13:40:30  <ThomasWaldmann> macro_Icon needs fix
2007-07-22T13:40:54  <johill> I suspected it ;)
2007-07-22T13:41:02  <johill> it's ok to have , in there right?
2007-07-22T13:42:04  <johill> oh no
2007-07-22T13:42:06  <johill> heh
2007-07-22T13:42:08  <johill> I thought I hda that
2007-07-22T13:42:44  <ThomasWaldmann> just the args>icon thing
2007-07-22T13:42:56  <johill> yeah, just saw it too
2007-07-22T13:43:04  <johill> apparently it's not on HelpOnMacros ;)
2007-07-22T13:45:21  <ThomasWaldmann> finally, we could use the same fn name for builtin and plugin macros
2007-07-22T13:45:29  <johill> hm?
2007-07-22T13:45:43  <ThomasWaldmann> so either both use _macro_xxx or both use macro_xxx
2007-07-22T13:45:47  <johill> you mean macro_ instead of _macro_
2007-07-22T13:45:48  <johill> ah ok
2007-07-22T13:46:09  <johill> right, yeah, I had initially changed them all to macro_ but then changed it back because of the private name thing
2007-07-22T13:46:14  <ThomasWaldmann> makes it easy to externalize/internalize them
2007-07-22T13:46:42  <ThomasWaldmann> i guess we can live without _
2007-07-22T13:47:30  <ThomasWaldmann> just check that there is no macro_* function that is NOT a macro :)
2007-07-22T13:49:33  <johill> there isn't :)
2007-07-22T13:50:12  <johill> refreshed
2007-07-22T13:54:02  <ThomasWaldmann> ok, looks good. did you run all tests?
2007-07-22T13:55:24  <johill> http://johannes.sipsolutions.net/patches/moin/port-hits-macro.patch
2007-07-22T13:55:56  <johill> almost halved the code :P
2007-07-22T13:57:26  <johill> bunch of pep8 tests fail, but not in the new code
2007-07-22T13:58:11  <ThomasWaldmann> rather use " ".join(possible)
2007-07-22T13:58:39  <johill> you mean in the string?
2007-07-22T13:59:32  <ThomasWaldmann> in the TypeError
2007-07-22T13:59:39  <johill> right
2007-07-22T14:00:01  <johill> I'll use ', '.join tho
2007-07-22T14:00:27  <ThomasWaldmann> sure
2007-07-22T14:01:25  <ThomasWaldmann> btw, it would be nice to add some get_boolean(arg) utility fn
2007-07-22T14:01:26  <johill> ok, I'll commit these then
2007-07-22T14:02:09  <ThomasWaldmann> which maps 0,1,true,false (in any case) to True/False
2007-07-22T14:02:22  <johill> hm, yeah, that could be good
2007-07-22T14:04:50  <lanius_> what about the strings "True" "False"
2007-07-22T14:05:00  <johill> "(in any case)"
2007-07-22T14:05:09  <lanius_> ahh :_)
2007-07-22T14:05:50  <xorAxAx> thats already existing
2007-07-22T14:06:06  <xorAxAx> we are the knights who say NIH!
2007-07-22T14:06:11  <xorAxAx> we want a shrubbery!
2007-07-22T14:06:25  <johill> xorAxAx: where?
2007-07-22T14:06:29  <xorAxAx> MoinMoin.packages
2007-07-22T14:06:46  <johill> not quite
2007-07-22T14:06:50  <johill> it accepts anything else as false
2007-07-22T14:06:55  <johill> you wanted fail-fast :P
2007-07-22T14:06:55  <ThomasWaldmann> johill: how do you treat missing args like the 2nd in a,,c?
2007-07-22T14:07:03  <xorAxAx> johill: well :)
2007-07-22T14:07:04  <johill> ThomasWaldmann: empty string
2007-07-22T14:07:17  <xorAxAx> johill: then modify it to be fail fast and replace all calls
2007-07-22T14:07:28  <johill> all calls?
2007-07-22T14:07:31  <johill> it isn't called ;)
2007-07-22T14:07:36  <ThomasWaldmann> then your get_whatevertype could include default handling
2007-07-22T14:07:46  <johill> oh it is
2007-07-22T14:08:04  <johill> true
2007-07-22T14:08:48  <johill> actually, it's called by two functions that aren't called
2007-07-22T14:09:35  <ThomasWaldmann> brb
2007-07-22T14:09:44  <johill> oh, the do_ thing is called by name, never mind
2007-07-22T14:10:23  <johill> seriously though, I think the whole thing is a bit different
2007-07-22T14:10:47  <xorAxAx> hm?
2007-07-22T14:11:04  <johill> http://johannes.sipsolutions.net/patches/moin/port-hits-macro.patch
2007-07-22T14:11:06  <johill> last hunk
2007-07-22T14:28:14  <ThomasWaldmann> why do you check for boolean if it must be a str/unicode?
2007-07-22T14:29:19  <ThomasWaldmann> if arg could be anything, you also have to check for int
2007-07-22T14:32:00  <ThomasWaldmann> johill:
2007-07-22T14:44:06  <grzywacz> Ok, safe. ;) Do you have more questions about events, lanius_? :)
2007-07-22T14:51:16  <johill> ThomasWaldmann: sorry, had lunch
2007-07-22T14:51:26  <johill> ThomasWaldmann: see the Hits macro
2007-07-22T14:51:40  <johill> it declares macro_Hits(macro, all=False, filter=..)
2007-07-22T14:51:47  <johill> thus all is false if you give no args
2007-07-22T14:52:03  <johill> sure, I could say all=u'False' but that seemed weird
2007-07-22T14:55:10  <johill> hence, it can't really be anything unless you wrote dumb code :P
2007-07-22T15:04:45  <ThomasWaldmann> if someone writes all=0 ? :)
2007-07-22T15:05:04  <johill> not a boolean, is it :)
2007-07-22T15:05:14  <johill> I can add that, but I don't see the point
2007-07-22T15:05:15  <ThomasWaldmann> (surely not perfect for something that should be boolean, but I guess quite common)
2007-07-22T15:05:36  <johill> they'd just get a typeerror all the time and need to fix it then
2007-07-22T15:05:59  <ThomasWaldmann> the .lower() would crash then
2007-07-22T15:06:04  <johill> oh true
2007-07-22T15:06:08  <johill> even better
2007-07-22T15:06:10  <johill> fails right away
2007-07-22T15:06:51  <johill> but I don't really mind. do you want to allow it?
2007-07-22T15:07:30  <ThomasWaldmann> maybe raising a TypeError("Argument must be unicode or boolean") is clearer than a failing lower()
2007-07-22T15:07:40  <johill> ok
2007-07-22T15:08:07  <johill> done
2007-07-22T15:09:59  <ThomasWaldmann> ValueError: invalid literal for int(): aa
2007-07-22T15:10:09  <ThomasWaldmann> this is what int() does when it gets wrong input
2007-07-22T15:11:24  <johill> oh right, value error is better in all these cases
2007-07-22T15:13:30  <johill> well, for the actual errors that the user could see
2007-07-22T15:14:49  <ThomasWaldmann> in some way the default handling is a bit strange
2007-07-22T15:15:16  <johill> why?
2007-07-22T15:15:17  <ThomasWaldmann> if you dont give any args, it will use the default value from the function declaration
2007-07-22T15:15:35  <johill> oh ok
2007-07-22T15:15:47  <johill> yeah, but I don't see how to fix that
2007-07-22T15:15:53  <ThomasWaldmann> if you give a,,c, it won't use the default for b, but result in b==''
2007-07-22T15:16:05  <johill> basically the macro has to make sure that the default given to get_boolean is the same as the default
2007-07-22T15:17:17  <johill> python gets around that because it doesn't allow you to say a,,c in the first place
2007-07-22T15:18:15  <ThomasWaldmann> maybe document that it should be this way
2007-07-22T15:19:15  <ThomasWaldmann> get_int, get_float would be nice, too (although they are not too complex, just do the default handling the same way)
2007-07-22T15:19:34  <johill> yeah, I'll copy it then once we're happy with it
2007-07-22T15:19:46  <johill> maybe it all should also live in a new file
2007-07-22T15:19:50  <johill> argparser.py or so
2007-07-22T15:20:23  <ThomasWaldmann> i would prefer to have it at the same place as the other 2 arg parsers, in wikiutil
2007-07-22T15:20:35  <johill> ok
2007-07-22T15:20:50  <ThomasWaldmann> (right above them)
2007-07-22T15:21:04  <johill> that's where it is :)
2007-07-22T15:21:44  <johill> maybe I should not make default=False
2007-07-22T15:21:48  <johill> but just force you to assign default
2007-07-22T15:23:01  <ThomasWaldmann> well, default=False makes sense somehow. bool('') == False :)
2007-07-22T15:23:26  <johill> true
2007-07-22T15:24:06  <ThomasWaldmann> otoh, no default default would make it more explicit :)
2007-07-22T15:24:29  <johill> thing is
2007-07-22T15:24:34  <johill> if you don't have a default value for the macro parameter
2007-07-22T15:24:39  <johill> and require the user to input some parameters
2007-07-22T15:24:49  <johill> like def macro_x(macro, a, b)
2007-07-22T15:24:52  <johill> then you don't need a default
2007-07-22T15:24:56  <johill> (and any default is fine)
2007-07-22T15:25:57  <johill> so I think I'd prefer to keep it
2007-07-22T15:26:07  <johill> ok I added docstring
2007-07-22T15:26:47  <ThomasWaldmann> another way would be to do it like dict.get()
2007-07-22T15:26:59  <ThomasWaldmann> either you supply a default or it is None
2007-07-22T15:27:29  <johill> doesn't change much though
2007-07-22T15:27:38  <johill> because if you then go to use the result as a boolean, None is false
2007-07-22T15:27:58  <ThomasWaldmann> well, you will know when there was nothing, because it will result in None
2007-07-22T15:28:08  <johill> you'd have to return a value that isn't coercible to boolean
2007-07-22T15:28:20  <johill> ah ok you mean that way
2007-07-22T15:28:22  <ThomasWaldmann> (if you check for "is None")
2007-07-22T15:28:37  <johill> dunno if that makes sense though, do you want to know if there was no input? tristate macro args?
2007-07-22T15:29:13  <johill> then again it doesn't hurt here and if somebody does end up wanting it..
2007-07-22T15:29:14  * johill changes
2007-07-22T15:29:57  <johill> oh btw, get_float and get_int aren't uesful, just use int() and float()
2007-07-22T15:30:12  <ThomasWaldmann> they are, because of default :)
2007-07-22T15:30:14  <johill> except for empty values I guess
2007-07-22T15:30:36  <johill> yeah
2007-07-22T15:31:23  <ThomasWaldmann> so you have less try: arg = int(arg) except ValueError: if arg == u'': arg = default else: raise in your code
2007-07-22T15:31:33  <johill> right
2007-07-22T15:35:02  <ThomasWaldmann> maybe you could commit the argparser (for plugin macros) and get_*, plus the tests to 1.7-main
2007-07-22T15:35:21  <johill> and not the conversion of the other ones then?
2007-07-22T15:35:39  <ThomasWaldmann> then I'ld try to use it for MonthCalendar and if I succeed, you could commit the internal macro changes
2007-07-22T15:35:52  <johill> ok
2007-07-22T15:36:02  <johill> give me a minute
2007-07-22T15:36:07  <johill> just writing int/float
2007-07-22T15:37:20  <ThomasWaldmann> get_unicode? :) would be just if arg == u'': arg = default
2007-07-22T15:37:24  <johill> heh
2007-07-22T15:38:03  <ThomasWaldmann> but nice for completeness :)
2007-07-22T15:38:34  <johill> but there's a catch
2007-07-22T15:38:41  <johill> what if you actually do want the empty string
2007-07-22T15:38:44  <johill> (as the macro user)
2007-07-22T15:38:50  <ThomasWaldmann> then you give it as default
2007-07-22T15:39:10  <johill> no I mean say you have a macro that takes one arg
2007-07-22T15:39:24  <johill> [[x()]] would give you the empty string but [[x]] would use the default
2007-07-22T15:39:48  <ThomasWaldmann> get_unicode(arg, u'')
2007-07-22T15:39:49  <johill> maybe I should modify the parser to pass None if nothing is given
2007-07-22T15:40:07  <johill> and pass the empty string if you give an empty quoted string
2007-07-22T15:40:21  <johill> [[x(1,)]] vs. [[x(1,"")]]
2007-07-22T15:40:40  <johill> not sure we need to cover all the corner cases tho
2007-07-22T15:41:12  <johill> no, I mean if you say
2007-07-22T15:41:22  <johill> def macro_x(macro, a=u'text'):
2007-07-22T15:41:41  <johill> then somebody calls [[x]] you get u'text' from the default because no args are given
2007-07-22T15:41:53  <johill> but if they do [[x()]] then you get u''
2007-07-22T15:42:14  <ThomasWaldmann> you would have to use get_unicode(arg, u'text')
2007-07-22T15:42:20  <johill> so if you then use get_unicode(a, u'text') you get u'text' again even if the user explicitly wanted an empty string
2007-07-22T15:42:27  <ThomasWaldmann> remember your convention of using same defaults? :)
2007-07-22T15:42:42  <ThomasWaldmann> oh, right
2007-07-22T15:43:02  <johill> hmm, btw
2007-07-22T15:43:08  <johill> we don't need to use the same defaults
2007-07-22T15:43:13  <johill> we could allow passing arg == None to the function
2007-07-22T15:43:17  <johill> and just return the default then
2007-07-22T15:43:31  <johill> that way, you can write def macro_x(macro, a=None) and then get_boolean(..., default=False)
2007-07-22T15:43:35  <johill> and only have the default in one place
2007-07-22T15:43:46  <ThomasWaldmann> looks cleaner :)
2007-07-22T15:43:50  <johill> yeah
2007-07-22T15:44:13  <ThomasWaldmann> macro writer will love your code :)
2007-07-22T15:44:17  <johill> heh
2007-07-22T15:44:30  <johill> in any case, I think get_unicode isn't what we want
2007-07-22T15:44:45  <johill> unless we modify the parser to read ,, as None and ,"", as u''
2007-07-22T15:44:50  <johill> which seems overkill
2007-07-22T15:45:17  <ThomasWaldmann> well, it would be very regular then
2007-07-22T15:46:10  <ThomasWaldmann> and if someone want ,, to be u'', he still can give it as default
2007-07-22T15:46:31  <johill> ah but the thing is that the macro user would get weird behaviour, not the macro writer
2007-07-22T15:46:45  <johill> the user would be unable to put the empty string into something that has a default
2007-07-22T15:47:21  <ThomasWaldmann> he would've to use '' or ""
2007-07-22T15:47:35  <johill> no, that wouldn't work either, that's the thing
2007-07-22T15:47:47  <johill> because the parser just gives you an empty strring for ,"", as well
2007-07-22T15:47:55  <ThomasWaldmann> if you modify the parser...
2007-07-22T15:48:06  <johill> if I modify it to give None for ,,
2007-07-22T15:48:08  <johill> right
2007-07-22T15:48:09  <johill> I can do that
2007-07-22T15:48:12  <ThomasWaldmann> yes
2007-07-22T15:48:20  <johill> ok
2007-07-22T15:48:47  <johill> give me a bit
2007-07-22T15:48:54  <ThomasWaldmann> (after years of not having anything useful, this will be great :)
2007-07-22T15:49:47  <johill> heh
2007-07-22T15:50:41  <johill> will need to rewrite a few tests I guess :)
2007-07-22T15:55:08  <johill> ok seems to work
2007-07-22T15:57:48  <johill> yep, tests asdded, works
2007-07-22T15:59:18  <CIA-27> moin: Johannes Berg <johannes AT sipsolutions DOT net> * 2507:ea255685d6b0 1.7/MoinMoin/ (_tests/test_wikiutil.py macro/__init__.py wikiutil.py): add macro argument parser and use it to invoke macros with args directly
2007-07-22T15:59:20  <CIA-27> moin: Johannes Berg <johannes AT sipsolutions DOT net> * 2508:552e748b86cd 1.7/MoinMoin/wikiutil.py: add get_{boolean,int,float,unicode} helpers
2007-07-22T16:03:55  <ThomasWaldmann> johill: base==0?
2007-07-22T16:04:13  <johill> oh, I thought it wouldn't matter
2007-07-22T16:04:16  <johill> makes it accept hex
2007-07-22T16:04:19  <johill> with 0x
2007-07-22T16:04:42  <johill> and octal with 0
2007-07-22T16:06:04  <ThomasWaldmann> the docstring of int() doesnt tell that :)
2007-07-22T16:06:11  <johill> huh ok
2007-07-22T16:06:25  <ThomasWaldmann> and that octal stuff is dangerous
2007-07-22T16:06:42  <johill> yeah could be
2007-07-22T16:07:13  <ThomasWaldmann> you're sure you want to return the default if get_unicode gets u'' as arg?
2007-07-22T16:07:22  <johill> yeah
2007-07-22T16:07:27  <johill> oh wait
2007-07-22T16:07:28  <johill> no
2007-07-22T16:07:29  <johill> heh
2007-07-22T16:07:33  <ThomasWaldmann> :)
2007-07-22T16:08:41  <CIA-27> moin: Johannes Berg <johannes AT sipsolutions DOT net> * 2509:a55a20b092a2 1.7/MoinMoin/wikiutil.py: make get_int safer, fix get_unicode(arg=u'')
2007-07-22T16:10:15  <CIA-27> moin: Johannes Berg <johannes AT sipsolutions DOT net> * 2510:f6a777f45559 1.7/MoinMoin/ (_tests/test_wikiutil.py wikiutil.py): clarify None behaviour for keys, add tests
2007-07-22T16:13:53  <johill> I think I'll try porting include
2007-07-22T16:13:59  <johill> should be interesting
2007-07-22T16:14:18  <ThomasWaldmann> so you want to begin with the ugliest code possible? :))
2007-07-22T16:15:04  <johill> well it has trailing argguments
2007-07-22T16:17:35  <johill> uh no, it's too much used elsewhere too
2007-07-22T16:17:44  <johill> don't have that much time any more :)
2007-07-22T16:18:27  <johill> I'll have to go soon anyway
2007-07-22T16:18:37  <johill> if you succeed you can apply this patch too, just updated it again: http://johannes.sipsolutions.net/patches/moin/port-hits-macro.patch
2007-07-22T16:19:00  <johill> and internal-macros.patch I guess
2007-07-22T16:19:17  <ThomasWaldmann> ok, those 2 is everything not committed yet?
2007-07-22T16:19:47  <johill> yup
2007-07-22T16:21:22  <ThomasWaldmann> baeh, I guess I won't touch include :-X
2007-07-22T16:21:47  <johill> yeah it's pretty icky
2007-07-22T16:21:54  <johill> but since it's not internal it doesn't stop working either ;)
2007-07-22T16:24:27  <CIA-27> moin: Johannes Berg <johannes AT sipsolutions DOT net> * 2511:e85e1ebb3459 1.7/MoinMoin/wikiutil.py: remove bogus _ variable from get_unicode
2007-07-22T16:27:00  <johill> month calendar should be easy
2007-07-22T16:31:46  <johill> well, I'm off
2007-07-22T16:31:51  <johill> have fun :P
2007-07-22T16:58:42  <CIA-27> moin: Heinrich Wendel <h_wendel@cojobo.net> * 2636:4da14f8624a9 1.7-storage-hwendel/MoinMoin/ (events/__init__.py storage/_tests/test_external.py user.py): add UserChangedEvent
2007-07-22T16:58:43  <CIA-27> moin: Heinrich Wendel <h_wendel@cojobo.net> * 2637:ac106da04e3c 1.7-storage-hwendel/MoinMoin/ (9 files in 5 dirs): make cache updates via the events system; add deleted to indexes
2007-07-22T17:43:17  <dreimark> moin neagulm
2007-07-22T17:44:11  <dreimark> neagulm: have you read MoinMoinChat/Logs/moin-dev/2007-07-21
2007-07-22T17:45:33  <dreimark> please follow the advice of ThomasWaldmann to skip unit tests if spambayes is not installed
2007-07-22T17:58:25  <neagulm> dreimark, uninstalling SpamBayes now to be sure tests run correctly
2007-07-22T18:04:15  <neagulm> dreimark, oau
2007-07-22T18:04:31  <neagulm> dreimark, lots of failed tests
2007-07-22T18:04:35  <neagulm> dreimark, :(
2007-07-22T18:08:23  <dreimark> neagulm: skip the test if its not installed  py.test.skip("Can't be used without SB") or something else if its not able to import spambayes
2007-07-22T18:09:10  <dreimark> and there was some code pieces Thomas found which could not be right
2007-07-22T18:19:56  <grzywacz> http://news.yahoo.com/s/nm/20070720/od_nm/nigeria_pornography_dc;_ylt=A0WTUfF176FG8XwBExgZ.3QA
2007-07-22T18:19:57  <grzywacz> :D
2007-07-22T18:23:10  <vpv> well that's one sort of education :P
2007-07-22T18:24:27  <grzywacz> I can imagine what kind of SoC projects will OLPC come up with next year. :-P
2007-07-22T18:27:09  <dreimark> bbl
2007-07-22T18:53:41  <CIA-27> moin: Thomas Waldmann <tw AT waldmann-edv DOT de> * 2512:68496057ee03 1.7/MoinMoin/ (_tests/test_wikiutil.py wikiutil.py): wikiutil.get_* tests + fixes
2007-07-22T19:46:45  * ThomasWaldmann rewrites MonthCalender with new arg parsing
2007-07-22T21:11:56  <CIA-27> moin: Thomas Waldmann <tw AT waldmann-edv DOT de> * 2513:6de0e14591f7 1.7/MoinMoin/ (macro/MonthCalendar.py macro/__init__.py wikiutil.py): macro.format_error to format what a macro shows in case of ValueError/TypeError happening, refactor MonthCalendar to use new arg parsing
2007-07-22T21:39:08  <xorAxAx> lanius_, grzywacz: http://hg.alexanderweb.de/moin-1.7-storage-hwendel/rev/4da14f8624a9 is buggy and there is no unittest for it
2007-07-22T21:39:20  <xorAxAx> lanius_: hint - try reading it from the bottom
2007-07-22T21:57:13  <CIA-27> moin: Thomas Waldmann <tw AT waldmann-edv DOT de> * 2514:9065adc695ca 1.7/MoinMoin/macro/Hits.py: refactored Hits macro for new arg parser
2007-07-22T22:00:45  <ThomasWaldmann> look dreimark, new arg parser from johill :)
2007-07-22T22:01:06  <dreimark> reading Hits currently
2007-07-22T22:01:13  <dreimark> quite short
2007-07-22T22:04:34  <ThomasWaldmann> you can help checking if any (plugin) macro is likely to NOT work with it, before I commit the patch for all internal macros
2007-07-22T22:04:43  <ThomasWaldmann> (or whether you see any other problems)
2007-07-22T22:06:24  <ThomasWaldmann> btw, we don't need to change all plugin macros, the old way also works for them
2007-07-22T22:15:29  <grzywacz> xorAxAx, why is that buggy?
2007-07-22T22:18:15  <xorAxAx> spot the spaces
2007-07-22T22:21:18  <grzywacz> You mean it has stray whitespace characters?
2007-07-22T22:21:46  <xorAxAx> no
2007-07-22T22:21:55  <xorAxAx> i am not thomas, am i? :)
2007-07-22T22:22:15  <xorAxAx> grzywacz: see the send_event line - it looks like its only run once
2007-07-22T22:23:21  <grzywacz> Hm, I guess I should look at the complete source file. ;)
2007-07-22T22:23:55  <grzywacz> Ah, right. Buggy.
2007-07-22T22:24:01  <xorAxAx> i just needed the diff :)
2007-07-22T22:26:32  <grzywacz> It's still to early for my nocturnal intelligence to work well. :D
2007-07-22T22:26:35  <grzywacz> *too
2007-07-22T22:38:24  <lanius_> well, it was my fault
2007-07-22T22:38:42  <xorAxAx> yep :)
2007-07-22T22:41:01  <lanius_> xorAxAx: i like your changeset layout more
2007-07-22T22:41:16  <xorAxAx> hmm?
2007-07-22T22:41:22  <lanius_> hg.moinmo.in has a different layout
2007-07-22T22:41:24  <xorAxAx> ah
2007-07-22T22:41:26  <xorAxAx> yes
2007-07-22T22:41:31  <xorAxAx> me too :)
2007-07-22T22:41:53  <lanius_> xorAxAx: yours is just more clear and better arranged
2007-07-22T22:41:58  <lanius_> better readble
2007-07-22T22:42:14  <xorAxAx> append ?style=gitweb
2007-07-22T22:43:08  <lanius_> nice, maybe we can make this the default?
2007-07-22T22:43:48  <xorAxAx> ask ThomasWaldmann
2007-07-22T22:44:18  <lanius_> ThomasWaldmann: can we make the gitweb mercurial style the default, it is better readable, more informative, looks nicer, it just rocks ;)
2007-07-22T22:48:17  <grzywacz> ThomasWaldmann, please do. 8)
2007-07-22T22:49:10  <ThomasWaldmann> done
2007-07-22T22:49:26  <dreimark> ThomasWaldmann: johill arg parser looks nice, I like it
2007-07-22T22:49:57  <ThomasWaldmann> I am currently reviewing the internal macros...
2007-07-22T22:50:04  <dreimark> using that it is clear that , is the parameter separator. so some of the macros on market have to be changed
2007-07-22T22:50:29  <dreimark> but they will save lots of lines
2007-07-22T22:50:37  <vpv> ThomasWaldmann: quick service around here ;) that looks nicer, thanks
2007-07-22T22:50:47  <grzywacz> ThomasWaldmann, nice, thanks. :)
2007-07-22T22:52:11  <ThomasWaldmann> dreimark: nothing must be changed, but we can
2007-07-22T22:53:59  <dreimark> I know
2007-07-22T22:55:43  <ThomasWaldmann> dreimark: http://test17.wikiwikiweb.de/HelpOnMacros see the pre at bottom. didnt you fix that already?
2007-07-22T22:57:02  <CIA-27> moin: Thomas Waldmann <tw AT waldmann-edv DOT de> * 2515:41bc022c2160 1.7/MoinMoin/macro/__init__.py: use new arg parser for buitlin macros
2007-07-22T23:14:46  <ThomasWaldmann> [[Icon: macro_Icon() takes exactly 2 arguments (1 given)]]     <-- off by one from the user perspective
2007-07-22T23:15:25  <grzywacz> Now now now.
2007-07-22T23:15:31  <grzywacz> xmlrpcbot i18n is tricky.
2007-07-22T23:15:51  <grzywacz> xorAxAx, should I make contacts list global, or do all the i18n in xmppbot and report error conditions with commands?
2007-07-22T23:16:03  <grzywacz> I prefer the second solution. >_>
2007-07-22T23:16:05  <xorAxAx> why is there an "or"?
2007-07-22T23:16:12  <xorAxAx> explain the relation
2007-07-22T23:16:38  <grzywacz> Well, I can either make xmppbot's contacts list global, so that xmlrpcbot can get access to language preferences for each jid.
2007-07-22T23:16:39  <grzywacz> OR
2007-07-22T23:17:02  <grzywacz> I can use commands, to tell xmppbot to send a localised message to a targeted recipient.
2007-07-22T23:17:18  <grzywacz> This way contacts remain xmppbot's business only.
2007-07-22T23:17:28  <grzywacz> And it seems cleaner.
2007-07-22T23:17:36  <xorAxAx> yes, of course
2007-07-22T23:17:58  <grzywacz> 'cos my first idea was the global list, but then I've figured out that isn't really that nice.
2007-07-22T23:19:13  <CIA-27> moin: Heinrich Wendel <h_wendel@cojobo.net> * 2638:f82208746f5b 1.7-storage-hwendel/MoinMoin/ (6 files in 4 dirs): fixes around
2007-07-22T23:20:45  <CIA-27> moin: Reimar Bauer <rb.proj AT googlemail DOT com> * 2516:05c9d52dcf5d 1.7/MoinMoin/parser/ (_tests/test_text_moin_wiki.py text_moin_wiki.py): text_moin_wiki:fixed wrong pre section, skipped a test because not implemented yet
2007-07-22T23:29:28  <dreimark> ThomasWaldmann: [[Hits: macro_Hits() takes at most 3 arguments (20 given)]]
2007-07-22T23:29:39  <dreimark> at most 2 not 3
2007-07-22T23:30:45  <dreimark> http://en.wikipedia.org/wiki/Special:Search?go=Go&search=Hits(,,,)
2007-07-22T23:30:51  <dreimark> [ [Hits(,,,)] ]
2007-07-22T23:31:05  <dreimark> [ [Hits: macro_Hits() takes at most 3 arguments (5 given)] ]
2007-07-22T23:40:02  <ThomasWaldmann> yeah, if you don't handle it in the macro, it is a python error that is +1 because of 1st parameter to macro call
2007-07-22T23:40:19  <xorAxAx> johill: thats guly
2007-07-22T23:40:25  <xorAxAx> ugly even
2007-07-22T23:40:58  <ThomasWaldmann> we could do some surgery on the error msg X)
2007-07-22T23:41:35  <ThomasWaldmann> wtf is macro.TemplateList good for? at least it doesn't do what one thinks....
2007-07-22T23:44:13  <dreimark> strange name
2007-07-22T23:46:18  <ThomasWaldmann> it is rather a RegExPagenameList
2007-07-22T23:50:15  <dreimark> [ [Hits(filter=VIEWPAGE,filter=VIEWPAGE)] ] should fail too
2007-07-22T23:58:34  <dreimark> more ugly [ [Hits(filter=VIEWPAGE,filter=SAVEPAGE,filter=SAVEPAGE,filter=VIEWPAGE)] ]

MoinMoin: MoinMoinChat/Logs/moin-dev/2007-07-22 (last edited 2007-10-29 19:08:45 by localhost)