Changeset 54ac968 in nscp
- Timestamp:
- 08/10/11 15:05:59 (22 months ago)
- Branches:
- master, 0.4.0, 0.4.1, 0.4.2
- Children:
- afd42f1
- Parents:
- 04ef932
- Files:
-
- 7 edited
-
CMakeLists.txt (modified) (1 diff)
-
changelog (modified) (1 diff)
-
include/nscapi/macros.hpp (modified) (1 diff)
-
include/nscapi/nscapi_helper.cpp (modified) (1 diff)
-
include/settings/client/settings_client.hpp (modified) (2 diffs)
-
scripts/python/test.py (modified) (2 diffs)
-
service/core_api.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
CMakeLists.txt
r04ef932 r54ac968 379 379 ${Boost_PROGRAM_OPTIONS_LIBRARY} 380 380 ${Boost_THREAD_LIBRARY} 381 ${Boost_SYSTEM_LIBRARY} 381 382 ${EXTRA_LIBS} 382 383 ${PROTOBUF_LIBRARY} -
changelog
r04ef932 r54ac968 8 8 9 9 2011-08-10 10 * Fixed linus issues and defect 11 * Fixed some issues in the test python script regarding how prefix is handled 12 * Fixed PythonScript module to actually use the correct function map :) 10 13 * Fixed so it builds and runs on linux (but parser had issues so disabled som grammar rules whichneeds to be enabled again) 11 14 * Added a lot of freatures and cleand up the PythonScript module -
include/nscapi/macros.hpp
rb7d17f8 r54ac968 7 7 extern "C" int NSModuleHelperInit(unsigned int id, nscapi::core_api::lpNSAPILoader f); \ 8 8 extern "C" int NSLoadModule(); \ 9 extern "C" int NSLoadModuleEx( const wchar_talias, int mode); \9 extern "C" int NSLoadModuleEx(wchar_t* alias, int mode); \ 10 10 extern "C" void NSDeleteBuffer(char**buffer); \ 11 11 extern "C" int NSGetModuleName(wchar_t* buf, int buflen); \ -
include/nscapi/nscapi_helper.cpp
rd66ccee r54ac968 226 226 return _T("WARNING"); 227 227 else 228 return _T("BAD_CODE ");228 return _T("BAD_CODE: " + strEx::itos(returnCode)); 229 229 } 230 230 /** -
include/settings/client/settings_client.hpp
rd66ccee r54ac968 590 590 v->key->notify(core_, v->path, v->key_name); 591 591 } 592 } catch (const nscapi::nscapi_exception &e) { 593 core_->err(__FILE__, __LINE__, _T("Failed to notify ") + v->key_name + _T(": ") + e.msg_); 594 } catch (const std::exception &e) { 595 core_->err(__FILE__, __LINE__, _T("Failed to notify ") + v->key_name + _T(": ") + utf8::cvt<std::wstring>(e.what())); 592 596 } catch (...) { 593 core_->err(__FILE__, __LINE__, _T("Failed to register: ") + v->key_name);597 core_->err(__FILE__, __LINE__, _T("Failed to notify: ") + v->key_name); 594 598 } 595 599 } … … 598 602 if (v->path) 599 603 v->path->notify(core_, v->path_name); 604 } catch (const nscapi::nscapi_exception &e) { 605 core_->err(__FILE__, __LINE__, _T("Failed to notify ") + v->path_name + _T(": ") + e.msg_); 606 } catch (const std::exception &e) { 607 core_->err(__FILE__, __LINE__, _T("Failed to notify ") + v->path_name + _T(": ") + utf8::cvt<std::wstring>(e.what())); 600 608 } catch (...) { 601 core_->err(__FILE__, __LINE__, _T("Failed to register: ") + v->path_name);609 core_->err(__FILE__, __LINE__, _T("Failed to notify: ") + v->path_name); 602 610 } 603 611 } -
scripts/python/test.py
r04ef932 r54ac968 3 3 core = Core.get() 4 4 5 prefix = 'py_' 5 6 def test(arguments): 6 7 log('inside test') 7 8 for a in arguments: 8 9 log('Got argument: %s'%a) 9 (retcode, msg, perf) = core.simple_query(" normal", [])10 (retcode, msg, perf) = core.simple_query("%snormal"%prefix, []) 10 11 if msg != "ok got: ": 11 12 return (status.CRITICAL, "Test failed") 12 (retcode, msg, perf) = core.simple_query(" normal", ["hello"])13 (retcode, msg, perf) = core.simple_query("%snormal"%prefix, ["hello"]) 13 14 if msg != "ok got: hello": 14 15 return (status.CRITICAL, "Test failed") 15 (retcode, msg, perf) = core.simple_query(" normal", ["hello", "world"])16 (retcode, msg, perf) = core.simple_query("%snormal"%prefix, ["hello", "world"]) 16 17 if perf != "'args'=2": 17 18 return (status.CRITICAL, "Test failed: -%s-"%perf) … … 44 45 45 46 def init(alias): 46 prefix = 'py_'47 47 if alias: 48 48 prefix = '%s_'%alias -
service/core_api.cpp
r7ec3dd1 r54ac968 53 53 try { 54 54 return nscapi::plugin_helper::wrapReturnString(buffer, bufLen, settings_manager::get_settings()->get_string(section, key, defaultValue), NSCAPI::isSuccess); 55 } catch (...) { 56 LOG_ERROR_STD(_T("Failed to getString: ") + key); 55 } catch (settings::settings_exception e) { 56 LOG_ERROR_STD(_T("Failed to set settings file") + e.getMessage()); 57 return NSCAPI::hasFailed; 58 } catch (const std::exception &e) { 59 LOG_ERROR_STD(_T("Failed to get key: ") + utf8::cvt<std::wstring>(e.what())); 60 return NSCAPI::hasFailed; 61 } catch (...) { 62 LOG_ERROR_STD(_T("Failed to get key: <UNKNOWN EXCEPTION>")); 57 63 return NSCAPI::hasFailed; 58 64 } … … 64 70 LOG_ERROR_STD(_T("Failed to set settings file") + e.getMessage()); 65 71 return defaultValue; 72 } catch (const std::exception &e) { 73 LOG_ERROR_STD(_T("Failed to get key: ") + utf8::cvt<std::wstring>(e.what())); 74 return defaultValue; 75 } catch (...) { 76 LOG_ERROR_STD(_T("Failed to get key: <UNKNOWN EXCEPTION>")); 77 return defaultValue; 66 78 } 67 79 } … … 70 82 return settings_manager::get_settings()->get_bool(section, key, defaultValue==1); 71 83 } catch (settings::settings_exception e) { 72 LOG_ERROR_STD(_T("Failed to set settings file") + e.getMessage()); 84 LOG_ERROR_STD(_T("Failed to get key: ") + e.getMessage()); 85 return defaultValue; 86 } catch (const std::exception &e) { 87 LOG_ERROR_STD(_T("Failed to get key: ") + utf8::cvt<std::wstring>(e.what())); 88 return defaultValue; 89 } catch (...) { 90 LOG_ERROR_STD(_T("Failed to get key: <UNKNOWN EXCEPTION>")); 73 91 return defaultValue; 74 92 }
Note: See TracChangeset
for help on using the changeset viewer.








