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
Package registry
Model registry
Operate
Environments
Terraform modules
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
Romain
mat2
Commits
56d2c4aa
Commit
56d2c4aa
authored
5 years ago
by
tguinot
Committed by
jvoisin
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add which pathfinding for executables
parent
12f23e01
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
README.md
+6
-0
6 additions, 0 deletions
README.md
libmat2/bubblewrap.py
+3
-4
3 additions, 4 deletions
libmat2/bubblewrap.py
libmat2/exiftool.py
+7
-8
7 additions, 8 deletions
libmat2/exiftool.py
libmat2/video.py
+4
-5
4 additions, 5 deletions
libmat2/video.py
with
20 additions
and
17 deletions
README.md
+
6
−
0
View file @
56d2c4aa
...
...
@@ -41,6 +41,12 @@ Nautilus, the default file manager of GNOME.
Please note that mat2 requires at least Python3.5.
# Requirements setup on macOS (OS X) using [Homebrew](https://brew.sh/)
```
bash
brew
install
exiftool cairo pygobject3 poppler gdk-pixbuf librsvg ffmpeg
```
# Running the test suite
```
bash
...
...
This diff is collapsed.
Click to expand it.
libmat2/bubblewrap.py
+
3
−
4
View file @
56d2c4aa
...
...
@@ -22,10 +22,9 @@ CalledProcessError = subprocess.CalledProcessError
def
_get_bwrap_path
()
->
str
:
bwrap_path
=
'
/usr/bin/bwrap
'
if
os
.
path
.
isfile
(
bwrap_path
):
if
os
.
access
(
bwrap_path
,
os
.
X_OK
):
return
bwrap_path
which_path
=
shutil
.
which
(
'
bwrap
'
)
if
which_path
:
return
which_path
raise
RuntimeError
(
"
Unable to find bwrap
"
)
# pragma: no cover
...
...
This diff is collapsed.
Click to expand it.
libmat2/exiftool.py
+
7
−
8
View file @
56d2c4aa
...
...
@@ -2,6 +2,7 @@ import functools
import
json
import
logging
import
os
import
shutil
import
subprocess
from
typing
import
Dict
,
Union
,
Set
...
...
@@ -71,14 +72,12 @@ class ExiftoolParser(abstract.AbstractParser):
@functools.lru_cache
()
def
_get_exiftool_path
()
->
str
:
# pragma: no cover
possible_pathes
=
{
'
/usr/bin/exiftool
'
,
# debian/fedora
'
/usr/bin/vendor_perl/exiftool
'
,
# archlinux
}
which_path
=
shutil
.
which
(
'
exiftool
'
)
if
which_path
:
return
which_path
for
possible_path
in
possible_pathes
:
if
os
.
path
.
isfile
(
possible_path
):
if
os
.
access
(
possible_path
,
os
.
X_OK
):
return
possible_path
# Exiftool on Arch Linux has a weird path
if
os
.
access
(
'
/usr/bin/vendor_perl/exiftool
'
,
os
.
X_OK
):
return
'
/usr/bin/vendor_perl/exiftool
'
raise
RuntimeError
(
"
Unable to find exiftool
"
)
This diff is collapsed.
Click to expand it.
libmat2/video.py
+
4
−
5
View file @
56d2c4aa
import
subprocess
import
functools
import
o
s
import
s
hutil
import
logging
from
typing
import
Dict
,
Union
...
...
@@ -137,9 +137,8 @@ class MP4Parser(AbstractFFmpegParser):
@functools.lru_cache
()
def
_get_ffmpeg_path
()
->
str
:
# pragma: no cover
ffmpeg_path
=
'
/usr/bin/ffmpeg
'
if
os
.
path
.
isfile
(
ffmpeg_path
):
if
os
.
access
(
ffmpeg_path
,
os
.
X_OK
):
return
ffmpeg_path
which_path
=
shutil
.
which
(
'
ffmpeg
'
)
if
which_path
:
return
which_path
raise
RuntimeError
(
"
Unable to find ffmpeg
"
)
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