Utilities icon indicating copy to clipboard operation
Utilities copied to clipboard

Update askpass.py user interface

Open wjk opened this issue 4 years ago • 7 comments

This PR does two things:

  • Update all copies of askpass.py to the version from the version in the ISO repo, albeit with one change: a colon is now present after “Password”.
  • The package downloader stub scripts now set SUDO_ASKPASS_TEXT.

wjk avatar May 19 '21 23:05 wjk

Thanks @wjk.

Since helloSystem now has /usr/local/bin/askpass, I was thinking of retiring all other copies. What do you think?

Also, let's avoid untranslated English-only text wherever possible, pending https://github.com/helloSystem/Utilities/issues/46#issuecomment-787431844.

Until we have found an easy way to manage translations for PyQt applications, I think "Password: _____" is better than "(Long English-only text): _____"-

probonopd avatar May 21 '21 20:05 probonopd

I created multiple copies of àskpass.py because I was trying to follow the AppImage philosophy of bundling all implementation-detail dependencies. I’ll leave it to your judgment if you want me to remove them and use the system copy. As for the dialog text, please see https://github.com/helloSystem/Utilities/issues/53#issuecomment-799646645; we decided that the calling process is responsible for localizing the SUDO_ASKPASS_TEXT string.

I would also like to invite your attention to the babel package. Among other useful tools, this package includes a pure-Python *.po file parser. It parses plain-text po files into the same type of data structure that would be output by loading a compiled *.mo binary file. I could wrap this library into an API resembling the gettext standard library module, and distribute the *.po files within the application bundles. Sound good to you?

wjk avatar May 21 '21 20:05 wjk

I could wrap this library into an API resembling the gettext standard library module, and distribute the *.po files within the application bundles. Sound good to you?

If this works with halfway reasonable code size and runtime performance overhead, then this would rock :+1: So I would highly appreciate a proof-of-concept.

AppImage philosophy of bundling all implementation-detail dependencies

"... that are not part of the base system". So this one is a close call, and I am still a bit undecided myself. It depends on whether we think that anyone outside of helloSystem will want to use those applications.

probonopd avatar May 21 '21 20:05 probonopd

that are not part of the base system

According to the “Note to distributors” page in your documentation, these apps are not intended to be used outside of helloSystem as-is. Therefore, the askpass script can indeed be assumed to be part of the base system. I will therefore remove the local copies. I will submit my gettext POC in another branch. Thanks!

wjk avatar May 21 '21 20:05 wjk

Agree that we should treat askpass as being part of the base system. However I think we should not hardcode the path but rely on SUDO_ASKPASS being supplied by the system in this case. (I have an experimental helloDesktop-on-Linux system for research purposes where it points to a different absolute path, for example.)

probonopd avatar May 22 '21 10:05 probonopd

@probonopd I can certainly inherit the value for SUDO_ASKPASS from the parent process’s environment, but then what do we do if it is unset? In that case, sudo would prompt for a password on its stdin and block forever since nothing is connected to it.

wjk avatar May 22 '21 17:05 wjk

We could

  • Search for askpass on the $PATH if SUDO_ASKPASS is unset
  • Show an error dialog saying that $SUDO_ASKPASS must be set

probonopd avatar May 23 '21 16:05 probonopd