From: Frederic Massart Date: Fri, 28 Jun 2013 04:38:29 +0000 (+0800) Subject: Command init does not fail when directory does not exist X-Git-Tag: v0.4.1~7 X-Git-Url: https://git.cameron1729.xyz/?a=commitdiff_plain;h=8b1c9fdc5304df6b1400d133323d4aa4809ce3c3;p=mdk.git Command init does not fail when directory does not exist --- diff --git a/lib/command.py b/lib/command.py index 1275e05..9c7157e 100644 --- a/lib/command.py +++ b/lib/command.py @@ -46,13 +46,15 @@ class Command(object): ) ] _description = 'Undocumented command' + _loadWorkplace = True __C = None __Wp = None def __init__(self, config): self.__C = config - self.__Wp = workplace.Workplace() + if self._loadWorkplace: + self.__Wp = workplace.Workplace() def argumentError(self, message): raise CommandArgumentError(message) diff --git a/lib/commands/config.py b/lib/commands/config.py index 981d021..dc1a7e6 100644 --- a/lib/commands/config.py +++ b/lib/commands/config.py @@ -86,6 +86,7 @@ class ConfigCommand(Command): ) ] _description = 'Manage your configuration' + _loadWorkplace = False def run(self, args): if args.action == 'list': diff --git a/lib/commands/init.py b/lib/commands/init.py index 44ca1e5..340b9d9 100644 --- a/lib/commands/init.py +++ b/lib/commands/init.py @@ -45,6 +45,7 @@ class InitCommand(Command): ) ] _description = 'Initialise MDK' + _loadWorkplace = False def resolve_directory(self, path, user): if path.startswith('~'):