예제 #1
0
    def testRepresentations(self):
        colors1 = colors.full(87)
        self.assertEqual(colors1, colors.DarkSlateGray2)
        self.assertEqual(colors1.basic, colors.DarkSlateGray2)
        self.assertEqual(str(colors1.basic), str(colors.LightGray))

        colors2 = colors.rgb(1, 45, 214)
        self.assertEqual(str(colors2.full), str(colors.Blue3A))
예제 #2
0
    def testRepresentations(self):
        colors1 = colors.full(87)
        self.assertEqual(colors1, colors.DarkSlateGray2)
        self.assertEqual(colors1.basic, colors.DarkSlateGray2)
        self.assertEqual(str(colors1.basic), str(colors.LightGray))

        colors2 = colors.rgb(1,45,214)
        self.assertEqual(str(colors2.full), str(colors.Blue3A))
예제 #3
0
    def testRepresentations(self):
        colors1 = colors.full(87)
        assert colors1 == colors.DarkSlateGray2
        assert colors1.basic == colors.DarkSlateGray2
        assert str(colors1.basic) == str(colors.LightGray)

        colors2 = colors.rgb(1, 45, 214)
        assert str(colors2.full) == str(colors.Blue3A)
예제 #4
0
    def testRepresentations(self):
        colors1 = colors.full(87)
        assert colors1 == colors.DarkSlateGray2
        assert colors1.basic == colors.DarkSlateGray2
        assert str(colors1.basic) == str(colors.LightGray)

        colors2 = colors.rgb(1,45,214)
        assert str(colors2.full) == str(colors.Blue3A)
예제 #5
0
 def testLimits(self):
     print()
     cval = colors.use_color
     colors.use_color = 4
     c = colors.rgb(123, 40, 200)
     print("True", repr(str(c)), repr(c))
     colors.use_color = 3
     print("Full", repr(str(c)), repr(c))
     colors.use_color = 2
     print("Simple", repr(str(c)), repr(c))
     colors.use_color = 1
     print("Basic", repr(str(c)), repr(c))
     colors.use_color = 0
     print("None", repr(str(c)), repr(c))
     colors.use_color = cval
예제 #6
0
 def testLimits(self):
     print()
     cval = colors.use_color
     colors.use_color = 4
     c = colors.rgb(123, 40, 200)
     print("True", repr(str(c)), repr(c))
     colors.use_color = 3
     print("Full", repr(str(c)), repr(c))
     colors.use_color = 2
     print("Simple", repr(str(c)), repr(c))
     colors.use_color = 1
     print("Basic", repr(str(c)), repr(c))
     colors.use_color = 0
     print("None", repr(str(c)), repr(c))
     colors.use_color = cval
예제 #7
0
 def testLimits(self):
     print()
     cval = colors.use_color
     colors.use_color = 4
     c = colors.rgb(123,40,200)
     print('True', repr(str(c)), repr(c))
     colors.use_color = 3
     print('Full', repr(str(c)), repr(c))
     colors.use_color = 2
     print('Simple', repr(str(c)), repr(c))
     colors.use_color = 1
     print('Basic', repr(str(c)), repr(c))
     colors.use_color = 0
     print('None', repr(str(c)), repr(c))
     colors.use_color = cval
예제 #8
0
 def testLimits(self):
     print()
     cval = colors.use_color
     colors.use_color = 4
     c = colors.rgb(123, 40, 200)
     print('True', repr(str(c)), repr(c))
     colors.use_color = 3
     print('Full', repr(str(c)), repr(c))
     colors.use_color = 2
     print('Simple', repr(str(c)), repr(c))
     colors.use_color = 1
     print('Basic', repr(str(c)), repr(c))
     colors.use_color = 0
     print('None', repr(str(c)), repr(c))
     colors.use_color = cval
예제 #9
0
 def testLoadNumericalColor(self):
     self.assertEqual(colors.full(2), colors[2])
     self.assertEqual(colors.simple(2), colors(2))
     self.assertEqual(colors(54), colors[54])
     self.assertEqual(colors(1, 30, 77), colors.rgb(1, 30, 77))
     self.assertEqual(colors[1, 30, 77], colors.rgb(1, 30, 77))
예제 #10
0
import logging
import os

from plumbum import cli, local, TEE,colors

logger = logging.getLogger()
docker = local["docker"]
kubectl = local["kubectl"]
gcloud = local["gcloud"]

info = colors.rgb(100,0,150)

class Cluster(cli.Application):
    def main(self, *args):
        if args:
            print("Unknown command {0!r}".format(args[0]))
            return 1  # error exit code
        if not self.nested_command:  # will be ``None`` if no sub-command follows
            print("No command given")
            return 1  # error exit code


@Cluster.subcommand("pushlatest")
class CreateTag(cli.Application):
    """Pushes the image to google registry"""

    @cli.switch("--project", str, mandatory=True)
    def gce_project(self, gceProject):
        """Set the google cloud project"""
        self.project = gceProject
예제 #11
0
 def testLoadNumericalColor(self):
     self.assertEqual(colors.full(2), colors[2])
     self.assertEqual(colors.simple(2), colors(2))
     self.assertEqual(colors(54), colors[54])
     self.assertEqual(colors(1,30,77),colors.rgb(1,30,77))
     self.assertEqual(colors[1,30,77],colors.rgb(1,30,77))
예제 #12
0
 def testLoadNumericalColor(self):
     assert colors.full(2) == colors[2]
     assert colors.simple(2) == colors(2)
     assert colors(54) == colors[54]
     assert colors(1, 30, 77) == colors.rgb(1, 30, 77)
     assert colors[1, 30, 77] == colors.rgb(1, 30, 77)
예제 #13
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function

from plumbum import colors

with colors:
    print("Do you believe in color, punk? DO YOU?")
    for i in range(0, 255, 10):
        for j in range(0, 255, 10):
            print(u"".join(
                colors.rgb(i, j, k)[u"\u2588"] for k in range(0, 255, 10)))
예제 #14
0
#!/usr/bin/env python
from __future__ import with_statement, print_function
from plumbum import colors

with colors:
    print("Do you believe in color, punk? DO YOU?")
    for i in range(0, 255, 10):
        for j in range(0, 255, 10):
            print(u''.join(
                colors.rgb(i, j, k)[u'\u2588'] for k in range(0, 255, 10)))
예제 #15
0
 def testLoadNumericalColor(self):
     assert colors.full(2) == colors[2]
     assert colors.simple(2) == colors(2)
     assert colors(54) == colors[54]
     assert colors(1,30,77) == colors.rgb(1,30,77)
     assert colors[1,30,77] == colors.rgb(1,30,77)
예제 #16
0
#!/usr/bin/env python
from __future__ import with_statement, print_function
from plumbum import colors

with colors:
    print("Do you believe in color, punk? DO YOU?")
    for i in range(0,255,10):
        for j in range(0,255,10):
            print(u''.join(colors.rgb(i,j,k)[u'\u2588'] for k in range(0,255,10)))