16 #General Public License for more details. |
16 #General Public License for more details. |
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 import traceback |
|
22 import LPCObject |
21 import LPCObject |
23 |
22 |
|
23 permanant_connector = None |
24 |
24 |
25 def LPC_connector_factory(uri, pluginsroot): |
25 def LPC_connector_factory(uri, pluginsroot): |
26 """ |
26 """ |
27 This returns the connector to LPC style PLCobject |
27 This returns the connector to LPC style PLCobject |
28 """ |
28 """ |
29 pluginsroot.logger.write(_("Connecting to URI : %s\n")%uri) |
29 global permanant_connector |
30 return LPCObject() |
30 if permanant_connector is None: |
|
31 permanant_connector = LPCObject(pluginsroot,location) |
|
32 else: |
|
33 servicetype, location = uri.split("://") |
|
34 permanant_connector.UpdateLocation(location) |
|
35 return permanant_connector |
31 |
36 |
32 |
37 |