mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
drop asyncore; pyftpdlib has vendored it
This commit is contained in:
parent
bac733113c
commit
7c0c6b94a3
|
@ -28,10 +28,6 @@ https://github.com/nayuki/QR-Code-generator/
|
||||||
C: Project Nayuki
|
C: Project Nayuki
|
||||||
L: MIT
|
L: MIT
|
||||||
|
|
||||||
https://github.com/python/cpython/blob/3.10/Lib/asyncore.py
|
|
||||||
C: 1996 Sam Rushing
|
|
||||||
L: ISC
|
|
||||||
|
|
||||||
https://github.com/ahupp/python-magic/
|
https://github.com/ahupp/python-magic/
|
||||||
C: 2001-2014 Adam Hupp
|
C: 2001-2014 Adam Hupp
|
||||||
L: MIT
|
L: MIT
|
||||||
|
|
|
@ -205,26 +205,22 @@ necho() {
|
||||||
mv {markupsafe,jinja2} j2/
|
mv {markupsafe,jinja2} j2/
|
||||||
|
|
||||||
necho collecting pyftpdlib
|
necho collecting pyftpdlib
|
||||||
f="../build/pyftpdlib-1.5.8.tar.gz"
|
f="../build/pyftpdlib-1.5.9.tar.gz"
|
||||||
[ -e "$f" ] ||
|
[ -e "$f" ] ||
|
||||||
(url=https://github.com/giampaolo/pyftpdlib/archive/refs/tags/release-1.5.8.tar.gz;
|
(url=https://github.com/giampaolo/pyftpdlib/archive/refs/tags/release-1.5.9.tar.gz;
|
||||||
wget -O$f "$url" || curl -L "$url" >$f)
|
wget -O$f "$url" || curl -L "$url" >$f)
|
||||||
|
|
||||||
tar -zxf $f
|
tar -zxf $f
|
||||||
mv pyftpdlib-release-*/pyftpdlib .
|
mv pyftpdlib-release-*/pyftpdlib .
|
||||||
rm -rf pyftpdlib-release-* pyftpdlib/test
|
rm -rf pyftpdlib-release-* pyftpdlib/test
|
||||||
|
for f in pyftpdlib/_async{hat,ore}.py; do
|
||||||
|
[ -e "$f" ] || continue;
|
||||||
|
iawk 'NR<4||NR>27||!/^#/;NR==4{print"# license: https://opensource.org/licenses/ISC\n"}' $f
|
||||||
|
done
|
||||||
|
|
||||||
mkdir ftp/
|
mkdir ftp/
|
||||||
mv pyftpdlib ftp/
|
mv pyftpdlib ftp/
|
||||||
|
|
||||||
necho collecting asyncore, asynchat
|
|
||||||
for n in asyncore.py asynchat.py; do
|
|
||||||
f=../build/$n
|
|
||||||
[ -e "$f" ] ||
|
|
||||||
(url=https://raw.githubusercontent.com/python/cpython/c4d45ee670c09d4f6da709df072ec80cb7dfad22/Lib/$n;
|
|
||||||
wget -O$f "$url" || curl -L "$url" >$f)
|
|
||||||
done
|
|
||||||
|
|
||||||
necho collecting python-magic
|
necho collecting python-magic
|
||||||
v=0.4.27
|
v=0.4.27
|
||||||
f="../build/python-magic-$v.tar.gz"
|
f="../build/python-magic-$v.tar.gz"
|
||||||
|
@ -293,12 +289,6 @@ necho() {
|
||||||
(cd "${x%/*}"; cp -p "../$(cat "${x##*/}")" ${x##*/})
|
(cd "${x%/*}"; cp -p "../$(cat "${x##*/}")" ${x##*/})
|
||||||
done
|
done
|
||||||
|
|
||||||
# insert asynchat
|
|
||||||
mkdir copyparty/vend
|
|
||||||
for n in asyncore.py asynchat.py; do
|
|
||||||
awk 'NR<4||NR>27;NR==4{print"# license: https://opensource.org/licenses/ISC\n"}' ../build/$n >copyparty/vend/$n
|
|
||||||
done
|
|
||||||
|
|
||||||
rm -f copyparty/stolen/*/README.md
|
rm -f copyparty/stolen/*/README.md
|
||||||
|
|
||||||
# remove type hints before build instead
|
# remove type hints before build instead
|
||||||
|
@ -419,7 +409,7 @@ iawk '/^ {0,4}[^ ]/{s=0}/^ {4}def (serve_forever|_loop)/{s=1}!s' ftp/pyftpdlib/s
|
||||||
rm -f ftp/pyftpdlib/{__main__,prefork}.py
|
rm -f ftp/pyftpdlib/{__main__,prefork}.py
|
||||||
|
|
||||||
[ $no_ftp ] &&
|
[ $no_ftp ] &&
|
||||||
rm -rf copyparty/ftpd.py ftp asyncore.py asynchat.py &&
|
rm -rf copyparty/ftpd.py ftp &&
|
||||||
sed -ri '/\.ftp/d' copyparty/svchub.py
|
sed -ri '/\.ftp/d' copyparty/svchub.py
|
||||||
|
|
||||||
[ $no_smb ] &&
|
[ $no_smb ] &&
|
||||||
|
@ -576,8 +566,8 @@ nf=$(ls -1 "$zdir"/arc.* 2>/dev/null | wc -l)
|
||||||
cat ../$bdir/COPYING.txt) >> copyparty/res/COPYING.txt ||
|
cat ../$bdir/COPYING.txt) >> copyparty/res/COPYING.txt ||
|
||||||
echo "copying.txt 404 pls rebuild"
|
echo "copying.txt 404 pls rebuild"
|
||||||
|
|
||||||
mv ftp/* j2/* copyparty/vend/* .
|
mv ftp/* j2/* .
|
||||||
rm -rf ftp j2 py2 py37 copyparty/vend
|
rm -rf ftp j2 py2 py37
|
||||||
(cd copyparty; tar -cvf z.tar $t; rm -rf $t)
|
(cd copyparty; tar -cvf z.tar $t; rm -rf $t)
|
||||||
cd ..
|
cd ..
|
||||||
pyoxidizer build --release --target-triple $tgt
|
pyoxidizer build --release --target-triple $tgt
|
||||||
|
|
|
@ -59,9 +59,6 @@ copyparty/th_srv.py,
|
||||||
copyparty/u2idx.py,
|
copyparty/u2idx.py,
|
||||||
copyparty/up2k.py,
|
copyparty/up2k.py,
|
||||||
copyparty/util.py,
|
copyparty/util.py,
|
||||||
copyparty/vend,
|
|
||||||
copyparty/vend/asynchat.py,
|
|
||||||
copyparty/vend/asyncore.py,
|
|
||||||
copyparty/web,
|
copyparty/web,
|
||||||
copyparty/web/a,
|
copyparty/web/a,
|
||||||
copyparty/web/a/__init__.py,
|
copyparty/web/a/__init__.py,
|
||||||
|
|
|
@ -16,16 +16,11 @@ def uncomment(fpath):
|
||||||
orig = f.read().decode("utf-8")
|
orig = f.read().decode("utf-8")
|
||||||
|
|
||||||
out = ""
|
out = ""
|
||||||
for ln in orig.split("\n"):
|
|
||||||
if not ln.startswith("#"):
|
|
||||||
break
|
|
||||||
|
|
||||||
out += ln + "\n"
|
|
||||||
|
|
||||||
io_obj = io.StringIO(orig)
|
io_obj = io.StringIO(orig)
|
||||||
prev_toktype = tokenize.INDENT
|
prev_toktype = tokenize.INDENT
|
||||||
last_lineno = -1
|
last_lineno = -1
|
||||||
last_col = 0
|
last_col = 0
|
||||||
|
code = False
|
||||||
for tok in tokenize.generate_tokens(io_obj.readline):
|
for tok in tokenize.generate_tokens(io_obj.readline):
|
||||||
# print(repr(tok))
|
# print(repr(tok))
|
||||||
token_type = tok[0]
|
token_type = tok[0]
|
||||||
|
@ -53,7 +48,11 @@ def uncomment(fpath):
|
||||||
out += token_string
|
out += token_string
|
||||||
else:
|
else:
|
||||||
out += '"a"'
|
out += '"a"'
|
||||||
elif token_type != tokenize.COMMENT or is_legalese:
|
elif token_type != tokenize.COMMENT:
|
||||||
|
out += token_string
|
||||||
|
if not code and token_string.strip():
|
||||||
|
code = True
|
||||||
|
elif is_legalese or (not start_col and not code):
|
||||||
out += token_string
|
out += token_string
|
||||||
else:
|
else:
|
||||||
if out.rstrip(" ").endswith("\n"):
|
if out.rstrip(" ").endswith("\n"):
|
||||||
|
|
Loading…
Reference in a new issue