Пример #1
0
 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)
Пример #2
0
 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
Пример #3
0
 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
Пример #4
0
 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)
Пример #5
0
 def lines(self, name):
     if self.closed:
         raise IOError('closed')
     return must_encode(self.zipf.read(name)).split(b'\n')