[Repoze-checkins] r1081 - compoze/trunk/compoze
Rocky Burt
rocky at serverzen.com
Fri Jun 13 12:07:57 EDT 2008
Author: Rocky Burt <rocky at serverzen.com>
Date: Fri Jun 13 12:07:57 2008
New Revision: 1081
Log:
Fixed an issue dealing with zip archives.
Modified:
compoze/trunk/compoze/fetcher.py
compoze/trunk/compoze/indexer.py
Modified: compoze/trunk/compoze/fetcher.py
==============================================================================
--- compoze/trunk/compoze/fetcher.py (original)
+++ compoze/trunk/compoze/fetcher.py Fri Jun 13 12:07:57 2008
@@ -120,10 +120,10 @@
source_only = self.options.source_only
for rqmt in self.requirements:
- self._blather('Fetching: %s' % rqmt)
+ self._blather('Fetching (%s): %s' % (index_url, rqmt))
dist = index.fetch_distribution(rqmt, self.tmpdir,
source=source_only)
- self._blather('Found: %s' % dist)
+ self._blather('Found (%s): %s' % (index_url, dist))
self._blather('=' * 50)
self._blather('Merging indexes')
Modified: compoze/trunk/compoze/indexer.py
==============================================================================
--- compoze/trunk/compoze/indexer.py (original)
+++ compoze/trunk/compoze/indexer.py Fri Jun 13 12:07:57 2008
@@ -49,12 +49,21 @@
def extract(self, name, tempdir):
if self.closed:
raise IOError('closed')
- data = self.zipf.read(name)
thedir = os.path.split(name)[0]
- os.makedirs(os.path.join(tempdir, thedir))
- fn = os.path.join(tempdir, name)
- f = open(fn, 'wb')
- f.write(data)
+ t = os.path.join(tempdir, thedir)
+ if not os.path.exists(t):
+ os.makedirs(t)
+
+ if name.endswith('/'):
+ fn = os.path.join(tempdir, name[:-1])
+ if not os.path.exists(fn):
+ os.makedirs(fn)
+ else:
+ data = self.zipf.read(name)
+ fn = os.path.join(tempdir, name)
+ f = open(fn, 'wb')
+ f.write(data)
+ f.close()
def close(self):
self.zipf.close()
More information about the Repoze-checkins
mailing list