Esempio n. 1
0
class Line(Tool):

    def init(self, xy):
        self.end = Point(*xy)

    def ident(self):
        return self.id, (self.point.ident(), self.end.ident())
Esempio n. 2
0
class Tool(object):

    @classmethod
    def assign(cls, value):
        cls.id = value
        return cls

    def __init__(self, xy, *args, **kwargs):
        self.point = Point(*xy)
        self.init(*args, **kwargs)

    def init(self, *args, **kwargs):
        ''' personal tool init, override it '''

    def ident(self):
        return self.id, (self.point.ident())
Esempio n. 3
0
 def init(self, xy):
     self.end = Point(*xy)
Esempio n. 4
0
 def __init__(self, xy, *args, **kwargs):
     self.point = Point(*xy)
     self.init(*args, **kwargs)