diff --git a/python/devsup/db.py b/python/devsup/db.py index 61f8eaa..4d8f0ab 100644 --- a/python/devsup/db.py +++ b/python/devsup/db.py @@ -61,6 +61,6 @@ def processLink(name, lstr): Returns (callable, Record, "arg1 arg2") """ rec = getRecord(name) - modname, factname, args = lstr.split(None,2) + modname, args = lstr.split(None,1) mod = __import__(modname) return rec, mod.build(rec, args) diff --git a/test.cmd b/test.cmd index 87152d1..e1b83f5 100644 --- a/test.cmd +++ b/test.cmd @@ -1,19 +1,13 @@ #!./bin/linux-x86-debug/devsup -epicsEnvSet("PYTHONPATH", "${PWD}/python") +epicsEnvSet("PYTHONPATH", "${PWD}/python:${PWD}/testApp") dbLoadDatabase("dbd/devsup.dbd") devsup_registerRecordDeviceDriver(pdbbase) -evalPy "import sys" -evalPy "print sys.path" -evalPy "import devsup.hooks" -evalPy "devsup.hooks.debugHooks()" -evalPy "import devsup.db" +#evalPy "import devsup.hooks" +#evalPy "devsup.hooks.debugHooks()" -dbLoadRecords("test.db","") +dbLoadRecords("db/test1.db","P=md:") -iocInit - -evalPy "print devsup.db.Record('test:rec')" -evalPy "print devsup.db.Record('does:not:exist')" +iocInit() diff --git a/test.db b/test.db deleted file mode 100644 index a26a3c2..0000000 --- a/test.db +++ /dev/null @@ -1 +0,0 @@ -record(ai, "test:rec") {} diff --git a/testApp/Makefile b/testApp/Makefile new file mode 100644 index 0000000..c667289 --- /dev/null +++ b/testApp/Makefile @@ -0,0 +1,22 @@ +TOP=.. +include $(TOP)/configure/CONFIG +#---------------------------------------- +# ADD MACRO DEFINITIONS AFTER THIS LINE + +#---------------------------------------------------- +# Optimization of db files using dbst (DEFAULT: NO) +#DB_OPT = YES + +#---------------------------------------------------- +# Create and install (or just install) into /db +# databases, templates, substitutions like this +DB += test1.db + +#---------------------------------------------------- +# If .db template is not named *.template add +# _template = + +include $(TOP)/configure/RULES +#---------------------------------------- +# ADD RULES AFTER THIS LINE + diff --git a/testApp/test1.db b/testApp/test1.db new file mode 100644 index 0000000..66cce41 --- /dev/null +++ b/testApp/test1.db @@ -0,0 +1,6 @@ + +record(longin, "$(P)li:cnt") { + field(DTYP, "Python Device") + field(INP , "@test1 hello world") + field(SCAN, "1 second") +} diff --git a/testApp/test1.py b/testApp/test1.py new file mode 100644 index 0000000..36b910d --- /dev/null +++ b/testApp/test1.py @@ -0,0 +1,13 @@ + +class MySup(object): + def __init__(self, rec): + self.val = rec.field('VAL') + def process(self, rec, reason): + print 'test1 proc',rec.name(),reason + self.val.putval(1+self.val.getval()) + def detach(self, rec): + print 'test1 detach',rec.name() + +def build(rec, args): + print 'test1 build for',rec.name() + return MySup(rec)