def add_setup(path): buffer = BytesIO() buffer.write(_DUMMY_SETUP.replace(b"testpackage", must_encode(path))) size = buffer.tell() buffer.seek(0) finfo = tarfile.TarInfo("%s/setup.py" % path) finfo.size = size archive.addfile(finfo, buffer)
def _get_location(self): from compoze._compat import must_encode import os result = os.path.join(self.tmpdir, self.project_name) f = open(result, 'wb') f.write(must_encode(self.project_name)) f.flush() f.close() return result
def _get_location(self): import os from compoze._compat import must_encode result = os.path.join(self.tmpdir, self.project_name) f = open(result, 'wb') f.write(must_encode(self.project_name)) f.flush() f.close() return result
def add_setup(path): buffer = BytesIO() buffer.write( _DUMMY_SETUP.replace(b'testpackage', must_encode(path))) size = buffer.tell() buffer.seek(0) finfo = tarfile.TarInfo('%s/setup.py' % path) finfo.size = size archive.addfile(finfo, buffer)
def lines(self, name): if self.closed: raise IOError('closed') return must_encode(self.zipf.read(name)).split(b'\n')