diff options
author | Patrick Monnerat <[email protected]> | 2019-02-11 19:50:38 +0100 |
---|---|---|
committer | monsta <[email protected]> | 2019-02-20 17:11:10 +0300 |
commit | 7842b86e8deac7b6cae3bea3d27b26ae7a399db0 (patch) | |
tree | 3c98d5854e72567dc58252340d484686d3bd13df /examples/md5sum-property-page.py | |
parent | 05c5dd58ebf03b1366a43cbcfd135079e6d4455d (diff) | |
download | python-caja-7842b86e8deac7b6cae3bea3d27b26ae7a399db0.tar.bz2 python-caja-7842b86e8deac7b6cae3bea3d27b26ae7a399db0.tar.xz |
Examples: remove use of Python 2/3 incompatible urllib/urlparse.
Plus some other rewriting to improve lisibility.
Diffstat (limited to 'examples/md5sum-property-page.py')
-rw-r--r-- | examples/md5sum-property-page.py | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/examples/md5sum-property-page.py b/examples/md5sum-property-page.py index 6f3f345..0557058 100644 --- a/examples/md5sum-property-page.py +++ b/examples/md5sum-property-page.py @@ -1,12 +1,5 @@ import hashlib -try: - # Python 3. - from urllib.parse import unquote -except: - # Python 2. - from urllib import unquote - from gi.repository import Caja, Gtk, GObject class MD5SumPropertyPage(GObject.GObject, Caja.PropertyPageProvider): @@ -24,7 +17,7 @@ class MD5SumPropertyPage(GObject.GObject, Caja.PropertyPageProvider): if file.is_directory(): return - filename = unquote(file.get_uri()[7:]) + filename = file.get_location().get_path() self.property_label = Gtk.Label('MD5Sum') self.property_label.show() |