Changeset 194

Show
Ignore:
Timestamp:
04/21/08 08:18:49 (9 months ago)
Author:
tal
Message:
Don't allow dispatcher in Glyph.__init__. It is safer to use the property.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • packages/defcon/trunk/Lib/defcon/objects/font.py

    r165 r194  
    114114        if name in self: 
    115115            self.unicodeData.removeGlyphData(name, self[name].unicodes) 
    116         glyph = self._glyphClass(self.dispatcher, contourClass=self._glyphContourClass) 
     116        glyph = self._glyphClass(contourClass=self._glyphContourClass) 
    117117        glyph.name = name 
    118118        self._glyphs[name] = glyph 
  • packages/defcon/trunk/Lib/defcon/objects/glyph.py

    r192 r194  
    1818    _notificationName = "Glyph.Changed" 
    1919 
    20     def __init__(self, dispatcher=None, contourClass=None, componentClass=None, anchorClass=None): 
     20    def __init__(self, contourClass=None, componentClass=None, anchorClass=None): 
    2121        super(Glyph, self).__init__() 
    2222        self._parent = None 
     
    2727        self.note = None 
    2828        self.lib = {} 
    29         self._dispatcher = dispatcher 
     29        self._dispatcher = None 
    3030 
    3131        self._contours = [] 
     
    5151        self.anchorClass = anchorClass 
    5252 
    53         if dispatcher is not None: 
    54             self.addObserver(observer=self, methodName="destroyAllRepresentations", notification="Glyph.Changed") 
    55  
    5653    def _set_dispatcher(self, dispatcher): 
    5754        super(Glyph, self)._set_dispatcher(dispatcher) 
     
    6360            for anchor in self._anchors: 
    6461                self._setParentDataInAnchor(anchor) 
     62            self.addObserver(observer=self, methodName="destroyAllRepresentations", notification="Glyph.Changed") 
    6563 
    6664    def _get_dispatcher(self):