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
1=== modified file 'python/libspud.py.ctypes'
2--- python/libspud.py.ctypes 2011-07-29 11:06:59 +0000
3+++ python/libspud.py.ctypes 2011-09-03 07:54:23 +0000
4@@ -207,7 +207,7 @@
5 out = cadd_option(s, c_int(len(s)))
6
7 if out != SPUD_NO_ERROR:
8- raise spud_exceptions[out]
9+ raise spud_exceptions[out]
10
11 return
12
13
14=== modified file 'src/spud.cpp'
15--- src/spud.cpp 2011-07-28 14:48:25 +0000
16+++ src/spud.cpp 2011-09-03 07:54:23 +0000
17@@ -333,13 +333,10 @@
18 }
19
20 OptionError OptionManager::add_option(const string& key){
21- logical_t new_key = !have_option(key);
22
23 OptionError add_err = manager.options->add_option(key);
24 if(add_err != SPUD_NO_ERROR){
25 return add_err;
26- }else if(new_key){
27- return SPUD_NEW_KEY_WARNING;
28 }
29
30 return SPUD_NO_ERROR;

Subscribers

People subscribed via source and target branches