[gnome-music] gnome-music.in: replace deprecated optparse with argparse
- From: Igor Gnatenko <ignatenko src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music] gnome-music.in: replace deprecated optparse with argparse
- Date: Mon, 13 Jul 2015 19:30:47 +0000 (UTC)
commit 593134bd86c68e9246ca1d8a8df495daaeb935a7
Author: Igor Gnatenko <ignatenko src gnome org>
Date: Mon Jul 13 22:29:49 2015 +0300
gnome-music.in: replace deprecated optparse with argparse
Signed-off-by: Igor Gnatenko <ignatenko src gnome org>
gnome-music.in | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/gnome-music.in b/gnome-music.in
index 59da73b..08d37de 100644
--- a/gnome-music.in
+++ b/gnome-music.in
@@ -11,7 +11,7 @@ sys.path.insert(1, '@pyexecdir@')
# Make sure we'll find the gnomemusic module, even in JHBuild
sys.path.insert(1, '@pythondir@')
-from optparse import OptionParser
+import argparse
import logging
from gi.repository import Gio
import gnomemusic
@@ -51,10 +51,10 @@ def install_excepthook():
if __name__ == "__main__":
install_excepthook()
- parser = OptionParser()
- parser.add_option('-d', "--debug", action="store_true", default=False, dest="debug")
- opts, args = parser.parse_args()
- if opts.debug:
+ parser = argparse.ArgumentParser()
+ parser.add_argument('-d', "--debug", action="store_true", default=False, dest="debug")
+ args = parser.parse_args()
+ if args.debug:
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s %(levelname)s\t%(filename)s:%(lineno)d \t%(message)s',
datefmt='%H:%M:%S')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]