From 104bad54d78037d8ef3102fcc110d380d77d1479 Mon Sep 17 00:00:00 2001 From: Ian Weller Date: Sun, 14 Mar 2010 01:49:04 -0600 Subject: [PATCH] Add a logout command --- src/mw/clicommands.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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): -- 2.39.5