Ver Fonte

Cli instance must receive a parser instance

oz123 há 10 anos atrás
pai
commit
e25f291dd6
1 ficheiros alterados com 3 adições e 6 exclusões
  1. 3 6
      pwman/ui/cli.py

+ 3 - 6
pwman/ui/cli.py

@@ -41,7 +41,7 @@ class PwmanCliNew(cmd.Cmd, Aliases, BaseCommands):
     """
     Inherit from the BaseCommands and Aliases
     """
-    def __init__(self, db, hasxsel, callback, config_parser=None):
+    def __init__(self, db, hasxsel, callback, config_parser):
         """
         initialize CLI interface, set up the DB
         connecion, see if we have xsel ...
@@ -49,13 +49,10 @@ class PwmanCliNew(cmd.Cmd, Aliases, BaseCommands):
         cmd.Cmd.__init__(self)
         self.intro = "%s %s (c) visit: %s" % (pwman.appname, pwman.version,
                                               pwman.website)
-        if not config_parser:
-            self._historyfile = config.get_value("Readline", "history")
-        else:
-            self._historyfile = config_parser.get_value("Readline", "history")
-
+        self._historyfile = config_parser.get_value("Readline", "history")
         self.hasxsel = hasxsel
         self.config = config_parser
+
         try:
             enc = CryptoEngine.get()
             enc.callback = callback()