connectors/LPC/__init__.py
author Edouard TISSERANT <edouard.tisserant@gmail.com>
Wed, 23 Dec 2009 22:23:02 +0100
changeset 532 a822b0b64252
parent 523 27903000e4ea
child 545 627e5c636a4f
permissions -rwxr-xr-x
Fixed startin debugger with non empty debug variable list
448
8ef035de86de Some rough copy'n'paste to pave path for an LPC connector
ed
parents:
diff changeset
     1
#!/usr/bin/env python
8ef035de86de Some rough copy'n'paste to pave path for an LPC connector
ed
parents:
diff changeset
     2
# -*- coding: utf-8 -*-
8ef035de86de Some rough copy'n'paste to pave path for an LPC connector
ed
parents:
diff changeset
     3
#
8ef035de86de Some rough copy'n'paste to pave path for an LPC connector
ed
parents:
diff changeset
     4
#Copyright (C) 2007: Edouard TISSERANT and Laurent BESSARD
8ef035de86de Some rough copy'n'paste to pave path for an LPC connector
ed
parents:
diff changeset
     5
#
8ef035de86de Some rough copy'n'paste to pave path for an LPC connector
ed
parents:
diff changeset
     6
#See COPYING file for copyrights details.
8ef035de86de Some rough copy'n'paste to pave path for an LPC connector
ed
parents:
diff changeset
     7
#
8ef035de86de Some rough copy'n'paste to pave path for an LPC connector
ed
parents:
diff changeset
     8
#This library is free software; you can redistribute it and/or
8ef035de86de Some rough copy'n'paste to pave path for an LPC connector
ed
parents:
diff changeset
     9
#modify it under the terms of the GNU General Public
8ef035de86de Some rough copy'n'paste to pave path for an LPC connector
ed
parents:
diff changeset
    10
#License as published by the Free Software Foundation; either
8ef035de86de Some rough copy'n'paste to pave path for an LPC connector
ed
parents:
diff changeset
    11
#version 2.1 of the License, or (at your option) any later version.
8ef035de86de Some rough copy'n'paste to pave path for an LPC connector
ed
parents:
diff changeset
    12
#
8ef035de86de Some rough copy'n'paste to pave path for an LPC connector
ed
parents:
diff changeset
    13
#This library is distributed in the hope that it will be useful,
8ef035de86de Some rough copy'n'paste to pave path for an LPC connector
ed
parents:
diff changeset
    14
#but WITHOUT ANY WARRANTY; without even the implied warranty of
8ef035de86de Some rough copy'n'paste to pave path for an LPC connector
ed
parents:
diff changeset
    15
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
8ef035de86de Some rough copy'n'paste to pave path for an LPC connector
ed
parents:
diff changeset
    16
#General Public License for more details.
8ef035de86de Some rough copy'n'paste to pave path for an LPC connector
ed
parents:
diff changeset
    17
#
8ef035de86de Some rough copy'n'paste to pave path for an LPC connector
ed
parents:
diff changeset
    18
#You should have received a copy of the GNU General Public
8ef035de86de Some rough copy'n'paste to pave path for an LPC connector
ed
parents:
diff changeset
    19
#License along with this library; if not, write to the Free Software
8ef035de86de Some rough copy'n'paste to pave path for an LPC connector
ed
parents:
diff changeset
    20
#Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
8ef035de86de Some rough copy'n'paste to pave path for an LPC connector
ed
parents:
diff changeset
    21
508
73ecb803d8af Revamped LPC connector and toolchain
edouard
parents: 502
diff changeset
    22
permanant_connector = None
448
8ef035de86de Some rough copy'n'paste to pave path for an LPC connector
ed
parents:
diff changeset
    23
8ef035de86de Some rough copy'n'paste to pave path for an LPC connector
ed
parents:
diff changeset
    24
def LPC_connector_factory(uri, pluginsroot):
8ef035de86de Some rough copy'n'paste to pave path for an LPC connector
ed
parents:
diff changeset
    25
    """
8ef035de86de Some rough copy'n'paste to pave path for an LPC connector
ed
parents:
diff changeset
    26
    This returns the connector to LPC style PLCobject
8ef035de86de Some rough copy'n'paste to pave path for an LPC connector
ed
parents:
diff changeset
    27
    """
523
27903000e4ea Bug when pyserial not available fixed
laurent
parents: 520
diff changeset
    28
    from LPCObject import LPCObject
508
73ecb803d8af Revamped LPC connector and toolchain
edouard
parents: 502
diff changeset
    29
    global permanant_connector
520
ca5a2047e0ed Fixed typos in LPC connector
edouard
parents: 508
diff changeset
    30
    servicetype, location = uri.split("://")
508
73ecb803d8af Revamped LPC connector and toolchain
edouard
parents: 502
diff changeset
    31
    if permanant_connector is None:
73ecb803d8af Revamped LPC connector and toolchain
edouard
parents: 502
diff changeset
    32
        permanant_connector  = LPCObject(pluginsroot,location)
73ecb803d8af Revamped LPC connector and toolchain
edouard
parents: 502
diff changeset
    33
    else:
73ecb803d8af Revamped LPC connector and toolchain
edouard
parents: 502
diff changeset
    34
        permanant_connector.UpdateLocation(location)
73ecb803d8af Revamped LPC connector and toolchain
edouard
parents: 502
diff changeset
    35
    return permanant_connector
448
8ef035de86de Some rough copy'n'paste to pave path for an LPC connector
ed
parents:
diff changeset
    36
    
8ef035de86de Some rough copy'n'paste to pave path for an LPC connector
ed
parents:
diff changeset
    37