2 # -*- coding: utf-8; mode: python; -*-
4 # GStreamer Debug Viewer - View and analyze GStreamer debug log files
6 # Copyright (C) 2007 René Stadler <mail@renestadler.de>
8 # This program is free software; you can redistribute it and/or modify it
9 # under the terms of the GNU General Public License as published by the Free
10 # Software Foundation; either version 3 of the License, or (at your option)
13 # This program is distributed in the hope that it will be useful, but WITHOUT
14 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
18 # You should have received a copy of the GNU General Public License along with
19 # this program. If not, see <http://www.gnu.org/licenses/>.
21 """GStreamer Debug Viewer program invocation."""
30 if s.startswith("@") and s.endswith("@"):
35 # These "$"-enclosed strings are substituted at install time by a custom
36 # distutils extension (see setup.py). If you don't see any dollar signs at
37 # all, you are looking at an installed version of this file.
38 data_dir = substituted("@DATADIR@")
39 lib_dir = substituted("@LIBDIR@")
44 # Substitution has not been run, we are running within a development
46 lib_dir = os.path.dirname(os.path.realpath(sys.argv[0]))
50 if not os.path.normpath(lib_dir) in [os.path.normpath(p)
52 sys.path.insert(0, lib_dir)
56 except ImportError as exc:
57 print(str(exc), file=sys.stderr)
61 GstDebugViewer.Paths.setup_installed(data_dir)
63 # Assume that we reside inside the source dist.
64 source_dir = os.path.dirname(os.path.realpath(sys.argv[0]))
65 GstDebugViewer.Paths.setup_devenv(source_dir)
70 if __name__ == "__main__":