def getStatic(self): try: if self.unpackStatic(): log.info('static content unpacked') return except Exception: log.error('failed to unpack static content') static_path = os.path.join(self.dir, 'static.zip') st_body = network.http_load( self.s['resource']['host'], self.s['resource']['url']) if st_body: with open(static_path, 'wb') as f: f.write(st_body) wx.PostEvent(self.callback, dcevent.LoaderEvent(attr1=False, attr2=static_path))