diff options
Diffstat (limited to 'nautilus/nautilus-mat.py')
| -rw-r--r-- | nautilus/nautilus-mat.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/nautilus/nautilus-mat.py b/nautilus/nautilus-mat.py index 2a84600..19b601e 100644 --- a/nautilus/nautilus-mat.py +++ b/nautilus/nautilus-mat.py | |||
| @@ -1,12 +1,11 @@ | |||
| 1 | #! /usr/bin/python | 1 | #! /usr/bin/python |
| 2 | 2 | ||
| 3 | ''' This file is an extension for the Nautilus | 3 | ''' This file is an extension for the Nautilus |
| 4 | file manager, to provide a contextual menu to | 4 | file manager, to provide a contextual menu to |
| 5 | clean metadata | 5 | clean metadata |
| 6 | ''' | 6 | ''' |
| 7 | 7 | ||
| 8 | import logging | 8 | import logging |
| 9 | import os | ||
| 10 | import urllib | 9 | import urllib |
| 11 | try: | 10 | try: |
| 12 | import gettext | 11 | import gettext |
| @@ -15,13 +14,12 @@ except: | |||
| 15 | logging.warning("Failed to initialise gettext") | 14 | logging.warning("Failed to initialise gettext") |
| 16 | _ = lambda x: x | 15 | _ = lambda x: x |
| 17 | 16 | ||
| 18 | import xml.sax | ||
| 19 | |||
| 20 | from gi.repository import Nautilus, GObject, Gtk | 17 | from gi.repository import Nautilus, GObject, Gtk |
| 21 | 18 | ||
| 22 | import MAT.mat | 19 | import MAT.mat |
| 23 | import MAT.strippers | 20 | import MAT.strippers |
| 24 | 21 | ||
| 22 | |||
| 25 | class MatExtension(GObject.GObject, Nautilus.MenuProvider): | 23 | class MatExtension(GObject.GObject, Nautilus.MenuProvider): |
| 26 | def __init__(self): | 24 | def __init__(self): |
| 27 | logging.debug("nautilus-mat: initialising") | 25 | logging.debug("nautilus-mat: initialising") |
| @@ -44,7 +42,7 @@ class MatExtension(GObject.GObject, Nautilus.MenuProvider): | |||
| 44 | logging.debug("%s files not supported by MAT" % file.get_uri_scheme()) | 42 | logging.debug("%s files not supported by MAT" % file.get_uri_scheme()) |
| 45 | return | 43 | return |
| 46 | 44 | ||
| 47 | # MAT can not clean non-writable files | 45 | # MAT can not clean non-writable files |
| 48 | if not file.can_write(): | 46 | if not file.can_write(): |
| 49 | logging.debug("%s is not writable by MAT" % file.get_uri_scheme()) | 47 | logging.debug("%s is not writable by MAT" % file.get_uri_scheme()) |
| 50 | return | 48 | return |
| @@ -56,7 +54,7 @@ class MatExtension(GObject.GObject, Nautilus.MenuProvider): | |||
| 56 | item.connect('activate', self.menu_activate_cb, file) | 54 | item.connect('activate', self.menu_activate_cb, file) |
| 57 | return item, | 55 | return item, |
| 58 | 56 | ||
| 59 | def show_message(self, message, type = Gtk.MessageType.INFO): | 57 | def show_message(self, message, type=Gtk.MessageType.INFO): |
| 60 | dialog = Gtk.MessageDialog(parent=None, | 58 | dialog = Gtk.MessageDialog(parent=None, |
| 61 | flags=Gtk.DialogFlags.MODAL, | 59 | flags=Gtk.DialogFlags.MODAL, |
| 62 | type=type, | 60 | type=type, |
