>>> profiles = app.quaive.profiles
>>> profiles["foo"].email = "foo.bar@example.com"
>>> from transaction import commit
>>> commit()
from lxml import html | |
import requests | |
template = "https://distrowatch.com/search.php?pkg=Python&relation=greaterequal&pkgver={}&distrorange=InLatest#pkgsearch" | |
def get_distros(min_python_version): | |
response = requests.get(template.format(min_python_version)) | |
distros = set() |
#!/bin/bash | |
# | |
BACKUPDEST="$1" | |
DOMAIN="$2" | |
MAXBACKUPS="$3" | |
if [ -z "$BACKUPDEST" -o -z "$DOMAIN" ]; then | |
echo "Usage: ./vm-backup <backup-folder> <domain> [max-backups]" | |
exit 1 |
# coding=utf-8 | |
from plone.app.blocks import utils | |
from plone.subrequest import subrequest | |
from zExceptions import NotFound | |
from zope.site.hooks import getSite | |
def resolveResource(url): | |
"""Resolve the given URL to a unicode string. If the URL is an absolute | |
path, it will be made relative to the Plone site root. |
[style] | |
# Align closing bracket with visual indentation. | |
align_closing_bracket_with_visual_indent=True | |
# Allow dictionary keys to exist on multiple lines. For example: | |
# | |
# x = { | |
# ('this is the first element of a tuple', | |
# 'this is the second element of a tuple'): | |
# value, |
[instance] | |
eggs+= | |
${hotfix:eggs} | |
[hotfix] | |
recipe = mr.scripty | |
eggs= | |
from urllib import urlopen | |
version = self.buildout['versions']['Plone'] | |
base_url = 'https://raw.githubusercontent.com/starzel/buildout/master/linkto/hotfixes/%s.cfg' |
# coding=utf-8 | |
from AccessControl.SecurityManagement import newSecurityManager | |
from AccessControl.SecurityManager import setSecurityPolicy | |
from collective.jsonify.export import export_content | |
from logging import DEBUG | |
from logging import getLogger | |
from Products.CMFCore.tests.base.security import OmnipotentUser | |
from Products.CMFCore.tests.base.security import PermissiveSecurityPolicy | |
from Testing.makerequest import makerequest |
# coding=utf-8 | |
from AccessControl.SecurityManagement import newSecurityManager | |
from AccessControl.SecurityManager import setSecurityPolicy | |
from collective.jsonify.export import export_content | |
from logging import DEBUG | |
from logging import getLogger | |
from Products.CMFCore.tests.base.security import OmnipotentUser | |
from Products.CMFCore.tests.base.security import PermissiveSecurityPolicy | |
from Testing.makerequest import makerequest |
Just add to the zcml-additional those lines | |
``` | |
[instance] | |
... | |
zcml-additional = | |
<configure xmlns="http://namespaces.zope.org/zope"> | |
<adapter for="collective.lineage.interfaces.IChildSite" | |
factory="collective.simplesocial.browser.configlet.FacebookSettingsAdapter" | |
provides="collective.simplesocial.browser.interfaces.IFacebookSettings" | |
/> |
def plonereload(user="admin", password='admin'): | |
''' Reload Plone | |
''' | |
from requests import get | |
from lxml.html import fromstring | |
auth = (user, password) | |
response = get('http://localhost:7081/reload?action=code', auth=auth) | |
try: | |
print fromstring(response.text).find('.//pre').text |