[gnome-dvb-daemon] Use argparse instead of deprecated optparse package
- From: Sebastian Polsterl <sebp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-dvb-daemon] Use argparse instead of deprecated optparse package
- Date: Sun, 19 Jun 2016 17:38:59 +0000 (UTC)
commit 4c2542eb3015bbf5099d80625e6951ff2a512409
Author: Sebastian Pölsterl <sebp k-d-w org>
Date: Sun Jun 19 18:37:46 2016 +0100
Use argparse instead of deprecated optparse package
client/gnome-dvb-setup.in | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/client/gnome-dvb-setup.in b/client/gnome-dvb-setup.in
index f7d7d1b..7c14b3b 100644
--- a/client/gnome-dvb-setup.in
+++ b/client/gnome-dvb-setup.in
@@ -23,22 +23,22 @@ gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, Gdk
import gnomedvb
from gnomedvb.ui.wizard.SetupWizard import SetupWizard
-from optparse import OptionParser
+import argparse
-parser = OptionParser()
-parser.add_option("--transient-for", dest="transient_for", type="long",
- help="XID of parent window")
+parser = argparse.ArgumentParser()
+parser.add_argument("--transient-for", dest="transient_for", type=int,
+ help="XID of parent window")
-(options, args) = parser.parse_args()
+args = parser.parse_args()
w = SetupWizard()
w.realize()
-if options.transient_for:
- print("Parent window:", options.transient_for)
+if args.transient_for is not None:
+ print("Parent window:", args.transient_for)
w.set_position(Gtk.WindowPosition.CENTER_ON_PARENT)
w.set_modal(True)
- #XXX foreign_win = Gdk.window_foreign_new(options.transient_for)
+ #XXX foreign_win = Gdk.window_foreign_new(args.transient_for)
#if foreign_win:
# w.window.set_transient_for(foreign_win)
#else:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]