summaryrefslogtreecommitdiff
path: root/dealconvert/formats/html.py
diff options
context:
space:
mode:
Diffstat (limited to 'dealconvert/formats/html.py')
-rw-r--r--dealconvert/formats/html.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/dealconvert/formats/html.py b/dealconvert/formats/html.py
index e39bae4..a60b3a3 100644
--- a/dealconvert/formats/html.py
+++ b/dealconvert/formats/html.py
@@ -18,8 +18,6 @@ HTML_SUITS = OrderedDict([
('c', u'\u2663')
])
-_deals_per_column = 6
-
_page_template = '''
<html>
<head>
@@ -82,6 +80,9 @@ class HTMLFormat(DealFormat):
def suffix(self):
return '.html'
+ def __init__(self, *args, **kwargs):
+ self.deals_per_column = kwargs.get('columns', 6)
+
def parse_content(self, content):
raise NotImplementedError
@@ -185,8 +186,8 @@ class HTMLFormat(DealFormat):
deal_rows = []
event_name = dealset[0].event
while len(dealset) > 0:
- deal_rows.append(dealset[0:_deals_per_column])
- dealset = dealset[_deals_per_column:]
+ deal_rows.append(dealset[0:self.deals_per_column])
+ dealset = dealset[self.deals_per_column:]
table_content = ''
for row in deal_rows:
table_content += '<tr>'
@@ -220,7 +221,7 @@ class HTMLFormat(DealFormat):
table_content += '</td>'
table_content += '</tr>'
return _page_template % (
- _deals_per_column - 1, event_name, table_content
+ self.deals_per_column - 1, event_name, table_content
)
def output_content(self, out_file, dealset):