Skip to content

Instantly share code, notes, and snippets.

View bebraw's full-sized avatar

Juho Vepsäläinen bebraw

View GitHub Profile
import inspect
import imp
import os
import sys
from node import TreeNode
class File(TreeNode):
def __init__(self, path=None, name=None):
super(File, self).__init__()
from __future__ import absolute_import
from pyeliza import eliza as therapist
class Eliza:
aliases = 'eliza'
description = 'Virtual therapist'
_therapist = therapist()
def execute(self, expression, context):
'''
from __future__ import absolute_import
from repeat import RepeatTimer
from visual import *
class Bounce:
aliases = 'bounce'
description = 'VPython Bounce Test'
def execute(self, expression, context):
expression = expression.strip()
...
def test_quit(self):
scenario = '''
>>> a = 10
>>> a
10
>>> quit
--- not running
--- restart
...
def test_quit(self):
scenario = '''
>>> a = 10
>>> a
10
>>> quit
--- restart
>>> a
...
def test_running(self):
class Application(AbstractApplication):
pass
scenario = '''
>>> a = 4
--- running
>>> b = 5
import types
from collections import deque
class InputError(Exception):
pass
class NotRunningError(Exception):
pass
class MatchError(Exception):
class Quit:
aliases = ('quit', 'quit()', )
description = 'Quits the application'
def execute(self):
raise SystemExit
...
def interpret(self, expression):
possible_parameters = {'context': self.context,
'commands': self.commands, 'expression': expression,
'variables': self.variables}
try:
if self.context.owner:
command = self.context.owner
else:
...
def interpret(self, expression):
possible_parameters = {'context': self.context,
'commands': self.commands, 'expression': expression,
'variables': self.variables}
if expression is None:
return