[orca] More argparser cleanup
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] More argparser cleanup
- Date: Fri, 18 May 2012 16:25:28 +0000 (UTC)
commit f0b4816287b5fe7f7e9013efb4973cfe13cdd067
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Fri May 18 12:25:42 2012 -0400
More argparser cleanup
src/orca/orca.py | 20 ++------------------
1 files changed, 2 insertions(+), 18 deletions(-)
---
diff --git a/src/orca/orca.py b/src/orca/orca.py
index 5c80400..2408e9d 100644
--- a/src/orca/orca.py
+++ b/src/orca/orca.py
@@ -107,9 +107,6 @@ class Settings(argparse.Action):
class Options(argparse.Namespace):
"""Class to handle getting run-time options."""
- profiles = None
- userPrefsDir = None
-
def __init__(self, **kwargs):
"""Initialize the Options class."""
@@ -123,16 +120,6 @@ class Options(argparse.Namespace):
def validate(self):
"""Validate the commandline options."""
- if self.userPrefsDir != None:
- try:
- os.chdir(self.userPrefsDir)
- except:
- debug.printException(debug.LEVEL_FINEST)
- self.userPrefsDir = None
-
- if self.profiles == None:
- self.profiles = []
-
if self.debugFile:
self.debug = True
elif self.debug:
@@ -228,7 +215,7 @@ parser.add_argument(
help = _("Prevent use of option"))
parser.add_argument(
- "-i", "--import-file", action = "append", dest = "profiles",
+ "-i", "--import-file", action = "append", dest = "profiles", default = [],
# Translators: this is the Orca command line option to import to Orca a user
# profile from a given file
#
@@ -241,10 +228,7 @@ parser.add_argument(
#
help = _("Replace a currently running Orca"))
-# temporary hack
-args = ' '.join(sys.argv[1:])
-options, invalidOpts = parser.parse_known_args(args.split(),
- namespace = Options())
+options, invalidOpts = parser.parse_known_args(namespace = Options())
invalidOpts.extend(options.invalid)
options.validate()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]