2006-07-05T00:25:38  <ThomasWaldmann> mvirkkil: pep8 describes codingstyle. e.g. x += 1 (not x+=1) or fn(a, b, c) (not fn(a,b,c))
2006-07-05T00:26:12  <ThomasWaldmann> ah kepplar was faster
2006-07-05T00:27:12  <Kepplar> ThomasWaldmann: ive just bounced the metaproblem off a guru python engineer i know
2006-07-05T00:27:16  <Kepplar> and solved it
2006-07-05T00:27:21  <Kepplar> so tomorrow ill impliment
2006-07-05T00:27:22  <Kepplar> it
2006-07-05T00:27:28  <Kepplar> (see change log for issue)
2006-07-05T09:14:53  <mvirkkil> ThomasWaldmann: I made the changes.
2006-07-05T15:00:40  <mvirkkil> rst-parser sucks :(
2006-07-05T15:01:06  <xorAxAx> mvirkkil: yep
2006-07-05T15:01:14  <xorAxAx> mvirkkil: we will rewrite it in this week :)
2006-07-05T15:03:11  <mvirkkil> xorAxAx: Really??
2006-07-05T15:03:29  <xorAxAx> mvirkkil: yes, if felix doesnt vanish before the sprint starts :)
2006-07-05T15:03:53  <mvirkkil> xorAxAx: That's pretty cool. Would you mind making "admonition" in to a formatter method?
2006-07-05T15:04:06  <xorAxAx> mvirkkil: what kind of semantics do you have in mind?
2006-07-05T15:04:31  <mvirkkil> xorAxAx: def admonition(self, on, role="tip", title=None, **kw)
2006-07-05T15:04:53  <xorAxAx> mvirkkil: no. of roles should be settled upon first
2006-07-05T15:04:54  <mvirkkil> where it's first called with on=1 and then the contents go through the regular route, and then you call on=0
2006-07-05T15:05:04  <xorAxAx> i mean the kind of ...
2006-07-05T15:05:20  <mvirkkil> xorAxAx: yup
2006-07-05T15:05:40  <mvirkkil> xorAxAx: rst has one set, and docbook has another.
2006-07-05T15:05:41  <xorAxAx> and it should be neither an html nor rst interface, but more flexible :)
2006-07-05T15:05:46  <xorAxAx> mvirkkil: ah, cool
2006-07-05T15:05:55  <xorAxAx> mvirkkil: so have a short wiki page thats maps them :)
2006-07-05T15:06:05  <xorAxAx> just to give an implementation hint
2006-07-05T15:06:56  <mvirkkil> xorAxAx: putting admonitions as a formatter-method where the contents can be just about anything is as flexible as it gets ;)
2006-07-05T15:07:04  <xorAxAx> hehe
2006-07-05T15:07:19  <xorAxAx> so do you know any other interface change suggestions that we could try in the next days?
2006-07-05T15:10:19  <mvirkkil> hmm.. not at the moment. I'll think about it
2006-07-05T15:11:02  <xorAxAx> nothing that might be advantagerous for the docbook parsers?
2006-07-05T15:11:57  <mvirkkil> well, the "include_into" thingie is something that feels a bit cludgy at the moment.
2006-07-05T15:12:02  <mvirkkil> it works as follows:
2006-07-05T15:13:42  <mvirkkil> the new insert macro has a into argument which takes a string. It then checks if the formatter has an include_into method. If it does, it gets called passing the argument along. Then it does the include as normal, and then it "closes" the include_into (on=0).
2006-07-05T15:14:03  <mvirkkil> if the formatter doesn't support include_into, it outputs a link to the page instead.
2006-07-05T15:14:42  <mvirkkil> so Insert(NameOfPage, into="chapter") will result in a chapter with the docbook formatter but with a link to NameOfPage with any other formatter.
2006-07-05T15:15:28  <mvirkkil> the Insert macro can also take a title, which will override the "NameOfPage" when generating the link text. The docbook formatter uses the title as the chapters title.
2006-07-05T15:15:34  <xorAxAx> and "chapter" refers to the included or the includee page?
2006-07-05T15:15:46  <mvirkkil> no
2006-07-05T15:16:44  <mvirkkil> it is more like: in to my current page (called CurrentPage), put the included page in to the element called "chapter".
2006-07-05T15:17:32  <mvirkkil> So CurrentPage should get an elemnt called chapter, which will contain the page that is to be included. In docbook it means that the page to be included will be put inside <chapter></chapter>
2006-07-05T15:17:53  <mvirkkil> in html, since there is no concept of chapters, it will be output as:
2006-07-05T15:17:53  <xorAxAx> ah, so this will just work with formatters that have large internal state (but thats ok currently)
2006-07-05T15:18:01  <xorAxAx> so i am wondering if that link makes any sense
2006-07-05T15:18:11  <mvirkkil> chapter: <a href="url>titletext</a>
2006-07-05T15:18:36  <xorAxAx> ah, thats cool
2006-07-05T15:19:00  <mvirkkil> I'm not a huge fan of the approach, but I couldn't find a better one.
2006-07-05T15:20:19  <xorAxAx> its ok for the current model IMHO
2006-07-05T15:20:21  <mvirkkil> Starting at line 127: http://hg.thinkmo.de/moin/1.6-docbook-mvirkkil?f=9fa31589f151;file=MoinMoin/macro/Insert.py
2006-07-05T15:20:43  <mvirkkil> Thats the code. As you can see it's quite simple fallback method.
2006-07-05T15:20:51  <mvirkkil> But this all should get documented :O)
2006-07-05T15:20:56  <xorAxAx> can you please move the getattr logic into the formatte rbase?
2006-07-05T15:21:08  <xorAxAx> so it works for all callers ...
2006-07-05T15:21:36  <mvirkkil> xorAxAx: Ok. I'm doing this with adding admonitions too.
2006-07-05T15:21:40  <xorAxAx> ok
2006-07-05T15:22:09  <mvirkkil> xorAxAx: But when you write the admonitions code, I'll change it not to check and not to do a "fallback"
2006-07-05T15:22:10  <Kepplar> hey
2006-07-05T15:22:25  <mvirkkil> xorAxAx: http://moinmoin.wikiwikiweb.de/Admonitions
2006-07-05T15:29:41  <mvirkkil> xorAxAx: Hmm.. Collecting resources would also be a nice feture. Stuff like collecting all links, images, "chapters" etc.
2006-07-05T15:30:03  <xorAxAx> mvirkkil: the base formatter should do that maybe ...
2006-07-05T15:30:32  <mvirkkil> xorAxAx: Maybe as a list of tuples, where the first one would be a _complete_ url, and the second one how it was used (link, image, embedded-object or what ever).
2006-07-05T15:30:38  <mvirkkil> xorAxAx: Yeah.. Maybe.
2006-07-05T15:31:01  <mvirkkil> xorAxAx: This isn't possible with the old include macro.
2006-07-05T15:31:15  <xorAxAx> i asked a question in the wiki about the include macro ...
2006-07-05T15:31:32  <xorAxAx> about its disadvantages ... if there arent any then we could merge it maybe
2006-07-05T15:31:35  <mvirkkil> xorAxAx: The main reason why I wrote the Insert macro, though I did find a workaround for docbooks, since I can just walk the tree.
2006-07-05T15:31:41  <xorAxAx> did you write some tests for the new one? :)
2006-07-05T15:31:49  <mvirkkil> xorAxAx: Nope :O)
2006-07-05T15:38:29  <mvirkkil> xorAxAx: I listed missing features. This list is based on the Include macro documentation.
2006-07-05T15:39:09  <mvirkkil> xorAxAx: Oh, and the old include macro sorted the results by default, mine only sorts them if the sort= argument is specified.
2006-07-05T15:40:03  <mvirkkil> And the order of the unnamed parameters differs a bit.
2006-07-05T15:40:15  <xorAxAx> can you fix that order? i think sorting is ok
2006-07-05T15:41:37  <mvirkkil> I _really_ don't like the old "heading" stuff, where you needed empty , , areas.
2006-07-05T15:41:45  <mvirkkil> as parameters.
2006-07-05T15:42:20  <xorAxAx> so its not the order but just one missing param?
2006-07-05T15:42:23  <mvirkkil> I'm parsing args with the ParamterParser, so I don't even think its possible to support that.
2006-07-05T15:42:46  <mvirkkil> xorAxAx: yeah.
2006-07-05T15:43:07  <mvirkkil> xorAxAx: At least according to the docs, only the two first arguments are order specific.
2006-07-05T15:43:14  <xorAxAx> WTH? :)
2006-07-05T15:43:25  <xorAxAx> ah, and now its only one?
2006-07-05T15:43:41  <mvirkkil> xorAxAx: yeah, pagename must bee first.
2006-07-05T15:44:00  <mvirkkil> xorAxAx: the rest are specified usually by args in the form from="here"
2006-07-05T15:44:06  <xorAxAx> ok
2006-07-05T15:44:20  <mvirkkil> xorAxAx: My version doesn't require them, if it's put in the right order.
2006-07-05T15:44:28  <mvirkkil> xorAxAx: But we could just not document that ;)
2006-07-05T15:44:41  <mvirkkil> look at the examples http://moinmoin.wikiwikiweb.de/HelpOnMacros/Include
2006-07-05T15:45:18  <mvirkkil> xorAxAx: The second arg field is left empty like that.. I think the heading argument is totally useless, but here its a mandatory argument :/
2006-07-05T15:45:54  <xorAxAx> LOL
2006-07-05T15:46:02  <xorAxAx> have you looked at the code how its used?
2006-07-05T15:46:42  <mvirkkil> xorAxAx: I looked at the code while I wrote the newer version, even copied some stuff from there, but I can't remember the specifics and there were areas I didn't even understand.
2006-07-05T15:47:06  <mvirkkil> copied some stuff==copied some lines
2006-07-05T15:48:45  <mvirkkil> hmm..
2006-07-05T15:48:52  <xorAxAx> mvirkkil: heading is an important feature
2006-07-05T15:48:56  <xorAxAx> it mainly does a TOC
2006-07-05T15:49:07  <xorAxAx> nothing more or less
2006-07-05T15:49:23  <mvirkkil> xorAxAx: according to the docs it doesn't.
2006-07-05T15:49:48  <xorAxAx> the code is the docs, first principle of moinmoin's code quality manifesto
2006-07-05T15:49:55  * xorAxAx ducks :)
2006-07-05T15:50:02  * mvirkkil swings the bat
2006-07-05T15:50:07  <xorAxAx> i have to move to the lightning talk room now, be right back
2006-07-05T15:50:10  <mvirkkil> argh.. too slow ;)
2006-07-05T15:56:18  <mvirkkil> xorAxAx: Ahh.. It does two different things depending on what is calling it.
2006-07-05T15:56:51  <mvirkkil> xorAxAx: I could implement the functionality as intended for wikiusers, ie. as described on http://moinmoin.wikiwikiweb.de/HelpOnMacros/Include
2006-07-05T15:58:08  <mvirkkil> xorAxAx: Doing what the documentation says Include should do is no problem. But I will not waste energy reverse engeneering the old behaviour.
2006-07-05T16:02:49  <xorAxAx> mvirkkil: hehe, ok
2006-07-05T16:04:35  <mvirkkil> xorAxAx: But parsing the args has some limitations.
2006-07-05T16:05:08  <mvirkkil> xorAxAx: Currently just specifying titlesonly as an arg, will make it titlesonly. This will need to be titlesonly=True in the fututer.
2006-07-05T16:05:30  <mvirkkil> xorAxAx: And I don't know what editlink should do. I could just copy the code over, but...
2006-07-05T16:05:59  <xorAxAx> it shows a link that can be used to edit the included page
2006-07-05T16:07:04  <mvirkkil> but Iinc_page.link_to(request, '[%s]' % (_('edit'),), css_class="include-edit-link", querystr={'action': 'edit', 'backto': request._Include_backto}),
2006-07-05T16:07:16  <mvirkkil> but I'm not sure I understand: inc_page.link_to(request, '[%s]' % (_('edit'),), css_class="include-edit-link", querystr={'action': 'edit', 'backto': request._Include_backto}),
2006-07-05T16:07:44  <mvirkkil> hmm.. actually, maybe I do.
2006-07-05T16:07:50  <mvirkkil> SO, should I add it?
2006-07-05T16:08:32  <xorAxAx> is it documented?
2006-07-05T16:08:51  <mvirkkil> "add a footer with links to the included page, both normal and edit (optional, available since MoinMoin 1.3.4)."
2006-07-05T16:09:02  <mvirkkil> not sure if that's correct though...
2006-07-05T16:10:09  <mvirkkil> Seems it counts on css to put it in the "footer"
2006-07-05T16:11:10  <mvirkkil> maybe we should automatically generate edit links for includes, unless "suppresseditlink=False" or something.
2006-07-05T16:12:02  <mvirkkil> when we aren't in "print mode", that is.
2006-07-05T16:13:29  <mvirkkil> hmm.. print mode doesn't even work correctly when using "action=show&mimetype=text/docbook" since the Include-macro only checks if we are either action=print or action=format.
2006-07-05T16:14:13  <mvirkkil> I'm feeling less and less inclined to closely mimic the old macro'
2006-07-05T16:16:22  <xorAxAx> hehe, good point
2006-07-05T17:20:37  <mvirkkil> Now what in the world should happen when I do that editlink stuff?
2006-07-05T17:27:04  <xorAxAx> you as in you having docbook?
2006-07-05T17:28:26  <mvirkkil> no.
2006-07-05T17:28:34  <mvirkkil> I was silly and not appending formatter output.
2006-07-05T17:28:43  <mvirkkil> (since docbook doesn't output anything)
2006-07-05T17:28:47  <mvirkkil> but html does.
2006-07-05T17:32:27  <xorAxAx> so do you have a question left?
2006-07-05T17:33:12  <mvirkkil> xorAxAx: I've implemented everything the old Include macro did (except the weird, internal, TOC stuff)
2006-07-05T17:33:32  <mvirkkil> xorAxAx: But it makes the Insert macro quite large, and even somewhat complex.
2006-07-05T17:34:21  <xorAxAx> what does it make complex?
2006-07-05T17:34:45  <mvirkkil> Do you mean what makes it complex?
2006-07-05T17:34:52  <mvirkkil> Just the amount of functionality.
2006-07-05T17:36:14  <mvirkkil> May I paste the description of all the arguments?
2006-07-05T17:36:22  <mvirkkil> 9 lines
2006-07-05T17:37:08  <xorAxAx> mvirkkil: no, i dont mean that because thats incorrect english :)
2006-07-05T17:37:21  <xorAxAx> umm, you did inthe wiki already, right?
2006-07-05T17:37:43  <mvirkkil> xorAxAx: yeah-
2006-07-05T17:37:56  <mvirkkil> xorAxAx: I haven't pushed it yet.
2006-07-05T17:37:59  <mvirkkil> or committed.-
2006-07-05T17:38:31  <xorAxAx> commit early and often :)
2006-07-05T17:39:10  <mvirkkil> xorAxAx: So you think the functionality should go in?
2006-07-05T17:39:27  <xorAxAx> let me have another look
2006-07-05T17:40:08  <xorAxAx> editlink is not much code ...
2006-07-05T17:40:27  <xorAxAx> heading either, right?
2006-07-05T17:40:32  <mvirkkil> xorAxAx: http://pastebin.ca/79596
2006-07-05T17:40:33  <xorAxAx> if it is just one heading
2006-07-05T17:40:43  <mvirkkil> no, it's just the complexity of all the args.
2006-07-05T17:40:53  <mvirkkil> each feature is quite simple alone.
2006-07-05T17:42:24  <xorAxAx> oh, the args
2006-07-05T17:42:42  <xorAxAx> hmm, that should not be an issue in a perfect world
2006-07-05T17:42:49  <xorAxAx> and i cannot help you here without seeing the code
2006-07-05T17:42:50  <mvirkkil> xorAxAx: Heres the whole file http://pastebin.ca/79598
2006-07-05T17:43:05  <xorAxAx> please commit/push, i cannot connect to that host from here
2006-07-05T17:44:37  <mvirkkil> xorAxAx: done
2006-07-05T17:46:38  <mvirkkil> http://hg.thinkmo.de/moin/1.6-docbook-mvirkkil?fd=4c4dd3944af3;file=MoinMoin/macro/Insert.py
2006-07-05T17:46:53  <mvirkkil> http://hg.thinkmo.de/moin/1.6-docbook-mvirkkil?f=26af38cdd466;file=MoinMoin/macro/Insert.py
2006-07-05T17:48:26  <xorAxAx> i dont need the links :)
2006-07-05T17:49:17  <xorAxAx> so the parameterparser is the problem?
2006-07-05T17:49:53  <mvirkkil> xorAxAx: No, there is no real problem, except maintainability of a macro that does n+1 things.
2006-07-05T17:50:11  <xorAxAx> thats true, but theres the compat issue
2006-07-05T17:51:00  <mvirkkil> xorAxAx: Well, yeah. That's the problem ;)
2006-07-05T17:51:19  <mvirkkil> and my version isn't 100% compatible, even with args.
2006-07-05T17:51:31  <mvirkkil> now it just has all the features the old one had.
2006-07-05T17:51:57  <xorAxAx> it is not compatible?
2006-07-05T17:52:01  <mvirkkil> (plus at least a few new bugs I'm tracking down)
2006-07-05T17:52:10  <xorAxAx> write tests first :)
2006-07-05T17:53:10  <mvirkkil> xorAxAx: I made it output edit links on html by default, and it now has an arg called noedit instead.
2006-07-05T17:53:38  <mvirkkil> xorAxAx: But the titlesonly arg is something I cannot support as it was in the old Include macro.
2006-07-05T17:54:04  <xorAxAx> ugh, thats incompatible and will annoy users i guess
2006-07-05T17:54:17  <mvirkkil> Or I can support the functionality, but not the way it is called.
2006-07-05T17:54:47  <xorAxAx> its mainly about calling the toc macro on another page
2006-07-05T17:54:53  <xorAxAx> right?
2006-07-05T17:54:57  <mvirkkil> xorAxAx: Re annoying users: very few people use the Include macro, and the changes on how spaces and underlines are handled is going to annoy users a lot more ;)
2006-07-05T17:55:06  <mvirkkil> xorAxAx: no
2006-07-05T17:55:19  <xorAxAx> the include macro is the most important one :)
2006-07-05T17:55:23  <xorAxAx> spaces and underline?
2006-07-05T17:55:29  <xorAxAx> (ok, besides the TOC one)
2006-07-05T17:55:42  <mvirkkil> Iclude(pagename, titlesonly) needs to be Insert(pagename, titlesonly=True)
2006-07-05T17:56:12  <mvirkkil> xorAxAx: Yeah, it used to be that spaces in a link got replaced by underlines, but now they are replaced by %20 instead
2006-07-05T17:56:51  <mvirkkil> So links like ["A page of mine"] used to go to a page called A_page_of_mine but now go to a page called A%20page%20of%20mine
2006-07-05T17:56:59  <xorAxAx> right
2006-07-05T17:57:06  <xorAxAx> thomas wants to write a converter :)
2006-07-05T17:58:04  <mvirkkil>  But like I say, the call Iclude(PageName, titlesonly) needs to be changed to something like Insert(pagename, titlesonly=True)
2006-07-05T18:00:12  <xorAxAx> thats a parser issue
2006-07-05T18:01:06  <mvirkkil> you mean an argument parser issue?
2006-07-05T18:01:23  <xorAxAx> yes
2006-07-05T18:02:10  <mvirkkil> xorAxAx: Well, maybe.
2006-07-05T18:02:22  <mvirkkil> xorAxAx: But it's still something I won't fix.
2006-07-05T18:02:36  <mvirkkil> partly because I have no great ideas on how to fix it.
2006-07-05T18:03:04  <xorAxAx> the semantics are clear no so you seemed to be blocked by the arg parser
2006-07-05T18:03:11  <xorAxAx> s/no/&w/
2006-07-05T18:07:11  <mvirkkil> Well, I feel I'm more blocked by the fact that you want 100% compatibility.
2006-07-05T18:07:46  <xorAxAx> i dont want to, but you skipped 4 features
2006-07-05T18:07:46  <mvirkkil> and that the original design sucked.
2006-07-05T18:07:54  <xorAxAx> thats another issue :)
2006-07-05T18:07:54  <mvirkkil> what 4?
2006-07-05T18:08:04  <xorAxAx> the list bullets you used in the wiki :)
2006-07-05T18:08:06  <mvirkkil> ah.
2006-07-05T18:08:41  <mvirkkil> Well, yeah. But now I've got feature parity, just not 100% identical.
2006-07-05T18:09:00  <mvirkkil> I just think adding an edit link by default is nices.
2006-07-05T18:09:02  <mvirkkil> I just think adding an edit link by default is nicer.
2006-07-05T18:09:16  <xorAxAx> but its incompatible :)
2006-07-05T18:10:33  <xorAxAx> maybe i will have time to tackle that in the next days
2006-07-05T18:10:37  <mvirkkil> Oh, by the way, the old way would have been:  Iclude(PageName, ,titlesonly) and now it no longer needs the stupid empty comma stuff.
2006-07-05T18:10:59  <mvirkkil> ;)
2006-07-05T18:12:45  <mvirkkil> xorAxAx: If you are going to hack on ParameterParser in wikiutils, _please_ use my version instead of the one in trunk. Mine is better :)
2006-07-05T18:19:32  <starshine> I like the plain * for bullets
2006-07-05T18:19:55  <starshine> having to remember to prefix them by special number of spaces (in a certain otherwiki) is really annoying.
2006-07-05T19:56:59  <ThomasWaldmann> moin
2006-07-05T20:01:32  <ThomasWaldmann> Kepplar: "is None" and not using "== True/False" would be really nice patterns to remember.
2006-07-05T20:11:05  <ThomasWaldmann> Kepplar: and don't process mimetype strings yourself, use wikiutil.MimeType
2006-07-05T21:39:05  <Kepplar> hi
2006-07-05T21:39:12  <Kepplar> line number and module is helpful =)
2006-07-05T21:41:57  <Kepplar> plus mimetype is storage
2006-07-05T22:57:48  <ThomasWaldmann> use grep, it is more than one place iirc
2006-07-05T22:58:57  <ThomasWaldmann> and use the stuff we already have for mimetype instead of reinventing the wheel
2006-07-05T22:59:23  <ThomasWaldmann> Kepplar: btw, do you edit with Vim?
2006-07-05T23:08:41  <Kepplar> ThomasWaldmann: nope
2006-07-05T23:08:54  <ThomasWaldmann> pity
2006-07-05T23:09:06  <Kepplar> ThomasWaldmann: the mechanism ive implimented is faster and more elegent I Blieve
2006-07-05T23:09:14  <Kepplar> plus it would need to be migrated to storage anyway
2006-07-05T23:09:43  <ThomasWaldmann> we need mimetypes not only in storage
2006-07-05T23:09:49  <Kepplar> where else?
2006-07-05T23:10:00  <Kepplar> storage is the object representation of data that is stored
2006-07-05T23:10:04  <Kepplar> which includes mimetype
2006-07-05T23:14:20  <ThomasWaldmann> we have output format as mimetype
2006-07-05T23:15:50  <Kepplar> which should access the pages mimtype through the storage layer
2006-07-05T23:21:14  <ThomasWaldmann> i am not talking about item mimetype
2006-07-05T23:27:57  <Kepplar> ....
2006-07-05T23:27:58  <Kepplar> ?
2006-07-05T23:30:26  <ThomasWaldmann> the output mimetype determines the formatter
2006-07-05T23:35:05  <Kepplar> oh yea sure
2006-07-05T23:35:09  <Kepplar> ive been thinking about that
2006-07-05T23:35:16  <Kepplar> maybe passing it to the revision object would work?
2006-07-05T23:37:19  <ThomasWaldmann> that has nothing to do with the item object
2006-07-05T23:38:14  <Kepplar> hmm thats a tricky one
2006-07-05T23:38:27  <Kepplar> as the item object is the moin representation of a given page or whatever
2006-07-05T23:38:38  <Kepplar> thus it calls it or passes itself to the item?
2006-07-05T23:40:30  <ThomasWaldmann> that stuff will be where the formatter is initialized

MoinMoin: MoinMoinChat/Logs/moin-dev/2006-07-05 (last edited 2007-10-29 19:07:54 by localhost)