Thread: [pygccxml-development] Recent changes
Brought to you by:
mbaas,
roman_yakovenko
From: Roman Y. <rom...@gm...> - 2006-05-02 05:39:58
|
Hi. Last week I work on re-factoring. Code that deal with exposing functions and operators was not as good, as I want. It means, that it was very difficult to read and understand it. So I fix it. There are few nice side effects and one not= so. 1. module_creator.creator_t class is now simpler that it was. 2. decl_wrapper_t class has new functionality: exportable - boolean property, that tells user whether this declaration can be exported to Python or not why_not_exportable - function, that will explain the reason why the declaration can not be exported. Sometimes link to the relevant piece of documentation will be provided. 3. function_t and function_wrapper_t code creators are deleted. 4. There are new code creators: free_function_t mem_fun_t mem_fun_pv_t mem_fun_pv_wrapper_t mem_fun_v_t mem_fun_v_wrapper_t mem_fun_protected_t mem_fun_protected_wrapper_t mem_fun_protected_s_t mem_fun_protected_s_wrapper_t mem_fun_protected_v_t mem_fun_protected_v_wrapper_t mem_fun_protected_pv_t mem_fun_protected_pv_wrapper_t mem_fun_private_v_wrapper_t mem_fun_private_pv_wrapper_t This approach is much better. 5. New bugs! Please test py++. 6. I did some changes to allow easy configuration of pygccxml/py++ unittest= s. For pygccxml, please take a look on pygccxml_dev/unittests/autoconfig.p= y. For py++, please take a look on pyplusplus_dev/environment.py 7. decl_wrappers.calldef_t has new functionality - overridable ( better name is needed ) Not all virtual functions could be redefined in Python. Functions that returns reference to some object in 99% cases will return reference to local variable, just causing access violation. In case of pure virtual functions, py++ must redefine those functions. In run time user will get nice error with explanation, why he can not redefine the function. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |
From: Matthias B. <ba...@ir...> - 2006-05-02 12:26:23
|
Roman Yakovenko wrote: > 5. New bugs! Please test py++. Maybe here is one, I get the following error when I run my script with latest pyplusplus: File "pypp_setup.py", line 538, in autoArgPolicies if decl.ignore: File ".../pyplusplus/decl_wrappers/decl_wrapper.py", line 67, in _get_ignore return self._ignore or not self.exportable File ".../pyplusplus/decl_wrappers/decl_wrapper.py", line 91, in get_exportable if self._exportable is None: AttributeError: 'constructor_t' object has no attribute '_exportable' - Matthias - |
From: Roman Y. <rom...@gm...> - 2006-05-03 05:18:05
|
On 5/2/06, Matthias Baas <ba...@ir...> wrote: > Roman Yakovenko wrote: > > 5. New bugs! Please test py++. > > Maybe here is one, I get the following error when I run my script with > latest pyplusplus: > > File "pypp_setup.py", line 538, in autoArgPolicies > if decl.ignore: > File ".../pyplusplus/decl_wrappers/decl_wrapper.py", line 67, in > _get_ignore > return self._ignore or not self.exportable > File ".../pyplusplus/decl_wrappers/decl_wrapper.py", line 91, in > get_exportable > if self._exportable is None: > AttributeError: 'constructor_t' object has no attribute '_exportable' I need help with the problem. I don't understand how it could happen. ( I am sure you are current on the whole source tree, right ? ) It could be nice if you can track this problem. I think this can happen onl= y if decl_wrapper.constructor_t class does not call __init__ methods of its base classes. If you can not, can you send me small piece of code/xml that reproduce the problem. I will try to solve it. Thanks > - Matthias - -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |
From: Matthias B. <ba...@ir...> - 2006-05-03 08:13:19
|
Roman Yakovenko wrote: > On 5/2/06, Matthias Baas <ba...@ir...> wrote: >> Roman Yakovenko wrote: >> > 5. New bugs! Please test py++. >> >> Maybe here is one, I get the following error when I run my script with >> latest pyplusplus: >> >> File "pypp_setup.py", line 538, in autoArgPolicies >> if decl.ignore: >> File ".../pyplusplus/decl_wrappers/decl_wrapper.py", line 67, in >> _get_ignore >> return self._ignore or not self.exportable >> File ".../pyplusplus/decl_wrappers/decl_wrapper.py", line 91, in >> get_exportable >> if self._exportable is None: >> AttributeError: 'constructor_t' object has no attribute '_exportable' > > I need help with the problem. I don't understand how it could happen. > ( I am sure you are current on the whole source tree, right ? ) Yes, but it only struck me when I was reading this. The problem was I forgot to delete the cache before running the new version and the cache still contained the old code.... sorry... After some more modifications here and there I think it works again. One more thing though, in pygccxml/declarations/scopedef.py (and maybe other places as well) there are log messages like the following: utils.logger.info( 'running query: %s and <user defined function>' % str( matcher ) ) These messages are issued as "info" messages and I get flooded with those messages when I run my script. Could those be changed to "debug" messages so that I can disable them without having to disable the entire log stream? - Matthias - |
From: Roman Y. <rom...@gm...> - 2006-05-03 08:25:55
|
On 5/3/06, Matthias Baas <ba...@ir...> wrote: > Roman Yakovenko wrote: > > On 5/2/06, Matthias Baas <ba...@ir...> wrote: > >> Roman Yakovenko wrote: > >> > 5. New bugs! Please test py++. > >> > >> Maybe here is one, I get the following error when I run my script with > >> latest pyplusplus: > >> > >> File "pypp_setup.py", line 538, in autoArgPolicies > >> if decl.ignore: > >> File ".../pyplusplus/decl_wrappers/decl_wrapper.py", line 67, in > >> _get_ignore > >> return self._ignore or not self.exportable > >> File ".../pyplusplus/decl_wrappers/decl_wrapper.py", line 91, in > >> get_exportable > >> if self._exportable is None: > >> AttributeError: 'constructor_t' object has no attribute '_exportable' > > > > I need help with the problem. I don't understand how it could happen. > > ( I am sure you are current on the whole source tree, right ? ) > > Yes, but it only struck me when I was reading this. The problem was I > forgot to delete the cache before running the new version and the cache > still contained the old code.... sorry... :-). Funny. At work I deal a lot with backward computability of saved data. And here I forgot about it completely. Some day I will fix it. It means tha= t we should save some "version" number within archive. > After some more modifications here and there I think it works again. Good > One more thing though, in pygccxml/declarations/scopedef.py (and maybe > other places as well) there are log messages like the following: > > utils.logger.info( 'running query: %s and <user defined function>' % > str( matcher ) ) > > These messages are issued as "info" messages and I get flooded with > those messages when I run my script. Could those be changed to "debug" > messages so that I can disable them without having to disable the entire > log stream? Go ahead. Please fix it and commit the change. > - Matthias - Thanks -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |