cifrado r102 - in trunk: . package/cifrado
- From: bersace svn gnome org
- To: svn-commits-list gnome org
- Subject: cifrado r102 - in trunk: . package/cifrado
- Date: Fri, 18 Apr 2008 16:14:15 +0100 (BST)
Author: bersace
Date: Fri Apr 18 15:14:15 2008
New Revision: 102
URL: http://svn.gnome.org/viewvc/cifrado?rev=102&view=rev
Log:
Conserver l'ordre des variable du message.
Modified:
trunk/ChangeLog
trunk/package/cifrado/message.py
Modified: trunk/package/cifrado/message.py
==============================================================================
--- trunk/package/cifrado/message.py (original)
+++ trunk/package/cifrado/message.py Fri Apr 18 15:14:15 2008
@@ -44,15 +44,16 @@
else:
self.emissions = emissions
-# jeu.forces.connect('row-inserted', self.forces_row_inserted, jeu)
jeu.forces.connect('row-changed', self.forces_row_changed, jeu)
jeu.forces.connect('row-deleted', self.forces_row_deleted)
def lister_variables(self):
variables = self.capture_vars.findall(self.message)
- variables = {}.fromkeys(variables).keys()
- variables.sort()
+ # http://www.peterbe.com/plog/uniqifiers-benchmark
+ seen = set()
+ variables = [x for x in variables if x not in seen and not seen.add(x)]
+
return variables
def forces_row_changed(self, forces, path, iter, jeu):
@@ -62,7 +63,8 @@
self.emissions[force] = emission.Emission(True, force, lieu, [codeurs.aucun.Codeur()])
def forces_row_deleted(self, forces, path):
- """On boucle les forces restantes pour les garder. On supprime 'les' autres."""
+ """On boucle les forces restantes pour les garder. On supprime
+ 'les' autres."""
iter = forces.get_iter_first()
while iter is not None and forces.iter_is_valid(iter):
force = forces.get_value(iter, JEU.COL_FORCE)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]