python3_support.patch 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. diff -Nuar a/extension/caja-admin.py.in b/extension/caja-admin.py.in
  2. --- a/extension/caja-admin.py.in 2017-08-16 18:55:41.000000000 +0300
  3. +++ b/extension/caja-admin.py.in 2020-03-18 23:41:45.604050174 +0300
  4. @@ -15,7 +15,7 @@
  5. # You should have received a copy of the GNU General Public License
  6. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  7. -import os, subprocess, urlparse, traceback
  8. +import os, subprocess, traceback
  9. from gi.repository import Caja, GObject, Gtk, GLib
  10. from gettext import gettext, locale, bindtextdomain, textdomain
  11. @@ -154,9 +154,7 @@
  12. def _is_executable(self, file):
  13. """Returns whether the current user can execute the given file."""
  14. try:
  15. - uri = file.get_uri()
  16. - p = urlparse.urlparse(uri)
  17. - path = os.path.abspath(os.path.join(p.netloc, p.path))
  18. + path = file.get_location().get_path()
  19. return os.access(path,os.X_OK)
  20. except:
  21. return False
  22. @@ -165,9 +163,7 @@
  23. """'Run as Administrator' menu item callback."""
  24. if self._show_warning_dialog():
  25. try:
  26. - uri = file.get_uri()
  27. - p = urlparse.urlparse(uri)
  28. - path = os.path.abspath(os.path.join(p.netloc, p.path))
  29. + path = file.get_location().get_path()
  30. #is_app = not os.path.splitext(path)[-1]
  31. cmd = [PKEXEC_PATH]
  32. #cmd +=['env','DISPLAY='+os.environ['DISPLAY'],'XAUTHORITY='+os.environ['XAUTHORITY']]