This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from plone.dexterity.content import Container | |
# Change permission for manage_pasteObjects to "Add portal content" | |
# See https://dev.plone.org/ticket/9177 | |
# XXX Find a way to do this without patching __ac_permissions__ directly | |
def drop_protected_attr_from_ac_permissions(attribute, classobj): | |
new_mappings = [] | |
for mapping in Container.__ac_permissions__: | |
perm, attrs = mapping |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" | |
xmlns:tal="http://xml.zope.org/namespaces/tal" | |
xmlns:metal="http://xml.zope.org/namespaces/metal" | |
xmlns:i18n="http://xml.zope.org/namespaces/i18n" | |
lang="en" | |
metal:use-macro="context/main_template/macros/master" | |
i18n:domain="opengever.maintenance"> | |
<head> | |
<metal:head metal:fill-slot="head_slot"> | |
<style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import ceil | |
class ColumnDistributor(list): | |
"""Distributes a list of items across a given number of columns. | |
>>> items = list('ABCDEFGHIJKLM') | |
>>> columns = ColumnDistributor(items) | |
>>> columns.distribute(4) | |
>>> for c in columns: |
NewerOlder