diff --git a/pandora_client/__init__.py b/pandora_client/__init__.py index ee11c5a..eb420fd 100644 --- a/pandora_client/__init__.py +++ b/pandora_client/__init__.py @@ -408,7 +408,7 @@ class Client(object): json.dump(self._config, f, indent=2) def config(self, args): - print "Current Config:\n User %s\n URL:%s\n" %(self._config['username'], self._config['url']) + print "Current Config:\n User: %s\n URL: %s\n" %(self._config['username'], self._config['url']) print "Leave empty to keep current value\n" username = raw_input('Username: ') if username: @@ -444,11 +444,12 @@ class Client(object): os.chmod(path, 0755) def add_volume(self, args): + usage = "Usage: %s add_volume name path" % sys.argv[0] if len(args) != 2: - print "Usage: %s add_volume name path" % sys.argv[0] + print usage sys.exit(1) name = args[0] - path = args[1] + path = os.path.abspath(args[1]) if not path.endswith('/'): path += '/' if os.path.isdir(path): @@ -458,8 +459,10 @@ class Client(object): print "added %s %s" % (name, path) self._config['volumes'][name] = path self.save_config() - - self._config['volumes'][name] = path + else: + print "'%s' does not exist" % path + print usage + sys.exit(1) def active_volumes(self): volumes = {}