diff --git a/extension/caja-admin.py.in b/extension/caja-admin.py.in index 8280808..480531c 100644 --- a/extension/caja-admin.py.in +++ b/extension/caja-admin.py.in @@ -15,7 +15,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -import os, subprocess, urlparse, traceback +import os, subprocess, traceback from gi.repository import Caja, GObject, Gtk, GLib from gettext import gettext, locale, bindtextdomain, textdomain @@ -154,9 +154,7 @@ class CajaAdmin(Caja.MenuProvider, GObject.GObject): def _is_executable(self, file): """Returns whether the current user can execute the given file.""" try: - uri = file.get_uri() - p = urlparse.urlparse(uri) - path = os.path.abspath(os.path.join(p.netloc, p.path)) + path = file.get_location().get_path() return os.access(path,os.X_OK) except: return False @@ -165,9 +163,7 @@ class CajaAdmin(Caja.MenuProvider, GObject.GObject): """'Run as Administrator' menu item callback.""" if self._show_warning_dialog(): try: - uri = file.get_uri() - p = urlparse.urlparse(uri) - path = os.path.abspath(os.path.join(p.netloc, p.path)) + path = file.get_location().get_path() #is_app = not os.path.splitext(path)[-1] cmd = [PKEXEC_PATH] #cmd +=['env','DISPLAY='+os.environ['DISPLAY'],'XAUTHORITY='+os.environ['XAUTHORITY']]