Example #1
0
 def dot(self):
     """ Emits a colourful character. """
     x = c = 0
     try:
         x, y, c = self.gen.next()
         if x == 0:
             width = get_terminal_width()
             if width != self.width:
                 self.init()
     except StopIteration:
         kwargs = self.kwargs
         self.zoom_location += 1
         self.zoom_location %= len(self.zoom_locations)
         loc = self.zoom_locations[self.zoom_location]
         kwargs.update({
             "x_pos": loc[0],
             "y_pos": loc[1],
             "distance": loc[2]
         })
         self.colour_range = loc[3]
         #global colour_range
         #print colour_range, loc[2]
         #colour_range = None
         return self.restart()
     print_pixel(c, self.colour_range, self.invert)
     if x == self.width - 1:
         print >> sys.stderr
Example #2
0
 def dot(self):
     """ Emits a colourful character. """
     x = c = 0
     try:
         x, y, c = self.gen.next()
         if x == 0:
             width = get_terminal_width()
             if width != self.width:
                 self.init()
     except StopIteration:
         kwargs = self.kwargs
         self.zoom_location += 1
         self.zoom_location %= len(self.zoom_locations)
         loc = self.zoom_locations[self.zoom_location]
         kwargs.update({"x_pos": loc[0], "y_pos": loc[1], "distance": loc[2]})
         self.colour_range = loc[3]
         #global colour_range
         #print colour_range, loc[2]
         #colour_range = None
         return self.restart()
     print_pixel(c, self.colour_range, self.invert)
     if x == self.width - 1:
         print >>sys.stderr
Example #3
0
 def init(self):
     self.width = get_terminal_width(
     ) or 80  # in some envs, the py lib doesnt default the width correctly
     self.mandelbrot = Mandelbrot(width=(self.width or 1), **self.kwargs)
     self.mandelbrot.init()
     self.gen = self.mandelbrot.generate()
Example #4
0
 def init(self):
     self.width = get_terminal_width() or 80 # in some envs, the py lib doesnt default the width correctly
     self.mandelbrot = Mandelbrot(width=(self.width or 1), **self.kwargs)
     self.mandelbrot.init()
     self.gen = self.mandelbrot.generate()