Normalize methods with 'UserName' to 'Username'

This commit is contained in:
Pierre Gordon
2019-01-01 14:20:05 -05:00
parent 812b27c268
commit 6af027c5dd
27 changed files with 184 additions and 165 deletions

View File

@@ -326,7 +326,7 @@ while (<$in>) {
}
say $out "\tif (!$a->{pyvar}) {";
say $out "\t\tCString sPyErr = m_pModPython->GetPyExceptionStr();";
say $out "\t\tDEBUG".'("modpython: " << (GetUser() ? GetUser()->GetUserName() : CString("<no user>")) << "/" << GetModName() << '."\"/$name: $a->{error}: \" << sPyErr);";
say $out "\t\tDEBUG".'("modpython: " << (GetUser() ? GetUser()->GetUsername() : CString("<no user>")) << "/" << GetModName() << '."\"/$name: $a->{error}: \" << sPyErr);";
print $out $cleanup;
say $out "\t\treturn $default;";
say $out "\t}";
@@ -342,14 +342,14 @@ while (<$in>) {
say $out "\t\tPyObject* pyVecEl = SWIG_NewInstanceObj(*i, SWIG_TypeQuery(\"$sub*\"), 0);";
say $out "\t\tif (!pyVecEl) {";
say $out "\t\t\tCString sPyErr = m_pModPython->GetPyExceptionStr();";
say $out "\t\t\tDEBUG".'("modpython: " << (GetUser() ? GetUser()->GetUserName() : CString("<no user>")) << "/" << GetModName() << '.
say $out "\t\t\tDEBUG".'("modpython: " << (GetUser() ? GetUser()->GetUsername() : CString("<no user>")) << "/" << GetModName() << '.
"\"/$name: can't convert element of vector '$a->{var}' to PyObject: \" << sPyErr);";
print $out $cleanup1;
say $out "\t\t\treturn $default;";
say $out "\t\t}";
say $out "\t\tif (PyList_Append($a->{pyvar}, pyVecEl)) {";
say $out "\t\t\tCString sPyErr = m_pModPython->GetPyExceptionStr();";
say $out "\t\t\tDEBUG".'("modpython: " << (GetUser() ? GetUser()->GetUserName() : CString("<no user>")) << "/" << GetModName() << '.
say $out "\t\t\tDEBUG".'("modpython: " << (GetUser() ? GetUser()->GetUsername() : CString("<no user>")) << "/" << GetModName() << '.
"\"/$name: can't add element of vector '$a->{var}' to PyObject: \" << sPyErr);";
say $out "\t\t\tPy_CLEAR(pyVecEl);";
print $out $cleanup1;
@@ -365,7 +365,7 @@ while (<$in>) {
say $out ", nullptr);";
say $out "\tif (!pyRes) {";
say $out "\t\tCString sPyErr = m_pModPython->GetPyExceptionStr();";
say $out "\t\tDEBUG".'("modpython: " << (GetUser() ? GetUser()->GetUserName() : CString("<no user>")) << "/" << GetModName() << '."\"/$name failed: \" << sPyErr);";
say $out "\t\tDEBUG".'("modpython: " << (GetUser() ? GetUser()->GetUsername() : CString("<no user>")) << "/" << GetModName() << '."\"/$name failed: \" << sPyErr);";
print $out $cleanup;
say $out "\t\treturn $default;";
say $out "\t}";
@@ -383,7 +383,7 @@ while (<$in>) {
when (/^(.*)\*$/) {
say $out "\t\tint res = SWIG_ConvertPtr(pyRes, (void**)&result, SWIG_TypeQuery(\"$type\"), 0);";
say $out "\t\tif (!SWIG_IsOK(res)) {";
say $out "\t\t\tDEBUG(\"modpython: \" << (GetUser() ? GetUser()->GetUserName() : CString(\"<no user>\")) << \"/\" << GetModName() << \"/$name was expected to return '$type' but error=\" << res);";
say $out "\t\t\tDEBUG(\"modpython: \" << (GetUser() ? GetUser()->GetUsername() : CString(\"<no user>\")) << \"/\" << GetModName() << \"/$name was expected to return '$type' but error=\" << res);";
say $out "\t\t\tresult = $default;";
say $out "\t\t}";
}
@@ -391,10 +391,10 @@ while (<$in>) {
say $out "\t\tCString* p = nullptr;";
say $out "\t\tint res = SWIG_AsPtr_CString(pyRes, &p);";
say $out "\t\tif (!SWIG_IsOK(res)) {";
say $out "\t\t\tDEBUG(\"modpython: \" << (GetUser() ? GetUser()->GetUserName() : CString(\"<no user>\")) << \"/\" << GetModName() << \"/$name was expected to return '$type' but error=\" << res);";
say $out "\t\t\tDEBUG(\"modpython: \" << (GetUser() ? GetUser()->GetUsername() : CString(\"<no user>\")) << \"/\" << GetModName() << \"/$name was expected to return '$type' but error=\" << res);";
say $out "\t\t\tresult = $default;";
say $out "\t\t} else if (!p) {";
say $out "\t\t\tDEBUG(\"modpython: \" << (GetUser() ? GetUser()->GetUserName() : CString(\"<no user>\")) << \"/\" << GetModName() << \"/$name was expected to return '$type' but returned nullptr\");";
say $out "\t\t\tDEBUG(\"modpython: \" << (GetUser() ? GetUser()->GetUsername() : CString(\"<no user>\")) << \"/\" << GetModName() << \"/$name was expected to return '$type' but returned nullptr\");";
say $out "\t\t\tresult = $default;";
say $out "\t\t} else result = *p;";
say $out "\t\tif (SWIG_IsNewObj(res)) delete p;";
@@ -403,7 +403,7 @@ while (<$in>) {
say $out "\t\tlong int x = PyLong_AsLong(pyRes);";
say $out "\t\tif (PyErr_Occurred()) {";
say $out "\t\t\tCString sPyErr = m_pModPython->GetPyExceptionStr();";
say $out "\t\t\tDEBUG".'("modpython: " << (GetUser() ? GetUser()->GetUserName() : CString("<no user>")) << "/" << GetModName() << '."\"/$name was expected to return EModRet but: \" << sPyErr);";
say $out "\t\t\tDEBUG".'("modpython: " << (GetUser() ? GetUser()->GetUsername() : CString("<no user>")) << "/" << GetModName() << '."\"/$name was expected to return EModRet but: \" << sPyErr);";
say $out "\t\t\tresult = $default;";
say $out "\t\t} else { result = (CModule::EModRet)x; }";
}
@@ -411,7 +411,7 @@ while (<$in>) {
say $out "\t\tint x = PyObject_IsTrue(pyRes);";
say $out "\t\tif (-1 == x) {";
say $out "\t\t\tCString sPyErr = m_pModPython->GetPyExceptionStr();";
say $out "\t\t\tDEBUG".'("modpython: " << (GetUser() ? GetUser()->GetUserName() : CString("<no user>")) << "/" << GetModName() << '."\"/$name was expected to return EModRet but: \" << sPyErr);";
say $out "\t\t\tDEBUG".'("modpython: " << (GetUser() ? GetUser()->GetUsername() : CString("<no user>")) << "/" << GetModName() << '."\"/$name was expected to return EModRet but: \" << sPyErr);";
say $out "\t\t\tresult = $default;";
say $out "\t\t} else result = x ? true : false;";
}