Skip to content

Commit

Permalink
Python 3 compatibility.
Browse files Browse the repository at this point in the history
Still running with Python 2.
  • Loading branch information
monnerat authored and infirit committed Aug 5, 2019
1 parent 603d5b5 commit 0af109a
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions extension/caja-admin.py.in
Expand Up @@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import os, subprocess, urlparse, traceback
import os, subprocess, traceback
from gi.repository import Caja, GObject, Gtk, GLib
from gettext import gettext, locale, bindtextdomain, textdomain

Expand Down Expand Up @@ -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
Expand All @@ -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']]
Expand Down

0 comments on commit 0af109a

Please sign in to comment.