mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 06:50:29 +03:00
standardize os.walk() var names based on Python 3.5 docs
There were multiple conventions used in the code, but mostly it was already using the convention from the docs, so this converts things to using that convention: https://docs.python.org/3/library/os.html#os.walk
This commit is contained in:
parent
96e71bfdb3
commit
cb10f0df09
7 changed files with 35 additions and 35 deletions
|
|
@ -96,19 +96,19 @@ def build_server(app, build, vcs, build_dir, output_dir, log_dir, force):
|
|||
|
||||
# Helper to copy the contents of a directory to the server...
|
||||
def send_dir(path):
|
||||
root = os.path.dirname(path)
|
||||
startroot = os.path.dirname(path)
|
||||
main = os.path.basename(path)
|
||||
ftp.mkdir(main)
|
||||
for r, d, f in os.walk(path):
|
||||
rr = os.path.relpath(r, root)
|
||||
for root, dirs, files in os.walk(path):
|
||||
rr = os.path.relpath(root, startroot)
|
||||
ftp.chdir(rr)
|
||||
for dd in d:
|
||||
ftp.mkdir(dd)
|
||||
for ff in f:
|
||||
lfile = os.path.join(root, rr, ff)
|
||||
for d in dirs:
|
||||
ftp.mkdir(d)
|
||||
for f in files:
|
||||
lfile = os.path.join(startroot, rr, f)
|
||||
if not os.path.islink(lfile):
|
||||
ftp.put(lfile, ff)
|
||||
ftp.chmod(ff, os.stat(lfile).st_mode)
|
||||
ftp.put(lfile, f)
|
||||
ftp.chmod(f, os.stat(lfile).st_mode)
|
||||
for i in range(len(rr.split('/'))):
|
||||
ftp.chdir('..')
|
||||
ftp.chdir('..')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue