;ò À‰ß>c@s”dZdklZdfd„ƒYZdefd„ƒYZedjoGeƒZeidƒdjpt‚ei dƒd jpt‚nd S( s/This module contains the CharacterCipher class.(sStringIOsCharacterCiphercBs)tZdZd„Zd„Zd„ZRS(sÓThis is a useful baseclass for character-oriented ciphers. Subclasses of this class do not need to implement encrypt or decrypt. Instead, they must implement encryptCharacter and decryptCharacter. cCs|i|i|ƒSdS(sEncrypt and return s.N(sselfs_mapsencryptCharacterss(sselfss((s./cipher/CharacterCipher.pysencryptscCs|i|i|ƒSdS(sDecrypt and return s.N(sselfs_mapsdecryptCharacterss(sselfss((s./cipher/CharacterCipher.pysdecryptscCs;tƒ}x!|D]}|i||ƒƒqW|iƒSdS(sgApply f to each character in s and return the new s. Use a cStringIO buffer. N(sStringIOsbufssscswritesfsgetvalue(sselfsfssscsbuf((s./cipher/CharacterCipher.pys_maps  (s__name__s __module__s__doc__sencryptsdecrypts_map(((s./cipher/CharacterCipher.pysCharacterCiphers   s_TestcBstZd„Zd„ZRS(NcCsdSdS(Nsz((sselfsc((s./cipher/CharacterCipher.pysencryptCharacter%scCsdSdS(Nsa((sselfsc((s./cipher/CharacterCipher.pysdecryptCharacter&s(s__name__s __module__sencryptCharactersdecryptCharacter(((s./cipher/CharacterCipher.pys_Test$s s__main__sfooszzzsaaaN( s__doc__s cStringIOsStringIOsCharacterCiphers_Tests__name__sciphersencryptsAssertionErrorsdecrypt(s_TestsCharacterCiphersciphersStringIO((s./cipher/CharacterCipher.pys?s