forked from MirrorHub/synapse
Rename path to path_segments to make it clearer that it is a list
This commit is contained in:
parent
5e54365234
commit
eab141ee67
1 changed files with 4 additions and 4 deletions
8
setup.py
8
setup.py
|
@ -21,18 +21,18 @@ from setuptools import setup, find_packages
|
||||||
here = os.path.abspath(os.path.dirname(__file__))
|
here = os.path.abspath(os.path.dirname(__file__))
|
||||||
|
|
||||||
|
|
||||||
def read_file(path):
|
def read_file(path_segments):
|
||||||
"""Read a file from the package. Takes a list of strings to join to
|
"""Read a file from the package. Takes a list of strings to join to
|
||||||
make the path"""
|
make the path"""
|
||||||
file_path = os.path.join(here, *path)
|
file_path = os.path.join(here, *path_segments)
|
||||||
with open(file_path) as f:
|
with open(file_path) as f:
|
||||||
return f.read()
|
return f.read()
|
||||||
|
|
||||||
|
|
||||||
def exec_file(path):
|
def exec_file(path_segments):
|
||||||
"""Execute a single python file to get the variables defined in it"""
|
"""Execute a single python file to get the variables defined in it"""
|
||||||
result = {}
|
result = {}
|
||||||
code = read_file(path)
|
code = read_file(path_segments)
|
||||||
exec(code, result)
|
exec(code, result)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue