Packaging empty folders to ZIP
Posted: Sat Apr 06, 2013 5:28 pm
Hi,
I need empty folders to be packaged to IIcharacter distributions.
Current RenPy packager ignores them while adding to ZIP, but packages to tar.bz2.
Right now I'm using this hack:
I understand that most people does not need empty dirs to be packaged, so, maybe, make it optional and same for tar.bz2 and ZIPs?
I need empty folders to be packaged to IIcharacter distributions.
Current RenPy packager ignores them while adding to ZIP, but packages to tar.bz2.
Right now I'm using this hack:
Code: Select all
class ZipPackage(object):
...
def add_directory(self, name, path):
- return
+ if path != None and len(os.listdir(path))==0:
+ zif = zipfile.ZipInfo(name + "/")
+ self.zipfile.writestr(zif, "")