28 lines
614 B
Python
Executable File
28 lines
614 B
Python
Executable File
#!/usr/bin/env python
|
|
# -*- python-mode -*-
|
|
"""Takes care of starting the main function."""
|
|
|
|
from __future__ import absolute_import
|
|
|
|
|
|
def init_paths():
|
|
import os.path as _path
|
|
|
|
prefix = _path.dirname(_path.dirname(_path.realpath(_path.abspath(__file__))))
|
|
|
|
dist_lib = _path.join(prefix, 'share', 'solaar', 'lib')
|
|
src_lib = _path.join(prefix, 'src')
|
|
|
|
for location in (dist_lib, src_lib):
|
|
init_py = _path.join(location, 'solaar', '__init__.py')
|
|
if _path.exists(init_py):
|
|
import sys
|
|
sys.path.insert(1, location)
|
|
break
|
|
|
|
|
|
if __name__ == '__main__':
|
|
init_paths()
|
|
import solaar.cli
|
|
solaar.cli.main()
|