Skip to content

Instantly share code, notes, and snippets.

View jerith's full-sized avatar

Jeremy Thurgood jerith

  • Cape Town, South Africa
View GitHub Profile
diff --git a/vumi/persist/txredis_manager.py b/vumi/persist/txredis_manager.py
index f4ba173..9cacc95 100644
--- a/vumi/persist/txredis_manager.py
+++ b/vumi/persist/txredis_manager.py
@@ -87,6 +87,14 @@ class VumiRedis(txr.Redis):
withscores=withscores,
reverse=desc)
+ def zrangebyscore(self, name, min, max, start=None, num=None,
+ withscores=False, score_cast_func=float):
...$ py.test foo.py --collectonly
Creating test database for alias 'default'...
=========================================== test session starts ===========================================
platform darwin -- Python 2.6.5 -- pytest-2.3.2.dev8
plugins: django, twisted
collected 3 items
<Module 'foo.py'>
<UnitTestCase 'TestCase'>
<TestCaseFunction 'runTest'>
<UnitTestCase 'TestWhyDoesThisWork'>
-----------------------------------------------------------------------------
-- This script creates a new terminal window.
--
-- If you disable "When switching to an application, switch to a space with
-- open windows" in the Spaces preferences, the new terminal window will
-- appear on the current workspace.
--
-- Terminal.app creates a new window on startup, so we need to check if it's
-- already running and not create an extra window in that case.
-----------------------------------------------------------------------------
diff --git a/diamondash/server.py b/diamondash/server.py
index ef99019..72ab792 100644
--- a/diamondash/server.py
+++ b/diamondash/server.py
@@ -266,6 +266,11 @@ def static(request):
return File(resource_filename(__name__, 'static'))
+@route('/favicon.ico')
+def favicon(request):
diff --git a/requirements.pip b/requirements.pip
index 30e6681..42b9ede 100644
--- a/requirements.pip
+++ b/requirements.pip
@@ -1,4 +1,4 @@
-https://github.com/twisted/klein.git#egg=klein
PyYAML
-Twisted
Unidecode
+Twisted
diff --git a/go/conversation/views.py b/go/conversation/views.py
index 4e76ad4..3001483 100644
--- a/go/conversation/views.py
+++ b/go/conversation/views.py
@@ -32,12 +32,10 @@ def index(request):
if c.conversation_type == conversation_type]
if conversation_status:
- if conversation_status == 'running':
- conversations = [c for c in conversations if c.running()]
@jerith
jerith / gist:4579714
Last active December 11, 2015 09:28
New pyntnclick game notes

The new game is a cyberpunk noir style "detective" story. There are two distinct environments in which the protagonist operates: meatspace is a dystopian near-future urban setting and cyberspace is a Gibson-style virtual reality environment with TRON-like visuals. Each environment would need to have its own inventory. Cyberspace can be reached at almost any point in the game by using a computer of some kind, but certain areas would require the player to be in associated meatspace locales because of firewalls and such.

The game opens with a straightforward puzzle that the narrator more or less walks through. You're on a normal corporate espionage mission which suddenly goes horribly awry when you uncover a major conspiracy and set off all sorts of alarms. You have to get out in a hurry with private security (translation: thugs with legal immunity) hot on your heels and all over your home and usual hangouts. Your primary servers have also been compromised, denying you access to most of your normal tools and re

diff --git a/go/apps/jsbox/vumi_app.py b/go/apps/jsbox/vumi_app.py
index 6a84175..f5df874 100644
--- a/go/apps/jsbox/vumi_app.py
+++ b/go/apps/jsbox/vumi_app.py
@@ -5,6 +5,7 @@
from twisted.internet.defer import inlineCallbacks, returnValue
+from vumi.config import ConfigField
from vumi.application.sandbox import JsSandbox, SandboxResource
diff --git a/tests/test_interpreter.py b/tests/test_interpreter.py
index 05536b4..e87da42 100644
--- a/tests/test_interpreter.py
+++ b/tests/test_interpreter.py
@@ -225,7 +225,7 @@ class TestInterpreter(BaseTopazTest):
end
""")
w_cls = space.w_object.constants_w["X"]
- assert w_cls.methods_w.viewkeys() == {"m", "f"}
+ assert set(w_cls.methods_w.keys()) == set(["m", "f"])
[Timer] Timings:
[Timer] annotate --- 98.8 s
[Timer] rtype_lltype --- 122.0 s
[Timer] backendopt_lltype --- 77.6 s
[Timer] stackcheckinsertion_lltype --- 4.3 s
[Timer] database_c --- 92.7 s
[Timer] source_c --- 80.1 s
[Timer] compile_c --- 66.2 s
[Timer] ==========================================
[Timer] Total: --- 541.8 s