[moin-user] ListPages macro doesn't work

Lars Kruse lists at sumpfralle.de
Sun Sep 3 08:33:45 EDT 2017


Hello Volker,


Am Sun, 03 Sep 2017 13:26:37 +0200
schrieb Volker Wysk <post at volker-wysk.de>:

> Thanks. I've figured it out.

good!
(It is always a nice habit to answer your own question, in order to 
save the time of other people willing to help you solving your issue.)


> BUT: It's broken nonetheless. The search order doesn't treat German 
> umlauts adequately. They all go to the top. And it treats upper/lower case 
> specially. 
> First all the page titles beginning with upper case letters appear, 
> then at the bottom the lower case ones appear.

"broken" is quite a heavy word.
Maybe you meant "not suitable for my purpose"?

Regarding the locale-aware sorting: this should probably depend on the 
configured locale of the user requesting the page. I am not sure, if 
this information is available in the context of a macro exection.
Anyone knows better?

upper/lower case: you seem to expect a case-insensitive sort order.
This can be accomplished by changing both "sort" calls from ".sort()" to
".sort(key=str.lower)".
Please upload this changed version of the macro, if you think that this is a
reasonable expectation for most users of this macro.


> I'm wondering how this could pass unnoticed, before publishing ListPages in 
> the macro market.

The macro market is organized like a wiki: contributors are free to improve and
upload useful code without a formal review procedure.

Cheers,
Lars


More information about the moin-user mailing list