Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
mat2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tails
mat2
Commits
9a81b3ad
Commit
9a81b3ad
authored
6 years ago
by
Julien (jvoisin) Voisin
Browse files
Options
Downloads
Patches
Plain Diff
Improve type annotation coverage
parent
f1a071d4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
libmat2/__init__.py
+1
-1
1 addition, 1 deletion
libmat2/__init__.py
libmat2/exiftool.py
+1
-1
1 addition, 1 deletion
libmat2/exiftool.py
libmat2/pdf.py
+1
-1
1 addition, 1 deletion
libmat2/pdf.py
libmat2/video.py
+1
-1
1 addition, 1 deletion
libmat2/video.py
with
4 additions
and
4 deletions
libmat2/__init__.py
+
1
−
1
View file @
9a81b3ad
...
...
@@ -40,7 +40,7 @@ DEPENDENCIES = {
def
check_dependencies
()
->
d
ict
:
def
check_dependencies
()
->
D
ict
[
str
,
bool
]
:
ret
=
collections
.
defaultdict
(
bool
)
# type: Dict[str, bool]
ret
[
'
Exiftool
'
]
=
True
if
exiftool
.
_get_exiftool_path
()
else
False
...
...
This diff is collapsed.
Click to expand it.
libmat2/exiftool.py
+
1
−
1
View file @
9a81b3ad
...
...
@@ -24,7 +24,7 @@ class ExiftoolParser(abstract.AbstractParser):
meta
.
pop
(
key
,
None
)
return
meta
def
_lightweight_cleanup
(
self
):
def
_lightweight_cleanup
(
self
)
->
bool
:
if
os
.
path
.
exists
(
self
.
output_filename
):
try
:
# exiftool can't force output to existing files
...
...
This diff is collapsed.
Click to expand it.
libmat2/pdf.py
+
1
−
1
View file @
9a81b3ad
...
...
@@ -125,7 +125,7 @@ class PDFParser(abstract.AbstractParser):
return
True
@staticmethod
def
__parse_metadata_field
(
data
:
str
)
->
d
ict
:
def
__parse_metadata_field
(
data
:
str
)
->
D
ict
[
str
,
str
]
:
metadata
=
{}
for
(
_
,
key
,
value
)
in
re
.
findall
(
r
"
<(xmp|pdfx|pdf|xmpMM):(.+)>(.+)</\1:\2>
"
,
data
,
re
.
I
):
metadata
[
key
]
=
value
...
...
This diff is collapsed.
Click to expand it.
libmat2/video.py
+
1
−
1
View file @
9a81b3ad
...
...
@@ -24,7 +24,7 @@ class AVIParser(exiftool.ExiftoolParser):
'
SampleRate
'
,
'
AvgBytesPerSec
'
,
'
BitsPerSample
'
,
'
Duration
'
,
'
ImageSize
'
,
'
Megapixels
'
}
def
remove_all
(
self
):
def
remove_all
(
self
)
->
bool
:
cmd
=
[
_get_ffmpeg_path
(),
'
-i
'
,
self
.
filename
,
# input file
'
-y
'
,
# overwrite existing output file
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment