summaryrefslogtreecommitdiff
path: root/examples/block-size-column.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/block-size-column.py')
-rw-r--r--examples/block-size-column.py9
1 files changed, 1 insertions, 8 deletions
diff --git a/examples/block-size-column.py b/examples/block-size-column.py
index c59d3e6..d3ce2b4 100644
--- a/examples/block-size-column.py
+++ b/examples/block-size-column.py
@@ -1,12 +1,5 @@
import os
-try:
- # Python 3.
- from urllib.parse import unquote
-except:
- # Python 2.
- from urllib import unquote
-
from gi.repository import GObject, Caja
class ColumnExtension(GObject.GObject, Caja.ColumnProvider, Caja.InfoProvider):
@@ -23,6 +16,6 @@ class ColumnExtension(GObject.GObject, Caja.ColumnProvider, Caja.InfoProvider):
if file.get_uri_scheme() != 'file':
return
- filename = unquote(file.get_uri()[7:])
+ filename = file.get_location().get_path()
file.add_string_attribute('block_size', str(os.stat(filename).st_blksize))