From 0cef06208496deb433cd03757727b5032f1acfb0 Mon Sep 17 00:00:00 2001
From: ed
Date: Thu, 1 Dec 2022 21:44:31 +0000
Subject: [PATCH] misc cleanup
---
.vscode/launch.py | 4 ++--
bin/up2k.py | 3 +--
copyparty/__init__.py | 2 +-
copyparty/util.py | 2 +-
copyparty/web/svcs.html | 2 +-
5 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/.vscode/launch.py b/.vscode/launch.py
index 8f7491b2..7c3e443e 100755
--- a/.vscode/launch.py
+++ b/.vscode/launch.py
@@ -11,15 +11,15 @@ import sys
print(sys.executable)
+import json5
import shlex
-import jstyleson
import subprocess as sp
with open(".vscode/launch.json", "r", encoding="utf-8") as f:
tj = f.read()
-oj = jstyleson.loads(tj)
+oj = json5.loads(tj)
argv = oj["configurations"][0]["args"]
try:
diff --git a/bin/up2k.py b/bin/up2k.py
index 801f3f7c..1e6d0ac6 100755
--- a/bin/up2k.py
+++ b/bin/up2k.py
@@ -51,8 +51,7 @@ except ImportError:
PY2 = sys.version_info < (3,)
if PY2:
from Queue import Queue
- from urllib import unquote
- from urllib import quote
+ from urllib import quote, unquote
sys.dont_write_bytecode = True
bytes = str
diff --git a/copyparty/__init__.py b/copyparty/__init__.py
index a9bdaf95..9adc6dd6 100644
--- a/copyparty/__init__.py
+++ b/copyparty/__init__.py
@@ -12,7 +12,7 @@ except:
TYPE_CHECKING = False
if True:
- from typing import Any, Union, Callable
+ from typing import Any, Callable, Union
PY2 = sys.version_info < (3,)
if not PY2:
diff --git a/copyparty/util.py b/copyparty/util.py
index 77e20778..f0e98c9f 100644
--- a/copyparty/util.py
+++ b/copyparty/util.py
@@ -458,7 +458,7 @@ class NetMap(object):
fam = socket.AF_INET6 if v6 else socket.AF_INET
bip = socket.inet_pton(fam, ip.split("/")[0])
self.bip.append(bip)
- self.b2sip[bip] = ip.split('/')[0]
+ self.b2sip[bip] = ip.split("/")[0]
self.b2net[bip] = (IPv6Network if v6 else IPv4Network)(ip, False)
self.bip.sort(reverse=True)
diff --git a/copyparty/web/svcs.html b/copyparty/web/svcs.html
index 53876857..e46fa969 100644
--- a/copyparty/web/svcs.html
+++ b/copyparty/web/svcs.html
@@ -152,7 +152,7 @@
partyfuse.py{% if accs %} -a {{ pw }}{% endif %} http{{ s }}://{{ ep }}/{{ vp }} W:mp
{% if s %}
-
note: if you are on LAN (or just dont have valid certificates), add -td
note: if you are on LAN (or just dont have valid certificates), add -td
you can use up2k.py to upload (sometimes faster than web-browsers)