예제 #1
0
    def __init__(self, handle):
        self._temp_archive = None

        if isinstance(handle, basestring):
            zipimporter.__init__(self, handle)
        else:
            with tempfile.NamedTemporaryFile(suffix='.egg', delete=False) as temp_handle:
                shutil.copyfileobj(handle, temp_handle)
                self._temp_archive = temp_handle.name

            zipimporter.__init__(self, self._temp_archive)
예제 #2
0
 def __init__(self):
     zipimporter.__init__(self, test_support.findfile('zipdir.zip'))
     self.bar = "bar"
예제 #3
0
 def __init__(self):
     zipimporter.__init__(self, test_support.findfile('zipdir.zip'))
     self.bar = "bar"