summaryrefslogtreecommitdiff
path: root/dealconvert/formats/html.py
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2020-10-20 15:23:10 +0200
committeremkael <emkael@tlen.pl>2020-10-20 15:23:10 +0200
commit5da79691092041d7291fc8534d4729938981aa4a (patch)
treea6cac7642024db971240a4ab2e2cc1cc332e557a /dealconvert/formats/html.py
parentd833d89ade81fd72efb76fb796cd5073e4e7c221 (diff)
Python3 compatibility
Fixes #1
Diffstat (limited to 'dealconvert/formats/html.py')
-rw-r--r--dealconvert/formats/html.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/dealconvert/formats/html.py b/dealconvert/formats/html.py
index 71ed008..c4325fd 100644
--- a/dealconvert/formats/html.py
+++ b/dealconvert/formats/html.py
@@ -7,15 +7,15 @@ from bcdd.Exceptions import FieldNotFoundException
from bcdd.ParScore import ParScore
from bcdd.PBNBoard import PBNBoard
-from . import DealFormat
+from . import BinaryFormat
from .. import dto
HTML_SUITS = OrderedDict([
- ('s', u'\u2660'),
- ('h', u'\u2665'),
- ('d', u'\u2666'),
- ('c', u'\u2663')
+ ('s', '\u2660'),
+ ('h', '\u2665'),
+ ('d', '\u2666'),
+ ('c', '\u2663')
])
_page_template = '''
@@ -70,20 +70,20 @@ thead {
</html>
'''
-class HTMLFormat(DealFormat):
+class HTMLFormat(BinaryFormat):
@property
def suffix(self):
return '.html'
def __init__(self, *args, **kwargs):
- DealFormat.__init__(self, *args, **kwargs)
+ BinaryFormat.__init__(self, *args, **kwargs)
self.deals_per_column = self.options.get('columns', 6) or 6
def parse_content(self, content):
raise NotImplementedError
def _get_html_hands(self, deal):
- suits = HTML_SUITS.keys()
+ suits = list(HTML_SUITS.keys())
return [
[
self._get_html_suit(suits[i], suit)
@@ -141,7 +141,7 @@ class HTMLFormat(DealFormat):
data['table'] += '<td>' + self._get_suit_symbol(suit) + '</td>'
data['table'] += '</tr>'
player_order = [0, 2, 1, 3] # NESW -> NSEW
- denom_order = range(4, -1, -1) # CDHSN -> NSHDC
+ denom_order = list(range(4, -1, -1)) # CDHSN -> NSHDC
for player in player_order:
data['table'] += '<tr>'
data['table'] += '<td style="border-left: solid 1px black">' + BCalcWrapper.PLAYERS[player] + '</td>'