This file contains 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 django import template | |
register = template.Library() | |
import lfs.cart.utils | |
from lfs.core.models import Shop | |
from lfs.caching.utils import lfs_get_object_or_404 | |
@register.inclusion_tag("lfs/disclaimer.html") | |
def disclaimer(): |
This file contains 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
[buildout] | |
parts += | |
zeoserver | |
client1 | |
client2 | |
cljobs | |
cldebug | |
[zeoserver] | |
recipe = plone.recipe.zeoserver |
This file contains 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
# temporary hack for fixing ZODB connection error | |
from ZODB import FileStorage, DB | |
dbname = 'my_missing_db' | |
path = 'path/to/missing/storage.fs' | |
storage = FileStorage.FileStorage(path) | |
db = DB(storage) | |
# app is the zope instance in debug mode | |
app._p_jar._db.databases[dbname] = db |
This file contains 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
#!/usr/bin/python2.7 | |
import sys | |
import os | |
import psutil | |
def find_process(tokill): | |
res = [] | |
for proc in psutil.process_iter(): | |
cmdline = hasattr(proc.cmdline, '__call__') \ |
This file contains 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
def _register(self, username, properties): | |
member = None | |
try: | |
# force encoding to utf8 | |
for k,v in properties.items(): | |
properties[k]= v.encode('utf8') | |
member = self.regtool.addMember(username, properties['fullname'], properties['email']) | |
member.setMemberProperties(properties) | |
self.created += 1 | |
msg = "created user '%s' -> %s" % (username,str(properties)) |
This file contains 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 Products.ATContentTypes.interfaces import IATTopic | |
from plone.app.collection.interfaces import ICollection | |
from plone.app.querystring import queryparser | |
def is_collection(obj): | |
return IATTopic.providedBy(obj) or ICollection.providedBy(obj) | |
def parse_new_collection_query(context): |
This file contains 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
<subscriber | |
for="Products.PlonePAS.interfaces.events.IUserInitialLoginInEvent" | |
handler=".subscribers.user_firsttime_loggedin" | |
/> | |
<subscriber | |
for="Products.PluggableAuthService.interfaces.events.IUserLoggedInEvent" | |
handler=".subscribers.user_loggedin" | |
/> | |
<subscriber |
This file contains 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 Acquisition import aq_inner | |
from Acquisition import aq_base | |
from five import grok | |
from zope import schema | |
from zope.component import getMultiAdapter |
This file contains 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
# ~/.gitconfig | |
[branch] | |
autosetupmerge = true | |
[push] | |
default = current | |
[core] | |
excludesfile = .gitignore |
This file contains 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
[buildout] | |
parts += | |
openldap | |
python-ldap | |
eggs += | |
plone.app.ldap | |
[openldap] | |
recipe = zc.recipe.cmmi |
OlderNewer