#!$python$

import $DRIVER$
from ardi import servicer
from ardi.driver import $DRIVERTYPE$driverbase

def mainloop():
    sdf = $DRIVER$.driverfactory()
    if "$DRIVERTYPE$" == "hist":
        base = histdriverbase.historian()
    else:
        base = driverbase.ardidriver()
        
    base.start(sdf)
        
service = servicer.ServiceApp("drv-$DRIVER$-$PORT$",mainloop);
service.start()
