Codebase list mirage / e58b891
Make bin/mirage actually work - Set up the Python path - Call the correct function to run Mirage Thomas Ross 3 years ago
1 changed file(s) with 29 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
2323 along with this program. If not, see <http://www.gnu.org/licenses/>.
2424 """
2525
26 import mirage
26 import os
27
28 from gi.repository import Gdk
29
30
31 def get_mirage_source_dir():
32 mirage_bin_dir = os.path.dirname(os.path.realpath(__file__))
33 mirage_source_dir = os.path.abspath(os.path.join(mirage_bin_dir, ".."))
34
35 if os.path.exists(os.path.join(mirage_source_dir, "mirage", "__init__.py")):
36 return mirage_source_dir
37
38 return None
39
2740
2841 if __name__ == "__main__":
42 mirage_source_dir = get_mirage_source_dir()
43 uninstalled = mirage_source_dir is not None
44
45 if uninstalled:
46 import sys
47
48 sys.path.insert(0, mirage_source_dir)
49
50 import mirage
51
2952 app = mirage.Base()
53 Gdk.threads_enter()
54
3055 try:
31 app.main()
56 app.run([])
3257 except KeyboardInterrupt:
3358 pass
59
60 Gdk.threads_leave()