コード例 #1
0
    def _determine_height_for_resource_node(self, elem_r, elem_rn, elem_s):
        LOG.info('%s()' % KenLog.fcn())

        height = self._padding_y
        height += Server.num_services(elem_s)
        height += Server.num_components(elem_s)
        height += 3  # Separation

        routes = Server.routes(elem_s)
        for i, elem_i in six.iteritems(Server.interfaces(elem_s)):
            height += 1
            for n, elem_n in six.iteritems(Interface.networks(elem_i)):
                height += 1
                for r in routes.get(n, []):
                    height += 1

        height += self._padding_y
        return height
コード例 #2
0
    def _determine_height_for_resource_node(self, elem_r, elem_rn, elem_s):
        LOG.info('%s()' % KenLog.fcn())

        height = self._padding_y
        height += Server.num_services(elem_s)
        height += Server.num_components(elem_s)
        height += 3  # Separation

        routes = Server.routes(elem_s)
        for i, elem_i in six.iteritems(Server.interfaces(elem_s)):
            height += 1
            for n, elem_n in six.iteritems(Interface.networks(elem_i)):
                height += 1
                for r in routes.get(n, []):
                    height += 1

        height += self._padding_y
        return height
コード例 #3
0
    def _determine_size_for_server(self, elem_r, elem_c, elem_s):
        LOG.info('%s()' % KenLog.fcn())

        num_components = Server.num_components(elem_s)
        num_services = Server.num_services(elem_s)

        width = self._server_width - self._padding_x

        height = self._padding_y
        height += num_services
        height += num_components
        height += 3  # Separation

        routes = Server.routes(elem_s)
        for i, elem_i in six.iteritems(Server.interfaces(elem_s)):
            height += 1
            for n, elem_n in six.iteritems(Interface.networks(elem_i)):
                height += 1
                for r in routes.get(n, []):
                    height += 1

        height += self._padding_y

        return width, height
コード例 #4
0
    def _determine_size_for_server(self, elem_r, elem_c, elem_s):
        LOG.info('%s()' % KenLog.fcn())

        num_components = Server.num_components(elem_s)
        num_services = Server.num_services(elem_s)

        width = self._server_width - self._padding_x

        height = self._padding_y
        height += num_services
        height += num_components
        height += 3  # Separation

        routes = Server.routes(elem_s)
        for i, elem_i in six.iteritems(Server.interfaces(elem_s)):
            height += 1
            for n, elem_n in six.iteritems(Interface.networks(elem_i)):
                height += 1
                for r in routes.get(n, []):
                    height += 1

        height += self._padding_y

        return width, height