summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2015-05-16 14:36:19 +0300
committerLars Wirzenius <liw@liw.fi>2015-05-16 14:36:19 +0300
commite62a7c640778d73a0f6f9b031ff4aaf3a9e8dfa2 (patch)
tree6a49f012daf63f93667c81380a7fa5ebe4735555
parent2a7f85746de1f4a8b894f4cde6bb849051c27e03 (diff)
downloadobnam-e62a7c640778d73a0f6f9b031ff4aaf3a9e8dfa2.tar.gz
Make delegator set client directory separately from name
-rw-r--r--obnamlib/delegator.py2
-rw-r--r--obnamlib/fmt_ga/client.py2
-rw-r--r--obnamlib/fmt_ga/client_list.py3
-rw-r--r--obnamlib/fmt_simple/simple.py4
4 files changed, 9 insertions, 2 deletions
diff --git a/obnamlib/delegator.py b/obnamlib/delegator.py
index 6c38fe1d..861d6453 100644
--- a/obnamlib/delegator.py
+++ b/obnamlib/delegator.py
@@ -371,6 +371,8 @@ class ClientFinder(object):
if client_name not in self._clients:
client = self._client_factory(client_name)
client.set_fs(self._fs)
+ dirname = self._client_list.get_client_dirname(client_name)
+ client.set_dirname(dirname)
client.set_current_time(self._current_time)
self._clients[client_name] = client
diff --git a/obnamlib/fmt_ga/client.py b/obnamlib/fmt_ga/client.py
index 8097a44f..852b71c2 100644
--- a/obnamlib/fmt_ga/client.py
+++ b/obnamlib/fmt_ga/client.py
@@ -26,7 +26,7 @@ class GAClient(object):
def __init__(self, client_name):
self._fs = None
- self.set_dirname(client_name)
+ self._dirname = None
self._client_name = client_name
self._current_time = None
self.clear()
diff --git a/obnamlib/fmt_ga/client_list.py b/obnamlib/fmt_ga/client_list.py
index 721be89d..dff9675b 100644
--- a/obnamlib/fmt_ga/client_list.py
+++ b/obnamlib/fmt_ga/client_list.py
@@ -83,6 +83,9 @@ class GAClientList(object):
}
self._data_is_loaded = True
+ def get_client_dirname(self, client_name):
+ return client_name
+
def add_client(self, client_name):
self._load_data()
self._require_client_does_not_exist(client_name)
diff --git a/obnamlib/fmt_simple/simple.py b/obnamlib/fmt_simple/simple.py
index cc77d585..e995c97a 100644
--- a/obnamlib/fmt_simple/simple.py
+++ b/obnamlib/fmt_simple/simple.py
@@ -131,6 +131,9 @@ class SimpleClientList(SimpleToplevel):
def get_client_names(self):
return self._data.get('clients', {}).keys()
+ def get_client_dirname(self, client_name):
+ return client_name
+
def add_client(self, client_name):
self._require_client_does_not_exist(client_name)
@@ -207,7 +210,6 @@ class SimpleClient(SimpleToplevel):
def __init__(self, client_name):
SimpleToplevel.__init__(self)
- self.set_dirname(client_name)
self._client_name = client_name
self._current_time = None