rename evalPy to py
This commit is contained in:
@ -61,7 +61,7 @@ static pystate statenames[] = {
|
|||||||
};
|
};
|
||||||
#undef INITST
|
#undef INITST
|
||||||
|
|
||||||
void evalPy(const char* code)
|
void py(const char* code)
|
||||||
{
|
{
|
||||||
PyGILState_STATE state;
|
PyGILState_STATE state;
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ void evalPy(const char* code)
|
|||||||
PyGILState_Release(state);
|
PyGILState_Release(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
void evalFilePy(const char* file)
|
void pyfile(const char* file)
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
PyGILState_STATE state;
|
PyGILState_STATE state;
|
||||||
@ -226,11 +226,11 @@ static const iocshArg argFile = {"file", iocshArgString};
|
|||||||
static const iocshArg* const codeArgs[] = {&argCode};
|
static const iocshArg* const codeArgs[] = {&argCode};
|
||||||
static const iocshArg* const fileArgs[] = {&argFile};
|
static const iocshArg* const fileArgs[] = {&argFile};
|
||||||
|
|
||||||
static const iocshFuncDef codeDef = {"evalPy", 1, codeArgs};
|
static const iocshFuncDef codeDef = {"py", 1, codeArgs};
|
||||||
static const iocshFuncDef fileDef = {"evalFilePy", 1, fileArgs};
|
static const iocshFuncDef fileDef = {"pyfile", 1, fileArgs};
|
||||||
|
|
||||||
static void codeRun(const iocshArgBuf *args){evalPy(args[0].sval);}
|
static void codeRun(const iocshArgBuf *args){py(args[0].sval);}
|
||||||
static void fileRun(const iocshArgBuf *args){evalFilePy(args[0].sval);}
|
static void fileRun(const iocshArgBuf *args){pyfile(args[0].sval);}
|
||||||
|
|
||||||
static void pySetupReg(void)
|
static void pySetupReg(void)
|
||||||
{
|
{
|
||||||
|
10
test.cmd
10
test.cmd
@ -5,12 +5,12 @@ epicsEnvSet("PYTHONPATH", "${PWD}/python:${PWD}/testApp")
|
|||||||
dbLoadDatabase("dbd/devsup.dbd")
|
dbLoadDatabase("dbd/devsup.dbd")
|
||||||
devsup_registerRecordDeviceDriver(pdbbase)
|
devsup_registerRecordDeviceDriver(pdbbase)
|
||||||
|
|
||||||
#evalPy "import devsup.hooks"
|
#py "import devsup.hooks"
|
||||||
#evalPy "devsup.hooks.debugHooks()"
|
#py "devsup.hooks.debugHooks()"
|
||||||
|
|
||||||
evalPy "import test2"
|
py "import test2"
|
||||||
evalPy "test2.addDrv('AAAA')"
|
py "test2.addDrv('AAAA')"
|
||||||
evalPy "test2.addDrv('BBBB')"
|
py "test2.addDrv('BBBB')"
|
||||||
|
|
||||||
dbLoadRecords("db/test.db","P=md:")
|
dbLoadRecords("db/test.db","P=md:")
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user