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
[ | |
{ | |
"_path": "private", | |
"_type": "ftw.topics.Topic", | |
"title": "Private" | |
}, | |
{ | |
"_path": "private/00054", |
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 socket | |
# Sauce only tunnels certain ports, so we need to pick one of those ports and it should be | |
# not used. | |
# See port list at: https://saucelabs.com/docs/connect#localhost | |
PORTS = [2000, 2001, 2020, 2222, 3000, 3001, 3030, 3333, 4000, 4001, 4040, 5000, 5001, 5050, 5555, 6000, 6001, 6060, 6666, 7000, 7070, 7777, 8000, 8001, 8080, 8888, 9000, 9001, 9080, 9090, 9999, 4502, 4503, 8003, 8031] | |
def get_free_port(): | |
for port in PORTS: | |
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
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" | |
xmlns:browser="http://namespaces.zope.org/browser"> | |
<browser:page | |
for="*" | |
name="tabbedview_view-tasks" | |
class=".tasks.TasksTab" | |
permission="zope2.View" | |
/> |
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
#!/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 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
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 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
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 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
from z3c.saconfig import named_scoped_session | |
Session = named_scoped_session('name_of_session') | |
Sesion() |
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
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 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
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 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 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.' |