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
HOMEBREW_VERSION: 0.9 | |
HEAD: 55d79f45121f2739b7df7125be8a27eacc28d292 | |
HOMEBREW_PREFIX: /usr/local | |
HOMEBREW_CELLAR: /usr/local/Cellar | |
CPU: quad-core 64-bit sandybridge | |
OS X: 10.7.4 | |
Kernel Architecture: x86_64 | |
Xcode: 4.3.2 | |
GCC-4.0: N/A | |
GCC-4.2: N/A |
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
import unicodedata | |
def normalized_cmp(x, y): | |
if isinstance(x, unicode) and isinstance(y, unicode): | |
normalized_x = ([c for c in unicodedata.normalize('NFKD', x) if not unicodedata.combining(c)] + [''])[0] | |
normalized_y = ([c for c in unicodedata.normalize('NFKD', y) if not unicodedata.combining(c)] + [''])[0] | |
return cmp(normalized_x, normalized_y) | |
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
HOMEBREW_VERSION: 0.9 | |
HEAD: 9d50a0ca0448c14bbdaa8f027b08b2cde6d90f08 | |
HOMEBREW_PREFIX: /usr/local | |
HOMEBREW_CELLAR: /usr/local/Cellar | |
CPU: quad-core 64-bit sandybridge | |
OS X: 10.7.4 | |
Kernel Architecture: x86_64 | |
Xcode: 4.3.2 | |
GCC-4.0: N/A | |
GCC-4.2: N/A |
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
HOMEBREW_VERSION: 0.9 | |
HEAD: 9d50a0ca0448c14bbdaa8f027b08b2cde6d90f08 | |
HOMEBREW_PREFIX: /usr/local | |
HOMEBREW_CELLAR: /usr/local/Cellar | |
CPU: quad-core 64-bit sandybridge | |
OS X: 10.7.4 | |
Kernel Architecture: x86_64 | |
Xcode: 4.3.2 | |
GCC-4.0: N/A | |
GCC-4.2: N/A |
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
class EchoWebSocketResponse(BaseWebSocketResponse): | |
def after_open(self): | |
self.receive_until_closed() | |
def handle_text(self, text): | |
self.send_text(text) | |
def handle_request(self, request): |
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
<configure xmlns="http://namespaces.zope.org/zope"> | |
<subscriber | |
for=".interfaces.IMyType | |
OFS.interfaces.IObjectWillBeRemovedEvent" | |
handler=".events.event_handler" | |
/> | |
</configure> |
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
def unlockAllObjects(app, path): | |
lockedobjs = findLockedObjects(app, path) | |
for (o, p, i) in lockedobjs: | |
errs = False | |
for l in [li['token'] for li in i]: | |
try: | |
o.wl_delLock(l) | |
except: | |
errs = True | |
if errs: |
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
catalog_interfaces = ('plone.app.discussion.interfaces.IComment',) | |
pc = context.portal_catalog | |
comment_brains = pc(object_provides=tuple(catalog_interfaces)) | |
for b in comment_brains: | |
comment = b.getObject() | |
comment_id = comment.comment_id | |
conversation = comment.aq_parent |
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
[buildout] | |
extends = versions.cfg | |
parts = | |
plone | |
zope2 | |
productdistros | |
instance | |
live-client | |
omelette |
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
import datetime | |
import re | |
import warnings | |
def strftime(dt, fmt): | |
if dt.year < 1900: | |
# create a copy of this datetime, just in case, then set the year to | |
# something acceptable, then replace that year in the resulting string | |
tmp_dt = datetime.datetime(datetime.MAXYEAR, dt.month, dt.day, | |
dt.hour, dt.minute, |