1# Copyright 2004-2008 Roman Yakovenko. 2# Distributed under the Boost Software License, Version 1.0. (See 3# accompanying file LICENSE_1_0.txt or copy at 4# http://www.boost.org/LICENSE_1_0.txt) 5 6"defines few classes, used by :class:`decl_wrapper.class_t` class to keep user code" 7 8class user_text_t(object): 9 "keeps reference to user code that belongs to declaration section" 10 def __init__( self, text ): 11 object.__init__( self ) 12 self.text = text 13 14class class_user_text_t( user_text_t ): 15 "keeps reference to user code that belongs to registration section" 16 def __init__( self, text, works_on_instance=True ): 17 """works_on_instance: If true, the custom code can be applied directly to obj inst. 18 Ex: ObjInst."CustomCode" 19 """ 20 user_text_t.__init__( self, text ) 21 self.works_on_instance = works_on_instance 22