Skip to content

Commit 65985d7

Browse files
committed
moved data structs and util functions
1 parent 6f82400 commit 65985d7

4 files changed

Lines changed: 194 additions & 177 deletions

File tree

kepconfig/__init__.py

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,21 @@
33
# See License.txt in the project root for
44
# license information.
55
# --------------------------------------------------------------------------
6+
r"""
67
7-
__version__ = "1.1.2"
8-
from . import connection, error
9-
10-
def path_split(path):
11-
'''Used to split the standard Kepware address decimal notation into a dict that contains the
12-
"channel", "device" and "tag_path".
8+
**Kepware Configuration (kepconfig) API Library**
9+
--
1310
14-
Ex. path input = "ch1.dev1.tg1.tg2.tg3"
11+
This is a package to help create Python applications to conduct operations with the Kepware Configuration API.
12+
This package is designed to work with all versions of Kepware that support the Configuration API including
13+
Thingworx Kepware Server (TKS), Thingworx Kepware Edge (TKE) and KEPServerEX (KEP).
1514
16-
Returns: {'channel': 'ch1', 'device': 'dev1', 'tag_path': ['tg1','tg2','tg3']}
15+
Copyright (c) PTC Inc. and/or all its affiliates. All rights reserved.
16+
See License.txt in the project root for
17+
license information.
1718
18-
Ex. path input = "ch1.dev1"
19-
20-
Returns: {'channel': 'ch1', 'device': 'dev1'}
21-
'''
22-
path_list = path.split('.', 2)
23-
path_obj = {}
24-
for x in range(0, len(path_list)):
25-
if x == 0:
26-
path_obj['channel'] = path_list[0]
27-
elif x == 1:
28-
path_obj['device'] = path_list[1]
29-
else:
30-
path_obj['tag_path'] = path_list[2].split('.')
31-
return path_obj
19+
"""
20+
__version__ = "1.1.2"
21+
from . import connection, error
22+
from .utils import path_split
3223

33-
def _address_dedecimal(tag_address):
34-
if tag_address[0] is '_':
35-
tag_address = tag_address[1::]
36-
updated = tag_address.replace('.','_')
37-
return updated

0 commit comments

Comments
 (0)