File: main.py

package info (click to toggle)
gpxviewer 1.1.0-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 476 kB
  • sloc: python: 553; makefile: 2
file content (48 lines) | stat: -rwxr-xr-x 1,308 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env python3
#
#  main.py - Launcher for GPX Viewer
#
#  Copyright (C) 2009 Andrew Gee
#
#  GPX Viewer is free software: you can redistribute it and/or modify it
#  under the terms of the GNU General Public License as published by the
#  Free Software Foundation, either version 3 of the License, or
#  (at your option) any later version.
#  
#  GPX Viewer is distributed in the hope that it will be useful, but
#  WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#  See the GNU General Public License for more details.
#  
#  You should have received a copy of the GNU General Public License along
#  with this program.  If not, see <http://www.gnu.org/licenses/>.

#
#  If you're having any problems, don't hesitate to contact: andrew@andrewgee.org
#
import sys, os.path

parent_dir = os.path.dirname(os.path.abspath(__file__))
source_dir = os.path.join(parent_dir, "gpxviewer")
sys.path.append(source_dir)

import gi
gi.require_version('Gdk', '3.0')

from gi.repository import Gdk
from gpxviewer.ui import MainWindow

if len(sys.argv) > 2:
	files = sys.argv[1:]
elif len(sys.argv) > 1:
	files = [sys.argv[1]]
else:
	files = []

ui_dir = os.path.join(parent_dir, "ui/")

gui = MainWindow(
		ui_dir=ui_dir,
		files=files
).main()