Jump to content

Nils

Members
  • Content count

    8
  • Joined

  • Last visited

Community Reputation

4 Neutral

About Nils

  • Rank
    Member

Profile Information

  • Gender
    Male
  • Location
    Sweden
  1. Suggestions for esudo

    Sorry, forgot to tell you that. I solved it with "esudo elementary_config". It is a sloppy solution, if user make changes, root has to do it also.
  2. Suggestions for esudo

    What is the problem?
  3. Suggestions for esudo

    Hi Jeff No I am not familiar with GitHub. So for now you have to do it the hard way. I suppose I have to look into GitHub later if I am going to come up with more additions/corrections.
  4. I discovered this after the installation of sbackup-gtk. Sbackup in admin mode started with a dbus error message. But the problem is in esudo. It is "sudo -E" that causes the problem. I used Ubuntu and gksudo to test the behavior, and then tried to rewrite the code. Now it seems OK to me. -----Here is my alterations. 
import random import string ----- This one, key_up/key_down is a fix for another problem, cursor positioning. if event_type == evas.EVAS_CALLBACK_KEY_DOWN: # was _UP ----- This is the rewrite. #Old method. Using -E is cleaner. Now rewritten self.rnd_dir = u"/tmp/libesudo-" + self.random_char(6) os.makedirs(self.rnd_dir, 0700) command = "cp /home/%s/.Xauthority %s" % (getpass.getuser(), self.rnd_dir) ecore.Exe(command, ecore.ECORE_EXE_PIPE_READ | ecore.ECORE_EXE_PIPE_ERROR | ecore.ECORE_EXE_PIPE_WRITE) self.run_command( "XAUTHORITY='%s/.Xauthority' ; sudo -EHS DBUS_SESSION_BUS_ADDRESS= %s" % (self.rnd_dir, cmd), password) #--------Random string for directory name def random_char(self, y): return ''.join(random.choice(string.ascii_letters) for x in range(y)) #--------Run Command ----- end of changes ----- Next piece of changes. def command_done(self, cmd, event, *args, **kwargs): log.info("Command done.") os.remove('%s/.Xauthority' % self.rnd_dir) os.rmdir(self.rnd_dir) if self.end_cb: ----- That's it. and gksu/gksudo can look like this #!/usr/bin/python "eSudo launcher" import esudo.esudo as esudo from efl import elementary import sys import os elementary.init() if sys.argv[1] == "--description": cmd = "".join(sys.argv[3:]) else: cmd = "".join(sys.argv[1:]) #Make sure we aren't already running as root if os.geteuid() != 0: #if we aren't show a GUI to get user password start = esudo.eSudo(cmd) else: #If we are - just fire the command os.system(cmd) sys.exit(0) elementary.run() elementary.shutdown() ----- What do you think, is it useful? Or totally unnecessary?
  5. Help Test ePad/elmextensions Update

    Hello Jeff Could you please add this to line 377 in fileselector.py for bk in self.getGTKBookmarks(): bk = urllib.url2pathname(bk.encode('ascii')).decode('utf-8') con = Icon(self, size_hint_weight=EXPAND_BOTH, Thank you
  6. Help Test ePad/elmextensions Update

    Yes, thank you very much.
  7. Help Test ePad/elmextensions Update

    A quick test shows that you have a print command in line 399 in epad that prevents my file from opening. And when I try to save an edited file I get this: Traceback (most recent call last): File "efl/elementary/object_item.pyx", line 87, in efl.elementary.object_item._object_item_callback (efl/elementary/object_item.c:3149) File "/usr/bin/epad", line 1069, in <lambda> lambda self, obj: self._parent.saveFile()) File "/usr/bin/epad", line 389, in saveFile self.tabbs.currentTab.button.text = os.path.basename(self.tabbs.currentTab.mainEn.file[0]) AttributeError: 'ePadEntry' object has no attribute 'button'
  8. Help Test ePad/elmextensions Update

    Hi there I think it works well, but I wish there were better support for UTF-8. 
There are three problems. First, line 427 in fileselector.py needs to be like this data = os.listdir(unicode(ourPath)) Otherwise I wont be able to see autocomplete if my folder contains filenames with non-ascii. Second problem, line 432 and 944 in epad needs to be like this newfile = io.open(file_selected, 'w') Using builtin function open just creates an empty file if it contains non-ascii. Third problem is that everywhere where you have a print command, and the output is a filename or a path, python stops with an error if the name or path contains utf-8. Like this, line 463 in epad needs .encode('utf-8') print("File Selected: {0}".format(file_selected.encode('utf-8'))) This is just what I tested, and what works for me.
×