Beispiel #1
0
    def _where(self, kwargs):
        buffer = self.owner._buffer()

        is_first = True

        for key, value in legacy.iteritems(kwargs):
            if is_first: is_first = False
            else: buffer.write(" and ")
            buffer.write(key)
            buffer.write(" = ")
            buffer.write_value(value)

        return buffer.join()
Beispiel #2
0
    def echo_map(cls, map):
        largest = 0

        for key in legacy.iterkeys(map):
            key_l = len(key)
            if not key_l > largest: continue
            largest = key_l

        for key, value in legacy.iteritems(map):
            key_l = len(key)
            value_s = str(value)
            remaining = largest - key_l
            cls.echo(key, nl = False)
            for _index in legacy.xrange(remaining):
                cls.echo(" ", nl = False)
            cls.echo(" : ", nl = False)
            cls.echo(value_s)