Difference between revisions of "TruxtonFileIO newcommunication"
Jump to navigation
Jump to search
(Created page with "This create new communication object from a file in Truxton. It automatically associates the parent file and media identifiers used in the <code>Messa...") |
(→Sample) |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
This create new [[TruxtonCommunication|communication]] object from a file in Truxton. | This create new [[TruxtonCommunication|communication]] object from a file in Truxton. | ||
| − | It automatically associates the parent file and media identifiers used in the <code>Message</code> table. | + | It automatically associates the parent file and media identifiers used in the <code>[Message]</code> table. |
=Syntax= | =Syntax= | ||
| Line 11: | Line 11: | ||
=Sample= | =Sample= | ||
| − | + | <source lang="Python" highlight="5"> | |
| − | < | ||
def main(): | def main(): | ||
t = truxton.create() | t = truxton.create() | ||
| Line 31: | Line 30: | ||
if __name__ == "__main__": | if __name__ == "__main__": | ||
| − | main() | + | sys.exit(main()) |
| − | </ | + | </source> |
Latest revision as of 09:03, 3 February 2024
This create new communication object from a file in Truxton.
It automatically associates the parent file and media identifiers used in the [Message] table.
Syntax
object newcommunication();
Return value
An communication object
Sample
def main():
t = truxton.create()
file = t.getfileid("5ec2a123-74d6-5da7-0653-4e6800000000")
communication = file.newcommunication()
communication.sent = ticks("2015-08-16T21:31:37-00:00");
communication.received = communication.sent
communication.subject = "Dinner at 8?"
communication.type = truxton.MESSAGE_TYPE_SMS
communication.save()
communication.addparticipant("703.555.1212", truxton.MESSAGE_PARTICIPANT_FROM)
communication.addparticipant("202.555.1212", truxton.MESSAGE_PARTICIPANT_TO)
communication.finished()
if __name__ == "__main__":
sys.exit(main())