Răsfoiți Sursa

纠正命令行问题;

Jeff 5 ani în urmă
părinte
comite
e9e2c14583

+ 2 - 2
SATService/SATService/PythonExecutor.cpp

@@ -185,7 +185,7 @@ int CPythonExecutor::RunScriptProcess()
 	// 强制stdion, stdout和stderr完全无缓冲:python -u
 	TCHAR szCommandLine[MAX_PATH] = { 0 };
 	if (_tcslen(m_szExtraSentence))
-		_stprintf_s(szCommandLine, _T("python -W ignore -u \"%s\" %s"), m_szScriptPath, m_szExtraSentence);
+		_stprintf_s(szCommandLine, _T("python -W ignore -u \"%s\" \"%s\""), m_szScriptPath, m_szExtraSentence);
 	else
 		_stprintf_s(szCommandLine, _T("python -W ignore -u \"%s\""), m_szScriptPath);
 
@@ -344,7 +344,7 @@ int CPythonExecutor::ServiceRunScriptProcess()
 	// 强制stdion, stdout和stderr完全无缓冲:python -u
 	TCHAR szCommandLine[MAX_PATH] = { 0 };
 	if (_tcslen(m_szExtraSentence))
-		_stprintf_s(szCommandLine, _T("python -W ignore -u \"%s\" %s"), m_szScriptPath, m_szExtraSentence);
+		_stprintf_s(szCommandLine, _T("python -W ignore -u \"%s\" \"%s\""), m_szScriptPath, m_szExtraSentence);
 	else
 		_stprintf_s(szCommandLine, _T("python -W ignore -u \"%s\""), m_szScriptPath);
 

+ 1 - 1
SATService/SATService/SATExecutor.cpp

@@ -191,7 +191,7 @@ SATHTTP::STCase* CSATExecutor::ExecuteFreeCaseScript(SATHTTP::STTask* pTask)
 #endif
 		// ÃüÁîÐУº{"Round": %d}
 		TCHAR szCommandLine[MAX_PATH] = { 0 };
-		_stprintf_s(szCommandLine, _T("{\"Round\": %s"), pCase->_strRoundNum.c_str());
+		_stprintf_s(szCommandLine, _T("{'Round': '%s'}"), pCase->_strRoundNum.c_str());
 		if ( !pCase->_pExcutor ) {
 			CPythonExecutor *pExcutor = new CPythonExecutor(); 
 			if ( pExcutor ) {