From: Ian Weller Date: Sun, 14 Mar 2010 07:49:04 +0000 (-0600) Subject: Add a logout command X-Git-Url: https://projects.mako.cc/source/mw/commitdiff_plain/104bad54d78037d8ef3102fcc110d380d77d1479?ds=sidebyside Add a logout command --- diff --git a/src/mw/clicommands.py b/src/mw/clicommands.py index 4b62564..33c4177 100644 --- a/src/mw/clicommands.py +++ b/src/mw/clicommands.py @@ -98,6 +98,19 @@ class LoginCommand(CommandBase): self._login() +class LogoutCommand(CommandBase): + + def __init__(self): + CommandBase.__init__(self, 'logout', 'forget authentication') + + def _do_command(self): + self._die_if_no_init() + try: + os.unlink(os.path.join(self.metadir.location, 'cookies')) + except OSError: + pass + + class PullCommand(CommandBase): def __init__(self):