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
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__() |
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 __future__ import absolute_import | |
from pyeliza import eliza as therapist | |
class Eliza: | |
aliases = 'eliza' | |
description = 'Virtual therapist' | |
_therapist = therapist() | |
def execute(self, expression, context): | |
''' |
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 __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() |
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 test_quit(self): | |
scenario = ''' | |
>>> a = 10 | |
>>> a | |
10 | |
>>> quit | |
--- not running | |
--- restart |
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 test_quit(self): | |
scenario = ''' | |
>>> a = 10 | |
>>> a | |
10 | |
>>> quit | |
--- restart | |
>>> a |
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 test_running(self): | |
class Application(AbstractApplication): | |
pass | |
scenario = ''' | |
>>> a = 4 | |
--- running | |
>>> b = 5 |
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
import types | |
from collections import deque | |
class InputError(Exception): | |
pass | |
class NotRunningError(Exception): | |
pass | |
class MatchError(Exception): |
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
class Quit: | |
aliases = ('quit', 'quit()', ) | |
description = 'Quits the application' | |
def execute(self): | |
raise SystemExit |
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 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: |
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 interpret(self, expression): | |
possible_parameters = {'context': self.context, | |
'commands': self.commands, 'expression': expression, | |
'variables': self.variables} | |
if expression is None: | |
return |