Make Service&File entries representation human-readable.

This will help in debugging and writing web-tests.

Change-Id: I748b19710f8590c6dee5e2e98e69aa8d74bb324a
This commit is contained in:
Timur Sufiev 2014-03-06 19:26:28 +04:00
parent 554c95e77c
commit 5bda7e00f5

View File

@ -12,6 +12,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import StringIO import StringIO
import re
from os.path import dirname, basename from os.path import dirname, basename
from metadataclient import exc from metadataclient import exc
@ -24,6 +25,14 @@ class Wrapper(object):
for key, value in kwargs.items(): for key, value in kwargs.items():
setattr(self, key, value) setattr(self, key, value)
def __str__(self):
if '##' in self.id:
return re.sub(r'##', '/', self.id)
return self.id
def __repr__(self):
return 'RowWrapper({0})'.format(str(self))
class Controller(object): class Controller(object):
def __init__(self, http_client): def __init__(self, http_client):