Merge lp:~spud/spud/add_option_fix into lp:spud

Proposed by Jon Hill
Status: Needs review
Proposed branch: lp:~spud/spud/add_option_fix
Merge into: lp:spud
Diff against target: 30 lines (+1/-4)
2 files modified
python/libspud.py.ctypes (+1/-1)
src/spud.cpp (+0/-3)
To merge this branch: bzr merge lp:~spud/spud/add_option_fix
Reviewer Review Type Date Requested Status
Patrick Farrell Pending
Review via email: mp+73760@code.launchpad.net

Description of the change

Edited add_options routine as per patch in Bug #813431. This means a warning is no longer issued when an option is added via this routine.

To post a comment you must log in.
Revision history for this message
Patrick Farrell (pefarrell) wrote :

a) libspud.py.ctypes is the old ctypes python interface, which is deprecated. The new one is in libspud.c (as this one can be used within the python interface in diamond). Admittedly, it doesn't say that anywhere ...

b) I think that the C, C++, Fortran and Python bindings should all be consistent. You've only changed the Python binding. Shouldn't we change the C++ layer so that it doesn't generate the error code in the first place?

Revision history for this message
Jon Hill (jon-hill) wrote :

Ah, ok. Didn't follow all the new files and what not.

lp:~spud/spud/add_option_fix updated
468. By Jon Hill

Trying again, but via fixing the cpp file. I think...

469. By Jon Hill

We dont need the new_key variable either

Unmerged revisions

469. By Jon Hill

We dont need the new_key variable either

468. By Jon Hill

Trying again, but via fixing the cpp file. I think...

467. By Jon Hill

Fix for bug #813431

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'python/libspud.py.ctypes'
--- python/libspud.py.ctypes 2011-07-29 11:06:59 +0000
+++ python/libspud.py.ctypes 2011-09-03 07:54:23 +0000
@@ -207,7 +207,7 @@
207 out = cadd_option(s, c_int(len(s)))207 out = cadd_option(s, c_int(len(s)))
208208
209 if out != SPUD_NO_ERROR:209 if out != SPUD_NO_ERROR:
210 raise spud_exceptions[out]210 raise spud_exceptions[out]
211211
212 return212 return
213213
214214
=== modified file 'src/spud.cpp'
--- src/spud.cpp 2011-07-28 14:48:25 +0000
+++ src/spud.cpp 2011-09-03 07:54:23 +0000
@@ -333,13 +333,10 @@
333 }333 }
334334
335 OptionError OptionManager::add_option(const string& key){335 OptionError OptionManager::add_option(const string& key){
336 logical_t new_key = !have_option(key);
337336
338 OptionError add_err = manager.options->add_option(key);337 OptionError add_err = manager.options->add_option(key);
339 if(add_err != SPUD_NO_ERROR){338 if(add_err != SPUD_NO_ERROR){
340 return add_err;339 return add_err;
341 }else if(new_key){
342 return SPUD_NEW_KEY_WARNING;
343 }340 }
344341
345 return SPUD_NO_ERROR;342 return SPUD_NO_ERROR;

Subscribers

People subscribed via source and target branches