python-osc 1.9.0__tar.gz → 1.9.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_osc-1.9.0/python_osc.egg-info → python_osc-1.9.2}/PKG-INFO +7 -4
- {python_osc-1.9.0 → python_osc-1.9.2}/README.rst +6 -3
- python_osc-1.9.2/pyproject.toml +58 -0
- {python_osc-1.9.0 → python_osc-1.9.2/python_osc.egg-info}/PKG-INFO +7 -4
- {python_osc-1.9.0 → python_osc-1.9.2}/python_osc.egg-info/SOURCES.txt +0 -1
- {python_osc-1.9.0 → python_osc-1.9.2}/pythonosc/dispatcher.py +2 -3
- {python_osc-1.9.0 → python_osc-1.9.2}/pythonosc/osc_bundle.py +3 -3
- {python_osc-1.9.0 → python_osc-1.9.2}/pythonosc/osc_bundle_builder.py +2 -3
- {python_osc-1.9.0 → python_osc-1.9.2}/pythonosc/osc_message.py +3 -7
- {python_osc-1.9.0 → python_osc-1.9.2}/pythonosc/osc_message_builder.py +4 -8
- {python_osc-1.9.0 → python_osc-1.9.2}/pythonosc/osc_packet.py +1 -1
- {python_osc-1.9.0 → python_osc-1.9.2}/pythonosc/parsing/osc_types.py +17 -17
- python_osc-1.9.2/setup.cfg +4 -0
- python_osc-1.9.0/pyproject.toml +0 -21
- python_osc-1.9.0/setup.cfg +0 -18
- {python_osc-1.9.0 → python_osc-1.9.2}/LICENSE.txt +0 -0
- {python_osc-1.9.0 → python_osc-1.9.2}/MANIFEST.in +0 -0
- {python_osc-1.9.0 → python_osc-1.9.2}/python_osc.egg-info/dependency_links.txt +0 -0
- {python_osc-1.9.0 → python_osc-1.9.2}/python_osc.egg-info/top_level.txt +0 -0
- {python_osc-1.9.0 → python_osc-1.9.2}/pythonosc/__init__.py +0 -0
- {python_osc-1.9.0 → python_osc-1.9.2}/pythonosc/osc_server.py +0 -0
- {python_osc-1.9.0 → python_osc-1.9.2}/pythonosc/osc_tcp_server.py +0 -0
- {python_osc-1.9.0 → python_osc-1.9.2}/pythonosc/parsing/__init__.py +0 -0
- {python_osc-1.9.0 → python_osc-1.9.2}/pythonosc/parsing/ntp.py +0 -0
- {python_osc-1.9.0 → python_osc-1.9.2}/pythonosc/slip.py +0 -0
- {python_osc-1.9.0 → python_osc-1.9.2}/pythonosc/tcp_client.py +0 -0
- {python_osc-1.9.0 → python_osc-1.9.2}/pythonosc/test/__init__.py +0 -0
- {python_osc-1.9.0 → python_osc-1.9.2}/pythonosc/test/parsing/__init__.py +0 -0
- {python_osc-1.9.0 → python_osc-1.9.2}/pythonosc/test/parsing/test_ntp.py +0 -0
- {python_osc-1.9.0 → python_osc-1.9.2}/pythonosc/test/parsing/test_osc_types.py +0 -0
- {python_osc-1.9.0 → python_osc-1.9.2}/pythonosc/test/test_dispatcher.py +0 -0
- {python_osc-1.9.0 → python_osc-1.9.2}/pythonosc/test/test_osc_bundle.py +0 -0
- {python_osc-1.9.0 → python_osc-1.9.2}/pythonosc/test/test_osc_bundle_builder.py +0 -0
- {python_osc-1.9.0 → python_osc-1.9.2}/pythonosc/test/test_osc_message.py +0 -0
- {python_osc-1.9.0 → python_osc-1.9.2}/pythonosc/test/test_osc_message_builder.py +0 -0
- {python_osc-1.9.0 → python_osc-1.9.2}/pythonosc/test/test_osc_packet.py +0 -0
- {python_osc-1.9.0 → python_osc-1.9.2}/pythonosc/test/test_osc_server.py +0 -0
- {python_osc-1.9.0 → python_osc-1.9.2}/pythonosc/test/test_osc_tcp_server.py +0 -0
- {python_osc-1.9.0 → python_osc-1.9.2}/pythonosc/test/test_tcp_client.py +0 -0
- {python_osc-1.9.0 → python_osc-1.9.2}/pythonosc/test/test_udp_client.py +0 -0
- {python_osc-1.9.0 → python_osc-1.9.2}/pythonosc/udp_client.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: python-osc
|
|
3
|
-
Version: 1.9.
|
|
3
|
+
Version: 1.9.2
|
|
4
4
|
Summary: Open Sound Control server and client implementations in pure Python
|
|
5
5
|
Author-email: attwad <tmusoft@gmail.com>
|
|
6
6
|
License: This is free and unencumbered software released into the public domain.
|
|
@@ -60,10 +60,12 @@ and is currently in a stable state.
|
|
|
60
60
|
Features
|
|
61
61
|
========
|
|
62
62
|
|
|
63
|
-
* UDP blocking/threading/forking/asyncio server implementations
|
|
64
|
-
* UDP
|
|
63
|
+
* UDP and TCP blocking/threading/forking/asyncio server implementations
|
|
64
|
+
* UDP and TCP clients, including asyncio support
|
|
65
|
+
* TCP support for 1.0 and 1.1 protocol formats
|
|
65
66
|
* int, int64, float, string, double, MIDI, timestamps, blob, nil OSC arguments
|
|
66
67
|
* simple OSC address<->callback matching system
|
|
68
|
+
* support for sending responses from callback handlers in client and server
|
|
67
69
|
* extensive unit test coverage
|
|
68
70
|
* basic client and server examples
|
|
69
71
|
|
|
@@ -188,7 +190,8 @@ Building bundles
|
|
|
188
190
|
# The bundle has 5 elements in total now.
|
|
189
191
|
|
|
190
192
|
bundle = bundle.build()
|
|
191
|
-
# You can now send it via a client
|
|
193
|
+
# You can now send it via a client with the `.send()` method:
|
|
194
|
+
client.send(bundle)
|
|
192
195
|
|
|
193
196
|
License?
|
|
194
197
|
========
|
|
@@ -18,10 +18,12 @@ and is currently in a stable state.
|
|
|
18
18
|
Features
|
|
19
19
|
========
|
|
20
20
|
|
|
21
|
-
* UDP blocking/threading/forking/asyncio server implementations
|
|
22
|
-
* UDP
|
|
21
|
+
* UDP and TCP blocking/threading/forking/asyncio server implementations
|
|
22
|
+
* UDP and TCP clients, including asyncio support
|
|
23
|
+
* TCP support for 1.0 and 1.1 protocol formats
|
|
23
24
|
* int, int64, float, string, double, MIDI, timestamps, blob, nil OSC arguments
|
|
24
25
|
* simple OSC address<->callback matching system
|
|
26
|
+
* support for sending responses from callback handlers in client and server
|
|
25
27
|
* extensive unit test coverage
|
|
26
28
|
* basic client and server examples
|
|
27
29
|
|
|
@@ -146,7 +148,8 @@ Building bundles
|
|
|
146
148
|
# The bundle has 5 elements in total now.
|
|
147
149
|
|
|
148
150
|
bundle = bundle.build()
|
|
149
|
-
# You can now send it via a client
|
|
151
|
+
# You can now send it via a client with the `.send()` method:
|
|
152
|
+
client.send(bundle)
|
|
150
153
|
|
|
151
154
|
License?
|
|
152
155
|
========
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "python-osc"
|
|
7
|
+
version = "1.9.2"
|
|
8
|
+
description = "Open Sound Control server and client implementations in pure Python"
|
|
9
|
+
readme = "README.rst"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = { file = "LICENSE.txt" }
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "attwad", email = "tmusoft@gmail.com" },
|
|
14
|
+
]
|
|
15
|
+
keywords = ["osc", "sound", "midi", "music"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 5 - Production/Stable",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"License :: Freely Distributable",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Topic :: Multimedia :: Sound/Audio",
|
|
22
|
+
"Topic :: System :: Networking",
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
[project.urls]
|
|
26
|
+
Repository = "https://github.com/attwad/python-osc"
|
|
27
|
+
|
|
28
|
+
[tool.mypy]
|
|
29
|
+
# Would be great to turn this on, however there's too many cases it would break
|
|
30
|
+
# right now.
|
|
31
|
+
# disallow_any_generics = true
|
|
32
|
+
|
|
33
|
+
disallow_subclassing_any = true
|
|
34
|
+
|
|
35
|
+
# Allow functions _without_ type annotations, but require that annotations be
|
|
36
|
+
# complete (possibly including the `Any` type) where they are present.
|
|
37
|
+
disallow_incomplete_defs = true
|
|
38
|
+
# check_untyped_defs = true
|
|
39
|
+
disallow_untyped_decorators = true
|
|
40
|
+
|
|
41
|
+
# # Would be great to turn these on eventually
|
|
42
|
+
# no_implicit_optional = true
|
|
43
|
+
# strict_optional = true
|
|
44
|
+
|
|
45
|
+
warn_redundant_casts = true
|
|
46
|
+
warn_unused_ignores = true
|
|
47
|
+
show_error_codes = true
|
|
48
|
+
# # Would be great to turn this on eventually
|
|
49
|
+
# # warn_return_any = true
|
|
50
|
+
# warn_unreachable = true
|
|
51
|
+
|
|
52
|
+
# implicit_reexport = False
|
|
53
|
+
# strict_equality = true
|
|
54
|
+
|
|
55
|
+
scripts_are_modules = true
|
|
56
|
+
warn_unused_configs = true
|
|
57
|
+
|
|
58
|
+
enable_error_code = "ignore-without-code"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: python-osc
|
|
3
|
-
Version: 1.9.
|
|
3
|
+
Version: 1.9.2
|
|
4
4
|
Summary: Open Sound Control server and client implementations in pure Python
|
|
5
5
|
Author-email: attwad <tmusoft@gmail.com>
|
|
6
6
|
License: This is free and unencumbered software released into the public domain.
|
|
@@ -60,10 +60,12 @@ and is currently in a stable state.
|
|
|
60
60
|
Features
|
|
61
61
|
========
|
|
62
62
|
|
|
63
|
-
* UDP blocking/threading/forking/asyncio server implementations
|
|
64
|
-
* UDP
|
|
63
|
+
* UDP and TCP blocking/threading/forking/asyncio server implementations
|
|
64
|
+
* UDP and TCP clients, including asyncio support
|
|
65
|
+
* TCP support for 1.0 and 1.1 protocol formats
|
|
65
66
|
* int, int64, float, string, double, MIDI, timestamps, blob, nil OSC arguments
|
|
66
67
|
* simple OSC address<->callback matching system
|
|
68
|
+
* support for sending responses from callback handlers in client and server
|
|
67
69
|
* extensive unit test coverage
|
|
68
70
|
* basic client and server examples
|
|
69
71
|
|
|
@@ -188,7 +190,8 @@ Building bundles
|
|
|
188
190
|
# The bundle has 5 elements in total now.
|
|
189
191
|
|
|
190
192
|
bundle = bundle.build()
|
|
191
|
-
# You can now send it via a client
|
|
193
|
+
# You can now send it via a client with the `.send()` method:
|
|
194
|
+
client.send(bundle)
|
|
192
195
|
|
|
193
196
|
License?
|
|
194
197
|
========
|
|
@@ -175,8 +175,7 @@ class Dispatcher(object):
|
|
|
175
175
|
except ValueError as e:
|
|
176
176
|
if str(e) == "list.remove(x): x not in list":
|
|
177
177
|
raise ValueError(
|
|
178
|
-
"Address '
|
|
179
|
-
% (address, handler)
|
|
178
|
+
f"Address '{address}' doesn't have handler '{handler}' mapped to it"
|
|
180
179
|
) from e
|
|
181
180
|
|
|
182
181
|
def handlers_for_address(
|
|
@@ -202,7 +201,7 @@ class Dispatcher(object):
|
|
|
202
201
|
pattern = pattern.replace("\\*", "[\\w|\\+]*")
|
|
203
202
|
# The rest of the syntax in the specification is like the re module so
|
|
204
203
|
# we're fine.
|
|
205
|
-
pattern = pattern
|
|
204
|
+
pattern = f"{pattern}$"
|
|
206
205
|
patterncompiled = re.compile(pattern)
|
|
207
206
|
matched = False
|
|
208
207
|
|
|
@@ -33,7 +33,7 @@ class OscBundle(object):
|
|
|
33
33
|
try:
|
|
34
34
|
self._timestamp, index = osc_types.get_date(self._dgram, index)
|
|
35
35
|
except osc_types.ParseError as pe:
|
|
36
|
-
raise ParseError("Could not get the date from the datagram:
|
|
36
|
+
raise ParseError(f"Could not get the date from the datagram: {pe}")
|
|
37
37
|
# Get the contents as a list of OscBundle and OscMessage.
|
|
38
38
|
self._contents = self._parse_contents(index)
|
|
39
39
|
|
|
@@ -61,10 +61,10 @@ class OscBundle(object):
|
|
|
61
61
|
contents.append(osc_message.OscMessage(content_dgram))
|
|
62
62
|
else:
|
|
63
63
|
logging.warning(
|
|
64
|
-
"Could not identify content type of dgram
|
|
64
|
+
f"Could not identify content type of dgram {content_dgram!r}"
|
|
65
65
|
)
|
|
66
66
|
except (osc_types.ParseError, osc_message.ParseError, IndexError) as e:
|
|
67
|
-
raise ParseError("Could not parse a content datagram:
|
|
67
|
+
raise ParseError(f"Could not parse a content datagram: {e}")
|
|
68
68
|
|
|
69
69
|
return contents
|
|
70
70
|
|
|
@@ -53,9 +53,8 @@ class OscBundleBuilder(object):
|
|
|
53
53
|
dgram += content.dgram
|
|
54
54
|
else:
|
|
55
55
|
raise BuildError(
|
|
56
|
-
"Content must be either OscBundle or OscMessage"
|
|
57
|
-
"found {}".format(type(content))
|
|
56
|
+
f"Content must be either OscBundle or OscMessage, found {type(content)}"
|
|
58
57
|
)
|
|
59
58
|
return osc_bundle.OscBundle(dgram)
|
|
60
59
|
except osc_types.BuildError as be:
|
|
61
|
-
raise BuildError("Could not build the bundle {}"
|
|
60
|
+
raise BuildError(f"Could not build the bundle {be}")
|
|
@@ -73,21 +73,17 @@ class OscMessage(object):
|
|
|
73
73
|
elif param == "]": # Array stop.
|
|
74
74
|
if len(param_stack) < 2:
|
|
75
75
|
raise ParseError(
|
|
76
|
-
"Unexpected closing bracket in type tag: {
|
|
77
|
-
type_tag
|
|
78
|
-
)
|
|
76
|
+
f"Unexpected closing bracket in type tag: {type_tag}"
|
|
79
77
|
)
|
|
80
78
|
param_stack.pop()
|
|
81
79
|
# TODO: Support more exotic types as described in the specification.
|
|
82
80
|
else:
|
|
83
|
-
logging.warning("Unhandled parameter type: {
|
|
81
|
+
logging.warning(f"Unhandled parameter type: {param}")
|
|
84
82
|
continue
|
|
85
83
|
if param not in "[]":
|
|
86
84
|
param_stack[-1].append(val)
|
|
87
85
|
if len(param_stack) != 1:
|
|
88
|
-
raise ParseError(
|
|
89
|
-
"Missing closing bracket in type tag: {0}".format(type_tag)
|
|
90
|
-
)
|
|
86
|
+
raise ParseError(f"Missing closing bracket in type tag: {type_tag}")
|
|
91
87
|
self._parameters = params
|
|
92
88
|
except osc_types.ParseError as pe:
|
|
93
89
|
raise ParseError("Found incorrect datagram, ignoring it", pe)
|
|
@@ -90,9 +90,7 @@ class OscMessageBuilder(object):
|
|
|
90
90
|
"""
|
|
91
91
|
if arg_type and not self._valid_type(arg_type):
|
|
92
92
|
raise ValueError(
|
|
93
|
-
"arg_type must be one of {}, or an array of valid types"
|
|
94
|
-
self._SUPPORTED_ARG_TYPES
|
|
95
|
-
)
|
|
93
|
+
f"arg_type must be one of {self._SUPPORTED_ARG_TYPES}, or an array of valid types"
|
|
96
94
|
)
|
|
97
95
|
if not arg_type:
|
|
98
96
|
arg_type = self._get_arg_type(arg_value)
|
|
@@ -161,7 +159,7 @@ class OscMessageBuilder(object):
|
|
|
161
159
|
|
|
162
160
|
# Write the parameters.
|
|
163
161
|
arg_types = "".join([arg[0] for arg in self._args])
|
|
164
|
-
dgram += osc_types.write_string(","
|
|
162
|
+
dgram += osc_types.write_string(f",{arg_types}")
|
|
165
163
|
for arg_type, value in self._args:
|
|
166
164
|
if arg_type == self.ARG_TYPE_STRING:
|
|
167
165
|
dgram += osc_types.write_string(value) # type: ignore[arg-type]
|
|
@@ -188,13 +186,11 @@ class OscMessageBuilder(object):
|
|
|
188
186
|
):
|
|
189
187
|
continue
|
|
190
188
|
else:
|
|
191
|
-
raise BuildError(
|
|
192
|
-
"Incorrect parameter type found {}".format(arg_type)
|
|
193
|
-
)
|
|
189
|
+
raise BuildError(f"Incorrect parameter type found {arg_type}")
|
|
194
190
|
|
|
195
191
|
return osc_message.OscMessage(dgram)
|
|
196
192
|
except osc_types.BuildError as be:
|
|
197
|
-
raise BuildError("Could not build the message: {}"
|
|
193
|
+
raise BuildError(f"Could not build the message: {be}")
|
|
198
194
|
|
|
199
195
|
|
|
200
196
|
def build_msg(address: str, value: ArgValue = "") -> osc_message.OscMessage:
|
|
@@ -76,7 +76,7 @@ class OscPacket(object):
|
|
|
76
76
|
"OscBundle."
|
|
77
77
|
)
|
|
78
78
|
except (osc_bundle.ParseError, osc_message.ParseError) as pe:
|
|
79
|
-
raise ParseError("Could not parse packet
|
|
79
|
+
raise ParseError(f"Could not parse packet {pe}")
|
|
80
80
|
|
|
81
81
|
@property
|
|
82
82
|
def messages(self) -> List[TimedMessage]:
|
|
@@ -43,7 +43,7 @@ def write_string(val: str) -> bytes:
|
|
|
43
43
|
try:
|
|
44
44
|
dgram = val.encode("utf-8") # Default, but better be explicit.
|
|
45
45
|
except (UnicodeEncodeError, AttributeError) as e:
|
|
46
|
-
raise BuildError("Incorrect string, could not encode {}"
|
|
46
|
+
raise BuildError(f"Incorrect string, could not encode {e}")
|
|
47
47
|
diff = _STRING_DGRAM_PAD - (len(dgram) % _STRING_DGRAM_PAD)
|
|
48
48
|
dgram += b"\x00" * diff
|
|
49
49
|
return dgram
|
|
@@ -90,9 +90,9 @@ def get_string(dgram: bytes, start_index: int) -> Tuple[str, int]:
|
|
|
90
90
|
data_str = dgram[start_index : start_index + offset]
|
|
91
91
|
return data_str.replace(b"\x00", b"").decode("utf-8"), start_index + offset
|
|
92
92
|
except IndexError as ie:
|
|
93
|
-
raise ParseError("Could not parse datagram
|
|
93
|
+
raise ParseError(f"Could not parse datagram {ie}")
|
|
94
94
|
except TypeError as te:
|
|
95
|
-
raise ParseError("Could not parse datagram
|
|
95
|
+
raise ParseError(f"Could not parse datagram {te}")
|
|
96
96
|
|
|
97
97
|
|
|
98
98
|
def write_int(val: int) -> bytes:
|
|
@@ -104,7 +104,7 @@ def write_int(val: int) -> bytes:
|
|
|
104
104
|
try:
|
|
105
105
|
return struct.pack(">i", val)
|
|
106
106
|
except struct.error as e:
|
|
107
|
-
raise BuildError("Wrong argument value passed: {}"
|
|
107
|
+
raise BuildError(f"Wrong argument value passed: {e}")
|
|
108
108
|
|
|
109
109
|
|
|
110
110
|
def get_int(dgram: bytes, start_index: int) -> Tuple[int, int]:
|
|
@@ -128,7 +128,7 @@ def get_int(dgram: bytes, start_index: int) -> Tuple[int, int]:
|
|
|
128
128
|
start_index + _INT_DGRAM_LEN,
|
|
129
129
|
)
|
|
130
130
|
except (struct.error, TypeError) as e:
|
|
131
|
-
raise ParseError("Could not parse datagram
|
|
131
|
+
raise ParseError(f"Could not parse datagram {e}")
|
|
132
132
|
|
|
133
133
|
|
|
134
134
|
def write_int64(val: int) -> bytes:
|
|
@@ -140,7 +140,7 @@ def write_int64(val: int) -> bytes:
|
|
|
140
140
|
try:
|
|
141
141
|
return struct.pack(">q", val)
|
|
142
142
|
except struct.error as e:
|
|
143
|
-
raise BuildError("Wrong argument value passed: {}"
|
|
143
|
+
raise BuildError(f"Wrong argument value passed: {e}")
|
|
144
144
|
|
|
145
145
|
|
|
146
146
|
def get_int64(dgram: bytes, start_index: int) -> Tuple[int, int]:
|
|
@@ -164,7 +164,7 @@ def get_int64(dgram: bytes, start_index: int) -> Tuple[int, int]:
|
|
|
164
164
|
start_index + _INT64_DGRAM_LEN,
|
|
165
165
|
)
|
|
166
166
|
except (struct.error, TypeError) as e:
|
|
167
|
-
raise ParseError("Could not parse datagram
|
|
167
|
+
raise ParseError(f"Could not parse datagram {e}")
|
|
168
168
|
|
|
169
169
|
|
|
170
170
|
def get_uint64(dgram: bytes, start_index: int) -> Tuple[int, int]:
|
|
@@ -190,7 +190,7 @@ def get_uint64(dgram: bytes, start_index: int) -> Tuple[int, int]:
|
|
|
190
190
|
start_index + _UINT64_DGRAM_LEN,
|
|
191
191
|
)
|
|
192
192
|
except (struct.error, TypeError) as e:
|
|
193
|
-
raise ParseError("Could not parse datagram
|
|
193
|
+
raise ParseError(f"Could not parse datagram {e}")
|
|
194
194
|
|
|
195
195
|
|
|
196
196
|
def get_timetag(dgram: bytes, start_index: int) -> Tuple[Tuple[datetime, int], int]:
|
|
@@ -223,7 +223,7 @@ def get_timetag(dgram: bytes, start_index: int) -> Tuple[Tuple[datetime, int], i
|
|
|
223
223
|
|
|
224
224
|
return (utc, fraction), start_index + _TIMETAG_DGRAM_LEN
|
|
225
225
|
except (struct.error, TypeError) as e:
|
|
226
|
-
raise ParseError("Could not parse datagram
|
|
226
|
+
raise ParseError(f"Could not parse datagram {e}")
|
|
227
227
|
|
|
228
228
|
|
|
229
229
|
def write_float(val: float) -> bytes:
|
|
@@ -235,7 +235,7 @@ def write_float(val: float) -> bytes:
|
|
|
235
235
|
try:
|
|
236
236
|
return struct.pack(">f", val)
|
|
237
237
|
except struct.error as e:
|
|
238
|
-
raise BuildError("Wrong argument value passed: {}"
|
|
238
|
+
raise BuildError(f"Wrong argument value passed: {e}")
|
|
239
239
|
|
|
240
240
|
|
|
241
241
|
def get_float(dgram: bytes, start_index: int) -> Tuple[float, int]:
|
|
@@ -262,7 +262,7 @@ def get_float(dgram: bytes, start_index: int) -> Tuple[float, int]:
|
|
|
262
262
|
start_index + _FLOAT_DGRAM_LEN,
|
|
263
263
|
)
|
|
264
264
|
except (struct.error, TypeError) as e:
|
|
265
|
-
raise ParseError("Could not parse datagram
|
|
265
|
+
raise ParseError(f"Could not parse datagram {e}")
|
|
266
266
|
|
|
267
267
|
|
|
268
268
|
def write_double(val: float) -> bytes:
|
|
@@ -274,7 +274,7 @@ def write_double(val: float) -> bytes:
|
|
|
274
274
|
try:
|
|
275
275
|
return struct.pack(">d", val)
|
|
276
276
|
except struct.error as e:
|
|
277
|
-
raise BuildError("Wrong argument value passed: {}"
|
|
277
|
+
raise BuildError(f"Wrong argument value passed: {e}")
|
|
278
278
|
|
|
279
279
|
|
|
280
280
|
def get_double(dgram: bytes, start_index: int) -> Tuple[float, int]:
|
|
@@ -300,7 +300,7 @@ def get_double(dgram: bytes, start_index: int) -> Tuple[float, int]:
|
|
|
300
300
|
start_index + _DOUBLE_DGRAM_LEN,
|
|
301
301
|
)
|
|
302
302
|
except (struct.error, TypeError) as e:
|
|
303
|
-
raise ParseError("Could not parse datagram {}"
|
|
303
|
+
raise ParseError(f"Could not parse datagram {e}")
|
|
304
304
|
|
|
305
305
|
|
|
306
306
|
def get_blob(dgram: bytes, start_index: int) -> Tuple[bytes, int]:
|
|
@@ -393,7 +393,7 @@ def write_rgba(val: bytes) -> bytes:
|
|
|
393
393
|
try:
|
|
394
394
|
return struct.pack(">I", val)
|
|
395
395
|
except struct.error as e:
|
|
396
|
-
raise BuildError("Wrong argument value passed: {}"
|
|
396
|
+
raise BuildError(f"Wrong argument value passed: {e}")
|
|
397
397
|
|
|
398
398
|
|
|
399
399
|
def get_rgba(dgram: bytes, start_index: int) -> Tuple[bytes, int]:
|
|
@@ -417,7 +417,7 @@ def get_rgba(dgram: bytes, start_index: int) -> Tuple[bytes, int]:
|
|
|
417
417
|
start_index + _INT_DGRAM_LEN,
|
|
418
418
|
)
|
|
419
419
|
except (struct.error, TypeError) as e:
|
|
420
|
-
raise ParseError("Could not parse datagram
|
|
420
|
+
raise ParseError(f"Could not parse datagram {e}")
|
|
421
421
|
|
|
422
422
|
|
|
423
423
|
def write_midi(val: MidiPacket) -> bytes:
|
|
@@ -435,7 +435,7 @@ def write_midi(val: MidiPacket) -> bytes:
|
|
|
435
435
|
value = sum((value & 0xFF) << 8 * (3 - pos) for pos, value in enumerate(val))
|
|
436
436
|
return struct.pack(">I", value)
|
|
437
437
|
except struct.error as e:
|
|
438
|
-
raise BuildError("Wrong argument value passed: {}"
|
|
438
|
+
raise BuildError(f"Wrong argument value passed: {e}")
|
|
439
439
|
|
|
440
440
|
|
|
441
441
|
def get_midi(dgram: bytes, start_index: int) -> Tuple[MidiPacket, int]:
|
|
@@ -460,4 +460,4 @@ def get_midi(dgram: bytes, start_index: int) -> Tuple[MidiPacket, int]:
|
|
|
460
460
|
)
|
|
461
461
|
return (midi_msg, start_index + _INT_DGRAM_LEN)
|
|
462
462
|
except (struct.error, TypeError) as e:
|
|
463
|
-
raise ParseError("Could not parse datagram
|
|
463
|
+
raise ParseError(f"Could not parse datagram {e}")
|
python_osc-1.9.0/pyproject.toml
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
[project]
|
|
2
|
-
name = "python-osc"
|
|
3
|
-
version="1.9.0"
|
|
4
|
-
description="Open Sound Control server and client implementations in pure Python"
|
|
5
|
-
readme="README.rst"
|
|
6
|
-
requires-python=">=3.10"
|
|
7
|
-
license = {file = "LICENSE.txt"}
|
|
8
|
-
authors = [
|
|
9
|
-
{name = "attwad", email = "tmusoft@gmail.com"},
|
|
10
|
-
]
|
|
11
|
-
keywords = ["osc", "sound", "midi", "music"]
|
|
12
|
-
classifiers=[
|
|
13
|
-
'Development Status :: 5 - Production/Stable',
|
|
14
|
-
'Intended Audience :: Developers',
|
|
15
|
-
'License :: Freely Distributable',
|
|
16
|
-
'Programming Language :: Python :: 3',
|
|
17
|
-
'Topic :: Multimedia :: Sound/Audio',
|
|
18
|
-
'Topic :: System :: Networking',
|
|
19
|
-
]
|
|
20
|
-
[project.urls]
|
|
21
|
-
Repository = "https://github.com/attwad/python-osc"
|
python_osc-1.9.0/setup.cfg
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
[metadata]
|
|
2
|
-
license_files = LICENSE.txt
|
|
3
|
-
|
|
4
|
-
[mypy]
|
|
5
|
-
disallow_subclassing_any = True
|
|
6
|
-
disallow_incomplete_defs = True
|
|
7
|
-
disallow_untyped_decorators = True
|
|
8
|
-
warn_redundant_casts = True
|
|
9
|
-
warn_unused_ignores = True
|
|
10
|
-
show_error_codes = True
|
|
11
|
-
scripts_are_modules = True
|
|
12
|
-
warn_unused_configs = True
|
|
13
|
-
enable_error_code = ignore-without-code
|
|
14
|
-
|
|
15
|
-
[egg_info]
|
|
16
|
-
tag_build =
|
|
17
|
-
tag_date = 0
|
|
18
|
-
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|