mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
tweaks
This commit is contained in:
parent
6e43ee7cc7
commit
0cda38f53d
|
@ -16,7 +16,7 @@ import argparse
|
||||||
from textwrap import dedent
|
from textwrap import dedent
|
||||||
|
|
||||||
from .__init__ import E, WINDOWS, VT100
|
from .__init__ import E, WINDOWS, VT100
|
||||||
from .__version__ import S_VERSION, S_BUILD_DT
|
from .__version__ import S_VERSION, S_BUILD_DT, CODENAME
|
||||||
from .svchub import SvcHub
|
from .svchub import SvcHub
|
||||||
from .util import py_desc
|
from .util import py_desc
|
||||||
|
|
||||||
|
@ -88,8 +88,10 @@ def main():
|
||||||
if WINDOWS:
|
if WINDOWS:
|
||||||
os.system("") # enables colors
|
os.system("") # enables colors
|
||||||
|
|
||||||
f = "\033[36mcopyparty v{} ({})\n python v{}\033[0m\n"
|
desc = py_desc().replace("[", "\033[1;30m[")
|
||||||
print(f.format(S_VERSION, S_BUILD_DT, py_desc()))
|
|
||||||
|
f = '\033[36mcopyparty v{} "\033[35m{}\033[36m" ({})\n{}\033[0m\n'
|
||||||
|
print(f.format(S_VERSION, CODENAME, S_BUILD_DT, desc))
|
||||||
|
|
||||||
ensure_locale()
|
ensure_locale()
|
||||||
ensure_cert()
|
ensure_cert()
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
|
|
||||||
VERSION = (0, 2, 3)
|
VERSION = (0, 2, 3)
|
||||||
BUILD_DT = (2020, 4, 27)
|
CODENAME = "docuparty"
|
||||||
|
BUILD_DT = (2020, 5, 3)
|
||||||
|
|
||||||
S_VERSION = ".".join(map(str, VERSION))
|
S_VERSION = ".".join(map(str, VERSION))
|
||||||
S_BUILD_DT = "{0:04d}-{1:02d}-{2:02d}".format(*BUILD_DT)
|
S_BUILD_DT = "{0:04d}-{1:02d}-{2:02d}".format(*BUILD_DT)
|
||||||
|
|
|
@ -108,8 +108,8 @@ class TcpSrv(object):
|
||||||
except (OSError, socket.error) as ex:
|
except (OSError, socket.error) as ex:
|
||||||
if ex.errno == 13:
|
if ex.errno == 13:
|
||||||
self.log("tcpsrv", "eaccess {} (trying next)".format(ip))
|
self.log("tcpsrv", "eaccess {} (trying next)".format(ip))
|
||||||
elif ex.errno not in [101, 10065]:
|
elif ex.errno not in [101, 10065, 10051]:
|
||||||
raise
|
self.log("tcpsrv", "route lookup failed; err {}".format(ex.errno))
|
||||||
|
|
||||||
s.close()
|
s.close()
|
||||||
|
|
||||||
|
|
|
@ -505,6 +505,7 @@ def gzip_orig_sz(fn):
|
||||||
|
|
||||||
|
|
||||||
def py_desc():
|
def py_desc():
|
||||||
|
interp = platform.python_implementation()
|
||||||
py_ver = ".".join([str(x) for x in sys.version_info])
|
py_ver = ".".join([str(x) for x in sys.version_info])
|
||||||
ofs = py_ver.find(".final.")
|
ofs = py_ver.find(".final.")
|
||||||
if ofs > 0:
|
if ofs > 0:
|
||||||
|
@ -512,8 +513,14 @@ def py_desc():
|
||||||
|
|
||||||
bitness = struct.calcsize(b"P") * 8
|
bitness = struct.calcsize(b"P") * 8
|
||||||
host_os = platform.system()
|
host_os = platform.system()
|
||||||
|
compiler = platform.python_compiler()
|
||||||
|
|
||||||
return "{0} on {1}{2}".format(py_ver, host_os, bitness)
|
os_ver = re.search(r"([0-9]+\.[0-9\.]+)", platform.version())
|
||||||
|
os_ver = os_ver.group(1) if os_ver else ""
|
||||||
|
|
||||||
|
return "{:>9} v{} on {}{} {} [{}]".format(
|
||||||
|
interp, py_ver, host_os, bitness, os_ver, compiler
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class Pebkac(Exception):
|
class Pebkac(Exception):
|
||||||
|
|
Loading…
Reference in a new issue