cifrado r105 - in trunk: . package/cifrado
- From: bersace svn gnome org
- To: svn-commits-list gnome org
- Subject: cifrado r105 - in trunk: . package/cifrado
- Date: Fri, 18 Apr 2008 17:17:27 +0100 (BST)
Author: bersace
Date: Fri Apr 18 16:17:27 2008
New Revision: 105
URL: http://svn.gnome.org/viewvc/cifrado?rev=105&view=rev
Log:
Distinguer conversion et substitution.
Substituer aussi le bandeau chef.
Modified:
trunk/ChangeLog
trunk/package/cifrado/cifrado.py
trunk/package/cifrado/emission.py
Modified: trunk/package/cifrado/cifrado.py
==============================================================================
--- trunk/package/cifrado/cifrado.py (original)
+++ trunk/package/cifrado/cifrado.py Fri Apr 18 16:17:27 2008
@@ -966,17 +966,19 @@
cr.set_line_width(.5)
cr.stroke()
cr.restore()
+
+ texte = em.substituer(message.message,
+ message.lister_variables())
# Original
- self.impr_text(contexte, message.message,
+ self.impr_text(contexte, texte,
font='sans normal 7',
y=int(1.5 * hh/pango.SCALE),
width=contexte.get_width()*pango.SCALE-(il+wc)*pango.SCALE,
justify=True)
# ChiffrÃ
- layout = self.layout_text(contexte, em.convertir(message.message,
- message.lister_variables()),
+ layout = self.layout_text(contexte, em.convertir(texte),
font=police,
justify=True)
w,h = layout.get_size()
Modified: trunk/package/cifrado/emission.py
==============================================================================
--- trunk/package/cifrado/emission.py (original)
+++ trunk/package/cifrado/emission.py Fri Apr 18 16:17:27 2008
@@ -78,12 +78,12 @@
def set_val(self, var, val):
self.subs[var] = val
- def convertir(self, texte, variables):
- # substitution
+ def substituer(self, texte, variables):
for var in variables:
texte = texte.replace(var, self.get_val(var))
+ return texte
- # conversion
+ def convertir(self, texte):
iter = self.codeurs.get_iter_first()
while iter is not None and self.codeurs.iter_is_valid(iter):
codeur = self.codeurs.get_value(iter, COL_COD)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]