[Pkg-privacy-commits] [Git][pkg-privacy-team/mat2][master] 6 commits: New upstream version 0.13.4
Georg Faerber (@georg)
georg at debian.org
Thu Aug 3 15:22:44 BST 2023
Georg Faerber pushed to branch master at Privacy Maintainers / mat2
Commits:
5ff0e54a by Georg Faerber at 2023-08-03T13:24:25+00:00
New upstream version 0.13.4
- - - - -
07655647 by Georg Faerber at 2023-08-03T13:24:31+00:00
Update upstream source from tag 'upstream/0.13.4'
Update to upstream version '0.13.4'
with Debian dir 07e43c6e5b7dbdbb43ae9e07f1271e072e06f415
- - - - -
4127306f by Georg Faerber at 2023-08-03T13:30:15+00:00
debian/control: Drop obsolete transitional package mat
- - - - -
f7c2d1fe by Georg Faerber at 2023-08-03T13:51:20+00:00
debian/mat2.install: Drop obsolete /usr/bin/mat2
- - - - -
9b88d366 by Georg Faerber at 2023-08-03T13:51:20+00:00
debian/patches: Drop obsolete patch to include version in pyproject
- - - - -
f6b79470 by Georg Faerber at 2023-08-03T13:51:20+00:00
debian/changelog: Debian release 0.13.4-1
- - - - -
27 changed files:
- .gitlab-ci.yml
- CHANGELOG.md
- CONTRIBUTING.md
- INSTALL.md
- README.md
- debian/changelog
- debian/control
- debian/mat2.install
- − debian/patches/0001-pyproject-include-version.patch
- − debian/patches/series
- doc/mat2.1
- libmat2/__init__.py
- libmat2/abstract.py
- libmat2/archive.py
- libmat2/audio.py
- libmat2/exiftool.py
- libmat2/harmless.py
- libmat2/images.py
- libmat2/office.py
- libmat2/parser_factory.py
- libmat2/video.py
- libmat2/web.py
- mat2
- pyproject.toml
- setup.py
- tests/test_libmat2.py
- − utils/ci/codespell/ignored_words.txt
Changes:
=====================================
.gitlab-ci.yml
=====================================
@@ -1,5 +1,7 @@
variables:
CONTAINER_REGISTRY: $CI_REGISTRY/georg/mat2-ci-images
+ GIT_DEPTH: "5"
+ GIT_STRATEGY: clone
stages:
- linting
@@ -11,6 +13,7 @@ stages:
- chown -R mat2 .
linting:ruff:
+ image: $CONTAINER_REGISTRY:linting
stage: linting
script:
- apt update
@@ -62,3 +65,33 @@ tests:gentoo:
<<: *prepare_env
script:
- su - mat2 -c "python3 -m unittest discover -v"
+
+tests:python3.7:
+ image: $CONTAINER_REGISTRY:python3.7
+ stage: test
+ script:
+ - python3 -m unittest discover -v
+
+tests:python3.8:
+ image: $CONTAINER_REGISTRY:python3.8
+ stage: test
+ script:
+ - python3 -m unittest discover -v
+
+tests:python3.9:
+ image: $CONTAINER_REGISTRY:python3.9
+ stage: test
+ script:
+ - python3 -m unittest discover -v
+
+tests:python3.10:
+ image: $CONTAINER_REGISTRY:python3.10
+ stage: test
+ script:
+ - python3 -m unittest discover -v
+
+tests:python3.11:
+ image: $CONTAINER_REGISTRY:python3.11
+ stage: test
+ script:
+ - python3 -m unittest discover -v
=====================================
CHANGELOG.md
=====================================
@@ -1,3 +1,12 @@
+# 0.13.4 - 2023-08-02
+
+- Add documentation about mat2 on OSX
+- Make use of python3.7 constructs to simplify code
+- Use moderner type annotations
+- Harden get_meta in archive.py against variants of CVE-2022-35410
+- Improve MSOffice document support
+- Package the manpage on pypi
+
# 0.13.3 - 2023-02-23
- Fix a decorator argument
=====================================
CONTRIBUTING.md
=====================================
@@ -30,15 +30,16 @@ Since mat2 is written in Python3, please conform as much as possible to the
1. Update the [changelog](https://0xacab.org/jvoisin/mat2/blob/master/CHANGELOG.md)
2. Update the version in the [mat2](https://0xacab.org/jvoisin/mat2/blob/master/mat2) file
3. Update the version in the [setup.py](https://0xacab.org/jvoisin/mat2/blob/master/setup.py) file
-4. Update the version and date in the [man page](https://0xacab.org/jvoisin/mat2/blob/master/doc/mat2.1)
-5. Commit the changelog, man page, mat2 and setup.py files
-6. Create a tag with `git tag -s $VERSION`
-7. Push the commit with `git push origin master`
-8. Push the tag with `git push --tags`
-9. Download the gitlab archive of the release
-10. Diff it against the local copy
-11. If there is no difference, sign the archive with `gpg --armor --detach-sign mat2-$VERSION.tar.xz`
-12. Upload the signature on Gitlab's [tag page](https://0xacab.org/jvoisin/mat2/tags) and add the changelog there
-13. Announce the release on the [mailing list](https://mailman.boum.org/listinfo/mat-dev)
-14. Sign'n'upload the new version on pypi with `python3 setup.py sdist bdist_wheel` then `twine upload -s dist/*`
-15. Do the secret release dance
+4. Update the version in the [pyproject.toml](https://0xacab.org/jvoisin/mat2/blob/master/yproject.toml) file
+5. Update the version and date in the [man page](https://0xacab.org/jvoisin/mat2/blob/master/doc/mat2.1)
+6. Commit the modified files
+7. Create a tag with `git tag -s $VERSION`
+8. Push the commit with `git push origin master`
+9. Push the tag with `git push --tags`
+10. Download the gitlab archive of the release
+11. Diff it against the local copy
+12. If there is no difference, sign the archive with `gpg --armor --detach-sign mat2-$VERSION.tar.xz`
+13. Upload the signature on Gitlab's [tag page](https://0xacab.org/jvoisin/mat2/tags) and add the changelog there
+14. Announce the release on the [mailing list](https://mailman.boum.org/listinfo/mat-dev)
+15. Sign'n'upload the new version on pypi with `python3 setup.py sdist bdist_wheel` then `twine upload -s dist/*`
+16. Do the secret release dance
=====================================
INSTALL.md
=====================================
@@ -49,3 +49,22 @@ dnf -y install mat2
## Gentoo
mat2 is available in the [torbrowser overlay](https://github.com/MeisterP/torbrowser-overlay).
+
+
+# OSX
+
+## Homebrew
+
+mat2 is [available on homebrew](https://formulae.brew.sh/formula/mat2):
+
+```
+brew install mat2
+```
+
+## MacPorts
+
+mat2 is [available on MacPorts](https://ports.macports.org/port/mat2/):
+
+```
+port install mat2
+```
=====================================
README.md
=====================================
@@ -100,6 +100,9 @@ example, with a file named "myfile.png" a cleaned version named
It's possible to run mat2 as a web service, via
[mat2-web](https://0xacab.org/jvoisin/mat2-web).
+If you're using WordPress, you might be interested in [wp-mat](https://git.autistici.org/noblogs/wp-mat)
+and [wp-mat-server](https://git.autistici.org/noblogs/wp-mat-server).
+
## Desktop GUI
For GNU/Linux desktops, it's possible to use the
=====================================
debian/changelog
=====================================
@@ -1,3 +1,19 @@
+mat2 (0.13.4-1) unstable; urgency=medium
+
+ * New upstream version 0.13.4:
+ - Adjust expected metadata to fix autopkgtest with ffmpeg >= 6.0.
+ (Closes: #1042432).
+ * debian/control:
+ - Drop obsolete transitional package mat. (Closes: #1032719)
+ * debian/mat2.install:
+ - Drop obsolete listing of /usr/bin/mat2, as otherwise the build errors
+ out and leads to FTBFS.
+ * debian/patches:
+ - Drop obsolete patch to include version in pyproject file; applied
+ upstream.
+
+ -- Georg Faerber <georg at debian.org> Thu, 03 Aug 2023 13:49:47 +0000
+
mat2 (0.13.3-1) unstable; urgency=medium
* New upstream version 0.13.3.
=====================================
debian/control
=====================================
@@ -84,11 +84,3 @@ Description: Metadata anonymisation toolkit v2
service menu for Dolphin, the default file manager of KDE. Besides, it
recommends metadata-cleaner, a GTK app for viewing and cleaning metadata of
files.
-
-Package: mat
-Depends: mat2,
- ${misc:Depends},
-Architecture: all
-Section: oldlibs
-Description: Transitional package to migrate to mat2
- This is a transitional package. It can safely be removed.
=====================================
debian/mat2.install
=====================================
@@ -1,4 +1,3 @@
-/usr/bin/mat2
data/mat2.png /usr/share/icons/hicolor/512x512/apps/
data/mat2.svg /usr/share/icons/hicolor/scalable/apps/
=====================================
debian/patches/0001-pyproject-include-version.patch deleted
=====================================
@@ -1,11 +0,0 @@
-Index: mat2/pyproject.toml
-===================================================================
---- mat2.orig/pyproject.toml 2023-02-26 10:15:04.487282755 +0000
-+++ mat2/pyproject.toml 2023-02-26 11:46:02.666423189 +0000
-@@ -1,5 +1,6 @@
- [project]
- name = "mat"
-+version = "0.13.3"
- readme = "README.md"
- requires-python = ">=3.9"
-
=====================================
debian/patches/series deleted
=====================================
@@ -1 +0,0 @@
-0001-pyproject-include-version.patch
=====================================
doc/mat2.1
=====================================
@@ -1,4 +1,4 @@
-.TH mat2 "1" "February 2023" "mat2 0.13.3" "User Commands"
+.TH mat2 "1" "August 2023" "mat2 0.13.4" "User Commands"
.SH NAME
mat2 \- the metadata anonymisation toolkit 2
=====================================
libmat2/__init__.py
=====================================
@@ -2,14 +2,10 @@
import enum
import importlib
-from typing import Optional, Union, Dict
+from typing import Dict
from . import exiftool, video
-# make pyflakes happy
-assert Optional
-assert Union
-
# A set of extension that aren't supported, despite matching a supported mimetype
UNSUPPORTED_EXTENSIONS = {
'.asc',
@@ -68,7 +64,7 @@ CMD_DEPENDENCIES = {
def check_dependencies() -> Dict[str, Dict[str, bool]]:
- ret = dict() # type: Dict[str, Dict]
+ ret: Dict[str, Dict] = dict()
for key, value in DEPENDENCIES.items():
ret[key] = {
=====================================
libmat2/abstract.py
=====================================
@@ -9,8 +9,8 @@ class AbstractParser(abc.ABC):
It might yield `ValueError` on instantiation on invalid files,
and `RuntimeError` when something went wrong in `remove_all`.
"""
- meta_list = set() # type: Set[str]
- mimetypes = set() # type: Set[str]
+ meta_list: Set[str] = set()
+ mimetypes: Set[str] = set()
def __init__(self, filename: str) -> None:
"""
=====================================
libmat2/archive.py
=====================================
@@ -49,15 +49,15 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser):
# Those are the files that have a format that _isn't_
# supported by mat2, but that we want to keep anyway.
- self.files_to_keep = set() # type: Set[Pattern]
+ self.files_to_keep: Set[Pattern] = set()
# Those are the files that we _do not_ want to keep,
# no matter if they are supported or not.
- self.files_to_omit = set() # type: Set[Pattern]
+ self.files_to_omit: Set[Pattern] = set()
# what should the parser do if it encounters an unknown file in
# the archive?
- self.unknown_member_policy = UnknownMemberPolicy.ABORT # type: UnknownMemberPolicy
+ self.unknown_member_policy: UnknownMemberPolicy = UnknownMemberPolicy.ABORT
# The LGTM comment is to mask a false-positive,
# see https://lgtm.com/projects/g/jvoisin/mat2/
@@ -105,6 +105,11 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser):
def _get_member_name(member: ArchiveMember) -> str:
"""Return the name of the given member."""
+ @staticmethod
+ @abc.abstractmethod
+ def _is_dir(member: ArchiveMember) -> bool:
+ """Return true is the given member is a directory."""
+
@abc.abstractmethod
def _add_file_to_archive(self, archive: ArchiveClass, member: ArchiveMember,
full_path: str):
@@ -129,7 +134,7 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser):
return member
def get_meta(self) -> Dict[str, Union[str, Dict]]:
- meta = dict() # type: Dict[str, Union[str, Dict]]
+ meta: Dict[str, Union[str, Dict]] = dict()
with self.archive_class(self.filename) as zin:
temp_folder = tempfile.mkdtemp()
@@ -138,12 +143,17 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser):
local_meta = self._get_member_meta(item)
member_name = self._get_member_name(item)
- if member_name[-1] == '/': # pragma: no cover
- # `is_dir` is added in Python3.6
+ if self._is_dir(item): # pragma: no cover
continue # don't keep empty folders
- zin.extract(member=item, path=temp_folder)
full_path = os.path.join(temp_folder, member_name)
+ if not os.path.abspath(full_path).startswith(temp_folder):
+ logging.error("%s contains a file (%s) pointing outside (%s) of its root.",
+ self.filename, member_name, full_path)
+ break
+
+ zin.extract(member=item, path=temp_folder)
+
os.chmod(full_path, stat.S_IRUSR)
specific_meta = self._specific_get_meta(full_path, member_name)
@@ -170,7 +180,7 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser):
# Sort the items to process, to reduce fingerprinting,
# and keep them in the `items` variable.
- items = list() # type: List[ArchiveMember]
+ items: List[ArchiveMember] = list()
for item in sorted(self._get_all_members(zin), key=self._get_member_name):
# Some fileformats do require to have the `mimetype` file
# as the first file in the archive.
@@ -183,7 +193,7 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser):
# we're iterating (and thus inserting) them in lexicographic order.
for item in items:
member_name = self._get_member_name(item)
- if member_name[-1] == '/': # `is_dir` is added in Python3.6
+ if self._is_dir(item):
continue # don't keep empty folders
full_path = os.path.join(temp_folder, member_name)
@@ -374,6 +384,11 @@ class TarParser(ArchiveBasedAbstractParser):
member.mode = permissions
return member
+ @staticmethod
+ def _is_dir(member: ArchiveMember) -> bool:
+ assert isinstance(member, tarfile.TarInfo) # please mypy
+ return member.isdir()
+
class TarGzParser(TarParser):
compression = ':gz'
@@ -460,3 +475,8 @@ class ZipParser(ArchiveBasedAbstractParser):
assert isinstance(member, zipfile.ZipInfo) # please mypy
member.compress_type = compression
return member
+
+ @staticmethod
+ def _is_dir(member: ArchiveMember) -> bool:
+ assert isinstance(member, zipfile.ZipInfo) # please mypy
+ return member.is_dir()
=====================================
libmat2/audio.py
=====================================
@@ -39,7 +39,7 @@ class MP3Parser(MutagenParser):
mimetypes = {'audio/mpeg', }
def get_meta(self) -> Dict[str, Union[str, Dict]]:
- metadata = {} # type: Dict[str, Union[str, Dict]]
+ metadata: Dict[str, Union[str, Dict]] = dict()
meta = mutagen.File(self.filename).tags
if not meta:
return metadata
=====================================
libmat2/exiftool.py
=====================================
@@ -15,7 +15,7 @@ class ExiftoolParser(abstract.AbstractParser):
from a import file, hence why several parsers are re-using its `get_meta`
method.
"""
- meta_allowlist = set() # type: Set[str]
+ meta_allowlist: Set[str] = set()
def get_meta(self) -> Dict[str, Union[str, Dict]]:
try:
=====================================
libmat2/harmless.py
=====================================
@@ -5,7 +5,7 @@ from . import abstract
class HarmlessParser(abstract.AbstractParser):
""" This is the parser for filetypes that can not contain metadata. """
- mimetypes = {'text/plain', 'image/x-ms-bmp'}
+ mimetypes = {'text/plain', 'image/x-ms-bmp', 'image/bmp'}
def get_meta(self) -> Dict[str, Union[str, Dict]]:
return dict()
=====================================
libmat2/images.py
=====================================
@@ -11,9 +11,6 @@ from gi.repository import GdkPixbuf, GLib, Rsvg
from . import exiftool, abstract
-# Make pyflakes happy
-assert Any
-
class SVGParser(exiftool.ExiftoolParser):
mimetypes = {'image/svg+xml', }
meta_allowlist = {'Directory', 'ExifToolVersion', 'FileAccessDate',
@@ -162,7 +159,7 @@ class PPMParser(abstract.AbstractParser):
mimetypes = {'image/x-portable-pixmap'}
def get_meta(self) -> Dict[str, Union[str, Dict]]:
- meta = {} # type: Dict[str, Union[str, Dict[Any, Any]]]
+ meta: Dict[str, Union[str, Dict[Any, Any]]] = dict()
with open(self.filename) as f:
for idx, line in enumerate(f):
if line.lstrip().startswith('#'):
=====================================
libmat2/office.py
=====================================
@@ -63,8 +63,20 @@ class MSOfficeParser(ZipParser):
'application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml', # /word/footer.xml
'application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml', # /word/header.xml
'application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml', # /word/styles.xml
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml', # /word/numbering.xml (used for bullet point formatting)
+ 'application/vnd.openxmlformats-officedocument.theme+xml', # /word/theme/theme[0-9].xml (used for font and background coloring, etc.)
'application/vnd.openxmlformats-package.core-properties+xml', # /docProps/core.xml
+ # for more complicated powerpoints
+ 'application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml',
+ 'application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml',
+ 'application/vnd.openxmlformats-officedocument.presentationml.handoutMaster+xml',
+ 'application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml',
+ 'application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml',
+ 'application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml',
+ 'application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml',
+ 'application/vnd.ms-office.drawingml.diagramDrawing+xml',
+
# Do we want to keep the following ones?
'application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml',
}
@@ -85,7 +97,7 @@ class MSOfficeParser(ZipParser):
r'^_rels/\.rels$',
r'^xl/sharedStrings\.xml$', # https://docs.microsoft.com/en-us/office/open-xml/working-with-the-shared-string-table
r'^xl/calcChain\.xml$',
- r'^(?:word|ppt|xl)/_rels/document\.xml\.rels$',
+ r'^(?:word|ppt|xl)/_rels/(document|workbook|presentation)\.xml\.rels$',
r'^(?:word|ppt|xl)/_rels/footer[0-9]*\.xml\.rels$',
r'^(?:word|ppt|xl)/_rels/header[0-9]*\.xml\.rels$',
r'^(?:word|ppt|xl)/charts/_rels/chart[0-9]+\.xml\.rels$',
@@ -100,6 +112,7 @@ class MSOfficeParser(ZipParser):
r'^ppt/slideLayouts/_rels/slideLayout[0-9]+\.xml\.rels$',
r'^ppt/slideLayouts/slideLayout[0-9]+\.xml$',
r'^(?:word|ppt|xl)/tableStyles\.xml$',
+ r'^(?:word|ppt|xl)/tables/table[0-9]+\.xml$',
r'^ppt/slides/_rels/slide[0-9]*\.xml\.rels$',
r'^ppt/slides/slide[0-9]*\.xml$',
# https://msdn.microsoft.com/en-us/library/dd908153(v=office.12).aspx
@@ -109,8 +122,13 @@ class MSOfficeParser(ZipParser):
r'^ppt/slideMasters/slideMaster[0-9]+\.xml',
r'^ppt/slideMasters/_rels/slideMaster[0-9]+\.xml\.rels',
r'^xl/worksheets/_rels/sheet[0-9]+\.xml\.rels',
- r'^xl/drawings/vmlDrawing[0-9]+\.vml',
- r'^xl/drawings/drawing[0-9]+\.xml',
+ r'^(?:word|ppt|xl)/drawings/vmlDrawing[0-9]+\.vml',
+ r'^(?:word|ppt|xl)/drawings/drawing[0-9]+\.xml',
+ r'^(?:word|ppt|xl)/embeddings/Microsoft_Excel_Worksheet[0-9]+\.xlsx',
+ # rels for complicated powerpoints
+ r'^ppt/notesSlides/_rels/notesSlide[0-9]+\.xml\.rels',
+ r'^ppt/notesMasters/_rels/notesMaster[0-9]+\.xml\.rels',
+ r'^ppt/handoutMasters/_rels/handoutMaster[0-9]+\.xml\.rels',
}))
self.files_to_omit = set(map(re.compile, { # type: ignore
r'^\[trash\]/',
@@ -120,18 +138,24 @@ class MSOfficeParser(ZipParser):
r'^(?:word|ppt|xl)/printerSettings/',
r'^(?:word|ppt|xl)/theme',
r'^(?:word|ppt|xl)/people\.xml$',
+ r'^(?:word|ppt|xl)/persons/person\.xml$',
r'^(?:word|ppt|xl)/numbering\.xml$',
r'^(?:word|ppt|xl)/tags/',
+ r'^(?:word|ppt|xl)/glossary/',
# View properties like view mode, last viewed slide etc
r'^(?:word|ppt|xl)/viewProps\.xml$',
# Additional presentation-wide properties like printing properties,
# presentation show properties etc.
r'^(?:word|ppt|xl)/presProps\.xml$',
r'^(?:word|ppt|xl)/comments[0-9]+\.xml$',
-
+ r'^(?:word|ppt|xl)/threadedComments/threadedComment[0-9]*\.xml$',
+ r'^(?:word|ppt|xl)/commentsExtended\.xml$',
+ r'^(?:word|ppt|xl)/commentsExtensible\.xml$',
+ r'^(?:word|ppt|xl)/commentsIds\.xml$',
# we have an allowlist in self.files_to_keep,
# so we can trash everything else
r'^(?:word|ppt|xl)/_rels/',
+ r'docMetadata/LabelInfo\.xml$'
}))
if self.__fill_files_to_keep_via_content_types() is False:
@@ -148,7 +172,7 @@ class MSOfficeParser(ZipParser):
return False
xml_data = zin.read('[Content_Types].xml')
- self.content_types = dict() # type: Dict[str, str]
+ self.content_types: Dict[str, str] = dict()
try:
tree = ET.fromstring(xml_data)
except ET.ParseError:
=====================================
libmat2/parser_factory.py
=====================================
@@ -2,7 +2,7 @@ import glob
import os
import mimetypes
import importlib
-from typing import TypeVar, Optional, List
+from typing import TypeVar, Optional, List, Tuple
from . import abstract, UNSUPPORTED_EXTENSIONS
@@ -42,7 +42,7 @@ def _get_parsers() -> List[T]:
return __get_parsers(abstract.AbstractParser)
-def get_parser(filename: str) -> tuple[Optional[T], Optional[str]]:
+def get_parser(filename: str) -> Tuple[Optional[T], Optional[str]]:
""" Return the appropriate parser for a given filename.
:raises ValueError: Raised if the instantiation of the parser went wrong.
=====================================
libmat2/video.py
=====================================
@@ -12,7 +12,7 @@ from . import bubblewrap
class AbstractFFmpegParser(exiftool.ExiftoolParser):
""" Abstract parser for all FFmpeg-based ones, mainly for video. """
# Some fileformats have mandatory metadata fields
- meta_key_value_allowlist = {} # type: Dict[str, Union[str, int]]
+ meta_key_value_allowlist: Dict[str, Union[str, int]] = dict()
def remove_all(self) -> bool:
if self.meta_key_value_allowlist:
@@ -48,7 +48,7 @@ class AbstractFFmpegParser(exiftool.ExiftoolParser):
def get_meta(self) -> Dict[str, Union[str, Dict]]:
meta = super().get_meta()
- ret = dict() # type: Dict[str, Union[str, Dict]]
+ ret: Dict[str, Union[str, Dict]] = dict()
for key, value in meta.items():
if key in self.meta_key_value_allowlist:
if value == self.meta_key_value_allowlist[key]:
=====================================
libmat2/web.py
=====================================
@@ -44,10 +44,10 @@ class CSSParser(abstract.AbstractParser):
class AbstractHTMLParser(abstract.AbstractParser):
- tags_blocklist = set() # type: Set[str]
+ tags_blocklist: Set[str] = set()
# In some html/xml-based formats some tags are mandatory,
# so we're keeping them, but are discarding their content
- tags_required_blocklist = set() # type: Set[str]
+ tags_required_blocklist: Set[str] = set()
def __init__(self, filename):
super().__init__(filename)
@@ -91,7 +91,7 @@ class _HTMLParser(parser.HTMLParser):
self.filename = filename
self.__textrepr = ''
self.__meta = {}
- self.__validation_queue = [] # type: list[str]
+ self.__validation_queue: List[str] = list()
# We're using counters instead of booleans, to handle nested tags
self.__in_dangerous_but_required_tag = 0
=====================================
mat2
=====================================
@@ -17,7 +17,7 @@ except ValueError as ex:
print(ex)
sys.exit(1)
-__version__ = '0.13.3'
+__version__ = '0.13.4'
logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.WARNING)
@@ -36,7 +36,7 @@ def __check_file(filename: str, mode: int = os.R_OK) -> bool:
__print_without_chars("[-] %s is not a regular file." % filename)
return False
elif not os.access(filename, mode):
- mode_str = [] # type: List[str]
+ mode_str: List[str] = list()
if mode & os.R_OK:
mode_str += 'readable'
if mode & os.W_OK:
@@ -168,7 +168,7 @@ def show_parsers():
def __get_files_recursively(files: List[str]) -> List[str]:
- ret = set() # type: Set[str]
+ ret: Set[str] = set()
for f in files:
if os.path.isdir(f):
for path, _, _files in os.walk(f):
=====================================
pyproject.toml
=====================================
@@ -1,5 +1,6 @@
[project]
name = "mat"
+version = "0.13.4"
readme = "README.md"
requires-python = ">=3.9"
=====================================
setup.py
=====================================
@@ -5,7 +5,7 @@ with open("README.md", encoding='utf-8') as fh:
setuptools.setup(
name="mat2",
- version='0.13.3',
+ version='0.13.4',
author="Julien (jvoisin) Voisin",
author_email="julien.voisin+mat2 at dustri.org",
description="A handy tool to trash your metadata",
@@ -20,6 +20,7 @@ setuptools.setup(
'pycairo',
],
packages=setuptools.find_packages(exclude=('tests', )),
+ data_files = [('man/man1', ['doc/mat2.1'])],
classifiers=[
"Development Status :: 3 - Alpha",
"Environment :: Console",
=====================================
tests/test_libmat2.py
=====================================
@@ -480,11 +480,12 @@ class TestCleaning(unittest.TestCase):
'expected_meta': {
'AverageBitrate': 465641,
'BufferSize': 0,
- 'CompatibleBrands': ['isom', 'iso2', 'avc1', 'mp41'],
- 'ColorProfiles': 'nclx',
'ColorPrimaries': 'BT.709',
+ 'ColorProfiles': 'nclx',
'ColorRepresentation': 'nclx 1 1 1',
+ 'CompatibleBrands': ['isom', 'iso2', 'avc1', 'mp41'],
'CompressorID': 'avc1',
+ 'CompressorName': 'JVT/AVC Coding',
'GraphicsMode': 'srcCopy',
'HandlerDescription': 'SoundHandler',
'HandlerType': 'Metadata',
@@ -495,6 +496,7 @@ class TestCleaning(unittest.TestCase):
'MediaDataOffset': 48,
'MediaDataSize': 379872,
'MediaHeaderVersion': 0,
+ 'MediaLanguageCode': 'eng',
'MinorVersion': '0.2.0',
'MovieDataOffset': 48,
'MovieHeaderVersion': 0,
=====================================
utils/ci/codespell/ignored_words.txt deleted
=====================================
@@ -1,3 +0,0 @@
-# Words to be ignored by codespell.
-# Put one word per line and sort alphabetically.
-process'
View it on GitLab: https://salsa.debian.org/pkg-privacy-team/mat2/-/compare/e77eb7bb69f91c3683a51b90b22b42b016340ab1...f6b794703352aecc3271252c98f5881ef50b239a
--
View it on GitLab: https://salsa.debian.org/pkg-privacy-team/mat2/-/compare/e77eb7bb69f91c3683a51b90b22b42b016340ab1...f6b794703352aecc3271252c98f5881ef50b239a
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-privacy-commits/attachments/20230803/e199f121/attachment-0001.htm>
More information about the Pkg-privacy-commits
mailing list