Kent Johnson wrote:
> Ognen Duzlevski wrote:
>> I appreciate your comments. Basically, the reason why this code generator
>> exists is the fact that I do not want to hard-code the resulting xml in
>> any way. The users of the web/db framework of which this solution is part of
>> might like the "we
Kent Johnson <[EMAIL PROTECTED]> wrote:
> Ognen Duzlevski wrote:
> > Can you suggest a better approach or did you already do that and I just
> > missed
> > it? :)
> With the above definitions, an equivalent class is created by calling
> page = classFactory( 'page', { 'name' : None, 'caption': No
Ognen Duzlevski wrote:
> Volker Grabsch <[EMAIL PROTECTED]> wrote:
>>I'm sure you could replace 2/3 of your code with something much simpler
>>(and shorter!) just by not inventing a new language and using the power
>>of Python instead.
>
>
> Hi Volker,
>
> I appreciate your comments. Basically,
Volker Grabsch <[EMAIL PROTECTED]> wrote:
> Ognen Duzlevski wrote:
> > Kent Johnson <[EMAIL PROTECTED]> wrote:
> >> Ognen Duzlevski wrote:
> >> > Say I got "page" as a string. How do I go about
> >> > instantiating a class from this piece of information? To make it
> >> > more obvious how do I cr
Ognen Duzlevski wrote:
> Kent Johnson <[EMAIL PROTECTED]> wrote:
>> Ognen Duzlevski wrote:
>> > Say I got "page" as a string. How do I go about
>> > instantiating a class from this piece of information? To make it
>> > more obvious how do I create the page() class based on the "page"
>> > string
Kent Johnson <[EMAIL PROTECTED]> wrote:
> Ognen Duzlevski wrote:
> > Say I got "page" as a string. How do I go about
> > instantiating a class from this piece of information? To make it
> > more obvious how do I create the page() class based on the "page"
> > string I have?
> Use getattr().
H
Ognen Duzlevski wrote:
> I have a parser that will go through the language definition
> file and produce the following as a separate .py file:
>
> class page(object):
> def __init__():
> self.name = None
> self.caption = None
> self.functions = []
>
Ognen Duzlevski wrote:
> Larry Bates <[EMAIL PROTECTED]> wrote:
>>> Now I want to use something like xml.dom.minidom to "parse" the
>>> .xml file into a set of classes defined according to the "language
>>> definition" file. The parse() method from the xml.dom.minidom
>>> package will return a d
Larry Bates <[EMAIL PROTECTED]> wrote:
> > Now I want to use something like xml.dom.minidom to "parse" the
> > .xml file into a set of classes defined according to the "language
> > definition" file. The parse() method from the xml.dom.minidom
> > package will return a document instance and I ca
Ognen Duzlevski wrote:
> Hi, I have a "language definition" file, something along the lines of:
>
> page ::
> name : simple
> caption : simple
> function : complex
>
> function ::
> name : simple
> code : simple
>
> component ::
> name : simple
> type :
Hi, I have a "language definition" file, something along the lines of:
page ::
name : simple
caption : simple
function : complex
function ::
name : simple
code : simple
component ::
name : simple
type : simple
dataset : complex
11 matches
Mail list logo