ed@448: #!/usr/bin/env python ed@448: # -*- coding: utf-8 -*- ed@448: # ed@448: #Copyright (C) 2007: Edouard TISSERANT and Laurent BESSARD ed@448: # ed@448: #See COPYING file for copyrights details. ed@448: # ed@448: #This library is free software; you can redistribute it and/or ed@448: #modify it under the terms of the GNU General Public ed@448: #License as published by the Free Software Foundation; either ed@448: #version 2.1 of the License, or (at your option) any later version. ed@448: # ed@448: #This library is distributed in the hope that it will be useful, ed@448: #but WITHOUT ANY WARRANTY; without even the implied warranty of ed@448: #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ed@448: #General Public License for more details. ed@448: # ed@448: #You should have received a copy of the GNU General Public ed@448: #License along with this library; if not, write to the Free Software ed@448: #Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ed@448: Edouard@717: def LPC_connector_factory(uri, confnodesroot): ed@448: """ ed@448: This returns the connector to LPC style PLCobject ed@448: """ edouard@520: servicetype, location = uri.split("://") Lolitech@545: mode,comportstr = location.split('/') Lolitech@545: if mode=="APPLICATION": Lolitech@545: from LPCAppObject import LPCAppObject Edouard@717: return LPCAppObject(confnodesroot,comportstr) Lolitech@545: elif mode=="BOOTLOADER": Lolitech@545: from LPCBootObject import LPCBootObject Edouard@717: return LPCBootObject(confnodesroot,comportstr) ed@448: Lolitech@545: