summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dealconvert/__init__.py2
-rw-r--r--dealconvert/formats/dup.py2
-rw-r--r--dealconvert/formats/pbn.py2
3 files changed, 3 insertions, 3 deletions
diff --git a/dealconvert/__init__.py b/dealconvert/__init__.py
index f613fac..1779976 100644
--- a/dealconvert/__init__.py
+++ b/dealconvert/__init__.py
@@ -7,7 +7,7 @@ class DealConverter(object):
self.parser = self._detect_format(self.input)
def output(self, output_files):
- deal_set = self.parser.parse(self.input)
+ deal_set = sorted(self.parser.parse(self.input), key=lambda d:d.number)
for output in output_files:
self._detect_format(output).output(output, deal_set)
diff --git a/dealconvert/formats/dup.py b/dealconvert/formats/dup.py
index 068a05e..53b790b 100644
--- a/dealconvert/formats/dup.py
+++ b/dealconvert/formats/dup.py
@@ -51,7 +51,7 @@ class DUPFormat(DealFormat):
print 'ERROR: .dup format requires consequent board numbers'
sys.exit()
header = 'YN%s 0 %02d ' % (str(first_board).ljust(2, ' '), board_count)
- for deal in sorted(dealset, key=lambda d:d.number):
+ for deal in dealset:
out_file.write(self.bri.single_deal_output(deal))
out_file.write(self.dge.single_deal_output(deal))
if deal.number == first_board:
diff --git a/dealconvert/formats/pbn.py b/dealconvert/formats/pbn.py
index 2f3be71..f1d3042 100644
--- a/dealconvert/formats/pbn.py
+++ b/dealconvert/formats/pbn.py
@@ -88,7 +88,7 @@ class PBNFormat(DealFormat):
return result
def output_content(self, out_file, dealset):
- for board in sorted(dealset, key=lambda d:d.number):
+ for board in dealset:
out_file.write('[Event "%s"]\r\n' % (board.event))
out_file.write('[Board "%d"]\r\n' % (board.number))
out_file.write('[Dealer "%s"]\r\n' % (