summaryrefslogtreecommitdiff
path: root/network/__init__.py
diff options
context:
space:
mode:
authorCarlo Zancanaro <carlo@zancanaro.id.au>2022-09-04 14:18:02 +1000
committerCarlo Zancanaro <carlo@zancanaro.id.au>2022-09-24 21:19:23 +1000
commite031af6e5e8324fe4cda66d9597904040b17ca80 (patch)
tree0917439655016b088ffe10ae76f85c7e97f1f621 /network/__init__.py
parent833f87ebba90e6c2d3cb386b2d51c3d113d98a54 (diff)
Vendor the "simple-network" library
Diffstat (limited to 'network/__init__.py')
-rw-r--r--network/__init__.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/network/__init__.py b/network/__init__.py
new file mode 100644
index 0000000..3812173
--- /dev/null
+++ b/network/__init__.py
@@ -0,0 +1,16 @@
+import warnings
+
+from gi.repository import GLib
+
+# GLib.threads_init() is deprecated, which is awesome, but it prints out an
+# error message which will be confusing to beginners.
+# I don't want to remove this either, as the library still needs to be usable on
+# older systems.
+# So we monkey-patch the warning away.
+_warn = warnings.warn
+warnings.warn = lambda *a, **k: None
+GLib.threads_init()
+warnings.warn = _warn
+
+from network.client import Client
+from network.server import Server