about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-02-10 18:27:41 +0100
committerhut <hut@lavabit.com>2010-03-09 14:40:19 +0100
commit2feb26dea6e9e55cf6bc0933baefd9fad99f5507 (patch)
tree8550f67c4e4b0676d6c79cc18c65422ed36bf82a
parentca909b9a3b638d25092bd3990919f61fb677a502 (diff)
downloadranger-2feb26dea6e9e55cf6bc0933baefd9fad99f5507.tar.gz
keyparser: cleanups
-rw-r--r--test/tc_newkeys.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/test/tc_newkeys.py b/test/tc_newkeys.py
index 1326677f..56a3303e 100644
--- a/test/tc_newkeys.py
+++ b/test/tc_newkeys.py
@@ -55,7 +55,7 @@ class CommandArgs(object):
 		self.direction = keybuffer.directions and keybuffer.directions[0] or None
 		self.directions = keybuffer.directions
 		self.keys = str(keybuffer)
-		self.moo = keybuffer.moo
+		self.matches = keybuffer.matches
 
 class KeyBuffer(object):
 	"""The evaluator and storage for pressed keys"""
@@ -133,7 +133,7 @@ class KeyBuffer(object):
 				assert isinstance(self.tree_pointer, (binding, dict))
 				self.dir_tree_pointer = self.direction_keys._tree
 			elif ANYKEY in self.tree_pointer:
-				self.moo.append(key)
+				self.matches.append(key)
 				self.tree_pointer = self.tree_pointer[ANYKEY]
 				assert isinstance(self.tree_pointer, (binding, dict))
 				self._try_to_finish()
@@ -153,8 +153,7 @@ class KeyBuffer(object):
 		self.failure = False
 		self.done = False
 		self.quant = None
-		self.moo = []
-		self.quant2 = None
+		self.matches = []
 		self.command = None
 		self.direction_quant = None
 		self.directions = []
@@ -210,8 +209,6 @@ class Keymap(object):
 					yield ord(char)
 		elif isinstance(key, int):
 			yield key
-		else:
-			raise TypeError(key)
 
 	def add_binding(self, *keys, **actions):
 		assert keys
@@ -394,7 +391,7 @@ class Test(PressTestCase):
 
 		def cat(arg):
 			n = arg.n is None and 1 or arg.n
-			return ''.join(chr(c) for c in arg.moo) * n
+			return ''.join(chr(c) for c in arg.matches) * n
 
 		km.add(cat, 'return.')
 		km.add(cat, 'cat4....')
OG' href='/danisanti/profani-tty/commit/CHANGELOG?id=841f907308f7a539e66a3be4f463ff2ed5941104'>841f9073 ^
1ed9580c ^
214eac6e ^

4257ecb1 ^
0269129d ^



9b797f3c ^
0269129d ^
6f1119d2 ^
f1875919 ^
89c7de77 ^
55b3e9d4 ^

89c7de77 ^
a3dccce2 ^
06882c01 ^

0269129d ^
a7de5933 ^


0bf9d324 ^
a7de5933 ^
0bf9d324 ^




a7de5933 ^
0bf9d324 ^





cd084c7e ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57