Fix for ticket #890 "python plugin installer unzip fails"

git-svn-id: http://svn.osgeo.org/qgis/trunk@7859 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
gsherman 2008-01-08 00:36:08 +00:00
parent 516e6a5dd7
commit 0a2a4b1a19

View File

@ -86,6 +86,15 @@ class unzip:
if name.endswith('/'):
dirs.append(name)
if len(dirs) == 0:
# this means there is no top level directory in the
# zip file. We'll assume the first entry contains the
# directory and use it
entry = zf.namelist()[0]
dir = entry.split('/')[0]
dir += '/'
dirs.append(dir)
dirs.sort()
return dirs