Thread: [pygccxml-development] Problems with reading XML files directly
Brought to you by:
mbaas,
roman_yakovenko
From: Matthias B. <ba...@ir...> - 2006-10-22 15:27:46
|
Hi, I just noticed that when I read a XML file directly (by using create_gccxml_fc()), Py++ creates an include directive where it tries to include the XML file (which, of course, won't compile). Another nuisance/bug is that the cache isn't used for XML files, so they get parsed every time. - Matthias - |
From: Roman Y. <rom...@gm...> - 2006-10-22 15:38:12
|
On 10/22/06, Matthias Baas <ba...@ir...> wrote: > Hi, > > I just noticed that when I read a XML file directly (by using > create_gccxml_fc()), Py++ creates an include directive where it tries to > include the XML file (which, of course, won't compile). What reader do you use? project_reader_t or source_reader_t? If first one, than please submit small test case that reproduces the problem. If second one, than it has special function to read xml generated files: read_xml_file > Another nuisance/bug is that the cache isn't used for XML files, so they > get parsed every time. By design. XML file is already a cache. It uses slightly ( :-) ) different format than cPickle. For my projects the difference between XML and cPickle is not that big. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |
From: Matthias B. <ba...@ir...> - 2006-10-22 17:47:04
|
Roman Yakovenko wrote: >> I just noticed that when I read a XML file directly (by using >> create_gccxml_fc()), Py++ creates an include directive where it tries to >> include the XML file (which, of course, won't compile). > > What reader do you use? project_reader_t or source_reader_t? I'm using the project_reader_t class. But I found the mistake, it was my fault, sorry. I forgot that I was passing a list to creator_t.create(). By the way, in create() there's the following 'if' statement right in the beginning: if not decl_headers: self._create_includes() Could the expression be changed from "not decl_headers" to "decl_headers is None"? Because when I pass an empty list to disable the creation of include files the expression "not decl_headers" is True and the includes get generated anyway. >> Another nuisance/bug is that the cache isn't used for XML files, so they >> get parsed every time. > > By design. XML file is already a cache. It uses slightly ( :-) ) > different format than cPickle. > For my projects the difference between XML and cPickle is not that big. In my case, it's 20s for parsing the XML file vs 7s for reading the cache. So I would prefer the cache. :) - Matthias - |
From: Roman Y. <rom...@gm...> - 2006-10-22 17:56:24
|
On 10/22/06, Matthias Baas <ba...@ir...> wrote: > Roman Yakovenko wrote: > >> I just noticed that when I read a XML file directly (by using > >> create_gccxml_fc()), Py++ creates an include directive where it tries to > >> include the XML file (which, of course, won't compile). > > > > What reader do you use? project_reader_t or source_reader_t? > > I'm using the project_reader_t class. But I found the mistake, it was my > fault, sorry. I forgot that I was passing a list to creator_t.create(). > By the way, in create() there's the following 'if' statement right in > the beginning: > > if not decl_headers: > self._create_includes() > > Could the expression be changed from "not decl_headers" to "decl_headers > is None"? Because when I pass an empty list to disable the creation of > include files the expression "not decl_headers" is True and the includes > get generated anyway. Go ahead :-) -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |
From: Brian O. <bob...@ya...> - 2006-10-22 18:41:31
|
I have a c++ class for reading and parsing xml data... Interested? --- Roman Yakovenko <rom...@gm...> wrote: > On 10/22/06, Matthias Baas <ba...@ir...> wrote: > > Roman Yakovenko wrote: > > >> I just noticed that when I read a XML file > directly (by using > > >> create_gccxml_fc()), Py++ creates an include > directive where it tries to > > >> include the XML file (which, of course, won't > compile). > > > > > > What reader do you use? project_reader_t or > source_reader_t? > > > > I'm using the project_reader_t class. But I found > the mistake, it was my > > fault, sorry. I forgot that I was passing a list > to creator_t.create(). > > By the way, in create() there's the following 'if' > statement right in > > the beginning: > > > > if not decl_headers: > > self._create_includes() > > > > Could the expression be changed from "not > decl_headers" to "decl_headers > > is None"? Because when I pass an empty list to > disable the creation of > > include files the expression "not decl_headers" is > True and the includes > > get generated anyway. > > Go ahead :-) > > -- > Roman Yakovenko > C++ Python language binding > http://www.language-binding.net/ > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support > web services, security? > Get stuff done quickly with pre-integrated > technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 > based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > pygccxml-development mailing list > pyg...@li... > https://lists.sourceforge.net/lists/listinfo/pygccxml-development > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Roman Y. <rom...@gm...> - 2006-10-22 18:45:13
|
On 10/22/06, Brian OBrien <bob...@ya...> wrote: > I have a c++ class for reading and parsing xml data... > Interested? I am not sure. First I don't know what additional value your class will provide. And second even if it x20 faster than built-in Python parser( I am sure it is :- ) it will introduce additional dependencies for the project. This is a huge headache for the users. Most of them drop an idea to use Py++ because of this. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |