Skip to content

Commit 84f18c8

Browse files
committed
Renaming toolkit function to be more pythonic
1 parent 8bbb43b commit 84f18c8

2 files changed

Lines changed: 6 additions & 13 deletions

File tree

toolkit/epanet/toolkit/toolkit.i

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ and return a (possibly) different pointer */
208208

209209

210210
/* RENAME FUNCTIONS PYTHON STYLE */
211-
%rename("%(undercase)s") "";
211+
%rename("%(regex:/^\w+_([a-zA-Z]+)/\L\\1/)s") "";
212212

213213
/* GENERATES DOCUMENTATION */
214214
%feature("autodoc", "2");
@@ -229,10 +229,6 @@ and return a (possibly) different pointer */
229229
}
230230

231231
/* INSERT EXCEPTION HANDLING FOR THESE FUNCTIONS */
232-
// RUNNING A COMPLETE CMD LINE STYLE SIMULATION
233-
int DLLEXPORT EN_epanet(EN_ProjectHandle ph, const char *inpFile,
234-
const char *rptFile, const char *binOutFile, void(*callback) (char *));
235-
236232
// OPENING A CLOSING THE EPANET TOOLKIT SYSTEM
237233
int DLLEXPORT EN_open(EN_ProjectHandle ph, const char *f1, const char *f2, const char *f3);
238234
int DLLEXPORT EN_close(EN_ProjectHandle ph);
@@ -306,8 +302,8 @@ int DLLEXPORT EN_setstatusreport(EN_ProjectHandle ph, int code);
306302
%exception;
307303

308304
/* NO EXCEPTION HANDLING FOR THESE FUNCTIONS */
309-
int DLLEXPORT EN_alloc(EN_ProjectHandle *ph_out);
310-
int DLLEXPORT EN_free(EN_ProjectHandle *ph_inout);
305+
int DLLEXPORT EN_createproject(EN_ProjectHandle *ph_out);
306+
int DLLEXPORT EN_deleteproject(EN_ProjectHandle *ph_inout);
311307

312308
int DLLEXPORT EN_getversion(int *version);
313309

toolkit/setup.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,16 @@
2323
version = "0.0.1",
2424
ext_modules = [
2525
Extension("epanet.toolkit._toolkit",
26-
include_dirs = ['epanet/toolkit/'],
26+
include_dirs = ['epanet/toolkit'],
2727
libraries = ['epanet'],
2828
library_dirs = ['epanet/toolkit'],
2929
sources = ['epanet/toolkit/toolkit.i'],
30-
swig_opts=['-py3'],
30+
swig_opts = ['-py3'],
3131
language = 'C'
3232
)
3333
],
3434
packages = {'epanet.toolkit'},
3535
py_modules = ['toolkit'],
3636
package_data = {'epanet.toolkit':['*epanet.dll', '*epanet.so']},
37-
38-
install_requires = [
39-
'enum34'
40-
]
37+
4138
)

0 commit comments

Comments
 (0)