• Jérome Perrin's avatar
    xhtml_style: version up ckeditor 4.19.1 · 5e82e22a
    Jérome Perrin authored
    done with an external method to upload the content of zip file in
    skin folder.
    
        import zipfile
        from io import BytesIO
    
        def uploadZip(self):
          dest = self.getPortalObject().portal_skins.custom
          with zipfile.ZipFile(
              '/srv/slapgrid/slappart3/srv/project/erp5/ckeditor_4.19.1_4b98d281bc34.zip'
          ) as f:
            for m in f.namelist():
              current_dest = dest
              print(m)
              for part in m.split('/')[:-1]:
                if part not in current_dest.objectIds():
                  current_dest.manage_addProduct['OFSP'].manage_addFolder(id=part)
                current_dest = current_dest[part]
              fname = m.split('/')[-1]
              if fname == '_translationstatus.txt':
                fname = 'translationstatus.txt'
              current_dest.manage_addProduct['OFSP'].manage_addFile(
                id=fname, file=BytesIO(f.read(m)))
          return repr(dest)
    5e82e22a
translationstatus.txt.xml 786 Bytes