Changeset 6424 for main/waeup.sirp


Ignore:
Timestamp:
20 Jun 2011, 15:40:27 (13 years ago)
Author:
uli
Message:

Respect batch_serial when writing batches to files. I wonder, however,
whether we need this serial number of an access code inside its batch
really.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/accesscodes.py

    r6423 r6424  
    177177        writer.writerow([self.prefix, str(self.num), "%0.2f" % self.cost])
    178178
    179         for value in self.values():
     179        for value in sorted(self.values(),
     180                            cmp=lambda x, y: cmp(
     181                x.batch_serial, y.batch_serial)):
    180182            writer.writerow(
    181183                [str(value.batch_serial), str(value.representation)]
     
    203205        writer.writerow([self.prefix, '%0.2f' % self.cost, str(self.num),
    204206                         str(self.entry_num)])
    205         for value in self.values():
     207        for value in sorted(
     208            self.values(),
     209            cmp = lambda x, y: cmp(x.batch_serial, y.batch_serial)
     210            ):
    206211            writer.writerow([
    207212                    self.prefix, value.batch_serial, value.representation,
Note: See TracChangeset for help on using the changeset viewer.