branch : pmacs2
This commit is contained in:
moculus 2008-03-14 21:17:04 +00:00
parent 13d488f440
commit 6bcf147a8e
10 changed files with 16 additions and 16 deletions

2
aes.py
View File

@ -3,7 +3,7 @@
# by Erik Osheim # by Erik Osheim
import os, popen2 import os, popen2
class Cipher: class Cipher(object):
'''Cipher represents a particular hashing strategy (password, seed, and type). Cipher can encrypt or decrypt data.''' '''Cipher represents a particular hashing strategy (password, seed, and type). Cipher can encrypt or decrypt data.'''
def __init__(self, password, seed='aes.py', hashtype='rmd160'): def __init__(self, password, seed='aes.py', hashtype='rmd160'):
self.password = password self.password = password

View File

@ -9,7 +9,7 @@ ACT_REDO = 2
STACK_LIMIT = 1024 STACK_LIMIT = 1024
# used for undo/redo stacks when text will need to be added back # used for undo/redo stacks when text will need to be added back
class AddMove: class AddMove(object):
def __init__(self, buffer, p, lines): def __init__(self, buffer, p, lines):
self.buffer = buffer self.buffer = buffer
self.p = p self.p = p
@ -21,7 +21,7 @@ class AddMove:
return self.p return self.p
# used for undo/redo stacks when text will need to be removed # used for undo/redo stacks when text will need to be removed
class DelMove: class DelMove(object):
def __init__(self, buffer, p1, p2): def __init__(self, buffer, p1, p2):
self.buffer = buffer self.buffer = buffer
self.p1 = p1 self.p1 = p1

View File

@ -1,7 +1,7 @@
import sets import sets
import window import window
class Slot: class Slot(object):
def __init__(self, height, width, offset): def __init__(self, height, width, offset):
self.height = height self.height = height
self.width = width self.width = width
@ -26,7 +26,7 @@ class Slot:
else: else:
return None return None
class BufferList: class BufferList(object):
def __init__(self, height, width, buffers=()): def __init__(self, height, width, buffers=()):
self.height = height self.height = height
self.width = width self.width = width

View File

@ -17,7 +17,7 @@ def find_common_string(candidates):
index += 1 index += 1
return test return test
class Completer: class Completer(object):
def get_candidates(self, s): def get_candidates(self, s):
assert "Not implemented" assert "Not implemented"
def tab_string(self, s, w=None): def tab_string(self, s, w=None):

View File

@ -31,7 +31,7 @@ def token_vmatch2(self, token, *pairs):
return True return True
return False return False
class Highlighter: class Highlighter(object):
def __init__(self, lexer): def __init__(self, lexer):
self.lexer = lexer self.lexer = lexer
self.tokens = [] self.tokens = []

View File

@ -11,7 +11,7 @@ def get_speller():
global _speller global _speller
return _speller return _speller
class Speller: class Speller(object):
def __init__(self, cmd='ispell'): def __init__(self, cmd='ispell'):
self.pipe = None self.pipe = None
self.cache = cache.CacheDict() self.cache = cache.CacheDict()

View File

@ -113,7 +113,7 @@ def disable_control_chars():
termios.tcsetattr(sys.stdin, termios.TCSANOW, attr) termios.tcsetattr(sys.stdin, termios.TCSANOW, attr)
class Handler: class Handler(object):
def __init__(self): def __init__(self):
self.tokens = [] self.tokens = []
self.unset_meta() self.unset_meta()

6
lex.py
View File

@ -60,7 +60,7 @@ class Token(object):
fields = (self.fqname(), self.rule, self.y, self.x, s) fields = (self.fqname(), self.rule, self.y, self.x, s)
return "<Token(%r, %r, %d, %d, %r)>" % fields return "<Token(%r, %r, %d, %d, %r)>" % fields
class Rule: class Rule(object):
reflags = 0 reflags = 0
def __init__(self, name): def __init__(self, name):
assert regex.valid_token_name.match(name), 'invalid name %r' % name assert regex.valid_token_name.match(name), 'invalid name %r' % name
@ -353,11 +353,11 @@ class RegionRule(Rule):
class NocaseRegionRule(RegionRule): class NocaseRegionRule(RegionRule):
reflags = re.IGNORECASE reflags = re.IGNORECASE
class Grammar: class Grammar(object):
rules = [] rules = []
grammar = Grammar() grammar = Grammar()
class Lexer: class Lexer(object):
def __init__(self, mode, grammar): def __init__(self, mode, grammar):
self.mode = mode self.mode = mode
self.mstack = [] self.mstack = []

View File

@ -14,7 +14,7 @@ DATATYPES = {
class MethodError(Exception): class MethodError(Exception):
pass pass
class Argument: class Argument(object):
def __init__(self, name, type=type(""), datatype=None, prompt=None, help="", def __init__(self, name, type=type(""), datatype=None, prompt=None, help="",
default=default.none, load_default=False): default=default.none, load_default=False):
self.name = name self.name = name
@ -64,7 +64,7 @@ class Argument:
if starting_value: if starting_value:
app.mini_buffer.set_data(starting_value) app.mini_buffer.set_data(starting_value)
class Method: class Method(object):
_is_method = True _is_method = True
args = [] args = []
def __init__(self): def __init__(self):

4
tab.py
View File

@ -1,14 +1,14 @@
import regex, util import regex, util
from point import Point from point import Point
class Marker: class Marker(object):
def __init__(self, name, level): def __init__(self, name, level):
self.name = name self.name = name
self.level = level self.level = level
def __repr__(self): def __repr__(self):
return '<Marker(%r, %r)>' % (self.name, self.level) return '<Marker(%r, %r)>' % (self.name, self.level)
class Tabber: class Tabber(object):
wsre = regex.whitespace wsre = regex.whitespace
wst = ('null', 'eol',) wst = ('null', 'eol',)
sre = regex.space sre = regex.space