summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.yml3
-rw-r--r--nautilus/mat2.py10
2 files changed, 5 insertions, 8 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 32ec086..10e0009 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -35,8 +35,7 @@ mypy:
35 - apt-get -qqy update 35 - apt-get -qqy update
36 - apt-get -qqy install --no-install-recommends python3-pip 36 - apt-get -qqy install --no-install-recommends python3-pip
37 - pip3 install mypy 37 - pip3 install mypy
38 - mypy mat2 libmat2/*.py --ignore-missing-imports 38 - mypy --ignore-missing-imports mat2 libmat2/*.py ./nautilus/mat2.py
39 - mypy --ignore-missing-imports ./nautilus/mat2.py
40 39
41tests:debian: 40tests:debian:
42 stage: test 41 stage: test
diff --git a/nautilus/mat2.py b/nautilus/mat2.py
index af49323..0688ef2 100644
--- a/nautilus/mat2.py
+++ b/nautilus/mat2.py
@@ -14,7 +14,7 @@ thread, so we'll have to resort to using a `queue` to pass "messages" around.
14 14
15import queue 15import queue
16import threading 16import threading
17from typing import Tuple 17from typing import Tuple, Optional, List
18from urllib.parse import unquote 18from urllib.parse import unquote
19 19
20import gi 20import gi
@@ -25,10 +25,8 @@ from gi.repository import Nautilus, GObject, Gtk, Gio, GLib, GdkPixbuf
25 25
26from libmat2 import parser_factory 26from libmat2 import parser_factory
27 27
28# make pyflakes happy
29assert Tuple
30 28
31def _remove_metadata(fpath): 29def _remove_metadata(fpath) -> Tuple[bool, Optional[str]]:
32 """ This is a simple wrapper around libmat2, because it's 30 """ This is a simple wrapper around libmat2, because it's
33 easier and cleaner this way. 31 easier and cleaner this way.
34 """ 32 """
@@ -63,7 +61,7 @@ class ColumnExtension(GObject.GObject, Nautilus.MenuProvider, Nautilus.LocationW
63 self.infobar.get_content_area().pack_start(self.infobar_hbox, True, True, 0) 61 self.infobar.get_content_area().pack_start(self.infobar_hbox, True, True, 0)
64 self.infobar.show_all() 62 self.infobar.show_all()
65 63
66 def get_widget(self, uri, window): 64 def get_widget(self, uri, window) -> Gtk.Widget:
67 """ This is the method that we have to implement (because we're 65 """ This is the method that we have to implement (because we're
68 a LocationWidgetProvider) in order to show our infobar. 66 a LocationWidgetProvider) in order to show our infobar.
69 """ 67 """
@@ -228,7 +226,7 @@ class ColumnExtension(GObject.GObject, Nautilus.MenuProvider, Nautilus.LocationW
228 """ https://bugzilla.gnome.org/show_bug.cgi?id=784278 """ 226 """ https://bugzilla.gnome.org/show_bug.cgi?id=784278 """
229 return None 227 return None
230 228
231 def get_file_items(self, window, files): 229 def get_file_items(self, window, files) -> Optional[List[Nautilus.MenuItem]]:
232 """ This method is the one allowing us to create a menu item. 230 """ This method is the one allowing us to create a menu item.
233 """ 231 """
234 # Do not show the menu item if not a single file has a chance to be 232 # Do not show the menu item if not a single file has a chance to be