[Py++] Include additional code with ctypes code generator
Hello, Is there a way to add additional code to the output generated by the ctypes code generator? Specifically, I would like to add some special comments to prevent the autogenerated files being checked by PyLink and PyDev. http://language-binding.net/pyplusplus/documentation/inserting_code.html talks about a add_registration_code method, but it doesn't seem to exist for the ctypes generator: mb = ctypes_module_builder_t( [header_file], symbols_file, gccxml_config=gccxml_cfg ) mb.build_code_creator(shared_library_file) mb.add_registration_code( '#@PyDevCodeAnalysisIgnore', False ) yields AttributeError: 'ctypes_module_builder_t' object has no attribute 'add_registration_code' Best, -Nikolaus -- »Time flies like an arrow, fruit flies like a Banana.« PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C
On Mon, Dec 14, 2009 at 4:00 PM, Nikolaus Rath <Nikolaus@rath.org> wrote:
Hello,
Is there a way to add additional code to the output generated by the ctypes code generator? Specifically, I would like to add some special comments to prevent the autogenerated files being checked by PyLink and PyDev.
http://language-binding.net/pyplusplus/documentation/inserting_code.html talks about a add_registration_code method, but it doesn't seem to exist for the ctypes generator:
mb = ctypes_module_builder_t( [header_file], symbols_file, gccxml_config=gccxml_cfg ) mb.build_code_creator(shared_library_file) mb.add_registration_code( '#@PyDevCodeAnalysisIgnore', False )
yields
AttributeError: 'ctypes_module_builder_t' object has no attribute 'add_registration_code'
Right now - there is no such way. I will try to add this functionality today or tomorrow. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/
On Mon, Dec 14, 2009 at 9:33 PM, Roman Yakovenko <roman.yakovenko@gmail.com> wrote:
On Mon, Dec 14, 2009 at 4:00 PM, Nikolaus Rath <Nikolaus@rath.org> wrote:
Hello,
Is there a way to add additional code to the output generated by the ctypes code generator? Specifically, I would like to add some special comments to prevent the autogenerated files being checked by PyLink and PyDev.
Right now - there is no such way. I will try to add this functionality today or tomorrow.
Nikolaus, can you take a (dummy) generated code and show me where you need to add the code? Thanks -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/
Roman Yakovenko <roman.yakovenko@gmail.com> writes:
On Mon, Dec 14, 2009 at 9:33 PM, Roman Yakovenko <roman.yakovenko@gmail.com> wrote:
On Mon, Dec 14, 2009 at 4:00 PM, Nikolaus Rath <Nikolaus@rath.org> wrote:
Hello,
Is there a way to add additional code to the output generated by the ctypes code generator? Specifically, I would like to add some special comments to prevent the autogenerated files being checked by PyLink and PyDev.
Right now - there is no such way. I will try to add this functionality today or tomorrow.
Nikolaus, can you take a (dummy) generated code and show me where you need to add the code?
At the very beginning would be best, right below '# This file has been generated by Py++'. Best, -Nikolaus -- »Time flies like an arrow, fruit flies like a Banana.« PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C
Roman Yakovenko <roman.yakovenko@gmail.com> writes:
On Mon, Dec 14, 2009 at 4:00 PM, Nikolaus Rath <Nikolaus@rath.org> wrote:
Hello,
Is there a way to add additional code to the output generated by the ctypes code generator? Specifically, I would like to add some special comments to prevent the autogenerated files being checked by PyLink and PyDev.
http://language-binding.net/pyplusplus/documentation/inserting_code.html talks about a add_registration_code method, but it doesn't seem to exist for the ctypes generator:
mb = ctypes_module_builder_t( [header_file], symbols_file, gccxml_config=gccxml_cfg ) mb.build_code_creator(shared_library_file) mb.add_registration_code( '#@PyDevCodeAnalysisIgnore', False )
yields
AttributeError: 'ctypes_module_builder_t' object has no attribute 'add_registration_code'
Right now - there is no such way. I will try to add this functionality today or tomorrow.
Have you had the time to do this yet? If not, I'll just manually add the required lines by rewriting the file after it has been generated. Just let me know. Best, -Nikolaus -- »Time flies like an arrow, fruit flies like a Banana.« PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C
On Tue, Dec 22, 2009 at 8:28 PM, Nikolaus Rath <Nikolaus@rath.org> wrote:
Have you had the time to do this yet? If not, I'll just manually add the required lines by rewriting the file after it has been generated. Just let me know.
Sorry, I forgot about this :-( I suggest you to rewrite the file and I will let you you when I implement the feature. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/
participants (2)
-
Nikolaus Rath -
Roman Yakovenko