TruxtonExport

From truxwiki.com
Revision as of 09:01, 2 December 2020 by Sam (talk | contribs) (Created page with "This class gives you the capability to export files from Truxton. =Attributes and Methods= ==<code>addcriteria(field, value)</code>== Adds criteria to the selection of files...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This class gives you the capability to export files from Truxton.

Attributes and Methods

addcriteria(field, value)

Adds criteria to the selection of files to export.

addoption(field, value)

Sets one of the output options.

execute()

After the criteria and options have been set, this function will perform the task of exporting the files from Truxton.

where

Holds the SQL WHERE clause based on the current criteria.

Sample

import truxton

def main():
  t = truxton.create()

  exporter = t.newfilexporter()

  file_type.parentid = truxton.Type_XML
  file_type.shortname = "MyType"
  file_type.longname = "A custom file type derived from XML for demo purposes"
  file_type.extension = "xm2"
  file_type.mimetype = "text/xml"

  file_type.save()

  print( "ID is " + str(file_type.id))

if __name__ == "__main__":
  main()