X-Git-Url: http://git.tremily.us/?a=blobdiff_plain;f=bin%2Fpinentry.py;h=2b4267347bd6e3b476cd10352282e09f696e9e97;hb=b1f26778341728661664adf87c1fa1b4f638e701;hp=9d0e7251e52a4a47ff96099833b16e7378737c1b;hpb=d1c160d5df1220d76ebc36118f4d898c34cfc969;p=pyassuan.git diff --git a/bin/pinentry.py b/bin/pinentry.py index 9d0e725..2b42673 100755 --- a/bin/pinentry.py +++ b/bin/pinentry.py @@ -256,7 +256,7 @@ class PinEntry (_server.AssuanServer): This indicator is updated as the passphrase is typed. The clients needs to implement an inquiry named "QUALITY" which - gets passed the current passpharse (percent-plus escaped) and + gets passed the current passphrase (percent-plus escaped) and should send back a string with a single numerical vauelue between -100 and 100. Negative values will be displayed in red. @@ -273,13 +273,27 @@ class PinEntry (_server.AssuanServer): S: OK With STRING being a percent escaped string shown as the tooltip. + + Here is a real world example of these commands in use: + + C: SETQUALITYBAR Quality%3a + S: OK + C: SETQUALITYBAR_TT The quality of the text entered above.%0aPlease ask your administrator for details about the criteria. + S: OK """ - raise NotImplementedError() + self.strings['qualitybar'] = arg + yield _common.Response('OK') + + def _handle_SETQUALITYBAR_TT(self, arg): + self.strings['qualitybar_tooltip'] = arg + yield _common.Response('OK') def _handle_GETPIN(self, arg): try: self._connect() self._write(self.strings['description']) + if 'qualitybar' in self.strings: + self._write(self.strings['qualitybar']) pin = self._prompt(self.strings['prompt'], add_colon=False) finally: self._disconnect()