>>> profiles = app.quaive.profiles
>>> profiles["foo"].email = "[email protected]"
>>> 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() |
>>> profiles = app.quaive.profiles
>>> profiles["foo"].email = "[email protected]"
>>> from transaction import commit
>>> commit()
#!/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 |
class BaseEditForm(DefaultEditForm): | |
def nextURL(self): | |
''' Try to guess in a smart way what will bethe next url | |
''' | |
next_url = super(BaseEditForm, self).nextURL() | |
current_tab = getattr(self, 'tab_id', '') | |
if not current_tab: | |
return next_url | |
if not current_tab in self.wizard_tabs: |
#!/usr/bin/env python | |
from PIL import Image | |
from base64 import encodestring | |
import sys | |
template = '''.%(classname)s { | |
width: %(width)spx; | |
height: %(height)spx; | |
background-repeat: no-repeat; |