diff options
| author | jvoisin | 2013-04-29 23:23:07 +0200 |
|---|---|---|
| committer | jvoisin | 2013-04-29 23:23:07 +0200 |
| commit | fee6adf444e1fc5fe606e059c57e9b534c082e70 (patch) | |
| tree | 4e90480151d78e5c2d956b9a3b5429227e1dc817 /MAT | |
| parent | ac82b5fb712cbc0c80d4f6fb7c11bae70eea78e5 (diff) | |
| parent | f5f1f9b0087a7fe535cc0f0072182f49d39619b2 (diff) | |
Merge branch 'glade'
Diffstat (limited to 'MAT')
| -rw-r--r-- | MAT/FORMATS | 117 | ||||
| -rw-r--r-- | MAT/mat.py | 15 |
2 files changed, 7 insertions, 125 deletions
diff --git a/MAT/FORMATS b/MAT/FORMATS deleted file mode 100644 index 3f0751c..0000000 --- a/MAT/FORMATS +++ /dev/null | |||
| @@ -1,117 +0,0 @@ | |||
| 1 | <xml> | ||
| 2 | <format> | ||
| 3 | <name>Portable Network Graphics</name> | ||
| 4 | <extension>.png</extension> | ||
| 5 | <mimetype>image/png</mimetype> | ||
| 6 | <support>full</support> | ||
| 7 | <metadata>textual metadata + date</metadata> | ||
| 8 | <method>removal of harmful fields is done with hachoir</method> | ||
| 9 | </format> | ||
| 10 | |||
| 11 | <format> | ||
| 12 | <name>Jpeg</name> | ||
| 13 | <extension>.jpeg, .jpg</extension> | ||
| 14 | <mimetype>image/jpeg</mimetype> | ||
| 15 | <support>partial</support> | ||
| 16 | <metadata>comment + exif/photoshop/adobe</metadata> | ||
| 17 | <method>removal of harmful fields is done with hachoir</method> | ||
| 18 | <remaining>Canon Raw tags : | ||
| 19 | http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/CanonRaw.html | ||
| 20 | </remaining> | ||
| 21 | </format> | ||
| 22 | |||
| 23 | <format> | ||
| 24 | <name>Open Document</name> | ||
| 25 | <extension>.odt, .odx, .ods, ...</extension> | ||
| 26 | <mimetype>application/opendocument</mimetype> | ||
| 27 | <support>full</support> | ||
| 28 | <metadata>a meta.xml file</metadata> | ||
| 29 | <method>removal of the meta.xml file</method> | ||
| 30 | </format> | ||
| 31 | |||
| 32 | <format> | ||
| 33 | <name>Office Openxml</name> | ||
| 34 | <extension>.docx, .pptx, .xlsx, ...</extension> | ||
| 35 | <mimetype>application/officeopenxml</mimetype> | ||
| 36 | <support>full</support> | ||
| 37 | <metadata>a docProps folder containings xml metadata files</metadata> | ||
| 38 | <method>removal of the docProps folder</method> | ||
| 39 | </format> | ||
| 40 | |||
| 41 | <format> | ||
| 42 | <name>Portable Document Fileformat</name> | ||
| 43 | <extension>.pdf</extension> | ||
| 44 | <mimetype>application/pdf</mimetype> | ||
| 45 | <support>full</support> | ||
| 46 | <metadata>a lot</metadata> | ||
| 47 | <method> rendering of the PDF file on a cairo surface with the help of | ||
| 48 | poppler in order to remove all the internal metadata. | ||
| 49 | For now, cairo create some metadata. | ||
| 50 | They can be remove if you install either exiftool, or python-pdfrw. | ||
| 51 | The next version of python-cairo will support PDF metadata. | ||
| 52 | </method> | ||
| 53 | </format> | ||
| 54 | |||
| 55 | <format> | ||
| 56 | <name>Tape ARchive</name> | ||
| 57 | <extension>.tar, .tar.bz2, .tar.gz</extension> | ||
| 58 | <mimetype>application/x-tar, application/x-gzip, application/x-bzip2</mimetype> | ||
| 59 | <support>full</support> | ||
| 60 | <metadata>metadata from the file itself, metadata from the file contained | ||
| 61 | into the archive, and metadata added by tar to the file at then | ||
| 62 | creation of the archive</metadata> | ||
| 63 | <method>extraction of each file, treatement of the file, add treated file | ||
| 64 | to a new archive, right before the add, remove the metadata added by tar | ||
| 65 | itself. When the new archive is complete, remove all his metadata.</method> | ||
| 66 | </format> | ||
| 67 | |||
| 68 | <format> | ||
| 69 | <name>Zip</name> | ||
| 70 | <extension>.zip</extension> | ||
| 71 | <mimetype>application/zip</mimetype> | ||
| 72 | <support>partial</support> | ||
| 73 | <metadata>metadata from the file itself, metadata from the file contained | ||
| 74 | into the archive, and metadata added by zip to the file when added to | ||
| 75 | the archive.</metadata> | ||
| 76 | <method>extraction of each file, treatement of the file, add treated file | ||
| 77 | to a new archive. When the new archive is complete, remove all his metadata</method> | ||
| 78 | <remaining>metadata added by zip itself to internal files</remaining> | ||
| 79 | </format> | ||
| 80 | |||
| 81 | <format> | ||
| 82 | <name>MPEG Audio</name> | ||
| 83 | <extension>.mp3, .mp2, .mp1, .mpa</extension> | ||
| 84 | <mimetype>audio/mpeg</mimetype> | ||
| 85 | <support>full</support> | ||
| 86 | <metadata>id3</metadata> | ||
| 87 | <method>removal of harmful fields is done with hachoir</method> | ||
| 88 | </format> | ||
| 89 | |||
| 90 | <format> | ||
| 91 | <name>Ogg Vorbis</name> | ||
| 92 | <extension>.ogg</extension> | ||
| 93 | <mimetype>audio/vorbis</mimetype> | ||
| 94 | <support>full</support> | ||
| 95 | <metadata>Vorbis</metadata> | ||
| 96 | <method>removal of harmful fields is done with mutagen</method> | ||
| 97 | </format> | ||
| 98 | |||
| 99 | <format> | ||
| 100 | <name>Free Lossless Audio Codec</name> | ||
| 101 | <extension>.flac</extension> | ||
| 102 | <mimetype>audio/x-flac</mimetype> | ||
| 103 | <support>full</support> | ||
| 104 | <metadata>Flac, Vorbis</metadata> | ||
| 105 | <method>removal of harmful fields is done with mutagen</method> | ||
| 106 | </format> | ||
| 107 | |||
| 108 | <format> | ||
| 109 | <name>Torrent</name> | ||
| 110 | <extension>.torrent</extension> | ||
| 111 | <mimetype>application/torrent</mimetype> | ||
| 112 | <support>full</support> | ||
| 113 | <metadata>torrent</metadata> | ||
| 114 | <method>remove all the compromizing metadata with a heavily tuned version | ||
| 115 | of the bencode lib by Petru Paled</method> | ||
| 116 | </format> | ||
| 117 | </xml> | ||
| @@ -39,14 +39,13 @@ def get_logo(): | |||
| 39 | elif os.path.isfile('/usr/local/share/pixmaps/mat.png'): | 39 | elif os.path.isfile('/usr/local/share/pixmaps/mat.png'): |
| 40 | return '/usr/local/share/pixmaps/mat.png' | 40 | return '/usr/local/share/pixmaps/mat.png' |
| 41 | 41 | ||
| 42 | def get_formats(): | 42 | def get_datadir(): |
| 43 | if os.path.isfile('./data/FORMATS'): | 43 | if os.path.isdir('./data/'): |
| 44 | return './data/FORMATS' | 44 | return './data/' |
| 45 | elif os.path.isfile('/usr/share/mat/FORMATS'): | 45 | elif os.path.isdir('/usr/share/mat/'): |
| 46 | return '/usr/share/mat/FORMATS' | 46 | return '/usr/share/mat/' |
| 47 | elif os.path.isfile('/usr/local/share/mat/FORMATS'): | 47 | elif os.path.isdir('/usr/local/share/mat/'): |
| 48 | return '/usr/local/share/mat/FORMATS' | 48 | return '/usr/local/share/mat/' |
| 49 | |||
| 50 | 49 | ||
| 51 | class XMLParser(xml.sax.handler.ContentHandler): | 50 | class XMLParser(xml.sax.handler.ContentHandler): |
| 52 | ''' | 51 | ''' |
