GithubHelp home page GithubHelp logo

cython-codegen's People

Contributors

cournape avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cython-codegen's Issues

Exception with the Gnokii library

Generate the xml file

$ h2xml gnokii.h -I ~/projects/Gnokyy/extra/gnokii/include/ -I ~/projects/Gnokyy/extra/gnokii/include/gnokii/ -o ../../../gnokii/gnokii.xml
creating xml output file ...
running: gccxml /tmp/tmpvUnUGQ.cpp -fxml=../../../gnokii/gnokii.xml -I /home/vampas/projects/Gnokyy/extra/gnokii/include/ -I /home/vampas/projects/Gnokyy/extra/gnokii/include/gnokii/

So far so good, but:

$ xml2cython.py gnokii.h ../../../gnokii/gnokii.xml 
Ignoring <ctypeslib.codegen.typedesc.Structure object at 0xb721de0c> _IO_FILE
Item not handled for cy_generate <ctypeslib.codegen.typedesc.ArrayType object at 0x9e0d28c>
Item not handled for cy_generate <ctypeslib.codegen.typedesc.ArrayType object at 0x9e0d28c>
Item not handled for cy_generate <ctypeslib.codegen.typedesc.ArrayType object at 0x9e0d28c>
Item not handled for cy_generate <ctypeslib.codegen.typedesc.ArrayType object at 0x9e0de0c>
Item not handled for cy_generate <ctypeslib.codegen.typedesc.ArrayType object at 0x9e0de0c>
Item not handled for cy_generate <ctypeslib.codegen.typedesc.ArrayType object at 0x9e0d28c>
Item not handled for cy_generate <ctypeslib.codegen.typedesc.ArrayType object at 0x9e0d28c>
Item not handled for cy_generate <ctypeslib.codegen.typedesc.ArrayType object at 0x9dfc42c>
Item not handled for cy_generate <ctypeslib.codegen.typedesc.ArrayType object at 0x9dfc42c>
Not handled:  <ctypeslib.codegen.typedesc.Enumeration object at 0xb72247ac>
Traceback (most recent call last):
  File "/home/vampas/projects/DotSOS/.working-dir/installed/1.0b1-dev/bin/xml2cython.py", line 165, in <module>
    sys.exit(main())
  File "/home/vampas/projects/DotSOS/.working-dir/installed/1.0b1-dev/bin/xml2cython.py", line 148, in main
    ffilter=ffilter, funcs_list=funcs)
  File "/home/vampas/projects/DotSOS/.working-dir/installed/1.0b1-dev/bin/xml2cython.py", line 71, in generate_main
    generate_cython(output, gen, anoenumvals)
  File "/home/vampas/projects/DotSOS/.working-dir/installed/1.0b1-dev/lib/python2.7/site-packages/cycodegenlib/cycodegen.py", line 12, in generate_cython
    cython_code = [cy_generate(i) for i in genitems]
  File "/home/vampas/projects/DotSOS/.working-dir/installed/1.0b1-dev/lib/python2.7/site-packages/cycodegenlib/cycodegen.py", line 76, in cy_generate
    return cy_generate_structure(item)
  File "/home/vampas/projects/DotSOS/.working-dir/installed/1.0b1-dev/lib/python2.7/site-packages/cycodegenlib/cycodegen.py", line 41, in cy_generate_structure
    output.append("\t" + (generic_named_decl(m.typ) % m.name))
  File "/home/vampas/projects/DotSOS/.working-dir/installed/1.0b1-dev/lib/python2.7/site-packages/cycodegenlib/cytypes.py", line 66, in generic_named_decl
    return pointer_named_decl(tp)
  File "/home/vampas/projects/DotSOS/.working-dir/installed/1.0b1-dev/lib/python2.7/site-packages/cycodegenlib/cytypes.py", line 55, in pointer_named_decl
    return generic_decl(tp.typ.returns) + '(*%s)' + '(%s)' % ", ".join(args)
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

What can I do now?

looks like crashing on union

Not handled: <ctypeslib.codegen.typedesc.Union object at 0x948e42c>
Traceback (most recent call last):
File "/usr/local/bin/xml2cython.py", line 165, in
sys.exit(main())
File "/usr/local/bin/xml2cython.py", line 148, in main
ffilter=ffilter, funcs_list=funcs)
File "/usr/local/bin/xml2cython.py", line 71, in generate_main
generate_cython(output, gen, anoenumvals)
File "/usr/local/lib/python2.7/dist-packages/cycodegenlib/cycodegen.py", line 12, in generate_cython
cython_code = [cy_generate(i) for i in genitems]
File "/usr/local/lib/python2.7/dist-packages/cycodegenlib/cycodegen.py", line 73, in cy_generate
return cy_generate_typedef(item)
File "/usr/local/lib/python2.7/dist-packages/cycodegenlib/cycodegen.py", line 32, in cy_generate_typedef
return ["ctypedef %s" % (named_pointer_decl(item.typ) % item.name)]
File "/usr/local/lib/python2.7/dist-packages/cycodegenlib/funcs.py", line 67, in named_pointer_decl
return generic_decl(tp.typ) + ' * %s'
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

Crash when parsing bn.h from OpenSSL

I have this header file from OpenSSL which when run through gccxml gives me this result. When running xml2cython on bn.xml I get this crash:

matej@wycliff: ~$ xml2cython.py /usr/include/openssl/bn.h bn.xml
Ignoring <ctypeslib.codegen.typedesc.Structure object at 0x7f7afa8b1390> _IO_FILE
Item not handled for cy_generate <ctypeslib.codegen.typedesc.ArrayType object at 0x23a5a50>
Item not handled for cy_generate <ctypeslib.codegen.typedesc.ArrayType object at 0x23b4810>
Item not handled for cy_generate <ctypeslib.codegen.typedesc.ArrayType object at 0x23b4810>
Item not handled for cy_generate <ctypeslib.codegen.typedesc.ArrayType object at 0x23a5650>
Item not handled for cy_generate <ctypeslib.codegen.typedesc.ArrayType object at 0x23a5650>
Struct member not handled: <ctypeslib.codegen.typedesc.Union object at 0x2397ad0>
Traceback (most recent call last):
  File "/home/matej/.local/bin/xml2cython.py", line 165, in <module>
    sys.exit(main())
  File "/home/matej/.local/bin/xml2cython.py", line 148, in main
    ffilter=ffilter, funcs_list=funcs)
  File "/home/matej/.local/bin/xml2cython.py", line 71, in generate_main
    generate_cython(output, gen, anoenumvals)
  File "/home/matej/.local/lib/python2.7/site-packages/cycodegenlib/cycodegen.py", line 12, in generate_cython
    cython_code = [cy_generate(i) for i in genitems]
  File "/home/matej/.local/lib/python2.7/site-packages/cycodegenlib/cycodegen.py", line 73, in cy_generate
    return cy_generate_typedef(item)
  File "/home/matej/.local/lib/python2.7/site-packages/cycodegenlib/cycodegen.py", line 30, in cy_generate_typedef
    return ["ctypedef %s %s" % (item.typ.name, item.name)]
AttributeError: 'FunctionType' object has no attribute 'name'

support for cdef cppclass

not an issue, just a feature request. any plans to add support for the 'cdef cppclass' statement?
i think it was added in cython 0.13 and allows for easy declaration of c++ classes.

Exception parsing FLAC library

Commands/Traceback

h2xml.py -I /path/to/flac/include/ FLAC/all.h -o flac.xml #works
xml2cython.py -l 'FLAC' -o flac.pyx FLAC/all.h flac.xml
Ignoring <ctypeslib.codegen.typedesc.Structure object at 0x22dadd0> _IO_FILE
Item not handled for cy_generate <ctypeslib.codegen.typedesc.ArrayType object at 0x25043d0>
Item not handled for cy_generate <ctypeslib.codegen.typedesc.ArrayType object at 0x24834d0>
Item not handled for cy_generate <ctypeslib.codegen.typedesc.ArrayType object at 0x2504ad0>
Item not handled for cy_generate <ctypeslib.codegen.typedesc.ArrayType object at 0x2504f10>
Struct member not handled: <ctypeslib.codegen.typedesc.Union object at 0x25033d0>
Struct member not handled: <ctypeslib.codegen.typedesc.Union object at 0x2503850>
Item not handled for cy_generate <ctypeslib.codegen.typedesc.CvQualifiedType object at 0x25111d0>
Struct member not handled: <ctypeslib.codegen.typedesc.Union object at 0x2502d50>
Item not handled for cy_generate <ctypeslib.codegen.typedesc.ArrayType object at 0x2503d90>
Item not handled for cy_generate <ctypeslib.codegen.typedesc.CvQualifiedType object at 0x2511210>
Item not handled for cy_generate <ctypeslib.codegen.typedesc.ArrayType object at 0x2510490>
Item not handled for cy_generate <ctypeslib.codegen.typedesc.ArrayType object at 0x2510490>
Item not handled for cy_generate <ctypeslib.codegen.typedesc.CvQualifiedType object at 0x2511210>
Item not handled for cy_generate <ctypeslib.codegen.typedesc.CvQualifiedType object at 0x2511210>
Struct member not handled: <ctypeslib.codegen.typedesc.Union object at 0x2478690>
Item not handled for cy_generate <ctypeslib.codegen.typedesc.ArrayType object at 0x2504390>
Not handled: <ctypeslib.codegen.typedesc.Enumeration object at 0x7ffc3b89f3d0>
Traceback (most recent call last):
File "/usr/local/bin/xml2cython.py", line 165, in
sys.exit(main())
File "/usr/local/bin/xml2cython.py", line 148, in main
ffilter=ffilter, funcs_list=funcs)
File "/usr/local/bin/xml2cython.py", line 71, in generate_main
generate_cython(output, gen, anoenumvals)
File "/usr/local/lib/python2.6/dist-packages/cycodegenlib/cycodegen.py", line 12, in generate_cython
cython_code = [cy_generate(i) for i in genitems]
File "/usr/local/lib/python2.6/dist-packages/cycodegenlib/cycodegen.py", line 73, in cy_generate
return cy_generate_typedef(item)
File "/usr/local/lib/python2.6/dist-packages/cycodegenlib/cycodegen.py", line 32, in cy_generate_typedef
return ["ctypedef %s" % (named_pointer_decl(item.typ) % item.name)]
File "/usr/local/lib/python2.6/dist-packages/cycodegenlib/funcs.py", line 65, in named_pointer_decl
return generic_decl(tp.typ.returns) + '(*%s)' + '(%s)' % ", ".join(args)
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.