Browse Source

Renamed Config.parser -> Config._parser

The argument parser isn't part of the API of the Config class, so now
its name reflects that.
Clara Hobbs 8 years ago
parent
commit
e3fd6a44b9
1 changed files with 9 additions and 9 deletions
  1. 9
    9
      kayleevc/util.py

+ 9
- 9
kayleevc/util.py View File

@@ -43,34 +43,34 @@ class Config:
43 43
         self._make_dir(self.data_dir)
44 44
 
45 45
         # Set up the argument parser
46
-        self.parser = ArgumentParser()
47
-        self.parser.add_argument("-i", "--interface", type=str,
46
+        self._parser = ArgumentParser()
47
+        self._parser.add_argument("-i", "--interface", type=str,
48 48
                 dest="interface", action='store',
49 49
                 help="Interface to use (if any). 'g' for GTK or 'gt' for GTK" +
50 50
                 " system tray icon")
51 51
 
52
-        self.parser.add_argument("-c", "--continuous",
52
+        self._parser.add_argument("-c", "--continuous",
53 53
                 action="store_true", dest="continuous", default=False,
54 54
                 help="Start interface with 'continuous' listen enabled")
55 55
 
56
-        self.parser.add_argument("-p", "--pass-words",
56
+        self._parser.add_argument("-p", "--pass-words",
57 57
                 action="store_true", dest="pass_words", default=False,
58 58
                 help="Pass the recognized words as arguments to the shell" +
59 59
                 " command")
60 60
 
61
-        self.parser.add_argument("-H", "--history", type=int,
61
+        self._parser.add_argument("-H", "--history", type=int,
62 62
                 action="store", dest="history",
63 63
                 help="Number of commands to store in history file")
64 64
 
65
-        self.parser.add_argument("-m", "--microphone", type=int,
65
+        self._parser.add_argument("-m", "--microphone", type=int,
66 66
                 action="store", dest="microphone", default=None,
67 67
                 help="Audio input card to use (if other than system default)")
68 68
 
69
-        self.parser.add_argument("--valid-sentence-command", type=str,
69
+        self._parser.add_argument("--valid-sentence-command", type=str,
70 70
                 dest="valid_sentence_command", action='store',
71 71
                 help="Command to run when a valid sentence is detected")
72 72
 
73
-        self.parser.add_argument("--invalid-sentence-command", type=str,
73
+        self._parser.add_argument("--invalid-sentence-command", type=str,
74 74
                 dest="invalid_sentence_command", action='store',
75 75
                 help="Command to run when an invalid sentence is detected")
76 76
 
@@ -78,7 +78,7 @@ class Config:
78 78
         self._read_options_file()
79 79
 
80 80
         # Parse command-line arguments, overriding config file as appropriate
81
-        self.parser.parse_args(namespace=self.options)
81
+        self._parser.parse_args(namespace=self.options)
82 82
 
83 83
     def _make_dir(self, directory):
84 84
         if not os.path.exists(directory):

Loading…
Cancel
Save