mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-26 15:10:22 -05:00
Python: Enforce checking on script name to make sure conversion between camelCase and snake_case works correctly
* #12044 Python: Add Non-Darcy properties available in Python * #12049 Python: Add checking for multiple consecutive upper case letters The scripting keyword is transformed to snake_case for use in Python. When data in Python is sent back to ResInsight, the opposite operation happens. This concept works well for most variants of keywords, but there are some corner cases that is not working. Add compile time checking to make sure that the scripting keywords are formatted correctly. Fix keyword that has been formatted the wrong way and has never worked. * Avoid running test if ResInsight executable path is not defined in env * Make sure dash is allowed in enumeration text string
This commit is contained in:
1 parent
90a1642326
commit
da69c1f049
9 files changed
+320
-94
No files matched your search
@@ -134,7 +134,28 @@ void RiaGrpcServiceInterface::copyPdmObjectFromRipsToCaf( const rips::PdmObject*
|
||||
|
||||
auto parametersMap = source->parameters();
|
||||
|
||||
bool printContent = false; // Flag to control debug output to debugger
|
||||
// Check for duplicate lowercase keywords. If this happens, the script checking in CAF_PDM_CheckScriptableKeyword in
|
||||
// cafPdmFieldScriptingCapability.h is not working as expected
|
||||
{
|
||||
std::set<QString> uniqueNames;
|
||||
|
||||
for ( const auto& p : parametersMap )
|
||||
{
|
||||
auto lowerCase = QString::fromStdString( p.first ).toLower();
|
||||
if ( uniqueNames.count( lowerCase ) > 0 )
|
||||
{
|
||||
QString txt = "When receiving an object from Python, multiple key/values for a field keyword was "
|
||||
"detected. This is an error will most likely fail to update the object as intende. "
|
||||
"Keyword name : " +
|
||||
QString::fromStdString( p.first );
|
||||
RiaLogging::error( txt );
|
||||
}
|
||||
uniqueNames.insert( lowerCase );
|
||||
}
|
||||
}
|
||||
|
||||
bool printContent = false; // Flag to control debug output to debugger. Do not remove this code, as it is useful for
|
||||
// debugging
|
||||
if ( printContent )
|
||||
{
|
||||
for ( const auto& p : parametersMap )
|
||||
|
||||
Reference in new issue
Block a user