"Added an environment variable to the API confi.py script so that it makes it easier to build on different machines."

bzr-revno: 127
This commit is contained in:
raoul@snyman.info 2015-10-17 12:31:49 +02:00 committed by Raoul Snyman
commit 3fc96ed390
2 changed files with 11 additions and 4 deletions

View File

@ -19,8 +19,11 @@ import os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
path_to_code = os.path.abspath(os.path.join(os.path.split(__file__)[0],
'..', '..', '..', '..', 'openlp', 'trunk'))
if 'OPENLP_SOURCE' in os.environ:
path_to_code = os.path.abspath(os.environ['OPENLP_SOURCE'])
else:
path_to_code = os.path.abspath(os.path.join(os.path.split(__file__)[0],
'..', '..', '..', '..', 'openlp', 'trunk'))
if not os.path.exists(path_to_code):
print('Incorrect path to code, expecting "%s"' % path_to_code)
sys.exit(1)

View File

@ -82,8 +82,11 @@ def progress(queue, number):
def main():
modules = []
path_to_code = os.path.abspath(os.path.join(os.path.split(__file__)[0],
'..', '..', '..', '..', 'openlp', 'trunk'))
if 'OPENLP_SOURCE' in os.environ:
path_to_code = os.path.abspath(os.environ['OPENLP_SOURCE'])
else:
path_to_code = os.path.abspath(os.path.join(os.path.split(__file__)[0],
'..', '..', '..', '..', 'openlp', 'trunk'))
if not os.path.exists(path_to_code):
print('Incorrect path to code, expecting "%s"' % path_to_code)
sys.exit(1)
@ -118,3 +121,4 @@ def main():
if __name__ == '__main__':
main()