(cls, source)
return source
Given a source (filename or zipfile), return an
        appropriate CompleteDirs subclass.
Given a source (filename or zipfile), return an
        appropriate CompleteDirs subclass.
Given a source ( filename or zipfile ) return an appropriate CompleteDirs subclass .
def make(cls, source):
        """
        Given a source (filename or zipfile), return an
        appropriate CompleteDirs subclass.
        """
        if isinstance(source, CompleteDirs):
            return source

        if not isinstance(source, ZipFile):
            return cls(source)

        # Only allow for FastLookup when supplied zipfile is read-only
        if 'r' not in source.mode:
            cls = CompleteDirs

        source.__class__ = cls
        return source
def make ( cls , source ) : if isinstance ( source , CompleteDirs ) : return source if not isinstance ( source , ZipFile ) : return cls ( source ) # Only allow for FastLookup when supplied zipfile is read-only if 'r' not in source . mode : cls = CompleteDirs source . __class__ = cls return source