diff --git a/functions.py b/functions.py index 7cedf027..4d3f99c0 100644 --- a/functions.py +++ b/functions.py @@ -1,4 +1,4 @@ -import pyfuzzyparser +import parsing def complete(source, row, colum, file_callback=None): """ @@ -13,4 +13,5 @@ def complete(source, row, colum, file_callback=None): :return: list :rtype: list """ + p = parsing.PyFuzzyParser(source, row) return [] diff --git a/pyfuzzyparser.py b/parsing.py similarity index 100% rename from pyfuzzyparser.py rename to parsing.py diff --git a/pycomplete.py b/pycomplete.py index a7dc7d6b..f7b1e64c 100755 --- a/pycomplete.py +++ b/pycomplete.py @@ -5,7 +5,7 @@ import cStringIO import sys import types -import pyfuzzyparser +import parsing def complete(file_name, line, colon): @@ -48,10 +48,9 @@ def _sanitize(str): class Completer(object): def __init__(self): self.compldict = {} - self.parser = pyfuzzyparser.PyFuzzyParser() def evalsource(self, text, line=0): - sc = self.parser.parse(text) + sc = self.parsing.parse(text) src = sc.get_code() #dbg("source: %s" % src) #try: exec(src) in self.compldict @@ -219,13 +218,13 @@ showdbg() def show_debug(*args): print args -pyfuzzyparser.debug_function = show_debug +parsing.debug_function = show_debug text = open('test.py').read() -parser = pyfuzzyparser.PyFuzzyParser(text) +p = parsing.PyFuzzyParser(text) -print parser.top.get_code() +print p.top.get_code() #print cmpl.parser.top.subscopes[1].subscopes[0].get_code() def handle_names(names): @@ -237,29 +236,29 @@ def handle_names(names): print 'star!', n.from_ns print 'global names:' -names = parser.top.get_set_vars() +names = p.top.get_set_vars() handle_names(names) print print 'func names:' -names = parser.top.subscopes[7].get_set_vars() +names = p.top.subscopes[7].get_set_vars() handle_names(names) print print 'class names:' -names = parser.top.subscopes[2].get_set_vars() +names = p.top.subscopes[2].get_set_vars() handle_names(names) -for s in parser.top.subscopes[2].subscopes: +for s in p.top.subscopes[2].subscopes: print 'method names:' names = s.get_set_vars() handle_names(names) print print 'start/end' -for s in parser.top.subscopes: +for s in p.top.subscopes: print repr(s) -s = parser.top +s = p.top import code sh = code.InteractiveConsole(locals=locals()) #sh.interact("InteractiveConsole")