forked from VimPlug/jedi
removed prints
This commit is contained in:
73
evaluate.py
73
evaluate.py
@@ -192,14 +192,7 @@ class Instance(Executable):
|
|||||||
args = [[obj], [obj.base]]
|
args = [[obj], [obj.base]]
|
||||||
method = InstanceElement(self, method)
|
method = InstanceElement(self, method)
|
||||||
print 'la'
|
print 'la'
|
||||||
try:
|
res = Execution(method, args).get_return_types()
|
||||||
res = Execution(method, args).get_return_types()
|
|
||||||
except Exception,e :
|
|
||||||
traceback.print_stack(file=sys.stdout)
|
|
||||||
print e, type(e)
|
|
||||||
print '\n'
|
|
||||||
#raise AttributeError('dini mueter')
|
|
||||||
raise e
|
|
||||||
|
|
||||||
print res
|
print res
|
||||||
print '\n\n'
|
print '\n\n'
|
||||||
@@ -224,36 +217,18 @@ class InstanceElement(object):
|
|||||||
@property
|
@property
|
||||||
@memoize_default()
|
@memoize_default()
|
||||||
def parent(self):
|
def parent(self):
|
||||||
try:
|
par = self.var.parent
|
||||||
par = self.var.parent
|
if isinstance(par, parsing.Function):
|
||||||
if isinstance(par, parsing.Function):
|
par = Function(par)
|
||||||
par = Function(par)
|
return InstanceElement(self.instance, par)
|
||||||
return InstanceElement(self.instance, par)
|
|
||||||
except Exception, e:
|
|
||||||
traceback.print_stack(file=sys.stdout)
|
|
||||||
print e
|
|
||||||
print '\n'
|
|
||||||
raise
|
|
||||||
|
|
||||||
|
|
||||||
def get_parent_until(self, *classes):
|
def get_parent_until(self, *classes):
|
||||||
scope = self.var.get_parent_until(*classes)
|
scope = self.var.get_parent_until(*classes)
|
||||||
return InstanceElement(self.instance, scope)
|
return InstanceElement(self.instance, scope)
|
||||||
|
|
||||||
def __getattribute__(self, name):
|
def __getattr__(self, name):
|
||||||
try:
|
return getattr(self.var, name)
|
||||||
a = object.__getattribute__(self, name)
|
|
||||||
except AttributeError:
|
|
||||||
try:
|
|
||||||
return getattr(self.var, name)
|
|
||||||
except AttributeError:
|
|
||||||
if name == '__get__':
|
|
||||||
raise
|
|
||||||
raise MultiLevelAttributeError(sys.exc_info()[1])
|
|
||||||
else:
|
|
||||||
if hasattr(a, '__get__'):
|
|
||||||
return a.__get__(self, self.__class__)
|
|
||||||
return a
|
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "<%s of %s>" % (self.__class__.__name__, self.var)
|
return "<%s of %s>" % (self.__class__.__name__, self.var)
|
||||||
@@ -346,13 +321,7 @@ class Function(object):
|
|||||||
old_func = Function(f, is_decorated=True)
|
old_func = Function(f, is_decorated=True)
|
||||||
params = parsing.Array(parsing.Array.NOARRAY, old_func)
|
params = parsing.Array(parsing.Array.NOARRAY, old_func)
|
||||||
params.values = [[old_func]]
|
params.values = [[old_func]]
|
||||||
try:
|
|
||||||
wrappers = Execution(decorator, params).get_return_types()
|
|
||||||
except Exception, e:
|
|
||||||
traceback.print_stack(file=sys.stdout)
|
|
||||||
print e
|
|
||||||
print '\n'
|
|
||||||
raise
|
|
||||||
wrappers = Execution(decorator, params).get_return_types()
|
wrappers = Execution(decorator, params).get_return_types()
|
||||||
if not len(wrappers):
|
if not len(wrappers):
|
||||||
debug.warning('no wrappers found', self.base_func)
|
debug.warning('no wrappers found', self.base_func)
|
||||||
@@ -368,20 +337,8 @@ class Function(object):
|
|||||||
f = Function(f)
|
f = Function(f)
|
||||||
return f
|
return f
|
||||||
|
|
||||||
def __getattribute__(self, name):
|
def __getattr__(self, name):
|
||||||
try:
|
return getattr(self.decorated_func(), name)
|
||||||
a = object.__getattribute__(self, name)
|
|
||||||
except AttributeError:
|
|
||||||
try:
|
|
||||||
return getattr(self.decorated_func(), name)
|
|
||||||
except AttributeError:
|
|
||||||
if name == '__get__':
|
|
||||||
raise
|
|
||||||
raise MultiLevelAttributeError(sys.exc_info()[1])
|
|
||||||
else:
|
|
||||||
if hasattr(a, '__get__'):
|
|
||||||
return a.__get__(self, self.__class__)
|
|
||||||
return a
|
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "<e%s of %s>" % (self.__class__.__name__, self.base_func)
|
return "<e%s of %s>" % (self.__class__.__name__, self.base_func)
|
||||||
@@ -623,7 +580,6 @@ class Execution(Executable):
|
|||||||
try:
|
try:
|
||||||
return call.parent_stmt.parent
|
return call.parent_stmt.parent
|
||||||
except AttributeError: # if operators are there
|
except AttributeError: # if operators are there
|
||||||
print '\n\n\n\n\n\nfuuuuuuu'
|
|
||||||
pass
|
pass
|
||||||
raise IndexError('No params available')
|
raise IndexError('No params available')
|
||||||
|
|
||||||
@@ -720,7 +676,6 @@ class Array(object):
|
|||||||
# multiple elements in the array
|
# multiple elements in the array
|
||||||
i = index.get_only_subelement().name
|
i = index.get_only_subelement().name
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
print '\n\n\n\n\n\nfuuuuuuu'
|
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
@@ -739,11 +694,9 @@ class Array(object):
|
|||||||
try:
|
try:
|
||||||
str_key = key_elements.get_code()
|
str_key = key_elements.get_code()
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
print '\n\n\n\n\n\nfuuuuuuu'
|
|
||||||
try:
|
try:
|
||||||
str_key = key_elements[0].name
|
str_key = key_elements[0].name
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
print '\n\n\n\n\n\nfuuuuuuu'
|
|
||||||
str_key = None
|
str_key = None
|
||||||
if old_index == str_key:
|
if old_index == str_key:
|
||||||
index = i
|
index = i
|
||||||
@@ -935,10 +888,7 @@ def get_scopes_for_name(scope, name_str, position=None, search_global=False):
|
|||||||
s = scope.base if isinstance(scope, Class) else scope
|
s = scope.base if isinstance(scope, Class) else scope
|
||||||
# this means that a definition was found and is not e.g.
|
# this means that a definition was found and is not e.g.
|
||||||
# in if/else.
|
# in if/else.
|
||||||
print 'dini mueter1', name, name.parent, result
|
|
||||||
a = name.parent.parent
|
a = name.parent.parent
|
||||||
print 'dini mueter2', a
|
|
||||||
print 'end dini m'
|
|
||||||
if not name.parent or name.parent.parent == s:
|
if not name.parent or name.parent.parent == s:
|
||||||
break
|
break
|
||||||
# if there are results, ignore the other scopes
|
# if there are results, ignore the other scopes
|
||||||
@@ -1039,7 +989,8 @@ def follow_statement(stmt, scope=None, seek_name=None):
|
|||||||
try:
|
try:
|
||||||
result = follow_call_list(scope, call_list)
|
result = follow_call_list(scope, call_list)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
# This is so evil! But necessary to propagate errors.
|
# This is so evil! But necessary to propagate errors. The attribute
|
||||||
|
# errors here must not be catched, because they shouldn't exist.
|
||||||
raise MultiLevelAttributeError(sys.exc_info()[1])
|
raise MultiLevelAttributeError(sys.exc_info()[1])
|
||||||
|
|
||||||
# assignment checking is only important if the statement defines multiple
|
# assignment checking is only important if the statement defines multiple
|
||||||
|
|||||||
Reference in New Issue
Block a user