2007-11-14 08:30:19 +00:00
|
|
|
# -*- coding: utf-8; mode: python; -*-
|
|
|
|
#
|
2007-11-22 08:47:06 +00:00
|
|
|
# GStreamer Debug Viewer - View and analyze GStreamer debug log files
|
2007-11-14 08:30:19 +00:00
|
|
|
#
|
|
|
|
# Copyright (C) 2007 René Stadler <mail@renestadler.de>
|
|
|
|
#
|
|
|
|
# This program 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.
|
|
|
|
#
|
|
|
|
# This program 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/>.
|
|
|
|
|
2007-11-22 08:47:06 +00:00
|
|
|
"""GStreamer Debug Viewer Main module."""
|
2007-11-14 08:30:19 +00:00
|
|
|
|
|
|
|
import sys
|
|
|
|
from gettext import gettext as _, ngettext
|
|
|
|
|
|
|
|
import GstDebugViewer.Common.Main
|
|
|
|
Common = GstDebugViewer.Common
|
|
|
|
|
|
|
|
GETTEXT_DOMAIN = "gst-debug-viewer"
|
|
|
|
|
2016-09-28 18:38:55 +00:00
|
|
|
|
|
|
|
def main_version():
|
2007-11-14 08:30:19 +00:00
|
|
|
|
|
|
|
from GstDebugViewer import version
|
|
|
|
|
|
|
|
print "GStreamer Debug Viewer %s" % (version,)
|
|
|
|
|
2016-09-28 18:38:55 +00:00
|
|
|
|
2007-11-14 08:30:19 +00:00
|
|
|
class Paths (Common.Main.PathsProgramBase):
|
|
|
|
|
|
|
|
program_name = "gst-debug-viewer"
|
|
|
|
|
2016-09-28 18:38:55 +00:00
|
|
|
|
2007-11-14 08:30:19 +00:00
|
|
|
class OptionParser (Common.Main.LogOptionParser):
|
|
|
|
|
2016-09-28 18:38:55 +00:00
|
|
|
def __init__(self, options):
|
2007-11-14 08:30:19 +00:00
|
|
|
|
2016-09-28 18:38:55 +00:00
|
|
|
Common.Main.LogOptionParser.__init__(self, options)
|
2007-11-14 08:30:19 +00:00
|
|
|
|
|
|
|
options["main"] = None
|
2007-11-28 08:27:45 +00:00
|
|
|
options["args"] = []
|
2007-11-14 08:30:19 +00:00
|
|
|
|
2016-09-28 18:38:55 +00:00
|
|
|
self.add_option("version", None, _("Display version and exit"))
|
2007-11-14 08:30:19 +00:00
|
|
|
|
2016-09-28 18:38:55 +00:00
|
|
|
def get_parameter_string(self):
|
2007-11-14 08:30:19 +00:00
|
|
|
|
2008-01-25 09:17:02 +00:00
|
|
|
return _("[FILENAME] - Display and analyze GStreamer debug log files")
|
2007-11-14 08:30:19 +00:00
|
|
|
|
2016-09-28 18:38:55 +00:00
|
|
|
def handle_parse_complete(self, remaining_args):
|
2007-11-14 08:30:19 +00:00
|
|
|
|
|
|
|
try:
|
|
|
|
version = self.options["version"]
|
|
|
|
except KeyError:
|
|
|
|
pass
|
|
|
|
else:
|
2016-09-28 18:38:55 +00:00
|
|
|
main_version()
|
|
|
|
sys.exit(0)
|
2007-11-14 08:30:19 +00:00
|
|
|
|
|
|
|
if self.options["main"] is None:
|
2009-10-20 21:31:46 +00:00
|
|
|
from GstDebugViewer import GUI
|
2007-11-14 08:30:19 +00:00
|
|
|
self.options["main"] = GUI.main
|
|
|
|
|
2007-11-28 08:27:45 +00:00
|
|
|
self.options["args"][:] = remaining_args
|
|
|
|
|
2016-09-28 18:38:55 +00:00
|
|
|
|
|
|
|
def main():
|
2007-11-14 08:30:19 +00:00
|
|
|
|
|
|
|
options = {}
|
2016-09-28 18:38:55 +00:00
|
|
|
parser = OptionParser(options)
|
2007-11-14 08:30:19 +00:00
|
|
|
|
2016-09-28 18:38:55 +00:00
|
|
|
Common.Main.main(option_parser=parser,
|
|
|
|
gettext_domain=GETTEXT_DOMAIN,
|
|
|
|
paths=Paths)
|