def archive_files(community, files, path): folder = ArchiveFolder() contents = [] for name, file in files.items(): if ICommunityFolder.providedBy(file): folder[name] = archive_files(community, file, path + (name,)) contents.append({ 'type': 'folder', 'title': file.title + ' /', 'url': file.__name__ + '/index.html', }) else: folder[name] = file.blobfile contents.append({ 'type': 'file', 'title': file.title, 'url': file.__name__, 'author': get_author(file), 'date': str(file.created) }) folder['index.html'] = ArchiveTemplate( 'templates/archive_files.pt', community=community, title=files.title, path=path, contents=contents, ) return folder
def archive_files(community, files, path): folder = ArchiveFolder() contents = [] for name, file in files.items(): if ICommunityFolder.providedBy(file): folder[name] = archive_files(community, file, path + (name, )) contents.append({ 'type': 'folder', 'title': file.title + ' /', 'url': file.__name__ + '/index.html', }) else: folder[name] = file.blobfile contents.append({ 'type': 'file', 'title': file.title, 'url': file.__name__, 'author': get_author(file), 'date': str(file.created) }) folder['index.html'] = ArchiveTemplate( 'templates/archive_files.pt', community=community, title=files.title, path=path, contents=contents, ) return folder
def __init__(self, context, request): self.context = context self.request = request in_intranets = find_interface(context, IIntranets) is not None is_folder = ICommunityFolder.providedBy(context) self.use_folder_options = is_folder and in_intranets title = getattr(context, 'title', context.__name__) self.page_title = 'Advanced Settings for %s' % title
def __init__(self, context, request): self.context = context self.request = request is_folder = ICommunityFolder.providedBy(context) self.use_folder_options = is_folder self.use_unlock = lock.is_locked(context) title = getattr(context, "title", context.__name__) self.page_title = "Advanced Settings for %s" % title
def __init__(self, context, request): self.context = context self.request = request is_folder = ICommunityFolder.providedBy(context) self.use_folder_options = is_folder self.use_unlock = lock.is_locked(context) title = getattr(context, 'title', context.__name__) self.page_title = 'Advanced Settings for %s' % title
def __init__(self, context, request): self.context = context self.request = request in_intranets = find_interface(context, IIntranets) is not None is_folder = ICommunityFolder.providedBy(context) self.use_folder_options = is_folder and in_intranets self.use_unlock = lock.is_locked(context) title = getattr(context, 'title', context.__name__) self.page_title = 'Advanced Settings for %s' % title
def __init__(self, context, request): assert ICommunityFolder.providedBy(context) self.context = context self.request = request