connectors/LPC/__init__.py
changeset 545 627e5c636a4f
parent 523 27903000e4ea
child 717 1c23952dbde1
equal deleted inserted replaced
544:064165a5276a 545:627e5c636a4f
    17 #
    17 #
    18 #You should have received a copy of the GNU General Public
    18 #You should have received a copy of the GNU General Public
    19 #License along with this library; if not, write to the Free Software
    19 #License along with this library; if not, write to the Free Software
    20 #Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    20 #Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    21 
    21 
    22 permanant_connector = None
       
    23 
       
    24 def LPC_connector_factory(uri, pluginsroot):
    22 def LPC_connector_factory(uri, pluginsroot):
    25     """
    23     """
    26     This returns the connector to LPC style PLCobject
    24     This returns the connector to LPC style PLCobject
    27     """
    25     """
    28     from LPCObject import LPCObject
       
    29     global permanant_connector
       
    30     servicetype, location = uri.split("://")
    26     servicetype, location = uri.split("://")
    31     if permanant_connector is None:
    27     mode,comportstr = location.split('/')
    32         permanant_connector  = LPCObject(pluginsroot,location)
    28     if mode=="APPLICATION":
    33     else:
    29         from LPCAppObject import LPCAppObject 
    34         permanant_connector.UpdateLocation(location)
    30         return LPCAppObject(pluginsroot,comportstr)
    35     return permanant_connector
    31     elif mode=="BOOTLOADER":
    36     
    32         from LPCBootObject import LPCBootObject 
       
    33         return LPCBootObject(pluginsroot,comportstr)
    37 
    34 
       
    35