# Path: TimelineDefn.py
# class TimelineMessage(object):
#     def __init__(self, format_string, *item_names):
#         """
#         Create a message to be printed on the timeline event.
#         Arguments:
#             - format_string, the format string that will be used with .format
#                         make sure that the parameters dont have any names
#                         example: "Received call from contact {} with number {}"
#             - item_names, variable argument string arguments with the internal
#                         names of the values we are looking for.
#         """
#         self.format_string = format_string
#         self.item_names = item_names
#     
#     def construct_message(self, dataquery_item):
#         """
#         Constructs the formatted message given the format this object was
#         initialized with. The dataquery_item must be a dictionary containing
#         a single timeline event.
#         
#         I thought about error checking fmt but that would hide the issue rather
#         than force people to re-write their definitions. So no error checking...
#         """
#         args = []
#         for name in self.item_names:
#             if name not in dataquery_item:
#                 raise KeyError
#             args.append(dataquery_item[name])
#         return self.format_string.format(*args)


from TimelineDefn import TimelineMessage
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

NFI is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with NFI.  If not, see <http://www.gnu.org/licenses/>.
'''
class BoxType():
    TYPE_DIV = 0
    TYPE_PRE = 1
    TYPE_TEXTBOX = 2
    
    _box_formats = {
        TYPE_DIV : u"""<div class="{}">{}</div>""",
        TYPE_PRE : u"<pre>{}</pre>",
        TYPE_TEXTBOX : u"""<div class="textbox">{}</div>"""
    }
    
class TimelineBox(object):
    '''
    This plugin is similar to the TimelineMessage object with the only
    difference that it generates a box wrapping the text. 
    '''
    
    def __init__(self, box_type, box_class, format_string, *item_names):

# Path: TimelineDefn.py
# class TimelineMessage(object):
#     def __init__(self, format_string, *item_names):
#         """
#         Create a message to be printed on the timeline event.
#         Arguments:
#             - format_string, the format string that will be used with .format
#                         make sure that the parameters dont have any names
#                         example: "Received call from contact {} with number {}"
#             - item_names, variable argument string arguments with the internal
#                         names of the values we are looking for.
#         """
#         self.format_string = format_string
#         self.item_names = item_names
#     
#     def construct_message(self, dataquery_item):
#         """
#         Constructs the formatted message given the format this object was
#         initialized with. The dataquery_item must be a dictionary containing
#         a single timeline event.
#         
#         I thought about error checking fmt but that would hide the issue rather
#         than force people to re-write their definitions. So no error checking...
#         """
#         args = []
#         for name in self.item_names:
#             if name not in dataquery_item:
#                 raise KeyError
#             args.append(dataquery_item[name])
#         return self.format_string.format(*args)


# Path: TimelinePlugins/TimelineBox.py
from TimelineDefn import TimelineMessage

it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

NFI is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with NFI.  If not, see <http://www.gnu.org/licenses/>.
'''
class BoxType():
    TYPE_DIV = 0
    TYPE_PRE = 1
    TYPE_TEXTBOX = 2
    
    _box_formats = {
        TYPE_DIV : u"""<div class="{}">{}</div>""",
        TYPE_PRE : u"<pre>{}</pre>",
        TYPE_TEXTBOX : u"""<div class="textbox">{}</div>"""
    }
    
class TimelineBox(object):
    '''
    This plugin is similar to the TimelineMessage object with the only
    difference that it generates a box wrapping the text. 
    '''
    
    def __init__(self, box_type, box_class, format_string, *item_names):

        self.message = TimelineMessage( format_string, *item_names )