diff options
author | Szczepan Zalega <szczepan@nitrokey.com> | 2016-08-05 18:23:04 +0200 |
---|---|---|
committer | Szczepan Zalega <szczepan@nitrokey.com> | 2016-08-05 20:32:45 +0200 |
commit | a579c6906f9f7fe6e19c70a44f74c0d2148c8085 (patch) | |
tree | 62fc5f5af737736ec583cc43883cf78dc1329b7f /python_bindings_example.py | |
parent | 2befc01bbdd43f7a1a97b9e39df53ba3ff25c25f (diff) | |
download | libnitrokey-a579c6906f9f7fe6e19c70a44f74c0d2148c8085.tar.gz libnitrokey-a579c6906f9f7fe6e19c70a44f74c0d2148c8085.tar.bz2 |
Bindings example update
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'python_bindings_example.py')
-rwxr-xr-x | python_bindings_example.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/python_bindings_example.py b/python_bindings_example.py index a690874..31cf285 100755 --- a/python_bindings_example.py +++ b/python_bindings_example.py @@ -12,9 +12,12 @@ def get_library(): with open(fp, 'r') as f: declarations = f.readlines() - for declaration in declarations: - if 'extern' in declaration and not '"C"' in declaration: + a = iter(declarations) + for declaration in a: + if declaration.startswith('extern') and not '"C"' in declaration: declaration = declaration.replace('extern', '').strip() + while not ';' in declaration: + declaration += (next(a)).strip() # print(declaration) ffi.cdef(declaration) |