Skip to content
This repository has been archived by the owner on Jul 11, 2021. It is now read-only.

Commit

Permalink
fix crash report #67; color prompt #64
Browse files Browse the repository at this point in the history
  • Loading branch information
timvieira committed Jul 27, 2013
1 parent 5367584 commit 798c6eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Dyna/Backend/Python/repl.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
"""

import re, os, cmd, readline
from utils import ip, lexer, subst, drepr, _repr, get_module, yellow
from utils import ip, lexer, subst, drepr, _repr, get_module, yellow, \
green, bold
from stdlib import topython, todyna
from errors import DynaCompilerError
from config import dotdynadir
from errors import show_traceback
import load, post


from interpreter import Rule
from contextlib import contextmanager

Expand Down Expand Up @@ -43,7 +43,7 @@ def show_doc(d=v.__doc__):

@property
def prompt(self):
return '> '
return bold % green % '> '

def do_rules(self, _):
"""
Expand Down Expand Up @@ -263,6 +263,7 @@ def add_rule(self, line, show_changed=True):
print e
print 'new rule(s) were not added to program.'
print
return ([], {})
else:
with self.error_tracker():
new_rules = self.interp.load_plan(src)
Expand Down
1 change: 1 addition & 0 deletions src/Dyna/Backend/Python/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ def get_module(cmd, sub):

black, red, green, yellow, blue, magenta, cyan, white = \
map('\033[3%sm%%s\033[0m'.__mod__, range(8))
bold = '\033[1m%s\033[0m'


_comments = re.compile('%.*$', re.MULTILINE)
Expand Down

0 comments on commit 798c6eb

Please sign in to comment.