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
(defun jone-filter (condp lst) | |
(delq nil | |
(mapcar (lambda (x) (and (funcall condp x) x)) lst))) | |
(jone-filter (lambda (e) (string= e "hans")) ("hans" "peter")) |
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
(defun find-buildout-root (path) | |
"Search PATH for a buildout root. | |
If a buildout root is found return the path, othwise return | |
nil." | |
;; find the most top one, not the first one | |
(let ((dir default-directory) | |
(previous nil)) | |
(while dir | |
(let ((dir (find-parent-with-file dir "boostrap.py"))) |
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 set_workflow_state(self): | |
state = 'task-state-new-successor' | |
mtool = getToolByName(self.context, 'portal_membership') | |
wtool = getToolByName(self.context, 'portal_workflow') | |
current_user_id = mtool.getAuthenticatedMember().getId() | |
wf_ids = wtool.getChainFor(self.context) | |
if wf_ids: | |
wf_id = wf_ids[0] | |
comment = 'Created successor.' |
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
wtool = getToolByName(task, 'portal_workflow') | |
review_state = wtool.getInfoFor(task, 'review_state', None) | |
print 'XXX', review_state | |
if review_state == from_review_state: | |
mtool = getToolByName(task, 'portal_membership') | |
current_user_id = mtool.getAuthenticatedMember().getId() | |
wf_ids = wtool.getChainFor(task) |
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 htmlentitydefs import name2codepoint as n2cp | |
from htmlentitydefs import codepoint2name as cp2n | |
import re | |
def decode_htmlentities(string): | |
""" | |
Decodes htmlentities or xmlentities | |
>>> decode_htmlentities('"X>Y"') | |
u'"X>Y"' |
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 z3c.saconfig import named_scoped_session | |
Session = named_scoped_session('name_of_session') | |
Sesion() |
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
diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el | |
index 157b2dd..f3807b7 100644 | |
--- a/lisp/term/ns-win.el | |
+++ b/lisp/term/ns-win.el | |
@@ -1263,6 +1263,11 @@ the operating system.") | |
(add-to-list 'window-system-initialization-alist '(ns . ns-initialize-window-system)) | |
+(declare-function ns-toggle-fullscreen-internal "nsfns.m" ()) | |
+(defun ns-toggle-fullscreen () |
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 AccessControl.SecurityManagement import newSecurityManager | |
from Testing.makerequest import makerequest | |
from zope.app.component.hooks import setSite | |
site_name = 'Plone' | |
# setup request and get plone site | |
app = makerequest(app) | |
site = app.unrestrictedTraverse(site_name) |
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/env bash | |
# Use either in a repository root or in a folder containing repositories (e.g. src) | |
pwd=`pwd` | |
if [[ -e ".git" ]]; then | |
repos=$pwd | |
else | |
repos=`find $pwd -name '.git' -maxdepth 2 -exec dirname {} \;` |
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
<configure | |
xmlns="http://namespaces.zope.org/zope" | |
xmlns:browser="http://namespaces.zope.org/browser"> | |
<browser:page | |
for="*" | |
name="tabbedview_view-tasks" | |
class=".tasks.TasksTab" | |
permission="zope2.View" | |
/> |
OlderNewer