Difference between revisions of "TruxtonFileIO tag"
Jump to navigation
Jump to search
| (2 intermediate revisions by the same user not shown) | |||
| Line 10: | Line 10: | ||
==<code>tag</code>== | ==<code>tag</code>== | ||
This string is the bit of text that will appear in the Analyst desktop. | This string is the bit of text that will appear in the Analyst desktop. | ||
| − | It must have first been created using the <code>[[TruxtonObject#createtag.28name.2C_description.29|createtag()]]</code> function. | + | It must have first been created using the <code>[[TruxtonObject#createtag.28name:_str.2C_description:_str.29|createtag()]]</code> function. |
==<code>reason</code>== | ==<code>reason</code>== | ||
| Line 23: | Line 23: | ||
=Remarks= | =Remarks= | ||
| − | In order for the tag to be visible in the Analyst desktop, the <code>tag</code> must first have been created using the <code>[[TruxtonObject#createtag.28name.2C_description.29|createtag()]]</code> function. | + | In order for the tag to be visible in the Analyst desktop, the <code>tag</code> must first have been created using the <code>[[TruxtonObject#createtag.28name:_str.2C_description:_str.29|createtag()]]</code> function. |
=Sample= | =Sample= | ||
| Line 36: | Line 36: | ||
if __name__ == "__main__": | if __name__ == "__main__": | ||
| − | main() | + | sys.exit(main()) |
</source> | </source> | ||
Latest revision as of 10:07, 3 February 2024
This creates a tag associated with this file in Truxton.
It will result in a record being added to the [Tagged] table.
Syntax
bool tag( tag, reason, origin );
Parameters
tag
This string is the bit of text that will appear in the Analyst desktop.
It must have first been created using the createtag() function.
reason
A description of why this tag is being applied to the file.
origin
This tells the analyst whether a human or an algorithm tagged this file.
TAG_ORIGIN_AUTOMATIC (1) means that an algorithm tagged the file while TAG_ORIGIN_HUMAN (2) means the tag is the result of a human making a decision.
Return value
True if the tag was associated with the file, False on failure.
Remarks
In order for the tag to be visible in the Analyst desktop, the tag must first have been created using the createtag() function.
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__":
sys.exit(main())