[FIX] problem with ncftp client
bzr revid: hmo@tinyerp.com-20090731122454-h1ttteq7lisp3f27
This commit is contained in:
parent
2a9a8db99a
commit
5a7bb51ff4
|
@ -13,6 +13,7 @@ import netsvc
|
|||
import os
|
||||
from service import security
|
||||
from osv import osv
|
||||
import stat
|
||||
|
||||
def log(message):
|
||||
logger = netsvc.Logger()
|
||||
|
@ -797,8 +798,7 @@ class abstracted_fs:
|
|||
if 'd' in perms:
|
||||
permdir += 'p'
|
||||
type = size = perm = modify = create = unique = mode = uid = gid = ""
|
||||
for basename in listing:
|
||||
file = os.path.join(basedir, basename)
|
||||
for file in listing:
|
||||
try:
|
||||
st = self.stat(file)
|
||||
except OSError:
|
||||
|
@ -808,12 +808,7 @@ class abstracted_fs:
|
|||
# type + perm
|
||||
if stat.S_ISDIR(st.st_mode):
|
||||
if 'type' in facts:
|
||||
if basename == '.':
|
||||
type = 'type=cdir;'
|
||||
elif basename == '..':
|
||||
type = 'type=pdir;'
|
||||
else:
|
||||
type = 'type=dir;'
|
||||
type = 'type=dir;'
|
||||
if 'perm' in facts:
|
||||
perm = 'perm=%s;' %permdir
|
||||
else:
|
||||
|
@ -855,9 +850,9 @@ class abstracted_fs:
|
|||
# on Windows NTFS filesystems MTF records could be used).
|
||||
if 'unique' in facts:
|
||||
unique = "unique=%x%x;" %(st.st_dev, st.st_ino)
|
||||
basename=_to_decode(basename)
|
||||
path=_to_decode(file.path)
|
||||
yield "%s%s%s%s%s%s%s%s%s %s\r\n" %(type, size, perm, modify, create,
|
||||
mode, uid, gid, unique, basename)
|
||||
mode, uid, gid, unique, path)
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
Loading…
Reference in New Issue