class Wardrobe(wr.Wardrobe): modes = { wr.MAIN: wr.Mode(fill_colors=('#ba11ad', )), 'pig': wr.Mode(fill_colors=('#facade', )) } modes['label'] = modes['pig'].copy(font=wr.Font('Googe Light')) font_size = 2
class Wardrobe0(wr.Wardrobe): modes = { 'a': wr.Mode(font=wr.Font('Vot'), bold=True), 'b': wr.Mode(font=wr.Font('Geb')) } font_size = 9 def reset(self): self.mode = self.modes['a']
class Grayscale(wardrobe.Wardrobe): modes = { wardrobe.MAIN: wardrobe.Mode(fill_colors=(color.BLACK, )), wardrobe.ACCENT: wardrobe.Mode(fill_colors=(color.GRAY_50, ), stroke_colors=(color.BLACK, )), wardrobe.CONTRAST: wardrobe.Mode(fill_colors=(color.WHITE, ), stroke_colors=(color.BLACK, )) }
class Wardrobe(wr.Wardrobe): modes = { wr.MAIN: wr.Mode(font=wr.Font('Wax'), stroke_colors=('#ffffff', ), thickness=0.03) } font_size = 3
def test_single(self): m0 = wr.Mode(bolder=True) self.assertEqual(m0.weight, 'bolder') self.assertEqual(m0.style, None) m1 = m0.copy(weight='bold', italic=True) self.assertEqual(m0.weight, 'bolder') self.assertEqual(m0.style, None) self.assertEqual(m1.weight, 'bold') self.assertEqual(m1.style, 'italic') m2 = m0.copy(weight=None, oblique=True) self.assertEqual(m0.weight, 'bolder') self.assertEqual(m0.style, None) self.assertEqual(m1.weight, 'bold') self.assertEqual(m1.style, 'italic') self.assertEqual(m2.weight, None) self.assertEqual(m2.style, 'oblique')
class Wardrobe(wr.Wardrobe): modes = { wr.MAIN: wr.Mode(fill_colors=('#facade', ), stroke_colors=('#f1eece', )) }
class Wardrobe(wr.Wardrobe): modes = {wr.MAIN: wr.Mode(fill_colors=('#ba11ad', '#f1eece'))}
class Wardrobe(wr.Wardrobe): modes = {wr.MAIN: wr.Mode(fill_colors=('#000000', ))}
class Wardrobe(wr.Wardrobe): modes = {wr.MAIN: wr.Mode(font=wr.Font('Wax'), thickness=0.02)} font_size = 3
class Wardrobe(wr.Wardrobe): modes = {wr.MAIN: wr.Mode(font=wr.Font('Wax'))} font_size = 4
class BasicTextWardrobe(Grayscale): modes = {wardrobe.MAIN: wardrobe.Mode(font=font.ARIAL, anchor='middle')} font_size = 4
def test_mode_single_argument_direct(self): m = wr.Mode(style='oblique') self.assertEqual(m.style, 'oblique')
def test_mode_single_argument_indirect(self): m = wr.Mode(italic=True) self.assertEqual(m.style, 'italic')
class Wardrobe(wr.Wardrobe): modes = {wr.MAIN: wr.Mode(stroke_colors=('#f1eece', ))}
def test_mode_redundant_arguments_favour_the_direct(self): m = wr.Mode(style='oblique', italic=True) self.assertEqual(m.style, 'oblique')
class Wardrobe(wardrobe.Wardrobe): '''A wardrobe for drawing a plain background and a black frame.''' modes = {wardrobe.MAIN: wardrobe.Mode(fill_colors=(color.NONE,), thickness=2), wardrobe.BACKGROUND: wardrobe.Mode(fill_colors=(color.WHITE,)) }
class Wardrobe(wardrobe.Wardrobe): font_size = 5 modes = {wardrobe.MAIN: wardrobe.Mode(font=wardrobe.Font('F'))}