Skip to content

Commit 12b0f9d

Browse files
committed
Modified typing to keep Python3.9 support
1 parent 65985d7 commit 12b0f9d

15 files changed

Lines changed: 16 additions & 16 deletions

File tree

kepconfig/admin/ua_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def _create_url(endpoint = None):
2626
else:
2727
return '{}/{}'.format(UA_ROOT,endpoint)
2828

29-
def add_endpoint(server: server, DATA: dict | list) -> Union[bool, list]:
29+
def add_endpoint(server: server, DATA: Union[dict, list]) -> Union[bool, list]:
3030
'''Add an `"endpoint"` or multiple `"endpoint"` objects to Kepware UA Server by passing a
3131
list of endpoints to be added all at once.
3232

kepconfig/admin/user_groups.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def _create_url(user_group = None):
2727
else:
2828
return '{}/{}'.format(USERGROUPS_ROOT,user_group)
2929

30-
def add_user_group(server: server, DATA: dict | list) -> Union[bool, list]:
30+
def add_user_group(server: server, DATA: Union[dict, list]) -> Union[bool, list]:
3131
'''Add a `"user group"` or multiple `"user group"` objects to Kepware User Manager by passing a
3232
list of user groups to be added all at once.
3333

kepconfig/admin/users.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def _create_url(user = None):
2727
else:
2828
return '{}/{}'.format(USERS_ROOT,user)
2929

30-
def add_user(server: server, DATA: dict | list) -> Union[bool, list]:
30+
def add_user(server: server, DATA: Union[dict, list]) -> Union[bool, list]:
3131
'''Add a `"user"` or multiple `"user"` objects to Kepware User Manager by passing a
3232
list of users to be added all at once.
3333

kepconfig/connectivity/channel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def _create_url(channel = None):
3030
else:
3131
return '{}/{}'.format(CHANNEL_ROOT,channel)
3232

33-
def add_channel(server: server, DATA: dict | list) -> Union[bool, list]:
33+
def add_channel(server: server, DATA: Union[dict, list]) -> Union[bool, list]:
3434
'''Add a `"channel"` or multiple `"channel"` objects to Kepware. Can be used to pass children of a channel object
3535
such as devices and tags/tag groups. This allows you to create a channel, it's devices and tags
3636
all in one function, if desired.

kepconfig/connectivity/device.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def _create_url(device = None):
3030
else:
3131
return '{}/{}'.format(DEVICE_ROOT,device)
3232

33-
def add_device(server: server, channel_name: str, DATA: dict | list) -> Union[bool, list]:
33+
def add_device(server: server, channel_name: str, DATA: Union[dict, list]) -> Union[bool, list]:
3434
'''Add a `"device"` or multiple `"device"` objects to a channel in Kepware. Can be used to pass children of a device object
3535
such as tags and tag groups. This allows you to create a device and tags
3636
all in one function, if desired.

kepconfig/connectivity/egd/exchange.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def _create_url(device_path, ex_type, exchange_name = None):
3838
else:
3939
return '{}{}/{}'.format(device_root,PRODUCER_ROOT,exchange_name)
4040

41-
def add_exchange(server: server, device_path: str, ex_type: str, DATA: dict | list) -> Union[bool, list]:
41+
def add_exchange(server: server, device_path: str, ex_type: str, DATA: Union[dict, list]) -> Union[bool, list]:
4242
'''Add a `"exchange"` or multiple `"exchange"` objects to Kepware. Can be used to pass children of a exchange object
4343
such as ranges. This allows you to create a exchange and ranges for the exchange all in one function, if desired.
4444

kepconfig/connectivity/egd/name.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def _create_url(device_path, name = None):
3131
else:
3232
return '{}/{}/{}'.format(device_root, NAMES_ROOT, name)
3333

34-
def add_name_resolution(server: server, device_path: str, DATA: dict | list) -> Union[bool, list]:
34+
def add_name_resolution(server: server, device_path: str, DATA: Union[dict, list]) -> Union[bool, list]:
3535
'''Add a `"name resolution"` or multiple `"name resolution"` objects to Kepware. This allows you to
3636
create a name resolution or multiple name resolutions all in one function, if desired.
3737

kepconfig/connectivity/egd/range.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def _create_url(device_path, ex_type, exchange_name, range = None):
2929
else:
3030
return '{}{}/{}'.format(exchange_root, RANGES_ROOT, range)
3131

32-
def add_range(server: server, device_path: str, ex_type: str, exchange_name: str, DATA: dict | list) -> Union[bool, list]:
32+
def add_range(server: server, device_path: str, ex_type: str, exchange_name: str, DATA: Union[dict, list]) -> Union[bool, list]:
3333
'''Add a `"range"` or multiple `"range"` objects to Kepware. This allows you to
3434
create a range or multiple ranges all in one function, if desired.
3535

kepconfig/connectivity/tag.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def _create_tag_groups_url(tag_group = None):
4141
else:
4242
return '{}/{}'.format(TAG_GRP_ROOT,tag_group)
4343

44-
def add_tag(server: server, tag_path: str, DATA: dict | list) -> Union[bool, list]:
44+
def add_tag(server: server, tag_path: str, DATA: Union[dict, list]) -> Union[bool, list]:
4545
'''Add `"tag"` or multiple `"tag"` objects to a specific path in Kepware.
4646
Can be used to pass a list of tags to be added at one path location.
4747
@@ -81,7 +81,7 @@ def add_tag(server: server, tag_path: str, DATA: dict | list) -> Union[bool, lis
8181
return errors
8282
else: raise KepHTTPError(r.url, r.code, r.msg, r.hdrs, r.payload)
8383

84-
def add_tag_group(server: server, tag_group_path: str, DATA: dict | list) -> Union[bool, list]:
84+
def add_tag_group(server: server, tag_group_path: str, DATA: Union[dict, list]) -> Union[bool, list]:
8585
'''Add `"tag_group"` or multiple `"tag_group"` objects to a specific path in Kepware.
8686
Can be used to pass a list of tag_groups and children (tags or tag groups) to be added at one
8787
path location.

kepconfig/connectivity/udd/profile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
PROFILE_ROOT = '/project/_profile_library/profiles'
1717

18-
def add_profile(server: server, DATA: dict | list) -> Union[bool, list]:
18+
def add_profile(server: server, DATA: Union[dict, list]) -> Union[bool, list]:
1919
'''Add a `"profile"` or a list of `"profile"` objects to the UDD Profile Library plug-in for Kepware.
2020
2121
:param server: instance of the `server` class

0 commit comments

Comments
 (0)