Пример #1
0
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)
        self.boxtype = box_type
        self.box_class = box_class

    def render(self, item):
        box_fmt = BoxType._box_formats[self.boxtype]
        if self.box_class != None and self.boxtype in [BoxType.TYPE_DIV]:
            rendered = box_fmt.render(self.box_class,
                                      self.message.construct_message(item))
        else:
            rendered = box_fmt.format(self.message.construct_message(item))
        return rendered
Пример #2
0
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 )
        self.boxtype = box_type
        self.box_class = box_class
        
    def render(self, item):
        box_fmt = BoxType._box_formats[self.boxtype]
        if self.box_class != None and self.boxtype in [ BoxType.TYPE_DIV ]:
            rendered = box_fmt.render(self.box_class, 
                                      self.message.construct_message(item))
        else:
            rendered = box_fmt.format(self.message.construct_message(item))
        return rendered
        
Пример #3
0
You should have received a copy of the GNU General Public License
along with NFI.  If not, see <http://www.gnu.org/licenses/>.
'''
from TimelineDefn import TimelineDefn, TimelineTitle, DataQueryCatalog
from TimelineDefn import TimelineMessage
from TimelinePlugins.TimelineBox import TimelineBox, BoxType
from Catalog import Catalog

timeline = [
    TimelineDefn(
        TimelineTitle("Call", "fa-phone"),
        DataQueryCatalog(Catalog.CATALOG_COMMS, "telephony.calls", "date",
                         "type", "name", "number", "duration"), "date",
        [
            TimelineMessage(u"{} call from {} ({})", "type", "name", "number"),
            TimelineMessage(u"Duration: {}", "duration")
        ]),
    TimelineDefn(
        TimelineTitle("SMS", "fa-comment"),
        DataQueryCatalog(Catalog.CATALOG_COMMS, "telephony.sms_messages",
                         "date", "date_send", "status", "type", "address",
                         "seen", "body"), "date",
        [
            TimelineMessage(u"{} SMS Message from/to {}", "type", "address"),
            TimelineMessage(u"Message Status: {}", "status"),
            TimelineMessage(u"Content:")
        ], [TimelineBox(BoxType.TYPE_TEXTBOX, None, u"{}", "body")]),
    TimelineDefn(
        TimelineTitle("Website Visit", "fa-globe"),
        DataQueryCatalog(Catalog.CATALOG_NETWORKING,
Пример #4
0
 def __init__(self, box_type, box_class, format_string, *item_names):
     self.message = TimelineMessage( format_string, *item_names )
     self.boxtype = box_type
     self.box_class = box_class
Пример #5
0
 def __init__(self, box_type, box_class, format_string, *item_names):
     self.message = TimelineMessage(format_string, *item_names)
     self.boxtype = box_type
     self.box_class = box_class