TruxtonFileIO newevent

From truxwiki.com
Revision as of 13:52, 21 May 2020 by Sam (talk | contribs) (Created page with "This create new event from a file in Truxton. It automatically associates the parent file and media identifiers used in the Event table. =Syntax= <syntaxhig...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This create new event from a file in Truxton. It automatically associates the parent file and media identifiers used in the Event table.

Syntax

object newevent();

Return value

An event object

Sample

import truxton

def main():
  t = truxton.create()
  file = t.getfileid("5ec2a123-74d6-5da7-0653-4e6800000000")

  event = file.newevent()

  event.type = EVENT_TYPE_ADDED_BY_ANALYST
  child.origin = truxton.ORIGIN_GENERATED
  child.write("Hello Truxton World")
  if child.save() is True:
    print( "New child saved as id " + child.id)

if __name__ == "__main__":
  main()