]> git.parisson.com Git - timeside.git/commitdiff
make Grapher an abstract interface
authorGuillaume Pellerin <yomguy@parisson.com>
Tue, 12 Nov 2013 13:33:45 +0000 (14:33 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Tue, 12 Nov 2013 13:33:45 +0000 (14:33 +0100)
doc/source/api/grapher/index.rst
timeside/grapher/core.py

index 6b65320f72828b61d8cb5639677e47b1b372b34b..61ea8bf09e847c281f4e84248877b94f03dfc9af 100644 (file)
@@ -1,6 +1,6 @@
-=======
-Grapher
-=======
+================
+Grapher package
+================
 
 
 .. toctree::
index 556e3e5b97195f333f78f2aae9ede354ad8c6ac5..17da285de2cf2e78207b9e8e5efdd3e320ccacf4 100644 (file)
@@ -30,6 +30,7 @@ except ImportError:
     import ImageFilter, ImageChops, Image, ImageDraw, ImageColor, ImageEnhance
 
 from timeside.core import *
+from timeside.api import IGrapher
 from timeside.grapher.color_schemes import default_color_schemes
 from utils import *
 
@@ -112,6 +113,9 @@ class Grapher(Processor):
     pixel_cursor = 0
     lower_freq = 20
 
+    implements(IGrapher)
+    abstract()
+
     def __init__(self, width=1024, height=256, bg_color=None, color_scheme='default'):
         super(Grapher, self).__init__()
         self.bg_color = bg_color
@@ -151,6 +155,7 @@ class Grapher(Processor):
         self.pixel = self.image.load()
         self.draw = ImageDraw.Draw(self.image)
 
+    @interfacedoc
     def render(self, output=None):
         if output:
             self.image.save(output)