You can find examples of using parseString in apps.py.

simpleparse is there for debugging purposes basically. It shows you the  
parse output on the screen, as well as returning the parse tree object.  
Unfortunately, the printed output currently does not include a lot of  
useful information, like link targets, which is - I presume - what you  
mean by 'loses "Abc"'.

You can recover the caption data with something like:
>>> import mwlib.uparser
>>> pt = mwlib.uparser.simpleparse("[[Abc|Cde]]")
  Article 'unknown': 1 children
      Paragraph '': 1 children
          ArticleLink '': 1 children
              'Cde'
>>> pt.children[0].children[0]
ArticleLink '': 1 children
>>> pt.children[0].children[0].target
'Abc'

And no, mwlib does not require an SQL database. It allows you to store the  
Wiki in a few forms:
- accessing the Mediawiki API for an online wiki
- accessing an online wiki directly
- a ZIP file of article sources
- a CDB which simply maps article titles to sources

mwlib provides ways to construct the latter two options.

Good luck!

- Joel



On Mon, 03 Nov 2008 06:30:49 +1100, [EMAIL PROTECTED]  
<[EMAIL PROTECTED]> wrote:

>
> Can I find example of using parseString?
> Or some sourcecode, using mwlib?
>
> Function simpleparse works good, it is nearly what I want, but
> simpleparse("[[Abc|Cde]]") loses "Abc", and there is comment "dont use
> it".
>
> parseString accept "wikidb" as one of its arguments. Is it necessary
> for using mwlib to have SQL database, built in rules of mwlib? Can I
> find somewhere definition of parseString arguments  or maybe an
> example.
> >



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"mwlib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/mwlib?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to