class ScriptsManager(object):
    def __init__(self, user="******", pwd="omero", host="localhost", port=4064):
        self.conn = BlitzGateway(user, pwd, host=host, port=port)
        result = self.conn.connect()
        if not result:
            raise RuntimeError("Cannot connect to <{0}>".format(host)+
                               " with user <{0}>.".format(user))
        self.svc = self.conn.getScriptService()

    def list(self):
         return self.svc.getScripts()

    def delete(self, id):
        try:
            self.svc.deleteScript(id)
        except Exception, e:
            raise RuntimeError("Failed to delete script: "+
                               "{0} ({1})".format(id, e))