Thanks for the information about pywikipedia. Python is my favorite
programming language. :)
My parser contains a lex file for scanning and a C++ file for parsing.
Just like you, I wanted to use a grammar file for parsing, but it
turned out to be difficult, so I resorted to manually write a parser
to process the tokens returned by the scanner. This part is working
now for basic mediawiki markups listed on
http://www.mediawiki.org/wiki/Help:Formatting including links, images
and tables, although the exact URL to produce for links and images may
not be correct yet.
I'll find a server to post them later today.
cheers,
Ping
On 8/2/07, Merlijn van Deen <valhallasw(a)arctus.nl> wrote:
> > "Ping Yeh" <ping.nsr.yeh(a)gmail.com> wrote:
> > So, with an html
> > formatter and a mediawiki parser (a draft version already exist), it
> > can already show HTML for mediawiki contents.
>
> For your information, and possibly some inspiration; I have been working
> on a python-based wikitext parser to be used with pywikipedia; the source
> is available at
> http://svn.wikimedia.org/viewvc/pywikipedia/trunk/pywikiparser/ ; How far
> has your parser been developed already, and how does it parse? I have been
> trying to fit wikitext into a grammar parseable by an LL(k) parser, but
> this was not as easy as it looked. Hence, I have started building a parser
> form scratch.
>
> > I'll attend the Hacking Days Extra in the afternoon tomorrow. Maybe I
> > can show you what I have so far and get your comments. :)
>
> Unfortunatly, not all of us are at wikimania ;) Have you got some on-line
> resource where we can find more information?
>
> --valhallasw
>
>
> _______________________________________________
> Wikitech-l mailing list
> Wikitech-l(a)lists.wikimedia.org
> http://lists.wikimedia.org/mailman/listinfo/wikitech-l
>
yurik(a)svn.wikimedia.org wrote:
> + if ($wgUser->isBlocked()) {
> + $id = $wgUser->blockedBy();
> + $vals['blockedby'] = is_numeric($id) ? User::whoIs($id) : $id;
This seems a little weird here... From what I can see, User::blockedBy()
should always return a user ID, never a name, so the is_numeric() check
shouldn't be needed here.
Secondly, the check would get false results if it did return a name
sometimes -- legitimate usernames might match is_numeric(), and you'd
then load a different, wrong username.
-- brion vibber (brion @ wikimedia.org)
Hi all,
After a brief planning discussion with Tim a few days ago, I'm
re-working the Title::userCan method. Once I'm done, and after code
review, on failure, the method will return, instead of false (although
that will still be returned for unexplainable events) an array
consisting of a message name, followed by a number of parameters which
are the arguments to the message. For example, being unable to edit
due to a block will return:
array ( $block->mAuto ? 'autoblockedtext' : 'blockedtext', $id,
$reason, $ip, $name, $blockid, $blockExpiry, $intended );
And being unable to edit due to cascading protection will return:
array( 'cascadeprotected', array_len( $cascadingSources ), $pages );
The purpose of these changes is to streamline the way access failures
are reported to the client. Currently, if userCan returns false, a
correct error message is guessed by the calling method. After these
changes, the message will be generated when the access failure is
detected. In addition, this method will be the only method that needs
to be called in order to ascertain whether a user can perform a
specific action on a specific page: block checks, readonly checks, and
other stuff is being folded into it, too.
This alteration is part of an effort I'm putting in to clean up and
streamline the permissions system.
Questions, comments, objections, abuse, and other feedback is welcome,
and will be appreciated.
Andrew