TruxtonExport
Jump to navigation
Jump to search
This class gives you the capability to export files from Truxton.
Contents
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
1 import truxton
2
3 def main():
4 t = truxton.create()
5
6 exporter = t.newexporter()
7
8 # Limit the number of files exported to 99
9 exporter.addcriteria( exporter.fqlimit, 99 )
10
11 # Make sure the files being exported are at least 4KB
12 exporter.addcriteria( exporter.fqsizeminimum, 4096)
13
14 # We want JPGs, EXIF and GIFs
15 exporter.addcriteria( exporter.fqtype, truxton.Type_JPEG )
16 exporter.addcriteria( exporter.fqtype, truxton.Type_JPEGWithExif)
17 exporter.addcriteria( exporter.fqtype, truxton.Type_GIF)
18
19 # Only output files that have an MD5 starting with E4
20 exporter.addcriteria( exporter.fqhash, "e4" )
21
22
23 exporter.execute()
24
25 if __name__ == "__main__":
26 main()