Difference between revisions of "TruxtonFileIO tag"

From truxwiki.com
Jump to navigation Jump to search
(Created page with "This creates a tag associated with this file in Truxton. =Syntax= <syntaxhighlight lang="Python"> bool tag(tag, reason); </syntaxhighlight> =Return value= [https://docs.pyth...")
 
Line 3: Line 3:
 
=Syntax=
 
=Syntax=
 
<syntaxhighlight lang="Python">
 
<syntaxhighlight lang="Python">
bool tag(tag, reason);
+
bool tag(tag, reason, origin);
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 18: Line 18:
 
   file = t.getfileid("5ec2a123-74d6-5da7-0653-4e6800000000")
 
   file = t.getfileid("5ec2a123-74d6-5da7-0653-4e6800000000")
  
   file.tag("Bomb", "Contains references to TNT")
+
   file.tag("Bomb", "Contains references to TNT", truxton.TAG_ORIGIN_HUMAN)
  
 
if __name__ == "__main__":
 
if __name__ == "__main__":
 
   main()
 
   main()
 
</syntaxhighlight>
 
</syntaxhighlight>

Revision as of 05:47, 28 May 2020

This creates a tag associated with this file in Truxton.

Syntax

bool tag(tag, reason, origin);

Return value

True if the tag was associated with the file, False on failure.

Sample

import truxton

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

  file.tag("Bomb", "Contains references to TNT", truxton.TAG_ORIGIN_HUMAN)

if __name__ == "__main__":
  main()