def __init__(self, context, request, previous=[]): SimpleItem.__init__(self, context, request) self.previous = previous self.__name__ = 'dvpdffiles' self.site = _getPortal(request, context) self.global_settings = GlobalSettings(self.site) self.storage_type = self.global_settings.storage_type self.__dir = Directory( os.path.join(self.global_settings.storage_location, *previous), self.__name__) DirectoryResource.__init__(self, self.__dir, request)
def get(self, name, default=_marker): original_resource = superfactory.resource superfactory.resource = DirectoryResource try: return superclass.get(self, name, default) finally: superfactory.resource = original_resource