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
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
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
jvoisin
mat2
Commits
91e80527
Commit
91e80527
authored
6 years ago
by
Julien (jvoisin) Voisin
Browse files
Options
Downloads
Patches
Plain Diff
Add archlinux to the CI
parent
7877ba0d
No related branches found
No related tags found
No related merge requests found
Pipeline
#18681
passed
6 years ago
Stage: linting
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+7
-0
7 additions, 0 deletions
.gitlab-ci.yml
libmat2/__init__.py
+16
-5
16 additions, 5 deletions
libmat2/__init__.py
libmat2/images.py
+2
-2
2 additions, 2 deletions
libmat2/images.py
with
25 additions
and
7 deletions
.gitlab-ci.yml
+
7
−
0
View file @
91e80527
...
@@ -53,3 +53,10 @@ tests:fedora:
...
@@ -53,3 +53,10 @@ tests:fedora:
-
dnf install -y python3 python3-mutagen python3-gobject gdk-pixbuf2 poppler-glib gdk-pixbuf2 gdk-pixbuf2-modules cairo-gobject cairo python3-cairo perl-Image-ExifTool mailcap
-
dnf install -y python3 python3-mutagen python3-gobject gdk-pixbuf2 poppler-glib gdk-pixbuf2 gdk-pixbuf2-modules cairo-gobject cairo python3-cairo perl-Image-ExifTool mailcap
-
gdk-pixbuf-query-loaders-64 > /usr/lib64/gdk-pixbuf-2.0/2.10.0/loaders.cache
-
gdk-pixbuf-query-loaders-64 > /usr/lib64/gdk-pixbuf-2.0/2.10.0/loaders.cache
-
python3 setup.py test
-
python3 setup.py test
tests:archlinux
:
image
:
archlinux/base
stage
:
test
script
:
-
pacman -Sy --noconfirm python-mutagen python-gobject gdk-pixbuf2 poppler-glib gdk-pixbuf2 python-cairo perl-image-exiftool python-setuptools mailcap
-
python3 setup.py test
This diff is collapsed.
Click to expand it.
libmat2/__init__.py
+
16
−
5
View file @
91e80527
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
import
os
import
os
import
collections
import
collections
import
importlib
import
importlib
from
typing
import
Dict
from
typing
import
Dict
,
Optional
# make pyflakes happy
# make pyflakes happy
assert
Dict
assert
Dict
...
@@ -35,13 +35,24 @@ DEPENDENCIES = {
...
@@ -35,13 +35,24 @@ DEPENDENCIES = {
'
mutagen
'
:
'
Mutagen
'
,
'
mutagen
'
:
'
Mutagen
'
,
}
}
def
_get_exiftool_path
()
->
Optional
[
str
]:
exiftool_path
=
'
/usr/bin/exiftool
'
if
os
.
path
.
isfile
(
exiftool_path
):
if
os
.
access
(
exiftool_path
,
os
.
X_OK
):
# pragma: no cover
return
exiftool_path
# ArchLinux
exiftool_path
=
'
/usr/bin/vendor_perl/exiftool
'
if
os
.
path
.
isfile
(
exiftool_path
):
if
os
.
access
(
exiftool_path
,
os
.
X_OK
):
# pragma: no cover
return
exiftool_path
return
None
def
check_dependencies
()
->
dict
:
def
check_dependencies
()
->
dict
:
ret
=
collections
.
defaultdict
(
bool
)
# type: Dict[str, bool]
ret
=
collections
.
defaultdict
(
bool
)
# type: Dict[str, bool]
exiftool
=
'
/usr/bin/exiftool
'
ret
[
'
Exiftool
'
]
=
True
if
_get_exiftool_path
()
else
False
ret
[
'
Exiftool
'
]
=
False
if
os
.
path
.
isfile
(
exiftool
)
and
os
.
access
(
exiftool
,
os
.
X_OK
):
# pragma: no cover
ret
[
'
Exiftool
'
]
=
True
for
key
,
value
in
DEPENDENCIES
.
items
():
for
key
,
value
in
DEPENDENCIES
.
items
():
ret
[
value
]
=
True
ret
[
value
]
=
True
...
...
This diff is collapsed.
Click to expand it.
libmat2/images.py
+
2
−
2
View file @
91e80527
...
@@ -13,7 +13,7 @@ import gi
...
@@ -13,7 +13,7 @@ import gi
gi
.
require_version
(
'
GdkPixbuf
'
,
'
2.0
'
)
gi
.
require_version
(
'
GdkPixbuf
'
,
'
2.0
'
)
from
gi.repository
import
GdkPixbuf
from
gi.repository
import
GdkPixbuf
from
.
import
abstract
from
.
import
abstract
,
_get_exiftool_path
# Make pyflakes happy
# Make pyflakes happy
assert
Set
assert
Set
...
@@ -40,7 +40,7 @@ class _ImageParser(abstract.AbstractParser):
...
@@ -40,7 +40,7 @@ class _ImageParser(abstract.AbstractParser):
self.filename to prevent parameter injections, so we need to take care
self.filename to prevent parameter injections, so we need to take care
of this.
of this.
"""
"""
fun
=
lambda
f
:
subprocess
.
check_output
([
'
/usr/bin/
exiftool
'
,
'
-json
'
,
f
])
fun
=
lambda
f
:
subprocess
.
check_output
([
_get_
exiftool
_path
()
,
'
-json
'
,
f
])
if
re
.
search
(
'
^[a-z0-9/]
'
,
self
.
filename
)
is
None
:
if
re
.
search
(
'
^[a-z0-9/]
'
,
self
.
filename
)
is
None
:
out
=
self
.
__handle_problematic_filename
(
self
.
filename
,
fun
)
out
=
self
.
__handle_problematic_filename
(
self
.
filename
,
fun
)
else
:
else
:
...
...
This diff is collapsed.
Click to expand it.
jvoisin
@jvoisin
mentioned in issue
#46 (closed)
·
6 years ago
mentioned in issue
#46 (closed)
mentioned in issue #46
Toggle commit list
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