+ self.metadir.create(self.args[0])
+
+
+class LoginCommand(CommandBase):
+
+ def __init__(self):
+ CommandBase.__init__(self, 'login', 'authenticate with wiki')
+
+ def _do_command(self):
+ self._die_if_no_init()
+ self._api_setup()
+ 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