author | Edouard Tisserant |
Sat, 19 May 2012 12:41:48 +0200 | |
changeset 731 | 4fc681ed0c61 |
parent 717 | 1c23952dbde1 |
permissions | -rwxr-xr-x |
448 | 1 |
#!/usr/bin/env python |
2 |
# -*- coding: utf-8 -*- |
|
3 |
# |
|
4 |
#Copyright (C) 2007: Edouard TISSERANT and Laurent BESSARD |
|
5 |
# |
|
6 |
#See COPYING file for copyrights details. |
|
7 |
# |
|
8 |
#This library is free software; you can redistribute it and/or |
|
9 |
#modify it under the terms of the GNU General Public |
|
10 |
#License as published by the Free Software Foundation; either |
|
11 |
#version 2.1 of the License, or (at your option) any later version. |
|
12 |
# |
|
13 |
#This library is distributed in the hope that it will be useful, |
|
14 |
#but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 |
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
16 |
#General Public License for more details. |
|
17 |
# |
|
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 |
|
20 |
#Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
21 |
||
717 | 22 |
def LPC_connector_factory(uri, confnodesroot): |
448 | 23 |
""" |
24 |
This returns the connector to LPC style PLCobject |
|
25 |
""" |
|
520 | 26 |
servicetype, location = uri.split("://") |
545
627e5c636a4f
Refactored LPC connector for new bootloader and application modes
Lolitech
parents:
523
diff
changeset
|
27 |
mode,comportstr = location.split('/') |
627e5c636a4f
Refactored LPC connector for new bootloader and application modes
Lolitech
parents:
523
diff
changeset
|
28 |
if mode=="APPLICATION": |
627e5c636a4f
Refactored LPC connector for new bootloader and application modes
Lolitech
parents:
523
diff
changeset
|
29 |
from LPCAppObject import LPCAppObject |
717 | 30 |
return LPCAppObject(confnodesroot,comportstr) |
545
627e5c636a4f
Refactored LPC connector for new bootloader and application modes
Lolitech
parents:
523
diff
changeset
|
31 |
elif mode=="BOOTLOADER": |
627e5c636a4f
Refactored LPC connector for new bootloader and application modes
Lolitech
parents:
523
diff
changeset
|
32 |
from LPCBootObject import LPCBootObject |
717 | 33 |
return LPCBootObject(confnodesroot,comportstr) |
448 | 34 |
|
545
627e5c636a4f
Refactored LPC connector for new bootloader and application modes
Lolitech
parents:
523
diff
changeset
|
35 |