branch : pmacs2
This commit is contained in:
moculus 2007-10-18 21:07:35 +00:00
parent b0f40259d6
commit aa56498955
35 changed files with 475 additions and 526 deletions

View File

@ -84,90 +84,47 @@ class Application(object):
self.set_error("Dynamic color not available")
# initialize our modes
self.modes = {
'blame': mode.blame.Blame,
'c': mode.c.C,
'console': mode.console.Console,
'consolemini': mode.consolemini.Console,
'diff': mode.diff.Diff,
'dir': mode.dir.Dir,
'fundamental': mode2.Fundamental,
'mini': mode.mini.Mini,
'nasm': mode.nasm.Nasm,
'perl': mode.perl.Perl,
'python': mode.python.Python,
'replace': mode.replace.Replace,
'search': mode.search.Search,
'sh': mode.sh.Sh,
'text': mode.text.Text,
'text2': mode.text2.Text2,
'which': mode.which.Which,
'xml': mode.xml.XML,
'html': mode.html.HTML,
'css': mode.css.CSS,
'mutt': mode.mutt.Mutt,
'javascript': mode.javascript.Javascript,
'sql': mode.sql.Sql,
'template': mode.tt.Template,
#'bds': mode.bds.BDS,
'rst': mode.rst.RST,
'java': mode.java.Java,
'hex': mode.hex.Hex,
'make': mode.make.Make,
# the first dict stores our modes by (lowercase) name, and the other
# dicts all store various ways to "auto-detecting" the correct mode,
# in the precedence with which they are used.
self.modes = {}
self.mode_paths = {}
self.mode_basenames = {}
self.mode_extensions = {}
self.mode_detection = {}
'ocaml': mode.ocaml.Ocaml,
# lisp dialects
'lisp': mode.lisp.Lisp,
'scheme': mode.scheme.Scheme,
'elisp': mode.elisp.ELisp,
}
# these are used in this order to determine which mode to open certain
# kinds of files
self.mode_paths = {
'/etc/profile': 'sh',
}
self.mode_basenames = {
'.bashrc': 'sh',
'.bash_profile': 'sh',
'.profile': 'sh',
#'components.xml': 'bds',
'.emacs': 'elisp',
'Makefile': 'make',
}
self.mode_extensions = {
'.py': 'python',
'.pl': 'perl',
'.pm': 'perl',
'.t': 'perl',
'.c': 'c',
#'.txt': 'text',
'.txt': 'text2',
'.s': 'nasm',
'.sh': 'sh',
'.bash': 'sh',
'.xml': 'xml',
'.xml.in': 'xml',
'.html': 'html',
'.htm': 'html',
'.js': 'javascript',
'.sql': 'sql',
'.tt': 'template',
'.css': 'css',
'.rst': 'rst',
'.java': 'java',
'.el': 'elisp',
'.scm': 'scheme',
'.mli': 'ocaml',
'.ml': 'ocaml',
}
self.mode_detection = {
'python': 'python',
'perl': 'perl',
'sh': 'sh',
'bash': 'sh',
}
mode2.Fundamental.install(self)
mode.blame.Blame.install(self)
mode.c.C.install(self)
mode.console.Console.install(self)
mode.consolemini.ConsoleMini.install(self)
mode.css.CSS.install(self)
mode.diff.Diff.install(self)
mode.dir.Dir.install(self)
mode.elisp.ELisp.install(self)
mode.hex.Hex.install(self)
mode.html.HTML.install(self)
mode.java.Java.install(self)
mode.javascript.Javascript.install(self)
mode.lisp.Lisp.install(self)
mode.make.Make.install(self)
mode.mini.Mini.install(self)
mode.mutt.Mutt.install(self)
mode.nasm.Nasm.install(self)
mode.ocaml.Ocaml.install(self)
mode.perl.Perl.install(self)
mode.python.Python.install(self)
mode.replace.Replace.install(self)
mode.rst.RST.install(self)
mode.scheme.Scheme.install(self)
mode.search.Search.install(self)
mode.sh.Sh.install(self)
mode.sql.Sql.install(self)
mode.tt.Template.install(self)
mode.text.Text.install(self)
mode.text2.Text2.install(self)
mode.which.Which.install(self)
mode.xml.XML.install(self)
# initialize our methods
self.methods = {}

View File

@ -23,6 +23,8 @@ class BDSGrammar(Grammar):
]
class BDS(mode2.Fundamental):
modename = 'BDS'
basenames = ['components.xml']
grammar = BDSGrammar
opentokens = ('delimiter',)
opentags = {'(': ')', '[': ']', '{': '}'}
@ -64,8 +66,6 @@ class BDS(mode2.Fundamental):
self.add_action(BDSMakeInstall())
self.add_action(BDSCompileResources())
self.add_action(BDSRestart())
def name(self):
return "BDS"
class BDSMakeInstall(Method):
def _execute(self, w, **vargs):

View File

@ -15,11 +15,10 @@ class BlameGrammar(Grammar):
]
class Blame(mode2.Fundamental):
modename = 'Blame'
grammar = BlameGrammar
colors = {
'metadata.start': ('blue', 'default', 'bold'),
'metadata.username': ('cyan', 'default', 'bold'),
'metadata.end': ('green', 'default', 'bold'),
}
def name(self):
return "Blame"

View File

@ -176,6 +176,8 @@ class CTabber(tab2.StackTabber):
return currlvl
class C(mode2.Fundamental):
modename = 'C'
extensions = ['.c']
tabbercls = CTabber
grammar = CGrammar
opentokens = ('delimiter',)
@ -240,8 +242,6 @@ class C(mode2.Fundamental):
self.add_action_and_bindings(CMake(), ('C-c C-c',))
self.add_action_and_bindings(CSetMake(), ('C-c M-m',))
self.makecmd = "make"
def name(self):
return "C"
class CSetMake(method.Method):
'''Set the path(s) to find perl modules'''

View File

@ -14,6 +14,7 @@ class ConsoleGrammar(Grammar):
PatternRule(r'bareword', r'[a-zA-Z_][a-zA-Z0-9_]*'),
]
class Console(mode2.Fundamental):
modename = 'Console'
grammar = ConsoleGrammar()
colors = {
'mesg': ('blue', 'default'),
@ -26,5 +27,3 @@ class Console(mode2.Fundamental):
'string.null': ('green', 'default'),
'string.end': ('green', 'default'),
}
def name(self):
return "Console"

View File

@ -3,7 +3,8 @@ import color, completer, method, mode2
from lex3 import Grammar, PatternRule
from point2 import Point
class Console(mode2.Fundamental):
class ConsoleMini(mode2.Fundamental):
modename = 'ConsoleMini'
def __init__(self, w):
mode2.Fundamental.__init__(self, w)
self.bindings = {}
@ -48,8 +49,6 @@ class Console(mode2.Fundamental):
#self.add_action_and_bindings(ConsoleTab(), ('TAB',))
for c in string.letters + string.digits + string.punctuation:
self.add_binding('insert-string-%s' % c, c)
def name(self):
return "Console"
class ConsoleExec(method.Method):
def _execute(self, w, **vargs):

View File

@ -42,6 +42,8 @@ class CSSGrammar(Grammar):
]
class CSS(mode2.Fundamental):
modename = 'CSS'
extensions = ['.css']
grammar = CSSGrammar
colors = {
'comment': ('red', 'default'),
@ -89,5 +91,3 @@ class CSS(mode2.Fundamental):
self.add_bindings('close-paren', (')',))
self.add_bindings('close-brace', ('}',))
self.add_bindings('close-bracket', (']',))
def name(self):
return "Javascript"

View File

@ -12,6 +12,7 @@ class DiffGrammar(Grammar):
]
class Diff(mode2.Fundamental):
modename = 'diff'
grammar = DiffGrammar()
colors = {
'left': ('red', 'default', 'bold'),
@ -24,8 +25,6 @@ class Diff(mode2.Fundamental):
mode2.Fundamental.__init__(self, w)
#self.add_action_and_bindings(DiffNextSection(), ('M-n', 'M-D_ARROW',))
#self.add_action_and_bindings(DiffPreviousSection(), ('M-p', 'M-U_ARROW',))
def name(self):
return "Diff"
class DiffNextSection(method.Method):
re = re.compile("(?:^|(?<=\n))@@ [-+0-9a-z, ]* @@(?:$|\n)")

View File

@ -36,6 +36,7 @@ class DirGrammar(Grammar):
]
class Dir(mode2.Fundamental):
modename = 'Dir'
grammar = DirGrammar()
colors = {
'blk.start': ('cyan', 'default'),
@ -74,8 +75,6 @@ class Dir(mode2.Fundamental):
self.add_action_and_bindings(Chgrp(), ('C-c g',))
self.add_action_and_bindings(TouchPath(), ('C-c t',))
self.add_action_and_bindings(RemovePath(), ('DELETE', 'BACKSPACE', 'C-d'))
def name(self):
return "Dir"
class RefreshView(Method):
def _execute(self, w, **vargs):

View File

@ -29,6 +29,9 @@ class ELispTabber(tab2.StackTabber):
pass
class ELisp(mode2.Fundamental):
modename = 'ELisp'
basenames = ['.emacs']
extensions = ['.el']
tabbercls = ELispTabber
grammar = ELispGrammar
opentokens = ('delimiter',)
@ -59,5 +62,3 @@ class ELisp(mode2.Fundamental):
self.add_bindings('close-bracket', (']',))
## add lisp-specific methods
#self.add_action_and_bindings(LispCheckSyntax(), ('C-c s',))
def name(self):
return "ELisp"

View File

@ -11,6 +11,7 @@ class HexGrammar(Grammar):
]
class Hex(mode2.Fundamental):
modename = 'Hex'
grammar = HexGrammar
colors = {
'zero': ('magenta', 'default'),
@ -30,9 +31,6 @@ class Hex(mode2.Fundamental):
else:
self.del_binding(c)
def name(self):
return "Hex"
class GotoWord(Method):
'''Jump to the specified line number'''
args = [Argument("wordno", type=type(0), prompt="Goto word: ")]

View File

@ -15,6 +15,8 @@ class HTMLGrammar(Grammar):
]
class HTML(mode2.Fundamental):
modename = 'HTML'
extensions = ['.html', '.htm', '.shtml', '.shtm', '.xhtml']
grammar = HTMLGrammar
colors = {
'comment.start': ('red', 'default'),
@ -39,14 +41,9 @@ class HTML(mode2.Fundamental):
'tag.string.end': ('green', 'default'),
'tag.end': ('default', 'default'),
}
js = Javascript(None)
for name in js.colors:
colors['script.%s' % name] = js.colors[name]
del js
colors.update(Javascript.colors)
def __init__(self, w):
mode2.Fundamental.__init__(self, w)
self.add_bindings('close-paren', (')',))
self.add_bindings('close-brace', ('}',))
self.add_bindings('close-bracket', (']',))
def name(self):
return "HTML"

View File

@ -154,6 +154,8 @@ class JavaTabber(CTabber):
return currlvl
class Java(mode2.Fundamental):
modename = 'Java'
extensions = ['.java']
tabbercls = JavaTabber
grammar = JavaGrammar
opentokens = ('delimiter',)
@ -190,5 +192,3 @@ class Java(mode2.Fundamental):
self.add_bindings('close-paren', (')',))
self.add_bindings('close-brace', ('}',))
self.add_bindings('close-bracket', (']',))
def name(self):
return "Java"

View File

@ -53,6 +53,8 @@ class JavascriptTabber(tab2.StackTabber):
return currlvl
class Javascript(mode2.Fundamental):
modename = 'Javascript'
extensions = ['.js']
grammar = JavascriptGrammar
tabbercls = JavascriptTabber
opentokens = ('delimiter',)
@ -93,5 +95,3 @@ class Javascript(mode2.Fundamental):
self.add_bindings('close-paren', (')',))
self.add_bindings('close-brace', ('}',))
self.add_bindings('close-bracket', (']',))
def name(self):
return "Javascript"

View File

@ -31,6 +31,7 @@ class LispTabber(tab2.StackTabber):
return currlvl
class Lisp(mode2.Fundamental):
modename = 'Lisp'
tabwidth = 2
tabbercls = LispTabber
grammar = LispGrammar
@ -51,5 +52,3 @@ class Lisp(mode2.Fundamental):
self.add_bindings('close-paren', (')',))
self.add_bindings('close-brace', ('}',))
self.add_bindings('close-bracket', (']',))
def name(self):
return "Lisp"

View File

@ -28,6 +28,8 @@ class MakeGrammar(Grammar):
]
class Make(mode2.Fundamental):
modename = 'Make'
basenames = ['Makefile']
grammar = MakeGrammar
savetabs = True
colors = {
@ -48,5 +50,3 @@ class Make(mode2.Fundamental):
'string.end': ('green', 'default'),
}
colors.update(Sh.colors)
def name(self):
return "Make"

View File

@ -1,7 +1,7 @@
import method, mode2
class Mini(mode2.Fundamental):
'''This is the default mode'''
modename = 'Mini'
def __init__(self, w):
mode2.Fundamental.__init__(self, w)
@ -18,10 +18,6 @@ class Mini(mode2.Fundamental):
# add some new actions for the minibuffer
self.add_action_and_bindings(MiniCallback(), ('RETURN',))
self.add_action_and_bindings(MiniTabComplete(), ('TAB',))
#self.add_action_and_bindings(MiniCancel(), ('C-]',))
def name(self):
return "Mini"
class MiniCallback(method.Method):
def execute(self, window, **vargs):

View File

@ -18,6 +18,7 @@ class MuttGrammar(Grammar):
]
class Mutt(mode2.Fundamental):
modename = 'Mutt'
grammar = MuttGrammar()
colors = {
'header': ('green', 'default', 'bold'),
@ -38,8 +39,6 @@ class Mutt(mode2.Fundamental):
self.add_action_and_bindings(mode.text.LearnWord(), ('C-c l',))
self.add_action_and_bindings(MuttWrapParagraph(), ('M-q',))
self.add_action_and_bindings(MuttInsertSpace(), ('SPACE',))
def name(self):
return "Mutt"
class MuttWrapLine(method.WrapLine):
limit = 72

View File

@ -27,6 +27,8 @@ class NasmGrammar(Grammar):
class Nasm(mode2.Fundamental):
modename = 'nasm'
extensions = ['.s']
grammar = NasmGrammar
colors = {
'keyword': ('cyan', 'default', 'bold'),
@ -39,7 +41,3 @@ class Nasm(mode2.Fundamental):
'instructions': ('magenta', 'default'),
'label': ('blue', 'default'),
}
def __init__(self, w):
mode2.Fundamental.__init__(self, w)
def name(self):
return "Nasm"

View File

@ -55,6 +55,8 @@ class OcamlGrammar(Grammar):
]
class Ocaml(mode2.Fundamental):
modename = 'ocaml'
extensions = ['.mli', '.ml']
grammar = OcamlGrammar
opentokens = ('delimiter',)
opentags = {'(': ')'}
@ -90,5 +92,3 @@ class Ocaml(mode2.Fundamental):
self.add_bindings('close-paren', (')',))
self.add_bindings('close-brace', ('}',))
self.add_bindings('close-bracket', (']',))
def name(self):
return "Ocaml"

View File

@ -195,6 +195,9 @@ class PerlTabber(tab2.StackTabber):
return currlvl
class Perl(mode2.Fundamental):
modename = 'Perl'
extensions = ['.pl', '.pm']
detection = ['perl']
tabbercls = PerlTabber
grammar = PerlGrammar
opentokens = ('delimiter',)
@ -297,7 +300,6 @@ class Perl(mode2.Fundamental):
'translate.end': ('magenta', 'default'),
'translate.null': ('magenta', 'default'),
}
def __init__(self, w):
mode2.Fundamental.__init__(self, w)
@ -321,9 +323,6 @@ class Perl(mode2.Fundamental):
self.functions = None
self.perllib = 'lib'
def name(self):
return "Perl"
def build_function_map(self):
b = self.window.buffer
self.functions = {}

View File

@ -10,6 +10,7 @@ class StringGrammar(Grammar):
]
class RawStringGrammar(Grammar):
rules = [
PatternRule(r'escaped', r'\\\\'),
PatternRule(r'escaped', r"\\'"),
PatternRule(r'escaped', r'\\"'),
]
@ -176,6 +177,9 @@ class PythonTabber(tab2.StackTabber):
return currlvl
class Python(mode2.Fundamental):
modename = 'Python'
extensions = ['.py']
detection = ['python']
tabbercls = PythonTabber
grammar = PythonGrammar
opentokens = ('delimiter',)
@ -215,8 +219,6 @@ class Python(mode2.Fundamental):
self.add_action_and_bindings(PythonDictCleanup(), ('C-c h',))
# highlighting
self.pythonlib = "."
def name(self):
return "Python"
class PythonSetLib(method.Method):
'''Set the path(s) to find perl modules'''

View File

@ -4,7 +4,7 @@ import color, method, minibuffer, mode2, searchutil
from point2 import Point
class Replace(mode2.Fundamental):
'''This is the default mode'''
modename = 'Replace'
def __init__(self, w):
mode2.Fundamental.__init__(self, w)
@ -22,8 +22,6 @@ class Replace(mode2.Fundamental):
w.set_error('%r was not found' % m.before)
raise minibuffer.MiniBufferError
_set_prompt(m)
def name(self):
return "Replace"
class ReplaceOne(method.Method):
def execute(self, w, **vargs):

View File

@ -41,6 +41,8 @@ class RSTGrammar(Grammar):
]
class RST(mode2.Fundamental):
modename = 'RST'
extensions = ['.rst']
grammar = RSTGrammar
colors = {
'title': ('blue', 'default'),
@ -73,5 +75,3 @@ class RST(mode2.Fundamental):
'bullet': ('magenta', 'default'),
'enumeration': ('magenta', 'default'),
}
def name(self):
return "RST"

View File

@ -26,6 +26,8 @@ class SchemeGrammar(Grammar):
]
class Scheme(mode2.Fundamental):
modename = 'Scheme'
extensions = ['.scm']
tabwidth = 2
tabbercls = mode.lisp.LispTabber
grammar = SchemeGrammar
@ -50,11 +52,6 @@ class Scheme(mode2.Fundamental):
}
def __init__(self, w):
mode2.Fundamental.__init__(self, w)
# tag matching
self.add_bindings('close-paren', (')',))
self.add_bindings('close-brace', ('}',))
self.add_bindings('close-bracket', (']',))
## add scheme-specific methods
#self.add_action_and_bindings(SchemeCheckSyntax(), ('C-c s',))
def name(self):
return "Scheme"

View File

@ -7,7 +7,7 @@ selected_color = 'magenta'
unselected_color = 'yellow'
class Search(mode2.Fundamental):
'''This is the default mode'''
modename = 'Search'
def __init__(self, w):
mode2.Fundamental.__init__(self, w)
@ -29,9 +29,6 @@ class Search(mode2.Fundamental):
self.add_action_and_bindings(InsertSearchString(c), (c,))
self.add_action_and_bindings(InsertSearchString(' '), ('SPACE',))
def name(self):
return "Search"
def _make_regex(w, s):
try:
if w.buffer.method.is_literal:

View File

@ -23,7 +23,6 @@ class EvalGrammar(Grammar):
class CaseGrammar(Grammar):
rules = [
#RegionRule(r'stanza', r'.+\)', Grammar, r';;'),
RegionRule(r'stanza', r'.+\)', Grammar, r';;'),
]
@ -71,8 +70,9 @@ class ShGrammar(Grammar):
PatternRule(r'eol', r'\n$'),
]
# hack to get some circular grammar refs
# hacks to get some circular grammar refs
CaseGrammar.rules[0].pairs[0] = (ShGrammar, CaseGrammar.rules[0].pairs[0][1])
#ShGrammar.rules[2].pairs[0] = (ShGrammar, ShGrammar.rules[0].pairs[0][1])
class ShTabber(tab2.StackTabber):
def is_base(self, y):
@ -102,11 +102,15 @@ class ShTabber(tab2.StackTabber):
return currlvl
class Sh(mode2.Fundamental):
modename = 'sh'
paths = ['/etc/profile']
basenames = ['.bashrc', '.bash_profile', '.profile']
extensions = ['.bash', '.sh']
detection = ['sh', 'bash']
grammar = ShGrammar
tabbercls = ShTabber
opentokens = ('delimiter', 'reserved', 'case.start')
opentags = {'(': ')', '[': ']', '{': '}',
'do': 'done', 'then': 'fi', 'case': 'esac'}
opentags = {'(': ')', '[': ']', '{': '}', 'do': 'done', 'then': 'fi', 'case': 'esac'}
closetokens = ('delimiter', 'reserved', 'case.end')
closetags = {')': '(', ']': '[', '}': '{',
'done': 'do', 'fi': 'then', 'esac': 'case'}

View File

@ -93,6 +93,8 @@ class SqlTabber(tab2.StackTabber):
return currlvl
class Sql(mode2.Fundamental):
modename = 'Sql'
extensions = ['.sql']
grammar = SqlGrammar
tabbercls = SqlTabber
opentokens = ('delimiter',)
@ -126,11 +128,8 @@ class Sql(mode2.Fundamental):
'function.definition.null': ('magenta', 'default'),
'function.definition.end': ('magenta', 'default'),
}
def __init__(self, w):
mode2.Fundamental.__init__(self, w)
self.add_bindings('close-paren', (')',))
self.add_bindings('close-brace', ('}',))
self.add_bindings('close-bracket', (']',))
def name(self):
return "Sql"

View File

@ -35,6 +35,8 @@ class TextGrammar(Grammar):
]
class Text(mode2.Fundamental):
modename = 'Text'
extensions=['.txt']
grammar = TextGrammar
colors = {
'misspelled': ('red', 'default'),
@ -49,8 +51,6 @@ class Text(mode2.Fundamental):
self.add_action_and_bindings(LearnWord(), ('C-c l',))
self.add_action_and_bindings(TextInsertSpace(), ('SPACE',))
self.add_action_and_bindings(method.WrapParagraph(), ('M-q',))
def name(self):
return "Text"
class TextInsertSpace(method.Method):
limit = 80

View File

@ -13,7 +13,9 @@ class Text2Grammar(Grammar):
]
class Text2(mode.text.Text):
modename = 'Text2'
grammar = Text2Grammar
extensions = ['.txt']
colors = {
'email': ('cyan', 'default'),
'url': ('green', 'default'),
@ -24,5 +26,3 @@ class Text2(mode.text.Text):
'punct': ('default', 'default'),
'stuff': ('default', 'default'),
}
def name(self):
return "Text2"

View File

@ -29,6 +29,8 @@ class TemplateGrammar(Grammar):
]
class Template(mode2.Fundamental):
modename = 'Template'
extensions = ['.tt']
grammar = TemplateGrammar
colors = {
'comment.start': ('red', 'default'),
@ -60,5 +62,3 @@ class Template(mode2.Fundamental):
self.add_bindings('close-paren', (')',))
self.add_bindings('close-brace', ('}',))
self.add_bindings('close-bracket', (']',))
def name(self):
return "Template"

View File

@ -2,6 +2,7 @@ import color, method, mode2
from point2 import Point
class Which(mode2.Fundamental):
modename = 'Which'
def __init__(self, w):
mode2.Fundamental.__init__(self, w)
old_mode = w.buffer.method.old_window.mode
@ -24,8 +25,6 @@ class Which(mode2.Fundamental):
err = "%s in mode '%s'" % (e, self.name())
self.window.application.set_error(err)
self._end()
def name(self):
return "Which"
def _end(self):
self.window.application.close_mini_buffer()
self.window.buffer.method.old_cursor = None

View File

@ -18,6 +18,8 @@ class XMLGrammar(Grammar):
]
class XML(mode2.Fundamental):
modename = 'XML'
extensions = ['.xml', '.xml.in']
grammar = XMLGrammar
colors = {
'comment.start': ('red', 'default'),
@ -32,5 +34,3 @@ class XML(mode2.Fundamental):
'tag.string.end': ('green', 'default'),
'tag.end': ('default', 'default'),
}
def name(self):
return "XML"

View File

@ -32,6 +32,8 @@ class Handler(object):
def add_binding(self, name, sequence):
if self.window is None:
return
elif not hasattr(self.window, 'application'):
raise Exception, "argh %r %r" % (self, self.window)
elif name not in self.window.application.methods:
raise Exception, "No action called %r found" % name
else:
@ -72,6 +74,11 @@ class Handler(object):
class Fundamental(Handler):
'''This is the default mode'''
modename = "Fundamental"
paths = []
basenames = []
extensions = []
detection = []
savetabs = False
tabwidth = 4
tabbercls = None
@ -80,6 +87,13 @@ class Fundamental(Handler):
tabber = None
default_color = ('default', 'default',)
colors = {}
def install(cls, app):
app.setmode(cls.modename.lower(), cls, paths=cls.paths,
basenames=cls.basenames, extensions=cls.extensions,
detection=cls.detection)
install = classmethod(install)
def __init__(self, w):
self.window = w
@ -185,7 +199,7 @@ class Fundamental(Handler):
# get mode name
def name(self):
return "Fundamental"
return self.modename
# handle input tokens
def handle_token(self, t):