fixed token names in mode.dir

--HG--
branch : pmacs2
This commit is contained in:
Erik Osheim 2009-06-11 00:00:33 -04:00
parent 675b40ad38
commit 954c383a29
1 changed files with 40 additions and 40 deletions

View File

@ -8,32 +8,32 @@ from method import Method, Argument
class PermGrammar(Grammar): class PermGrammar(Grammar):
rules = [ rules = [
PatternRule('perm_sticky', '[tT]'), PatternRule('sticky', '[tT]'),
PatternRule('perm_setid', '[sS]'), PatternRule('setid', '[sS]'),
PatternRule('perm_read', 'r'), PatternRule('read', 'r'),
PatternRule('perm_write', 'w'), PatternRule('write', 'w'),
PatternRule('perm_exec', 'x'), PatternRule('exec', 'x'),
] ]
ds = r'([^ ]+)( +)([^ ]+)( +)([^ ]+)( +)([A-Za-z]{3} [ 0-9]{2} [0-9]{2}:[0-9]{2})( +)([^\n]+)' ds = r'([^ ]+)( +)([^ ]+)( +)([^ ]+)( +)([A-Za-z]{3} [ 0-9]{2} [0-9]{2}:[0-9]{2})( +)([^\n]+)'
class PathGrammar(Grammar): class PathGrammar(Grammar):
rules = [ rules = [
RegionRule('dir_perm', '(?<=^.)', PermGrammar, ' '), RegionRule('perm', '(?<=^.)', PermGrammar, ' '),
PatternMatchRule('x', ds, 'dir_owner', 'spaces', 'dir_group', 'spaces', PatternMatchRule('x', ds, 'dir.owner', 'spaces', 'dir.group', 'spaces',
'dir_size', 'spaces', 'dir_mtime', 'spaces', 'dir.size', 'spaces', 'dir.mtime', 'spaces',
'dir_name', 'spaces'), 'name', 'spaces'),
] ]
class DirGrammar(Grammar): class DirGrammar(Grammar):
rules = [ rules = [
RegionRule('dir_file', '^-', PathGrammar, r'\n'), RegionRule('dir.file', '^-', PathGrammar, r'\n'),
RegionRule('dir_blk', '^b', PathGrammar, r'\n'), RegionRule('dir.blk', '^b', PathGrammar, r'\n'),
RegionRule('dir_chr', '^c', PathGrammar, r'\n'), RegionRule('dir.chr', '^c', PathGrammar, r'\n'),
RegionRule('dir_dir', '^d', PathGrammar, r'\n'), RegionRule('dir.dir', '^d', PathGrammar, r'\n'),
RegionRule('dir_lnk', '^l', PathGrammar, r'\n'), RegionRule('dir.lnk', '^l', PathGrammar, r'\n'),
RegionRule('dir_fifo', '^p', PathGrammar, r'\n'), RegionRule('dir.fifo', '^p', PathGrammar, r'\n'),
RegionRule('dir_sock', '^s', PathGrammar, r'\n'), RegionRule('dir.sock', '^s', PathGrammar, r'\n'),
RegionRule('dir_unk', '^\?', PathGrammar, r'\n'), RegionRule('dir.unk', '^\?', PathGrammar, r'\n'),
] ]
class FsSettingBase(Method): class FsSettingBase(Method):
@ -191,31 +191,31 @@ class Dir(mode.Fundamental):
name = 'Dir' name = 'Dir'
grammar = DirGrammar() grammar = DirGrammar()
colors = { colors = {
'dir_blk.start': ('cyan', 'default', 'bold'), 'dir.blk.start': ('cyan', 'default', 'bold'),
'dir_blk.dir_name': ('cyan', 'default', 'bold'), 'dir.blk.name': ('cyan', 'default', 'bold'),
'dir_chr.start': ('yellow', 'default', 'bold'), 'dir.chr.start': ('yellow', 'default', 'bold'),
'dir_chr.dir_name': ('yellow', 'default', 'bold'), 'dir.chr.name': ('yellow', 'default', 'bold'),
'dir_dir.start': ('blue', 'default', 'bold'), 'dir.dir.start': ('blue', 'default', 'bold'),
'dir_dir.dir_name': ('blue', 'default', 'bold'), 'dir.dir.name': ('blue', 'default', 'bold'),
'dir_lnk.start': ('green', 'default', 'bold'), 'dir.lnk.start': ('green', 'default', 'bold'),
'dir_lnk.dir_name': ('green', 'default', 'bold'), 'dir.lnk.name': ('green', 'default', 'bold'),
'dir_fifo.start': ('red', 'default', 'bold'), 'dir.fifo.start': ('red', 'default', 'bold'),
'dir_fifo.dir_name': ('red', 'default', 'bold'), 'dir.fifo.name': ('red', 'default', 'bold'),
'dir_sock.start': ('red', 'default', 'bold'), 'dir.sock.start': ('red', 'default', 'bold'),
'dir_sock.dir_name': ('red', 'default', 'bold'), 'dir.sock.name': ('red', 'default', 'bold'),
'dir_unk.start': ('magenta', 'default', 'bold'), 'dir.unk.start': ('magenta', 'default', 'bold'),
'dir_unk.dir_name': ('magenta', 'default', 'bold'), 'dir.unk.name': ('magenta', 'default', 'bold'),
'dir_perm.perm_setid': ('yellow', 'default', 'bold'), 'perm.setid': ('yellow', 'default', 'bold'),
'dir_perm.perm_sticky': ('yellow', 'default', 'bold'), 'perm.sticky': ('yellow', 'default', 'bold'),
'dir_perm.perm_read': ('magenta', 'default', 'bold'), 'perm.read': ('magenta', 'default', 'bold'),
'dir_perm.perm_write': ('magenta', 'default', 'bold'), 'perm.write': ('magenta', 'default', 'bold'),
'dir_perm.perm_exec': ('magenta', 'default', 'bold'), 'perm.exec': ('magenta', 'default', 'bold'),
'dir_owner': ('cyan', 'default', 'bold'), 'dir.owner': ('cyan', 'default', 'bold'),
'dir_group': ('cyan', 'default', 'bold'), 'dir.group': ('cyan', 'default', 'bold'),
'dir_size': ('yellow', 'default', 'bold'), 'dir.size': ('yellow', 'default', 'bold'),
'dir_mtime': ('green', 'default', 'bold'), 'dir.mtime': ('green', 'default', 'bold'),
} }
actions = [DirRefresh, DirOpen, DirGrep, DirChmod, DirChown, DirChgrp, actions = [DirRefresh, DirOpen, DirGrep, DirChmod, DirChown, DirChgrp,
DirTouch, DirRemove, HideDotFiles, ShowDotFiles, SortName, DirTouch, DirRemove, HideDotFiles, ShowDotFiles, SortName,