Skip to content

Commit

Permalink
Merge pull request #16 from Gjacquenot/master
Browse files Browse the repository at this point in the history
Removed eventual C comment in command in create_dict_of_defines
  • Loading branch information
scemama authored Jun 8, 2017
2 parents c84d87e + 82e7570 commit f78c4e4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
13 changes: 7 additions & 6 deletions create_f77_zmq_h_py2.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env python2
#
# f77_zmq : Fortran 77 bindings for the ZeroMQ library
# Copyright (C) 2014 Anthony Scemama
#
# Copyright (C) 2014 Anthony Scemama
#
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand All @@ -25,7 +25,7 @@
# 31062 Toulouse Cedex 09, France



import re
import sys
import ctypes

Expand All @@ -47,6 +47,7 @@ def create_dict_of_defines(lines,file_out):
if key[0] == '_' or '(' in key or ',' in value:
continue
command = "%(key)s=%(value)s\nd['%(key)s']=%(key)s"%locals()
command = re.sub("/\*.*?\*/", "", command)
exec command in locals()

# Add the version number:
Expand All @@ -70,9 +71,9 @@ def create_prototypes(lines,file_out):
typ_conv = {
'long' : 'integer*8' ,
'int' : 'integer' ,
'float' : 'real',
'char*' : 'character*(64)',
'double' : 'double precision',
'float' : 'real',
'char*' : 'character*(64)',
'double' : 'double precision',
'void*' : 'integer*%d'%(ctypes.sizeof(ctypes.c_voidp)),
'void' : None
}
Expand Down
13 changes: 7 additions & 6 deletions create_f77_zmq_h_py3.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env python3
#
# f77_zmq : Fortran 77 bindings for the ZeroMQ library
# Copyright (C) 2014 Anthony Scemama
#
# Copyright (C) 2014 Anthony Scemama
#
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand All @@ -25,7 +25,7 @@
# 31062 Toulouse Cedex 09, France



import re
import sys
import ctypes

Expand All @@ -48,6 +48,7 @@ def create_dict_of_defines(lines,file_out):
continue
d[key] = value
command = "%(key)s=%(value)s\nd['%(key)s']=%(key)s"%locals()
command = re.sub("/\*.*?\*/", "", command)
exec(command, locals())

# Add the version number:
Expand All @@ -71,9 +72,9 @@ def create_prototypes(lines,file_out):
typ_conv = {
'long' : 'integer*8' ,
'int' : 'integer' ,
'float' : 'real',
'char*' : 'character*(64)',
'double' : 'double precision',
'float' : 'real',
'char*' : 'character*(64)',
'double' : 'double precision',
'void*' : 'integer*%d'%(ctypes.sizeof(ctypes.c_voidp)),
'void' : None
}
Expand Down

0 comments on commit f78c4e4

Please sign in to comment.