# vim: ts=4 et sts=4 sw=4 autoindent

class PyroProxyMixin(object):

    def formatNamespace(self, namespace):
        return ":" + namespace

    def formatObjectString(self, namespace, path = []):
        """
        The name server is hierarchical. Path is an array strings that will
        form the absolute path to the object (not including the main
        namespace)
        """
        return ".".join((self.formatNamespace(namespace), ".".join(path)))

    def formatPyronameString(self, namespace, path = []):
        """
        See above docstring
        """
        return "PYRONAME://" + self.formatObjectString(namespace, path)
