Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
mat2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
13
Issues
13
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jvoisin
mat2
Commits
56d2c4aa
Commit
56d2c4aa
authored
Feb 10, 2020
by
tguinot
Committed by
jvoisin
Feb 11, 2020
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add which pathfinding for executables
parent
12f23e01
Pipeline
#35000
passed with stages
in 12 minutes and 9 seconds
Changes
4
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
17 deletions
+20
-17
README.md
README.md
+6
-0
libmat2/bubblewrap.py
libmat2/bubblewrap.py
+3
-4
libmat2/exiftool.py
libmat2/exiftool.py
+7
-8
libmat2/video.py
libmat2/video.py
+4
-5
No files found.
README.md
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
...
...
libmat2/bubblewrap.py
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
...
...
libmat2/exiftool.py
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"
)
libmat2/video.py
View file @
56d2c4aa
import
subprocess
import
functools
import
os
import
shutil
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"
)
jvoisin
@jvoisin
mentioned in issue
#101 (closed)
·
Mar 04, 2020
mentioned in issue
#101 (closed)
mentioned in issue #101
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment