Skip to content

Instantly share code, notes, and snippets.

$ mkdir /tmp/liquidluck-crash
$ cd /tmp/liquidluck-crash
$ virtualenv .env
New python executable in .env/bin/python
Installing setuptools............done.
Installing pip...............done.
dhcp-172-26-14-131:liquidluck-crash tusk$ . .env/bin/activate
(.env)$ pip install --upgrade liquidluck
Downloading/unpacking liquidluck
Downloading liquidluck-3.8.tar.gz (40kB): 40kB downloaded
lrwxrwxrwx 1 root root 23 Jul 23 03:50 20d096ba.0 -> ValiCert_Class_1_VA.pem
lrwxrwxrwx 1 root root 23 Jul 23 03:50 f4996e82.0 -> ValiCert_Class_1_VA.pem
lrwxrwxrwx 1 root root 58 Jul 23 03:50 ValiCert_Class_1_VA.pem -> /usr/share/ca-certificates/mozilla/ValiCert_Class_1_VA.crt
-rw-r--r-- 1 root root 1066 Jun 12 2012 ValiCert_Class_2_VA.pem.dpkg-new
tusk@hippo:~/src/twistedchecker
$ bzr branch lp:twistedchecker trunk
The authenticity of host 'bazaar.launchpad.net (91.189.95.84)' can't be established.
RSA key fingerprint is 9d:38:3a:63:b1:d5:6f:c4:44:67:53:49:2e:ee:fc:89.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'bazaar.launchpad.net,91.189.95.84' (RSA) to the list of known hosts.
Connection to 91.189.95.84 timed out while waiting to read
ConnectionReset reading response for 'BzrDir.open_2.1', retrying
Connection to 91.189.95.84 timed out while waiting to read
bzr: ERROR: Connection closed: Unexpected end of message. Please check connectivity and permissions, and report a bug if problems persist.
Wed 2013-09-04 11:53:04 +0100
0.035 bazaar version: 2.5.1
0.035 bzr arguments: [u'-Dhpss', u'branch', u'lp:twistedchecker', u'trunk']
0.036 looking for plugins in /usr/local/google/home/tusk/.bazaar/plugins
0.036 looking for plugins in /usr/lib/python2.7/dist-packages/bzrlib/plugins
0.045 encoding stdout as sys.stdout encoding 'UTF-8'
0.082 hpss: Built a new medium: SmartSSHClientMedium
0.105 hpss call: 'BzrDir.open_2.1', '+branch/twistedchecker/'
0.105 (to bzr+ssh://bazaar.launchpad.net/+branch/twistedchecker/)
0.144 ssh implementation is OpenSSH
(.env)jml@grace:~/src/filthy-lucre$ pip list
argparse (1.2.1)
distribute (0.6.34)
edn (0.0.1, /home/jml/src/edn)
extras (0.0.3)
filthy-lucre (0.0.1, /home/jml/src/filthy-lucre)
fixtures (0.3.14)
iso8601 (0.1.4)
klein (0.2.1)
lxml (3.2.3)
$ testr run
running=${PYTHON:-python} -m subunit.run discover .
�)7.edn.tests.test_ast.EDNTestCase.test_bad_floats�p�D�)4+edn.tests.test_ast.EDNTestCase.test_booleanyG��)6-edn.tests.test_ast.EDNTestCase.test_characterb�г)4+edn.tests.test_ast.EDNTestCase.test_commentg�܀�)4+edn.tests.test_ast.EDNTestCase.test_discard�&�)2)edn.tests.test_ast.EDNTestCase.test_floatW1ݙ�)4+edn.tests.test_ast.EDNTestCase.test_integer��%��)4+edn.tests.test_ast.EDNTestCase.test_keyword�Q�׳)1(edn.tests.test_ast.EDNTestCase.test_listd�Lͳ)0'edn.tests.test_ast.EDNTestCase.test_map��.dz)0'edn.tests.test_ast.EDNTestCase.test_nilp[Fٳ)0'edn.tests.test_ast.EDNTestCase.test_set�|���)3*edn.tests.test_ast.EDNTestCase.test_stringt�In�)3*edn.tests.test_ast.EDNTestCase.test_symbol��>�)0'edn.tests.test_ast.EDNTestCase.test_tag>�3��)4+edn.tests.test_ast.EDNTestCase.test_unicode s:��)3*edn.tests.test_ast.EDNTestCase.test_vector�Z���)8/edn.tests.test_ast.ParseTestCase.test_structure4���)90edn.tests.test_ast.UnparseTestCase.test_bo
from parsley import makeGrammar
grammar = "word = <(~ws anything)+>:w"
G = makeGrammar(grammar, {})
print G('word').word()
from parsley import makeGrammar
G = makeGrammar("""
nonx = ~(' ' | '\n' |'x') anything
nonws = ~(' ' | '\n') anything
foo = (nonx | nonws)+ 'x'
""", {})
print G('foox').foo()
@jml
jml / gist:6875518
Created October 7, 2013 21:49
Streaming parser
from ometa.grammar import OMeta
from ometa.interp import TrampolinedGrammarInterpreter
from parsley import makeGrammar
import sys
grammar = """
hex_digit = digit | 'A' | 'B' | 'C' | 'D' | 'E' | 'F'
import iso8601
strings = [
"1985-04-12T23:20:50.52-05:30",
"1985-04-12T23:20:50.52+05:30",
]
for string in strings: