Fixed function calls
This commit is contained in:
parent
0203c79d83
commit
388831a732
1 changed files with 5 additions and 8 deletions
|
@ -6,16 +6,13 @@ from project.export import exports
|
||||||
@click.argument('sections', nargs=-1)
|
@click.argument('sections', nargs=-1)
|
||||||
def cli(sections):
|
def cli(sections):
|
||||||
functions = [f for k, f in exports.__dict__.items() if is_function(f)]
|
functions = [f for k, f in exports.__dict__.items() if is_function(f)]
|
||||||
print("got all functions", functions)
|
|
||||||
if sections: # If they don't want to export everything
|
if sections: # If they don't want to export everything
|
||||||
print("YOu specified sections")
|
temp_functions = functions
|
||||||
for func in functions:
|
functions = []
|
||||||
if func.__name__ not in sections:
|
for func in temp_functions:
|
||||||
print("{} not in {}".format(func.__name__, sections))
|
if func.__name__ in sections:
|
||||||
functions.remove(func)
|
functions.append(func)
|
||||||
print("Calling functions", functions)
|
|
||||||
for func in functions:
|
for func in functions:
|
||||||
print("Calling", func.__name__)
|
|
||||||
func()
|
func()
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
Reference in a new issue