mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 09:22:31 -06:00
tweaks
This commit is contained in:
parent
2a5a4e785f
commit
ae28dfd020
|
@ -583,12 +583,12 @@ def run_argparse(argv: list[str], formatter: Any, retry: bool) -> argparse.Names
|
||||||
ap2 = ap.add_argument_group('qr options')
|
ap2 = ap.add_argument_group('qr options')
|
||||||
ap2.add_argument("--qr", action="store_true", help="show http:// QR-code on startup")
|
ap2.add_argument("--qr", action="store_true", help="show http:// QR-code on startup")
|
||||||
ap2.add_argument("--qrs", action="store_true", help="show https:// QR-code on startup")
|
ap2.add_argument("--qrs", action="store_true", help="show https:// QR-code on startup")
|
||||||
ap2.add_argument("--qrl", metavar="PATH", type=u, default="", help="location to include in the url, for example [\033[32mpriv/?pw=hunter2\033[0m] (also enables --qr if not --qrs)")
|
ap2.add_argument("--qrl", metavar="PATH", type=u, default="", help="location to include in the url, for example [\033[32mpriv/?pw=hunter2\033[0m]")
|
||||||
ap2.add_argument("--qr-ip", metavar="PREFIX", type=u, default="", help="select IP which starts with PREFIX")
|
ap2.add_argument("--qr-ip", metavar="PREFIX", type=u, default="", help="select IP which starts with PREFIX")
|
||||||
ap2.add_argument("--qr-fg", metavar="COLOR", type=int, default=16, help="foreground")
|
ap2.add_argument("--qr-fg", metavar="COLOR", type=int, default=16, help="foreground")
|
||||||
ap2.add_argument("--qr-bg", metavar="COLOR", type=int, default=229, help="background (white=255)")
|
ap2.add_argument("--qr-bg", metavar="COLOR", type=int, default=229, help="background (white=255)")
|
||||||
ap2.add_argument("--qr-pad", metavar="CELLS", type=int, default=4, help="padding (spec says 4 or more, but 1 is usually fine)")
|
ap2.add_argument("--qrp", metavar="CELLS", type=int, default=4, help="padding (spec says 4 or more, but 1 is usually fine)")
|
||||||
ap2.add_argument("--qr-zoom", metavar="N", type=int, default=0, help="[\033[32m1\033[0m]=1x, [\033[32m2\033[0m]=2x, [\033[32m0\033[0m]=auto (try 2 on broken fonts)")
|
ap2.add_argument("--qrz", metavar="N", type=int, default=0, help="[\033[32m1\033[0m]=1x, [\033[32m2\033[0m]=2x, [\033[32m0\033[0m]=auto (try 2 on broken fonts)")
|
||||||
|
|
||||||
ap2 = ap.add_argument_group('upload options')
|
ap2 = ap.add_argument_group('upload options')
|
||||||
ap2.add_argument("--dotpart", action="store_true", help="dotfile incomplete uploads, hiding them from clients unless -ed")
|
ap2.add_argument("--dotpart", action="store_true", help="dotfile incomplete uploads, hiding them from clients unless -ed")
|
||||||
|
@ -920,7 +920,7 @@ def main(argv: Optional[list[str]] = None) -> None:
|
||||||
zs = "argument {} cannot be '{}'; try one of these: {}"
|
zs = "argument {} cannot be '{}'; try one of these: {}"
|
||||||
raise Exception(zs.format(arg, val, okays))
|
raise Exception(zs.format(arg, val, okays))
|
||||||
|
|
||||||
if al.qrl and not al.qrs:
|
if not al.qrs and [k for k in argv if k.startswith("--qr")]:
|
||||||
al.qr = True
|
al.qr = True
|
||||||
|
|
||||||
if HAVE_SSL:
|
if HAVE_SSL:
|
||||||
|
|
|
@ -393,8 +393,8 @@ class TcpSrv(object):
|
||||||
|
|
||||||
fg = self.args.qr_fg
|
fg = self.args.qr_fg
|
||||||
bg = self.args.qr_bg
|
bg = self.args.qr_bg
|
||||||
pad = self.args.qr_pad
|
pad = self.args.qrp
|
||||||
zoom = self.args.qr_zoom
|
zoom = self.args.qrz
|
||||||
qrc = QrCode.encode_binary(btxt)
|
qrc = QrCode.encode_binary(btxt)
|
||||||
if zoom == 0:
|
if zoom == 0:
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -258,7 +258,7 @@ def py_desc() -> str:
|
||||||
bitness = struct.calcsize("P") * 8
|
bitness = struct.calcsize("P") * 8
|
||||||
|
|
||||||
host_os = platform.system()
|
host_os = platform.system()
|
||||||
compiler = platform.python_compiler()
|
compiler = platform.python_compiler().split("http")[0]
|
||||||
|
|
||||||
m = re.search(r"([0-9]+\.[0-9\.]+)", platform.version())
|
m = re.search(r"([0-9]+\.[0-9\.]+)", platform.version())
|
||||||
os_ver = m.group(1) if m else ""
|
os_ver = m.group(1) if m else ""
|
||||||
|
|
Loading…
Reference in a new issue