łň 1ńîEc@s dZdefd„ƒYZdS(sř This module documents a class that expands abbreviations the editor's buffer. @author: Lateef Alabi-Oki @organization: The Scribes Project @copyright: Copyright Š 2006 Lateef Alabi-Oki @license: GNU GPLv2 or Later @contact: mystilleef@gmail.com tAutoReplaceExpandercBs;eZdZd„Zd„Zd„Zd„Zd„ZRS(sK This class creates an object that expands abbreviations in the buffer. cCse|i||ƒ|iid|iƒ|_|iid|iƒ|_|iid|iƒ|_dS(s÷ Initialize the monitor object. @param self: Reference to the AutoReplaceExpander instance. @type self: An AutoReplaceExpander object. @param manager: Reference to the AutoReplaceManager. @type manager: An AutoReplaceManager object. sabbreviations-updatedtdestroysabbreviation-foundN( t%_AutoReplaceExpander__init_attributest_AutoReplaceExpander__managertconnectt7_AutoReplaceExpander__expander_abbreviations_updated_cbt!_AutoReplaceExpander__signal_id_1t)_AutoReplaceExpander__expander_destroy_cbt!_AutoReplaceExpander__signal_id_2t4_AutoReplaceExpander__expander_abbreviation_found_cbt!_AutoReplaceExpander__signal_id_3(tselftmanagerteditor((splugins/AutoReplace/Expander.pyt__init__&s cCs:||_||_h|_d|_d|_d|_dS(só Initialize data attributes. @param self: Reference to the AutoReplaceExpander instance. @type self: An AutoReplaceExpander object. @param manager: Reference to the AutoReplaceManager @type manager: An AutoReplaceManager object. N(Rt_AutoReplaceExpander__editort-_AutoReplaceExpander__abbreviation_dictionarytNoneRRR (R R R ((splugins/AutoReplace/Expander.pyt__init_attributes5s      cCs ||_dS(s• Handles callback when the "abbreviations-updated" signal is emitted. @param self: Reference to the AutoReplaceMonitor instance. @type self: An AutoReplaceMonitor object. @param manager: Reference to the AutoReplaceManager. @type manager: An AutoReplaceManager object. @param abbreviation_dictionary: A dictionary of abbreviations. @type abbreviation_dictionary: A Dictionary object. N(R(R R tabbreviation_dictionary((splugins/AutoReplace/Expander.pyt#__expander_abbreviations_updated_cbRs cCss|iiƒddkl}l}||i|iƒ||i|iƒ||i|iƒ||ƒ~d}dS(s  Handles callback when the "destroy" signal is emitted. @param self: Reference to the AutoReplaceManager instance. @type self: An AutoReplaceManager object. @param manager: Reference to the AutoReplaceManager. @type manager: An AutoReplaceManager object. i˙˙˙˙(tdisconnect_signaltdelete_attributesN( Rtcleart SCRIBES.utilsRRRRRR R(R R RR((splugins/AutoReplace/Expander.pyt__expander_destroy_cbcs  c Csýy|i|d }Wntj o dSnX|d}ddkl}||iiƒ}|iƒ}x(tt|d ƒƒD]}|i ƒq~W|iii ||ƒ|iii ||ƒddk l } | |d |f} |iii| dƒdS(sƒ Handles callback when the "abbreviation-found" signal is emitted. @param self: Reference to the AutoReplaceExpander instance. @type self: An AutoReplaceExpander object. @param monitor: Reference to the AutoReplaceManager. @type monitor: An AutoReplaceManager object. @param abbreviation: An abbreviation eligible for replacement. @type abbreviation: A String object. i˙˙˙˙N(tget_cursor_iterator(tmsg0001tsucceed(RtKeyErrortSCRIBES.cursorRRt textbuffertcopytrangetlent backward_chartdeletetinsert_at_cursorti18nRtfeedbacktupdate_status_message( R R t abbreviationt expanded_wordtdelimeter_characterRtiteratort tmp_iteratortvalueRtmessage((splugins/AutoReplace/Expander.pyt __expander_abbreviation_found_cbws"    (t__name__t __module__t__doc__RRRRR (((splugins/AutoReplace/Expander.pyR s     N(R3tobjectR(((splugins/AutoReplace/Expander.pyss