Skip to content

Commit 87abec3

Browse files
authored
Update license text with Wirepas Ltd (#34)
1 parent 7c3dde5 commit 87abec3

32 files changed

+345
-322
lines changed

.ci/install-devtools.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
# Wirepas Oy
2+
# Copyright Wirepas Ltd 2019
33

44

55
function _instructions

.ci/releases.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
# Wirepas Oy
2+
# Copyright Wirepas Ltd 2019
33
set -e
44

55
ROOT_DIR=$(pwd)

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2019 Wirepas Oy
189+
Copyright 2019 Wirepas Ltd
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

wrappers/python/LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2019 Wirepas Oy
189+
Copyright 2019 Wirepas Ltd
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

wrappers/python/setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
=================
44
Installation script
55
6-
Wirepas Oy licensed under Apache 2.0
6+
Copyright Wirepas Ltd 2019 licensed under Apache 2.0
77
88
Please see License file for full text.
99
"""

wrappers/python/utils/compile_protos.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
# Wirepas Oy
2+
# Copyright Wirepas Ltd 2019
33

44

55
PKG_NAME=${1:-"wirepas_messaging"}

wrappers/python/utils/generate_sphinx_docs.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
# Wirepas Oy
2+
# Copyright Wirepas Ltd 2019
33

44
set -e
55

wrappers/python/utils/generate_wheel.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
# Wirepas Oy
2+
# Copyright Wirepas Ltd 2019
33

44
echo "generating the wheel"
55

wrappers/python/utils/pull_protos.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
# Wirepas Oy
2+
# Copyright Wirepas Ltd 2019
33

44
WIREPAS_USER=${1:-""}
55

wrappers/python/wirepas_messaging/__about__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
.. Copyright:
3-
Wirepas Oy licensed under Apache License, Version 2.0
3+
Copyright Wirepas Ltd 2019 licensed under Apache License, Version 2.0
44
See file LICENSE for full license details.
55
"""
66

wrappers/python/wirepas_messaging/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Wirepas Oy
1+
# Copyright Wirepas Ltd 2019
22

33
from .__about__ import (
44
__author__,

wrappers/python/wirepas_messaging/gateway/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Wirepas Oy
1+
# Copyright Wirepas Ltd 2019
22

33
from .config_message_pb2 import *
44
from .data_message_pb2 import *

wrappers/python/wirepas_messaging/gateway/api/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Wirepas Oy
1+
# Copyright Wirepas Ltd 2019
22

33
from .get_configs import *
44
from .get_gw_info import *

wrappers/python/wirepas_messaging/gateway/api/config_helper.py

+86-106
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Wirepas Oy
1+
# Copyright Wirepas Ltd 2019
22

33
import wirepas_messaging
44

@@ -14,16 +14,20 @@ def convert_proto_role_to_wirepas(base, flags):
1414
Returns:
1515
Wirepas role as an int
1616
"""
17-
base_proto_to_wirepas = dict([
18-
(wirepas_messaging.gateway.NodeRole.SINK, 1),
19-
(wirepas_messaging.gateway.NodeRole.ROUTER, 2),
20-
(wirepas_messaging.gateway.NodeRole.NON_ROUTER, 3)
21-
])
22-
23-
flag_proto_to_wirepas = dict([
24-
(wirepas_messaging.gateway.NodeRole.LOW_LATENCY, 0x10),
25-
(wirepas_messaging.gateway.NodeRole.AUTOROLE, 0x80)
26-
])
17+
base_proto_to_wirepas = dict(
18+
[
19+
(wirepas_messaging.gateway.NodeRole.SINK, 1),
20+
(wirepas_messaging.gateway.NodeRole.ROUTER, 2),
21+
(wirepas_messaging.gateway.NodeRole.NON_ROUTER, 3),
22+
]
23+
)
24+
25+
flag_proto_to_wirepas = dict(
26+
[
27+
(wirepas_messaging.gateway.NodeRole.LOW_LATENCY, 0x10),
28+
(wirepas_messaging.gateway.NodeRole.AUTOROLE, 0x80),
29+
]
30+
)
2731

2832
wirepas_role = base_proto_to_wirepas[base]
2933

@@ -43,23 +47,27 @@ def convert_wirepas_role_to_proto(wirepas_role):
4347
Returns:
4448
Tupple with protocol buffer base and flags
4549
"""
46-
wirepas_base = wirepas_role & 0xf
47-
48-
wirepas_base_to_proto = dict([
49-
(1, wirepas_messaging.gateway.NodeRole.SINK),
50-
(2, wirepas_messaging.gateway.NodeRole.ROUTER),
51-
(3, wirepas_messaging.gateway.NodeRole.NON_ROUTER)
52-
])
53-
54-
flag_proto_to_wirepas = dict([
55-
(0x10, wirepas_messaging.gateway.NodeRole.LOW_LATENCY),
56-
(0x80, wirepas_messaging.gateway.NodeRole.AUTOROLE)
57-
])
50+
wirepas_base = wirepas_role & 0xF
51+
52+
wirepas_base_to_proto = dict(
53+
[
54+
(1, wirepas_messaging.gateway.NodeRole.SINK),
55+
(2, wirepas_messaging.gateway.NodeRole.ROUTER),
56+
(3, wirepas_messaging.gateway.NodeRole.NON_ROUTER),
57+
]
58+
)
59+
60+
flag_proto_to_wirepas = dict(
61+
[
62+
(0x10, wirepas_messaging.gateway.NodeRole.LOW_LATENCY),
63+
(0x80, wirepas_messaging.gateway.NodeRole.AUTOROLE),
64+
]
65+
)
5866

5967
base = wirepas_base_to_proto[wirepas_base]
6068

6169
flags = []
62-
flags_val = wirepas_role & 0xf0
70+
flags_val = wirepas_role & 0xF0
6371
for flag in flag_proto_to_wirepas:
6472
if flag & flags_val != 0:
6573
flags.append(flag_proto_to_wirepas[flag])
@@ -116,26 +124,23 @@ def parse_config_rw(message_obj, dic):
116124

117125
if message_obj.HasField("node_role"):
118126
dic["node_role"] = convert_proto_role_to_wirepas(
119-
message_obj.node_role.role, message_obj.node_role.flags)
127+
message_obj.node_role.role, message_obj.node_role.flags
128+
)
120129

130+
parse_optional_field(message_obj, "node_address", dic, "node_address")
131+
parse_optional_field(message_obj, "network_address", dic, "network_address")
132+
parse_optional_field(message_obj, "network_channel", dic, "network_channel")
121133
parse_optional_field(
122-
message_obj, "node_address", dic, "node_address")
123-
parse_optional_field(
124-
message_obj, "network_address", dic, "network_address")
125-
parse_optional_field(
126-
message_obj, "network_channel", dic, "network_channel")
134+
message_obj.app_config, "diag_interval_s", dic, "app_config_diag"
135+
)
136+
parse_optional_field(message_obj.app_config, "seq", dic, "app_config_seq")
127137
parse_optional_field(
128-
message_obj.app_config, "diag_interval_s", dic, "app_config_diag")
129-
parse_optional_field(
130-
message_obj.app_config, "seq", dic, "app_config_seq")
131-
parse_optional_field(
132-
message_obj.app_config, "app_config_data", dic, "app_config_data")
133-
parse_optional_field(
134-
message_obj, "channel_map", dic, "channel_map")
138+
message_obj.app_config, "app_config_data", dic, "app_config_data"
139+
)
140+
parse_optional_field(message_obj, "channel_map", dic, "channel_map")
135141

136142
if message_obj.HasField("sink_state"):
137-
dic["started"] = (message_obj.sink_state ==
138-
wirepas_messaging.gateway.ON)
143+
dic["started"] = message_obj.sink_state == wirepas_messaging.gateway.ON
139144

140145

141146
def set_config_rw(message_obj, dic):
@@ -155,27 +160,22 @@ def set_config_rw(message_obj, dic):
155160
# Field is unknown, just skip it
156161
pass
157162

158-
set_optional_field(
159-
message_obj, "node_address", dic, "node_address")
160-
set_optional_field(
161-
message_obj, "network_address", dic, "network_address")
162-
set_optional_field(
163-
message_obj, "network_channel", dic, "network_channel")
163+
set_optional_field(message_obj, "node_address", dic, "node_address")
164+
set_optional_field(message_obj, "network_address", dic, "network_address")
165+
set_optional_field(message_obj, "network_channel", dic, "network_channel")
164166

165167
set_optional_field(
166-
message_obj.app_config, "diag_interval_s", dic, "app_config_diag")
167-
set_optional_field(
168-
message_obj.app_config, "seq", dic, "app_config_seq")
168+
message_obj.app_config, "diag_interval_s", dic, "app_config_diag"
169+
)
170+
set_optional_field(message_obj.app_config, "seq", dic, "app_config_seq")
169171

170172
try:
171-
message_obj.app_config.app_config_data = bytes(
172-
dic["app_config_data"])
173+
message_obj.app_config.app_config_data = bytes(dic["app_config_data"])
173174
except KeyError:
174175
# Field is unknown, just skip it
175176
pass
176177

177-
set_optional_field(
178-
message_obj, "channel_map", dic, "channel_map")
178+
set_optional_field(message_obj, "channel_map", dic, "channel_map")
179179

180180
try:
181181
if dic["started"]:
@@ -198,10 +198,8 @@ def parse_config_keys(message_obj, dic):
198198
dic (dict): the dictionary where to copy the keys into
199199
"""
200200

201-
parse_optional_field(
202-
message_obj.keys, "cipher", dic, "cipher_key")
203-
parse_optional_field(
204-
message_obj.keys, "authentication", dic, "authentication_key")
201+
parse_optional_field(message_obj.keys, "cipher", dic, "cipher_key")
202+
parse_optional_field(message_obj.keys, "authentication", dic, "authentication_key")
205203

206204

207205
def set_config_keys(message_obj, dic):
@@ -214,10 +212,8 @@ def set_config_keys(message_obj, dic):
214212
message_obj (proto): protocol buffer object
215213
dic (dict): the dictionary where to copy the keys from
216214
"""
217-
set_optional_field(
218-
message_obj, "cipher", dic, "cipher_key")
219-
set_optional_field(
220-
message_obj, "authentication", dic, "authentication_key")
215+
set_optional_field(message_obj, "cipher", dic, "cipher_key")
216+
set_optional_field(message_obj, "authentication", dic, "authentication_key")
221217

222218

223219
def parse_config_ro(message_obj, dic):
@@ -230,36 +226,31 @@ def parse_config_ro(message_obj, dic):
230226
231227
"""
232228
parse_optional_field(
233-
message_obj.current_ac_range, "min_ms", dic, "current_ac_range_min")
229+
message_obj.current_ac_range, "min_ms", dic, "current_ac_range_min"
230+
)
234231
parse_optional_field(
235-
message_obj.current_ac_range, "max_ms", dic, "current_ac_range_max")
232+
message_obj.current_ac_range, "max_ms", dic, "current_ac_range_max"
233+
)
236234

237-
parse_optional_field(
238-
message_obj.ac_limits, "min_ms", dic, "min_ac")
239-
parse_optional_field(
240-
message_obj.ac_limits, "max_ms", dic, "max_ac")
235+
parse_optional_field(message_obj.ac_limits, "min_ms", dic, "min_ac")
236+
parse_optional_field(message_obj.ac_limits, "max_ms", dic, "max_ac")
241237

242-
parse_optional_field(
243-
message_obj, "max_mtu", dic, "max_mtu")
238+
parse_optional_field(message_obj, "max_mtu", dic, "max_mtu")
244239

245-
parse_optional_field(
246-
message_obj.channel_limits, "min_channel", dic, "min_ch")
247-
parse_optional_field(
248-
message_obj.channel_limits, "max_channel", dic, "max_ch")
249-
parse_optional_field(
250-
message_obj, "hw_magic", dic, "hw_magic")
251-
parse_optional_field(
252-
message_obj, "stack_profile", dic, "stack_profile")
253-
parse_optional_field(
254-
message_obj, "app_config_max_size", dic, "app_config_max_size")
255-
parse_optional_field(
256-
message_obj, "are_keys_set", dic, "are_keys_set")
240+
parse_optional_field(message_obj.channel_limits, "min_channel", dic, "min_ch")
241+
parse_optional_field(message_obj.channel_limits, "max_channel", dic, "max_ch")
242+
parse_optional_field(message_obj, "hw_magic", dic, "hw_magic")
243+
parse_optional_field(message_obj, "stack_profile", dic, "stack_profile")
244+
parse_optional_field(message_obj, "app_config_max_size", dic, "app_config_max_size")
245+
parse_optional_field(message_obj, "are_keys_set", dic, "are_keys_set")
257246

258247
if message_obj.HasField("firmware_version"):
259-
dic["firmware_version"] = [message_obj.firmware_version.major,
260-
message_obj.firmware_version.minor,
261-
message_obj.firmware_version.maint,
262-
message_obj.firmware_version.dev]
248+
dic["firmware_version"] = [
249+
message_obj.firmware_version.major,
250+
message_obj.firmware_version.minor,
251+
message_obj.firmware_version.maint,
252+
message_obj.firmware_version.dev,
253+
]
263254

264255

265256
def set_config_ro(message_obj, dic):
@@ -271,32 +262,21 @@ def set_config_ro(message_obj, dic):
271262
dic (dict): the dictionary where to copy the ro fields from
272263
273264
"""
274-
set_optional_field(
275-
message_obj.current_ac_range, "min_ms", dic, "min_ac_cur")
276-
set_optional_field(
277-
message_obj.current_ac_range, "max_ms", dic, "max_ac_cur")
265+
set_optional_field(message_obj.current_ac_range, "min_ms", dic, "min_ac_cur")
266+
set_optional_field(message_obj.current_ac_range, "max_ms", dic, "max_ac_cur")
278267

279-
set_optional_field(
280-
message_obj.ac_limits, "min_ms", dic, "min_ac")
281-
set_optional_field(
282-
message_obj.ac_limits, "max_ms", dic, "max_ac")
268+
set_optional_field(message_obj.ac_limits, "min_ms", dic, "min_ac")
269+
set_optional_field(message_obj.ac_limits, "max_ms", dic, "max_ac")
283270

284-
set_optional_field(
285-
message_obj, "max_mtu", dic, "max_mtu")
271+
set_optional_field(message_obj, "max_mtu", dic, "max_mtu")
286272

287-
set_optional_field(
288-
message_obj.channel_limits, "min_channel", dic, "min_ch")
289-
set_optional_field(
290-
message_obj.channel_limits, "max_channel", dic, "max_ch")
273+
set_optional_field(message_obj.channel_limits, "min_channel", dic, "min_ch")
274+
set_optional_field(message_obj.channel_limits, "max_channel", dic, "max_ch")
291275

292-
set_optional_field(
293-
message_obj, "hw_magic", dic, "hw_magic")
294-
set_optional_field(
295-
message_obj, "stack_profile", dic, "stack_profile")
296-
set_optional_field(
297-
message_obj, "app_config_max_size", dic, "app_config_max_size")
298-
set_optional_field(
299-
message_obj, "are_keys_set", dic, "are_keys_set")
276+
set_optional_field(message_obj, "hw_magic", dic, "hw_magic")
277+
set_optional_field(message_obj, "stack_profile", dic, "stack_profile")
278+
set_optional_field(message_obj, "app_config_max_size", dic, "app_config_max_size")
279+
set_optional_field(message_obj, "are_keys_set", dic, "are_keys_set")
300280

301281
try:
302282
message_obj.firmware_version.major = dic["firmware_version"][0]

0 commit comments

Comments
 (0)