1
0
forked from VimPlug/jedi

PEP8 whitespace fixes

This commit is contained in:
Laurens Van Houtven
2013-07-10 18:55:48 +02:00
parent cdc41128b4
commit ad932815b9
5 changed files with 20 additions and 18 deletions

View File

@@ -18,7 +18,7 @@ is_py33 = sys.hexversion >= 0x03030000
def find_module_py33(string, path=None):
loader = importlib.machinery.PathFinder.find_module(string, path)
if loader is None and path is None: # Fallback to find builtins
if loader is None and path is None: # Fallback to find builtins
loader = importlib.find_loader(string)
if loader is None:

View File

@@ -254,8 +254,8 @@ def _generate_code(scope, mixin_funcs={}, depth=0):
code += get_doc(scope)
names = set(dir(scope)) - set(['__file__', '__name__', '__doc__',
'__path__', '__package__']) \
| set(['mro'])
'__path__', '__package__']) \
| set(['mro'])
classes, funcs, stmts, members = get_scope_objects(names)
@@ -337,11 +337,11 @@ def _generate_code(scope, mixin_funcs={}, depth=0):
code += '%s = %s\n' % (name, value)
if depth == 0:
#with open('writeout.py', 'w') as f:
# with open('writeout.py', 'w') as f:
# f.write(code)
#import sys
#sys.stdout.write(code)
#exit()
# import sys
# sys.stdout.write(code)
# exit()
pass
return code

View File

@@ -334,7 +334,7 @@ def _check_array_additions(compare_array, module, is_list):
settings.dynamic_params_for_other_modules = False
search_names = ['append', 'extend', 'insert'] if is_list else \
['add', 'update']
['add', 'update']
comp_arr_parent = get_execution_parent(compare_array, er.Execution)
possible_stmts = []
@@ -351,7 +351,7 @@ def _check_array_additions(compare_array, module, is_list):
# literally copy the contents of a function.
if isinstance(comp_arr_parent, er.Execution):
stmt = comp_arr_parent. \
get_statement_for_position(stmt.start_pos)
get_statement_for_position(stmt.start_pos)
if stmt is None:
continue
# InstanceElements are special, because they don't get copied,
@@ -403,7 +403,9 @@ class ArrayInstance(pr.Base):
if self.var_args.start_pos != array.var_args.start_pos:
items += array.iter_content()
else:
debug.warning('ArrayInstance recursion', self.var_args)
debug.warning(
'ArrayInstance recursion',
self.var_args)
continue
items += evaluate.get_iterator_types([typ])

View File

@@ -197,8 +197,8 @@ class InstanceElement(use_metaclass(cache.CachedMetaClass)):
def parent(self):
par = self.var.parent
if isinstance(par, Class) and par == self.instance.base \
or isinstance(par, pr.Class) \
and par == self.instance.base.base:
or isinstance(par, pr.Class) \
and par == self.instance.base.base:
par = self.instance
elif not isinstance(par, pr.Module):
par = InstanceElement(self.instance, par, self.is_class_var)
@@ -417,7 +417,7 @@ class Execution(Executable):
debug.warning('jedi getattr is too simple')
key = arr_name.var_args[0]
stmts += evaluate.follow_path(iter([key]), obj,
self.base)
self.base)
return stmts
elif func_name == 'type':
# otherwise it would be a metaclass
@@ -430,7 +430,7 @@ class Execution(Executable):
func = self.var_args.get_parent_until(accept)
if func.isinstance(*accept):
cls = func.get_parent_until(accept + (pr.Class,),
include_current=False)
include_current=False)
if isinstance(cls, pr.Class):
cls = Class(cls)
su = cls.get_super_classes()
@@ -802,8 +802,8 @@ class Array(use_metaclass(cache.CachedMetaClass, pr.Base)):
# otherwise it just ignores the index (e.g. [1+1]).
index = index_possibilities[0]
if isinstance(index, Instance) \
and str(index.name) in ['int', 'str'] \
and len(index.var_args) == 1:
and str(index.name) in ['int', 'str'] \
and len(index.var_args) == 1:
with common.ignored(KeyError, IndexError):
return self.get_exact_index_types(index.var_args[0])

View File

@@ -345,8 +345,8 @@ class Parser(object):
tok_list = []
while not (tok in always_break
or tok in not_first_break and not tok_list
or tok in breaks and level <= 0):
or tok in not_first_break and not tok_list
or tok in breaks and level <= 0):
try:
# print 'parse_stmt', tok, tokenize.tok_name[token_type]
tok_list.append(self.current + (self.start_pos,))