diff options
| -rw-r--r-- | CHANGELOG.md | 16 | ||||
| -rw-r--r-- | CONTRIBUTING.md | 6 | ||||
| -rw-r--r-- | INSTALL.md | 4 | ||||
| -rw-r--r-- | README.md | 22 | ||||
| -rw-r--r-- | doc/implementation_notes.md | 18 | ||||
| -rw-r--r-- | doc/mat2.1 | 6 | ||||
| -rw-r--r-- | doc/threat_model.md | 24 | ||||
| -rw-r--r-- | libmat2/archive.py | 2 | ||||
| -rw-r--r-- | libmat2/pdf.py | 2 | ||||
| -rw-r--r-- | libmat2/torrent.py | 2 | ||||
| -rwxr-xr-x | mat2 | 8 | ||||
| -rw-r--r-- | nautilus/mat2.py | 2 | ||||
| -rw-r--r-- | tests/test_climat2.py | 4 |
13 files changed, 58 insertions, 58 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 941c0a8..3cd83e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md | |||
| @@ -67,12 +67,12 @@ | |||
| 67 | 67 | ||
| 68 | # 0.3.1 - 2018-09-01 | 68 | # 0.3.1 - 2018-09-01 |
| 69 | 69 | ||
| 70 | - Document how to install MAT2 for various distributions | 70 | - Document how to install mat2 for various distributions |
| 71 | - Fix various typos in the documentation/comments | 71 | - Fix various typos in the documentation/comments |
| 72 | - Add ArchLinux to the CI to ensure that MAT2 is running on it | 72 | - Add ArchLinux to the CI to ensure that mat2 is running on it |
| 73 | - Fix the handling of files with a name ending in `.JPG` | 73 | - Fix the handling of files with a name ending in `.JPG` |
| 74 | - Improve the detection of unsupported extensions in upper-case | 74 | - Improve the detection of unsupported extensions in upper-case |
| 75 | - Streamline MAT2's logging | 75 | - Streamline mat2's logging |
| 76 | 76 | ||
| 77 | 77 | ||
| 78 | # 0.3.0 - 2018-08-03 | 78 | # 0.3.0 - 2018-08-03 |
| @@ -92,14 +92,14 @@ | |||
| 92 | - Simplify various code-paths | 92 | - Simplify various code-paths |
| 93 | - Remove superfluous debug message | 93 | - Remove superfluous debug message |
| 94 | - Remove the `--check` option that never was implemented anyway | 94 | - Remove the `--check` option that never was implemented anyway |
| 95 | - Add a `-c` option to check for MAT2's dependencies | 95 | - Add a `-c` option to check for mat2's dependencies |
| 96 | 96 | ||
| 97 | 97 | ||
| 98 | # 0.1.3 - 2018-07-06 | 98 | # 0.1.3 - 2018-07-06 |
| 99 | 99 | ||
| 100 | - Improve MAT2 resilience against corrupted images | 100 | - Improve mat2 resilience against corrupted images |
| 101 | - Check that the minimal version of Poppler is available | 101 | - Check that the minimal version of Poppler is available |
| 102 | - Simplify how MAT2 deals with office files | 102 | - Simplify how mat2 deals with office files |
| 103 | - Improve cleaning of office files | 103 | - Improve cleaning of office files |
| 104 | - Thumbnails are removed | 104 | - Thumbnails are removed |
| 105 | - Revisions are removed | 105 | - Revisions are removed |
| @@ -111,8 +111,8 @@ | |||
| 111 | - Rename some files to ease the packaging | 111 | - Rename some files to ease the packaging |
| 112 | - Add linters to the CI (mypy, bandit and pyflakes) | 112 | - Add linters to the CI (mypy, bandit and pyflakes) |
| 113 | - Prevent exitftool-related parameters injections | 113 | - Prevent exitftool-related parameters injections |
| 114 | - Improve MAT2's resilience against corrupted files | 114 | - Improve mat2's resilience against corrupted files |
| 115 | - Make MAT2 work on fedora, thanks to @atenart | 115 | - Make mat2 work on fedora, thanks to @atenart |
| 116 | - Tighten the threat model | 116 | - Tighten the threat model |
| 117 | - Simplify and improve how office files are handled | 117 | - Simplify and improve how office files are handled |
| 118 | 118 | ||
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ed8013c..34dfe23 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | # Contributing to MAT2 | 1 | # Contributing to mat2 |
| 2 | 2 | ||
| 3 | The main repository for MAT2 is on [0xacab]( https://0xacab.org/jvoisin/mat2 ), | 3 | The main repository for mat2 is on [0xacab]( https://0xacab.org/jvoisin/mat2 ), |
| 4 | but you can send patches to jvoisin by [email](https://dustri.org/) if you prefer. | 4 | but you can send patches to jvoisin by [email](https://dustri.org/) if you prefer. |
| 5 | 5 | ||
| 6 | Do feel free to pick up [an issue]( https://0xacab.org/jvoisin/mat2/issues ) | 6 | Do feel free to pick up [an issue]( https://0xacab.org/jvoisin/mat2/issues ) |
| @@ -16,7 +16,7 @@ If you're adding a new fileformat, please add tests for: | |||
| 16 | 2. Cleaning metadata | 16 | 2. Cleaning metadata |
| 17 | 3. Raising `ValueError` upon a corrupted file | 17 | 3. Raising `ValueError` upon a corrupted file |
| 18 | 18 | ||
| 19 | Since MAT2 is written in Python3, please conform as much as possible to the | 19 | Since mat2 is written in Python3, please conform as much as possible to the |
| 20 | [pep8]( https://pep8.org/ ) style; except where it makes no sense of course. | 20 | [pep8]( https://pep8.org/ ) style; except where it makes no sense of course. |
| 21 | 21 | ||
| 22 | # Doing a release | 22 | # Doing a release |
| @@ -14,7 +14,7 @@ pip3 install mat2 | |||
| 14 | ## Optional dependencies | 14 | ## Optional dependencies |
| 15 | 15 | ||
| 16 | When [bubblewrap](https://github.com/projectatomic/bubblewrap) is | 16 | When [bubblewrap](https://github.com/projectatomic/bubblewrap) is |
| 17 | installed, MAT2 uses it to sandbox any external processes it invokes. | 17 | installed, mat2 uses it to sandbox any external processes it invokes. |
| 18 | 18 | ||
| 19 | ## Arch Linux | 19 | ## Arch Linux |
| 20 | 20 | ||
| @@ -48,4 +48,4 @@ dnf -y install mat2 mat2-nautilus | |||
| 48 | 48 | ||
| 49 | ## Gentoo | 49 | ## Gentoo |
| 50 | 50 | ||
| 51 | MAT2 is available in the [torbrowser overlay](https://github.com/MeisterP/torbrowser-overlay). | 51 | mat2 is available in the [torbrowser overlay](https://github.com/MeisterP/torbrowser-overlay). |
| @@ -22,10 +22,10 @@ camera was used. Office documents like PDF or Office automatically adds | |||
| 22 | author and company information to documents and spreadsheets. | 22 | author and company information to documents and spreadsheets. |
| 23 | Maybe you don't want to disclose those information. | 23 | Maybe you don't want to disclose those information. |
| 24 | 24 | ||
| 25 | This is precisely the job of MAT2: getting rid, as much as possible, of | 25 | This is precisely the job of mat2: getting rid, as much as possible, of |
| 26 | metadata. | 26 | metadata. |
| 27 | 27 | ||
| 28 | MAT2 provides both a command line tool, and a graphical user interface | 28 | mat2 provides both a command line tool, and a graphical user interface |
| 29 | via an extension for Nautilus, the default file manager of GNOME. | 29 | via an extension for Nautilus, the default file manager of GNOME. |
| 30 | 30 | ||
| 31 | # Requirements | 31 | # Requirements |
| @@ -38,7 +38,7 @@ via an extension for Nautilus, the default file manager of GNOME. | |||
| 38 | - `libimage-exiftool-perl` for everything else | 38 | - `libimage-exiftool-perl` for everything else |
| 39 | - `bubblewrap`, optionally, for sandboxing | 39 | - `bubblewrap`, optionally, for sandboxing |
| 40 | 40 | ||
| 41 | Please note that MAT2 requires at least Python3.5. | 41 | Please note that mat2 requires at least Python3.5. |
| 42 | 42 | ||
| 43 | # Running the test suite | 43 | # Running the test suite |
| 44 | 44 | ||
| @@ -53,7 +53,7 @@ $ python3-coverage run --branch -m unittest discover -s tests/ | |||
| 53 | $ python3-coverage report --include -m --include /libmat2/*' | 53 | $ python3-coverage report --include -m --include /libmat2/*' |
| 54 | ``` | 54 | ``` |
| 55 | 55 | ||
| 56 | # How to use MAT2 | 56 | # How to use mat2 |
| 57 | 57 | ||
| 58 | ```bash | 58 | ```bash |
| 59 | usage: mat2 [-h] [-v] [-l] [--check-dependencies] [-V] | 59 | usage: mat2 [-h] [-v] [-l] [--check-dependencies] [-V] |
| @@ -69,25 +69,25 @@ optional arguments: | |||
| 69 | -h, --help show this help message and exit | 69 | -h, --help show this help message and exit |
| 70 | -v, --version show program's version number and exit | 70 | -v, --version show program's version number and exit |
| 71 | -l, --list list all supported fileformats | 71 | -l, --list list all supported fileformats |
| 72 | --check-dependencies check if MAT2 has all the dependencies it needs | 72 | --check-dependencies check if mat2 has all the dependencies it needs |
| 73 | -V, --verbose show more verbose status information | 73 | -V, --verbose show more verbose status information |
| 74 | --unknown-members policy | 74 | --unknown-members policy |
| 75 | how to handle unknown members of archive-style files | 75 | how to handle unknown members of archive-style files |
| 76 | (policy should be one of: abort, omit, keep) [Default: | 76 | (policy should be one of: abort, omit, keep) [Default: |
| 77 | abort] | 77 | abort] |
| 78 | -s, --show list harmful metadata detectable by MAT2 without | 78 | -s, --show list harmful metadata detectable by mat2 without |
| 79 | removing them | 79 | removing them |
| 80 | -L, --lightweight remove SOME metadata | 80 | -L, --lightweight remove SOME metadata |
| 81 | ``` | 81 | ``` |
| 82 | 82 | ||
| 83 | Note that MAT2 **will not** clean files in-place, but will produce, for | 83 | Note that mat2 **will not** clean files in-place, but will produce, for |
| 84 | example, with a file named "myfile.png" a cleaned version named | 84 | example, with a file named "myfile.png" a cleaned version named |
| 85 | "myfile.cleaned.png". | 85 | "myfile.cleaned.png". |
| 86 | 86 | ||
| 87 | # Notes about detecting metadata | 87 | # Notes about detecting metadata |
| 88 | 88 | ||
| 89 | While MAT2 is doing its very best to display metadata when the `--show` flag is | 89 | While mat2 is doing its very best to display metadata when the `--show` flag is |
| 90 | passed, it doesn't mean that a file is clean from any metadata if MAT2 doesn't | 90 | passed, it doesn't mean that a file is clean from any metadata if mat2 doesn't |
| 91 | show any. There is no reliable way to detect every single possible metadata for | 91 | show any. There is no reliable way to detect every single possible metadata for |
| 92 | complex file formats. | 92 | complex file formats. |
| 93 | 93 | ||
| @@ -138,14 +138,14 @@ You should have received a copy of the GNU Lesser General Public License | |||
| 138 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 138 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 139 | 139 | ||
| 140 | Copyright 2018 Julien (jvoisin) Voisin <julien.voisin+mat2@dustri.org> | 140 | Copyright 2018 Julien (jvoisin) Voisin <julien.voisin+mat2@dustri.org> |
| 141 | Copyright 2016 Marie-Rose for MAT2's logo | 141 | Copyright 2016 Marie-Rose for mat2's logo |
| 142 | 142 | ||
| 143 | The `tests/data/dirty_with_nsid.docx` file is licensed under GPLv3, | 143 | The `tests/data/dirty_with_nsid.docx` file is licensed under GPLv3, |
| 144 | and was borrowed from the Calibre project: https://calibre-ebook.com/downloads/demos/demo.docx | 144 | and was borrowed from the Calibre project: https://calibre-ebook.com/downloads/demos/demo.docx |
| 145 | 145 | ||
| 146 | # Thanks | 146 | # Thanks |
| 147 | 147 | ||
| 148 | MAT2 wouldn't exist without: | 148 | mat2 wouldn't exist without: |
| 149 | 149 | ||
| 150 | - the [Google Summer of Code](https://summerofcode.withgoogle.com/); | 150 | - the [Google Summer of Code](https://summerofcode.withgoogle.com/); |
| 151 | - the fine people from [Tails]( https://tails.boum.org); | 151 | - the fine people from [Tails]( https://tails.boum.org); |
diff --git a/doc/implementation_notes.md b/doc/implementation_notes.md index 7555d2e..e298646 100644 --- a/doc/implementation_notes.md +++ b/doc/implementation_notes.md | |||
| @@ -4,7 +4,7 @@ Implementation notes | |||
| 4 | Lightweight cleaning mode | 4 | Lightweight cleaning mode |
| 5 | ------------------------- | 5 | ------------------------- |
| 6 | 6 | ||
| 7 | Due to *popular* request, MAT2 is providing a *lightweight* cleaning mode, | 7 | Due to *popular* request, mat2 is providing a *lightweight* cleaning mode, |
| 8 | that only cleans the superficial metadata of your file, but not | 8 | that only cleans the superficial metadata of your file, but not |
| 9 | the ones that might be in **embedded** resources. Like for example, | 9 | the ones that might be in **embedded** resources. Like for example, |
| 10 | images in a PDF or an office document. | 10 | images in a PDF or an office document. |
| @@ -19,7 +19,7 @@ are entirely removed. | |||
| 19 | deleted. For example journalists that are editing a document to erase | 19 | deleted. For example journalists that are editing a document to erase |
| 20 | mentions sources mentions. | 20 | mentions sources mentions. |
| 21 | 21 | ||
| 22 | - Or they are aware of it, and will likely not expect MAT2 to be able to keep | 22 | - Or they are aware of it, and will likely not expect mat2 to be able to keep |
| 23 | the revisions, that are basically traces about how, when and who edited the | 23 | the revisions, that are basically traces about how, when and who edited the |
| 24 | document. | 24 | document. |
| 25 | 25 | ||
| @@ -27,15 +27,15 @@ are entirely removed. | |||
| 27 | Race conditions | 27 | Race conditions |
| 28 | --------------- | 28 | --------------- |
| 29 | 29 | ||
| 30 | MAT2 does its very best to avoid crashing at runtime. This is why it's checking | 30 | mat2 does its very best to avoid crashing at runtime. This is why it's checking |
| 31 | if the file is valid __at parser creation__. MAT2 doesn't take any measure to | 31 | if the file is valid __at parser creation__. mat2 doesn't take any measure to |
| 32 | ensure that the file is not changed between the time the parser is | 32 | ensure that the file is not changed between the time the parser is |
| 33 | instantiated, and the call to clean or show the metadata. | 33 | instantiated, and the call to clean or show the metadata. |
| 34 | 34 | ||
| 35 | Symlink attacks | 35 | Symlink attacks |
| 36 | --------------- | 36 | --------------- |
| 37 | 37 | ||
| 38 | MAT2 output predictable filenames (like yourfile.jpg.cleaned). | 38 | mat2 output predictable filenames (like yourfile.jpg.cleaned). |
| 39 | This may lead to symlink attack. Please check if you OS prevent | 39 | This may lead to symlink attack. Please check if you OS prevent |
| 40 | against them | 40 | against them |
| 41 | 41 | ||
| @@ -65,10 +65,10 @@ didn't remove any *deep metadata*, like the ones in embedded pictures. This was | |||
| 65 | on of the reason MAT was abandoned: the absence of satisfying solution to | 65 | on of the reason MAT was abandoned: the absence of satisfying solution to |
| 66 | handle PDF. But apparently, people are ok with [pdf redact | 66 | handle PDF. But apparently, people are ok with [pdf redact |
| 67 | tools](https://github.com/firstlookmedia/pdf-redact-tools), that simply | 67 | tools](https://github.com/firstlookmedia/pdf-redact-tools), that simply |
| 68 | transform the PDF into images. So this is what's MAT2 is doing too. | 68 | transform the PDF into images. So this is what's mat2 is doing too. |
| 69 | 69 | ||
| 70 | Of course, it would be possible to detect images in PDf file, and process them | 70 | Of course, it would be possible to detect images in PDf file, and process them |
| 71 | with MAT2, but since a PDF can contain a lot of things, like images, videos, | 71 | with mat2, but since a PDF can contain a lot of things, like images, videos, |
| 72 | javascript, pdf, blobs, … this is the easiest and safest way to clean them. | 72 | javascript, pdf, blobs, … this is the easiest and safest way to clean them. |
| 73 | 73 | ||
| 74 | Images handling | 74 | Images handling |
| @@ -81,7 +81,7 @@ XML attacks | |||
| 81 | ----------- | 81 | ----------- |
| 82 | 82 | ||
| 83 | Since our threat model conveniently excludes files crafted to specifically | 83 | Since our threat model conveniently excludes files crafted to specifically |
| 84 | bypass MAT2, fileformats containing harmful XML are out of our scope. | 84 | bypass mat2, fileformats containing harmful XML are out of our scope. |
| 85 | But since MAT2 is using [etree](https://docs.python.org/3/library/xml.html#xml-vulnerabilities) | 85 | But since mat2 is using [etree](https://docs.python.org/3/library/xml.html#xml-vulnerabilities) |
| 86 | to process XML, it's "only" vulnerable to DoS, and not memory corruption: | 86 | to process XML, it's "only" vulnerable to DoS, and not memory corruption: |
| 87 | odds are that the user will notice that the cleaning didn't succeed. | 87 | odds are that the user will notice that the cleaning didn't succeed. |
| @@ -1,4 +1,4 @@ | |||
| 1 | .TH MAT2 "1" "May 2019" "MAT2 0.9.0" "User Commands" | 1 | .TH mat2 "1" "May 2019" "mat2 0.9.0" "User Commands" |
| 2 | 2 | ||
| 3 | .SH NAME | 3 | .SH NAME |
| 4 | mat2 \- the metadata anonymisation toolkit 2 | 4 | mat2 \- the metadata anonymisation toolkit 2 |
| @@ -32,7 +32,7 @@ show program's version number and exit | |||
| 32 | list all supported fileformats | 32 | list all supported fileformats |
| 33 | .TP | 33 | .TP |
| 34 | \fB\-\-check\-dependencies\fR | 34 | \fB\-\-check\-dependencies\fR |
| 35 | check if MAT2 has all the dependencies it needs | 35 | check if mat2 has all the dependencies it needs |
| 36 | .TP | 36 | .TP |
| 37 | \fB\-V\fR, \fB\-\-verbose\fR | 37 | \fB\-V\fR, \fB\-\-verbose\fR |
| 38 | show more verbose status information | 38 | show more verbose status information |
| @@ -41,7 +41,7 @@ show more verbose status information | |||
| 41 | how to handle unknown members of archive-style files (policy should be one of: abort, omit, keep) | 41 | how to handle unknown members of archive-style files (policy should be one of: abort, omit, keep) |
| 42 | .TP | 42 | .TP |
| 43 | \fB\-s\fR, \fB\-\-show\fR | 43 | \fB\-s\fR, \fB\-\-show\fR |
| 44 | list harmful metadata detectable by MAT2 without | 44 | list harmful metadata detectable by mat2 without |
| 45 | removing them | 45 | removing them |
| 46 | .TP | 46 | .TP |
| 47 | \fB\-L\fR, \fB\-\-lightweight\fR | 47 | \fB\-L\fR, \fB\-\-lightweight\fR |
diff --git a/doc/threat_model.md b/doc/threat_model.md index 31bfe91..8b97c67 100644 --- a/doc/threat_model.md +++ b/doc/threat_model.md | |||
| @@ -3,7 +3,7 @@ Threat Model | |||
| 3 | 3 | ||
| 4 | The Metadata Anonymisation Toolkit 2 adversary has a number | 4 | The Metadata Anonymisation Toolkit 2 adversary has a number |
| 5 | of goals, capabilities, and counter-attack types that can be | 5 | of goals, capabilities, and counter-attack types that can be |
| 6 | used to guide us towards a set of requirements for the MAT2. | 6 | used to guide us towards a set of requirements for the mat2. |
| 7 | 7 | ||
| 8 | This is an overhaul of MAT's (the first iteration of the software) one. | 8 | This is an overhaul of MAT's (the first iteration of the software) one. |
| 9 | 9 | ||
| @@ -53,7 +53,7 @@ Adversary | |||
| 53 | user. This is the strongest position for the adversary to | 53 | user. This is the strongest position for the adversary to |
| 54 | have. In this case, the adversary is capable of inserting | 54 | have. In this case, the adversary is capable of inserting |
| 55 | arbitrary, custom watermarks specifically for tracking | 55 | arbitrary, custom watermarks specifically for tracking |
| 56 | the user. In general, MAT2 cannot defend against this | 56 | the user. In general, mat2 cannot defend against this |
| 57 | adversary, but we list it for completeness' sake. | 57 | adversary, but we list it for completeness' sake. |
| 58 | 58 | ||
| 59 | - The adversary created the document for a group of users. | 59 | - The adversary created the document for a group of users. |
| @@ -65,7 +65,7 @@ Adversary | |||
| 65 | - The adversary did not create the document, the weakest | 65 | - The adversary did not create the document, the weakest |
| 66 | position for the adversary to have. The file format is | 66 | position for the adversary to have. The file format is |
| 67 | (most of the time) standard, nothing custom is added: | 67 | (most of the time) standard, nothing custom is added: |
| 68 | MAT2 must be able to remove all metadata from the file. | 68 | mat2 must be able to remove all metadata from the file. |
| 69 | 69 | ||
| 70 | 70 | ||
| 71 | Requirements | 71 | Requirements |
| @@ -73,28 +73,28 @@ Requirements | |||
| 73 | 73 | ||
| 74 | * Processing | 74 | * Processing |
| 75 | 75 | ||
| 76 | - MAT2 *should* avoid interactions with information. | 76 | - mat2 *should* avoid interactions with information. |
| 77 | Its goal is to remove metadata, and the user is solely | 77 | Its goal is to remove metadata, and the user is solely |
| 78 | responsible for the information of the file. | 78 | responsible for the information of the file. |
| 79 | 79 | ||
| 80 | - MAT2 *must* warn when encountering an unknown | 80 | - mat2 *must* warn when encountering an unknown |
| 81 | format. For example, in a zipfile, if MAT2 encounters an | 81 | format. For example, in a zipfile, if mat2 encounters an |
| 82 | unknown format, it should warn the user, and ask if the | 82 | unknown format, it should warn the user, and ask if the |
| 83 | file should be added to the anonymised archive that is | 83 | file should be added to the anonymised archive that is |
| 84 | produced. | 84 | produced. |
| 85 | 85 | ||
| 86 | - MAT2 *must* not add metadata, since its purpose is to | 86 | - mat2 *must* not add metadata, since its purpose is to |
| 87 | anonymise files: every added items of metadata decreases | 87 | anonymise files: every added items of metadata decreases |
| 88 | anonymity. | 88 | anonymity. |
| 89 | 89 | ||
| 90 | - MAT2 *should* handle unknown/hidden metadata fields, | 90 | - mat2 *should* handle unknown/hidden metadata fields, |
| 91 | like proprietary extensions of open formats. | 91 | like proprietary extensions of open formats. |
| 92 | 92 | ||
| 93 | - MAT2 *must not* fail silently. Upon failure, | 93 | - mat2 *must not* fail silently. Upon failure, |
| 94 | MAT2 *must not* modify the file in any way. | 94 | mat2 *must not* modify the file in any way. |
| 95 | 95 | ||
| 96 | - MAT2 *might* leak the fact that MAT2 was used on the file, | 96 | - mat2 *might* leak the fact that mat2 was used on the file, |
| 97 | since it might be uncommon for some file formats to come | 97 | since it might be uncommon for some file formats to come |
| 98 | without any kind of metadata, an adversary might suspect that | 98 | without any kind of metadata, an adversary might suspect that |
| 99 | the user used MAT2 on certain files. | 99 | the user used mat2 on certain files. |
| 100 | 100 | ||
diff --git a/libmat2/archive.py b/libmat2/archive.py index e715fb1..de80a35 100644 --- a/libmat2/archive.py +++ b/libmat2/archive.py | |||
| @@ -52,7 +52,7 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser): | |||
| 52 | self.member_class = None # type: ignore | 52 | self.member_class = None # type: ignore |
| 53 | 53 | ||
| 54 | # Those are the files that have a format that _isn't_ | 54 | # Those are the files that have a format that _isn't_ |
| 55 | # supported by MAT2, but that we want to keep anyway. | 55 | # supported by mat2, but that we want to keep anyway. |
| 56 | self.files_to_keep = set() # type: Set[Pattern] | 56 | self.files_to_keep = set() # type: Set[Pattern] |
| 57 | 57 | ||
| 58 | # Those are the files that we _do not_ want to keep, | 58 | # Those are the files that we _do not_ want to keep, |
diff --git a/libmat2/pdf.py b/libmat2/pdf.py index b9f7c99..547e071 100644 --- a/libmat2/pdf.py +++ b/libmat2/pdf.py | |||
| @@ -19,7 +19,7 @@ from . import abstract | |||
| 19 | 19 | ||
| 20 | poppler_version = Poppler.get_version() | 20 | poppler_version = Poppler.get_version() |
| 21 | if LooseVersion(poppler_version) < LooseVersion('0.46'): # pragma: no cover | 21 | if LooseVersion(poppler_version) < LooseVersion('0.46'): # pragma: no cover |
| 22 | raise ValueError("MAT2 needs at least Poppler version 0.46 to work. \ | 22 | raise ValueError("mat2 needs at least Poppler version 0.46 to work. \ |
| 23 | The installed version is %s." % poppler_version) # pragma: no cover | 23 | The installed version is %s." % poppler_version) # pragma: no cover |
| 24 | 24 | ||
| 25 | 25 | ||
diff --git a/libmat2/torrent.py b/libmat2/torrent.py index e2c82b7..1a82740 100644 --- a/libmat2/torrent.py +++ b/libmat2/torrent.py | |||
| @@ -36,7 +36,7 @@ class TorrentParser(abstract.AbstractParser): | |||
| 36 | class _BencodeHandler: | 36 | class _BencodeHandler: |
| 37 | """ | 37 | """ |
| 38 | Since bencode isn't that hard to parse, | 38 | Since bencode isn't that hard to parse, |
| 39 | MAT2 comes with its own parser, based on the spec | 39 | mat2 comes with its own parser, based on the spec |
| 40 | https://wiki.theory.org/index.php/BitTorrentSpecification#Bencoding | 40 | https://wiki.theory.org/index.php/BitTorrentSpecification#Bencoding |
| 41 | """ | 41 | """ |
| 42 | def __init__(self): | 42 | def __init__(self): |
| @@ -63,19 +63,19 @@ def create_arg_parser() -> argparse.ArgumentParser: | |||
| 63 | excl_group.add_argument('files', nargs='*', help='the files to process', | 63 | excl_group.add_argument('files', nargs='*', help='the files to process', |
| 64 | default=[]) | 64 | default=[]) |
| 65 | excl_group.add_argument('-v', '--version', action='version', | 65 | excl_group.add_argument('-v', '--version', action='version', |
| 66 | version='MAT2 %s' % __version__) | 66 | version='mat2 %s' % __version__) |
| 67 | excl_group.add_argument('-l', '--list', action='store_true', default=False, | 67 | excl_group.add_argument('-l', '--list', action='store_true', default=False, |
| 68 | help='list all supported fileformats') | 68 | help='list all supported fileformats') |
| 69 | excl_group.add_argument('--check-dependencies', action='store_true', | 69 | excl_group.add_argument('--check-dependencies', action='store_true', |
| 70 | default=False, | 70 | default=False, |
| 71 | help='check if MAT2 has all the dependencies it ' | 71 | help='check if mat2 has all the dependencies it ' |
| 72 | 'needs') | 72 | 'needs') |
| 73 | 73 | ||
| 74 | excl_group = parser.add_mutually_exclusive_group() | 74 | excl_group = parser.add_mutually_exclusive_group() |
| 75 | excl_group.add_argument('-L', '--lightweight', action='store_true', | 75 | excl_group.add_argument('-L', '--lightweight', action='store_true', |
| 76 | help='remove SOME metadata') | 76 | help='remove SOME metadata') |
| 77 | excl_group.add_argument('-s', '--show', action='store_true', | 77 | excl_group.add_argument('-s', '--show', action='store_true', |
| 78 | help='list harmful metadata detectable by MAT2 ' | 78 | help='list harmful metadata detectable by mat2 ' |
| 79 | 'without removing them') | 79 | 'without removing them') |
| 80 | 80 | ||
| 81 | return parser | 81 | return parser |
| @@ -190,7 +190,7 @@ def main() -> int: | |||
| 190 | show_parsers() | 190 | show_parsers() |
| 191 | return 0 | 191 | return 0 |
| 192 | elif args.check_dependencies: | 192 | elif args.check_dependencies: |
| 193 | print("Dependencies for MAT2 %s:" % __version__) | 193 | print("Dependencies for mat2 %s:" % __version__) |
| 194 | for key, value in sorted(check_dependencies().items()): | 194 | for key, value in sorted(check_dependencies().items()): |
| 195 | print('- %s: %s %s' % (key, 'yes' if value['found'] else 'no', | 195 | print('- %s: %s %s' % (key, 'yes' if value['found'] else 'no', |
| 196 | '(optional)' if not value['required'] else '')) | 196 | '(optional)' if not value['required'] else '')) |
diff --git a/nautilus/mat2.py b/nautilus/mat2.py index d476d55..fdba725 100644 --- a/nautilus/mat2.py +++ b/nautilus/mat2.py | |||
| @@ -235,7 +235,7 @@ class Mat2Extension(GObject.GObject, Nautilus.MenuProvider, Nautilus.LocationWid | |||
| 235 | return None | 235 | return None |
| 236 | 236 | ||
| 237 | item = Nautilus.MenuItem( | 237 | item = Nautilus.MenuItem( |
| 238 | name="MAT2::Remove_metadata", | 238 | name="mat2::Remove_metadata", |
| 239 | label="Remove metadata", | 239 | label="Remove metadata", |
| 240 | tip="Remove metadata" | 240 | tip="Remove metadata" |
| 241 | ) | 241 | ) |
diff --git a/tests/test_climat2.py b/tests/test_climat2.py index da790d0..8ab7cbd 100644 --- a/tests/test_climat2.py +++ b/tests/test_climat2.py | |||
| @@ -40,14 +40,14 @@ class TestVersion(unittest.TestCase): | |||
| 40 | def test_version(self): | 40 | def test_version(self): |
| 41 | proc = subprocess.Popen(mat2_binary + ['--version'], stdout=subprocess.PIPE) | 41 | proc = subprocess.Popen(mat2_binary + ['--version'], stdout=subprocess.PIPE) |
| 42 | stdout, _ = proc.communicate() | 42 | stdout, _ = proc.communicate() |
| 43 | self.assertTrue(stdout.startswith(b'MAT2 ')) | 43 | self.assertTrue(stdout.startswith(b'mat2 ')) |
| 44 | 44 | ||
| 45 | 45 | ||
| 46 | class TestDependencies(unittest.TestCase): | 46 | class TestDependencies(unittest.TestCase): |
| 47 | def test_dependencies(self): | 47 | def test_dependencies(self): |
| 48 | proc = subprocess.Popen(mat2_binary + ['--check-dependencies'], stdout=subprocess.PIPE) | 48 | proc = subprocess.Popen(mat2_binary + ['--check-dependencies'], stdout=subprocess.PIPE) |
| 49 | stdout, _ = proc.communicate() | 49 | stdout, _ = proc.communicate() |
| 50 | self.assertTrue(b'MAT2' in stdout) | 50 | self.assertTrue(b'mat2' in stdout) |
| 51 | 51 | ||
| 52 | 52 | ||
| 53 | class TestReturnValue(unittest.TestCase): | 53 | class TestReturnValue(unittest.TestCase): |
