mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
a e s t h e t i c
This commit is contained in:
parent
cecac64b68
commit
08977854b3
|
@ -311,6 +311,7 @@ sfx_out=../dist/copyparty-$CSN
|
||||||
echo cleanup
|
echo cleanup
|
||||||
find -name '*.pyc' -delete
|
find -name '*.pyc' -delete
|
||||||
find -name __pycache__ -delete
|
find -name __pycache__ -delete
|
||||||
|
find -name py.typed -delete
|
||||||
|
|
||||||
# especially prevent osx from leaking your lan ip (wtf apple)
|
# especially prevent osx from leaking your lan ip (wtf apple)
|
||||||
find -type f \( -name .DS_Store -or -name ._.DS_Store \) -delete
|
find -type f \( -name .DS_Store -or -name ._.DS_Store \) -delete
|
||||||
|
|
|
@ -142,6 +142,7 @@ def testchk(cdata):
|
||||||
|
|
||||||
def encode(data, size, cksum, ver, ts):
|
def encode(data, size, cksum, ver, ts):
|
||||||
"""creates a new sfx; `data` should yield bufs to attach"""
|
"""creates a new sfx; `data` should yield bufs to attach"""
|
||||||
|
nb = 0
|
||||||
nin = 0
|
nin = 0
|
||||||
nout = 0
|
nout = 0
|
||||||
skip = False
|
skip = False
|
||||||
|
@ -151,6 +152,7 @@ def encode(data, size, cksum, ver, ts):
|
||||||
for ln in src.split("\n"):
|
for ln in src.split("\n"):
|
||||||
if ln.endswith("# skip 0"):
|
if ln.endswith("# skip 0"):
|
||||||
skip = False
|
skip = False
|
||||||
|
nb = 9
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if ln.endswith("# skip 1") or skip:
|
if ln.endswith("# skip 1") or skip:
|
||||||
|
@ -160,6 +162,13 @@ def encode(data, size, cksum, ver, ts):
|
||||||
if ln.strip().startswith("# fmt: "):
|
if ln.strip().startswith("# fmt: "):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
if ln:
|
||||||
|
nb = 0
|
||||||
|
else:
|
||||||
|
nb += 1
|
||||||
|
if nb > 2:
|
||||||
|
continue
|
||||||
|
|
||||||
unpk += ln + "\n"
|
unpk += ln + "\n"
|
||||||
|
|
||||||
for k, v in [
|
for k, v in [
|
||||||
|
@ -177,7 +186,7 @@ def encode(data, size, cksum, ver, ts):
|
||||||
unpk = unpk.replace("\t ", "\t\t")
|
unpk = unpk.replace("\t ", "\t\t")
|
||||||
|
|
||||||
with open("sfx.out", "wb") as f:
|
with open("sfx.out", "wb") as f:
|
||||||
f.write(unpk.encode("utf-8") + b"\n\n# eof\n# ")
|
f.write(unpk.encode("utf-8").rstrip(b"\n") + b"\n\n\n# eof\n# ")
|
||||||
for buf in data:
|
for buf in data:
|
||||||
ebuf = buf.replace(b"\n", b"\n#n").replace(b"\r", b"\n#r")
|
ebuf = buf.replace(b"\n", b"\n#n").replace(b"\r", b"\n#r")
|
||||||
f.write(ebuf)
|
f.write(ebuf)
|
||||||
|
|
Loading…
Reference in a new issue