configurationengine/source/plugins/symbian/ConeThemePlugin/themeplugin/unzip.py
changeset 5 d2c80f5cab53
parent 0 2e8eeb919028
equal deleted inserted replaced
4:0951727b8815 5:d2c80f5cab53
    20     if (os.path.exists(file) is not True):
    20     if (os.path.exists(file) is not True):
    21         return
    21         return
    22     
    22     
    23     if (os.path.exists(dir) is not True):
    23     if (os.path.exists(dir) is not True):
    24         os.mkdir(dir, 0777)
    24         os.mkdir(dir, 0777)
    25         
       
    26     zfobj = zipfile.ZipFile(file)
    25     zfobj = zipfile.ZipFile(file)
    27     for name in zfobj.namelist():
    26     for name in zfobj.namelist():
    28         filePath = dir + name
    27         filePath = dir + name
    29         if name.endswith('/'):
    28         if name.endswith('/'):
    30             os.mkdir(filePath)
    29             if not os.path.exists(filePath):
       
    30                 createEmtyResource(filePath)
       
    31                 #os.mkdir(filePath)
    31         else:
    32         else:
    32             createEmtyResource(filePath)
    33             if not os.path.exists(filePath):
    33             outfile = open(dir+ name, 'wb')
    34                 createEmtyResource(filePath)
    34             outfile.write(zfobj.read(name))
    35                 outfile = open(dir+ name, 'wb')
    35             outfile.close()
    36                 outfile.write(zfobj.read(name))
       
    37                 outfile.close()
    36 
    38 
    37 def createEmtyResource(path):
    39 def createEmtyResource(path):
    38     splitdrive = os.path.splitdrive(path)
    40     splitdrive = os.path.splitdrive(path)
    39     splitPath = os.path.split(splitdrive[1])
    41     splitPath = os.path.split(splitdrive[1])
    40 
    42