27 lines
641 B
Python
Executable File
27 lines
641 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():
|
|
"""Make the app work in the source tree."""
|
|
import sys
|
|
import os.path as _path
|
|
|
|
prefix = _path.normpath(_path.join(_path.realpath(sys.path[0]), '..'))
|
|
src_lib = _path.join(prefix, 'lib')
|
|
share_lib = _path.join(prefix, 'share', 'solaar', 'lib')
|
|
for location in src_lib, share_lib:
|
|
init_py = _path.join(location, 'solaar', '__init__.py')
|
|
if _path.exists(init_py):
|
|
sys.path[0] = location
|
|
break
|
|
|
|
|
|
if __name__ == '__main__':
|
|
init_paths()
|
|
import solaar.gtk
|
|
solaar.gtk.main()
|