Skip to content

Commit 0272410

Browse files
authored
Merge branch 'master' into 1.1.0-dev
2 parents 204d09e + bba2f59 commit 0272410

16 files changed

Lines changed: 62 additions & 368 deletions

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -------------------------------------------------------------------------
2-
# Copyright (c) PTC Inc. and/or all its affiliates. All rights reserved.
2+
# Copyright (c) 2020, PTC Inc. and/or all its affiliates. All rights reserved.
33
# See License.txt in the project root for
44
# license information.
55
# --------------------------------------------------------------------------
@@ -13,7 +13,6 @@ _notes
1313
_new*
1414
_test*
1515
_build*
16-
_dev*
1716
/docs
1817
mkdocs.yml
1918

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ SDK allows for *GET*, *ADD*, *DELETE*, and *MODIFY* functions for the following
2020
| **Connectivity** <br /> *(Channel, Devices, Tags, Tag Groups)* | Y | Y |
2121
| **IoT Gateway** <br /> *(Agents, IoT Items)* | Y | Y |
2222
| **Datalogger** <br /> *(Log Groups, Items, Mapping, Triggers, Reset Mapping Service)* | Y | Y |
23-
| **Administration** <br /> *(User Groups, Users, UA Endpoints, Local License Server)* | Y* | Y |
23+
| **Administration** <br /> *(User Groups, Users, UA Endpoints)* | Y* | Y |
2424

25-
Note (*) - UA Endpoints and Local License Server supported for Kepware Edge only
25+
Note (*) - UA Endpoints supported for Kepware Edge only
2626

2727
Driver specific features:
2828

kepconfig/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -------------------------------------------------------------------------
2-
# Copyright (c) PTC Inc. and/or all its affiliates. All rights reserved.
2+
# Copyright (c) 2020, PTC Inc. and/or all its affiliates. All rights reserved.
33
# See License.txt in the project root for
44
# license information.
55
# --------------------------------------------------------------------------

kepconfig/admin/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# -------------------------------------------------------------------------
2-
# Copyright (c) PTC Inc. and/or all its affiliates. All rights reserved.
2+
# Copyright (c) 2020, PTC Inc. and/or all its affiliates. All rights reserved.
33
# See License.txt in the project root for
44
# license information.
55
# --------------------------------------------------------------------------
66

77
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
8-
from . import users, user_groups,ua_server, lls
8+
from . import users, user_groups,ua_server

kepconfig/admin/lls.py

Lines changed: 0 additions & 133 deletions
This file was deleted.

kepconfig/connection.py

Lines changed: 2 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -37,25 +37,6 @@ def __init__(self, code = '', message = '', href = ''):
3737
def __str__(self):
3838
return '{"code": %s, "message": %s, "href": %s}' % (self.code, self.message, self.href)
3939

40-
class KepServiceStatus:
41-
'''A class to represent a status object when checking on a "service" API job state in Kepware. This is
42-
used to return the status of a "service" job
43-
44-
Properties:
45-
46-
"complete" - Boolean of service job completion status
47-
"status" - Status code of job
48-
"message" - Error message if service job fails
49-
50-
'''
51-
def __init__(self, complete = '', status = '', message = ''):
52-
self.status = status
53-
self.message = message
54-
self.complete = complete
55-
56-
def __str__(self):
57-
return '{"complete": %s, "status": %s, "message": %s}' % (self.complete, self.status, self.message)
58-
5940
class _HttpDataAbstract:
6041
def __init__(self):
6142
self.payload = ''
@@ -81,12 +62,9 @@ class server:
8162
8263
Methods:
8364
84-
"reinitialize()" - reinitialize the Kepware server
65+
"reinitialize()" - Reinitialize the Kepware server
8566
"get_trans_log()" - retrieve the Configuration API transaction logs
8667
"get_event_log()" - retrieve the Kepware Event Log
87-
"get_project_properties()" - retrieve the Kepware Project Properties
88-
"modify_project_properties()" - modify the Kepware Project Properties
89-
"service_status()" - retrive service job status
9068
'''
9169
__root_url = '/config'
9270
__version_url = '/v1'
@@ -235,30 +213,6 @@ def modify_project_properties(self, DATA, force = False) -> bool:
235213
r = self._config_update(self.url + '/project', prop_data)
236214
if r.code == 200: return True
237215
else: raise KepHTTPError(r.url, r.code, r.msg, r.hdrs, r.payload)
238-
239-
def service_status(self, resp: KepServiceResponse):
240-
'''Returns the status of a service job. Used to verify if a service call
241-
has completed or not.
242-
243-
INPUT:
244-
"resp" - KepServiceResponse instance with job information
245-
246-
RETURNS:
247-
KepServiceStatus instance with job status
248-
249-
EXCEPTIONS:
250-
251-
KepHTTPError - If urllib provides an HTTPError
252-
KepURLError - If urllib provides an URLError
253-
'''
254-
# need to remove part of job href
255-
loc = resp.href.find(self.__root_url + self.__version_url)
256-
job_url = resp.href[loc + len(self.__root_url + self.__version_url):]
257-
258-
r = self._config_get(self.url + job_url)
259-
job = KepServiceStatus(r.payload['servermain.JOB_COMPLETE'],r.payload['servermain.JOB_STATUS'], r.payload['servermain.JOB_STATUS_MSG'])
260-
return job
261-
262216

263217
#Function used to Add an object to Kepware (HTTP POST)
264218
def _config_add(self, url, DATA):
@@ -325,7 +279,7 @@ def _force_update_check(self, force, DATA):
325279
pass
326280
return DATA
327281
# General service call handler
328-
def _kep_service_execute(self, url, TTL = None):
282+
def _kep_service_execute(self, url, TTL):
329283
try:
330284
if TTL != None:
331285
TTL = {"servermain.JOB_TIME_TO_LIVE_SECONDS": TTL}

pyproject.toml

Lines changed: 0 additions & 3 deletions
This file was deleted.

release.py

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import os
33

44
file_location = "kepconfig/__init__.py"
5-
version_re_string = "([0-9]+)\.([0-9]+)\.([0-9]+(?:[ab][0-9])?)"
5+
version_re_string = "([0-9]+)\.([0-9]+)\.([0-9]+$|[0-9]+[ab][0-9]+)"
66
version_search = re.compile(r'__version__ = "'+ version_re_string + '"')
77
version_check = re.compile(version_re_string)
88

@@ -12,7 +12,7 @@ def bump_version():
1212
m = version_search.search(s)
1313
v1, v2, v3 = m.groups()
1414
oldv = "{0}.{1}.{2}".format(v1, v2, v3)
15-
ans = input("Current version of kepconfig is: {} \nUpdate new version to? (ctrl-c to exit): ".format(oldv))
15+
ans = input("Current version of kepconfig is: {0} \nUpdate new version to? (ctrl-c to exit): ".format(oldv))
1616
if ans:
1717
m = version_check.search(ans)
1818
if (m==None):
@@ -22,7 +22,7 @@ def bump_version():
2222
else:
2323
print("Please enter updated version number. Exiting...")
2424
exit()
25-
print("\n"+ "Updating " + file_location + " version to {}.".format(newv))
25+
print("\n"+ "Updating " + file_location + " version to {0}.".format(newv))
2626
s = s.replace(oldv, newv)
2727
with open(file_location, "w") as f:
2828
f.write(s)
@@ -36,24 +36,22 @@ def release():
3636
os.system("git add " + file_location)
3737
os.system('git commit -m \"{} Release\"'.format(v))
3838
os.system("git tag {0}".format(v))
39-
ans = input("Change committed, push to server? (Y/n)")
39+
ans = input("Change committed, push to server? (y/n)")
4040
if ans.lower() in ("y", "yes"):
4141
# os.system("git push")
4242
# os.system("git push --tags")
4343
os.system("git push --follow-tags")
44-
ans = input("Build dist packages?(Y/n)")
45-
if ans.lower() in ("y", "yes"):
46-
# os.system("rm -rf dist/*") #Linux
47-
os.system("RMDIR /S /Q dist") #Windows
48-
os.system("python -m build")
49-
ans = input("upload to pip?(Y/n)")
50-
if ans.lower() in ("y", "yes"):
44+
ans = input("upload to pip?(Y/n)")
45+
if ans.lower() in ("y", "yes"):
46+
# os.system("rm -rf dist/*") #Linux
47+
os.system("RMDIR /S /Q dist") #Windows
48+
os.system("python setup.py sdist bdist_wheel")
5149

52-
# Test PyPi Server
53-
os.system("twine upload --repository testpypi dist/*")
50+
# Test PyPi Server
51+
os.system("twine upload --repository testpypi dist/*")
5452

55-
#Production PyPi Server
56-
# os.system("twine upload dist/*")
53+
#Production PyPi Server
54+
# os.system("twine upload dist/*")
5755

5856

5957
if __name__ == "__main__":

0 commit comments

Comments
 (0)