This commit is contained in:
rocky 2015-12-23 20:11:06 -05:00
parent 0c45fcfab9
commit 484cd703bf

View File

@ -55,8 +55,8 @@ ExtractInfo = namedtuple("ExtractInfo",
"lineNo lineStartOffset markerLine selectedLine selectedText") "lineNo lineStartOffset markerLine selectedLine selectedText")
TABLE_DIRECT_FRAGMENT = { TABLE_DIRECT_FRAGMENT = {
'importstmt': ( '%|import %c%x\n', 2, (2,(0,1)), ), 'importstmt': ( '%|import %c%x\n', 2, (2, (0, 1)), ),
'importfrom': ( '%|from %[2]{pattr}%x import %c\n', (2,(0,1)), 3), 'importfrom': ( '%|from %[2]{pattr}%x import %c\n', (2, (0, 1)), 3),
} }
class Traverser(pysource.Walker, object): class Traverser(pysource.Walker, object):
@ -87,7 +87,6 @@ class Traverser(pysource.Walker, object):
# Customize with our more-pervisive rules # Customize with our more-pervisive rules
TABLE_DIRECT.update(TABLE_DIRECT_FRAGMENT) TABLE_DIRECT.update(TABLE_DIRECT_FRAGMENT)
f = property(lambda s: s.__params['f'], f = property(lambda s: s.__params['f'],
lambda s, x: s.__params.__setitem__('f', x), lambda s, x: s.__params.__setitem__('f', x),
lambda s: s.__params.__delitem__('f'), lambda s: s.__params.__delitem__('f'),