OSDN Git Service

2b77ae09da5b6fa6c25650befd52eaa6342de9e8
[ftg/ftg.git] / ftg / formatter / base_formatter.py
1 # vim: tabstop=4 shiftwidth=4 softtabstop=4
2 # -*- coding: utf-8 -*-
3 #
4
5 __version__ = '1.1'
6
7 from ftg.flow_table import FlowTable
8 from ftg.flow_priority import FlowPriority
9 from ftg.flow_entry import FlowEntry
10 from ftg.utils.common import CommonUtils
11
12
13 class BaseFormatter(object):
14     HEADER_FORMAT = ""
15     FOOTER_FORMAT = ""
16     formatter_name = "base"
17
18     def __init__(self, util=CommonUtils(), title=""):
19         self._tables = []
20         self.util = util
21         self._title = title
22         self._groupid = 1
23         self.output_summary = True
24         self.output_resubmit_loop = True
25         self.util.debug_out(self.formatter_name + " formatter initialized")
26
27     def format(self):
28         return "FORMATTED STRINGS"
29     
30     def get_header(self):
31         header = self.HEADER_FORMAT
32         return header
33
34     def get_footer(self):
35         footer = self.FOOTER_FORMAT
36         return footer
37
38     def set_tables(self, tables):
39         self._tables = tables
40
41     def set_output_summary(self, output_summary):
42         self.output_summary = output_summary
43
44     def set_output_resubmit_loop(self, output_resubmit_loop):
45         self.output_resubmit_loop = output_resubmit_loop