Fix the example plugin upload script

This commit is contained in:
Kovid Goyal 2011-04-25 22:19:09 -06:00
parent 98b2dba03f
commit 4255df2dc7

View File

@ -347,9 +347,10 @@ class UploadUserManual(Command): # {{{
with NamedTemporaryFile(suffix='.zip') as f: with NamedTemporaryFile(suffix='.zip') as f:
os.fchmod(f.fileno(), os.fchmod(f.fileno(),
stat.S_IRUSR|stat.S_IRGRP|stat.S_IROTH|stat.S_IWRITE) stat.S_IRUSR|stat.S_IRGRP|stat.S_IROTH|stat.S_IWRITE)
with CurrentDir(self.d(path)): with CurrentDir(path):
with ZipFile(f, 'w') as zf: with ZipFile(f, 'w') as zf:
for x in os.listdir('.'): for x in os.listdir('.'):
if x.endswith('.swp'): continue
zf.write(x) zf.write(x)
if os.path.isdir(x): if os.path.isdir(x):
for y in os.listdir(x): for y in os.listdir(x):