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
import os, popen2
class Cipher:
class Cipher(object):
'''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'):
self.password = password

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -113,7 +113,7 @@ def disable_control_chars():
termios.tcsetattr(sys.stdin, termios.TCSANOW, attr)
class Handler:
class Handler(object):
def __init__(self):
self.tokens = []
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)
return "<Token(%r, %r, %d, %d, %r)>" % fields
class Rule:
class Rule(object):
reflags = 0
def __init__(self, name):
assert regex.valid_token_name.match(name), 'invalid name %r' % name
@ -353,11 +353,11 @@ class RegionRule(Rule):
class NocaseRegionRule(RegionRule):
reflags = re.IGNORECASE
class Grammar:
class Grammar(object):
rules = []
grammar = Grammar()
class Lexer:
class Lexer(object):
def __init__(self, mode, grammar):
self.mode = mode
self.mstack = []

View File

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

4
tab.py
View File

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