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: |
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 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
<?xml version="1.0" ?> | |
<ldapplugins> | |
<ldapplugin title="Example LDAP" id="ldap" meta_type="Plone LDAP plugin" update="False"> | |
<interface value="IAuthenticationPlugin"/> | |
<interface value="ICredentialsResetPlugin"/> | |
<interface value="IGroupEnumerationPlugin"/> | |
<interface value="IGroupIntrospection"/> | |
<interface value="IGroupManagement"/> |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<rules | |
xmlns="http://namespaces.plone.org/diazo" | |
xmlns:css="http://namespaces.plone.org/diazo/css" | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<rules css:if-not-content="body.template-mail_password_form, body.template-mail_password_response, body.template-pwreset_form, body.template-register, body.template-registered"> | |
<drop css:content="#hugo" /> | |
</rules> | |
</rules> |
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 http.server import BaseHTTPRequestHandler, HTTPServer | |
from socket import socket | |
from socketserver import ThreadingMixIn | |
from threading import Thread | |
import logging | |
import ssl | |
class LoggingSSLSocket(ssl.SSLSocket): |
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
lukasgraf@helios ~/Plone/buildouts/opengever/og-core-4.x $ md5 bootstrap.py | |
MD5 (bootstrap.py) = dcf4d3aa7102eb3885a7cea1f6b50a23 | |
lukasgraf@helios ~/Plone/buildouts/opengever/og-core-4.x $ python2.7 bootstrap.py | |
Downloading https://pypi.python.org/packages/source/s/setuptools/setuptools-7.0.zip | |
Extracting in /var/folders/d5/8djs4qxd78lb98g8r7hyp7wr0000gn/T/tmpDoh09p | |
Now working in /var/folders/d5/8djs4qxd78lb98g8r7hyp7wr0000gn/T/tmpDoh09p/setuptools-7.0 | |
Building a Setuptools egg in /var/folders/d5/8djs4qxd78lb98g8r7hyp7wr0000gn/T/tmpt3fsyg | |
/var/folders/d5/8djs4qxd78lb98g8r7hyp7wr0000gn/T/tmpt3fsyg/setuptools-7.0-py2.7.egg |
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
lukasgraf@helios ~/Plone/buildouts/opengever/og-core-4.x $ bin/buildout -vvvvvvv | |
Installing 'mr.developer', 'lovely.buildouthttp'. | |
We have the distribution that satisfies 'mr.developer==1.21'. | |
We have the best distribution that satisfies 'lovely.buildouthttp'. | |
Picked: lovely.buildouthttp = 0.5.0 | |
mr.developer: Queued 'opengever.maintenance' for checkout. | |
mr.developer: Updated 'opengever.maintenance' with git. | |
lovely.buildouthttp: Added credentials 'foo', 'http://psc.4teamwork.ch' | |
lovely.buildouthttp: Added credentials 'bar', 'https://svn.4teamwork.ch' | |
Installing 'zc.buildout', 'setuptools'. |
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
# -*- coding: utf-8 -*- | |
from ftw.shop.interfaces import IPaymentProcessor | |
from ftw.shop.interfaces import IShoppingCart | |
from ftwshop.adminpay.interfaces import IAdminpayAccountConfig | |
from ftwshop.adminpay.interfaces import IGlobalAdminpaySettings | |
from plone.registry.interfaces import IRegistry | |
from Products.Five.browser import BrowserView | |
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile | |
from zope.component import adapts | |
from zope.component import getMultiAdapter |
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
"""Helper to trace ZODB object registrations in order to debug CSRF false | |
positives with plone.protect. | |
This helper is intended for DEBUGGING, not for use in production! | |
""" | |
from collections import namedtuple | |
from functools import partial | |
from threading import local | |
from ZODB.utils import u64 |
OlderNewer