+
    oÆFj©  ã                   óD   € R t ^ RIt^ RIt ! R R4      t ! R R]4      tR# )z8Interactive functions which can be used in package hooksNc                   óR   a € ] tR t^t o RtR tR tR tRR ltR t	R t
R tR	tV tR
# )ÚHookUIaS  Interactive functions which can be used in package hooks.

This provides an interface for package hooks which need to ask interactive
questions. Directly passing the UserInterface instance to the hooks needs
to be avoided, since we need to call the UI methods in a different thread,
and also don't want hooks to be able to poke in the UI.
c                ó¤   € Wn         \        P                  ! 4       V n        \        P                  ! 4       V n        RV n        RV n        RV n        R# )zCCreate a HookUI object.

ui is the UserInterface instance to wrap.
N)ÚuiÚ	threadingÚEventÚ_request_eventÚ_response_eventÚ_request_fnÚ_request_argsÚ	_response)Úselfr   s   &&Ú0/usr/lib/python3/dist-packages/apport/hook_ui.pyÚ__init__ÚHookUI.__init__   s@   € ð
 Œô (ŸošoÓ/ˆÔÜ(ŸšÓ0ˆÔØˆÔØ!ˆÔØˆŽó    c                ó(   € V P                  RRV4      # )z¤Show an information with OK/Cancel buttons.

This can be used for asking the user to perform a particular action,
such as plugging in a device which does not work.
Úui_info_messageÚ ©Ú_trigger_ui_request©r   Útexts   &&r   ÚinformationÚHookUI.information+   s   € ð ×'Ñ'Ð(9¸2¸tÓDÐDr   c                ó&   € V P                  RV4      # )z|Show a yes/no question.

Return True if the user selected "Yes", False if selected "No" or
"None" on cancel/dialog closing.
Úui_question_yesnor   r   s   &&r   ÚyesnoÚHookUI.yesno3   s   € ð ×'Ñ'Ð(;¸TÓBÐBr   c                ó(   € V P                  RWV4      # )a=  Show an question with predefined choices.

options is a list of strings to present. If multiple is True, they
should be check boxes, if multiple is False they should be radio
buttons.

Return list of selected option indexes, or None if the user cancelled.
If multiple == False, the list will always have one element.
Úui_question_choicer   ©r   r   ÚoptionsÚmultiples   &&&&r   ÚchoiceÚHookUI.choice;   s   € ð ×'Ñ'Ð(<¸dÈXÓVÐVr   c                ó&   € V P                  RV4      # )z]Show a file selector dialog.

Return path if the user selected a file, or None if cancelled.
Úui_question_filer   r   s   &&r   ÚfileÚHookUI.fileG   s   € ð
 ×'Ñ'Ð(:¸DÓAÐAr   c                ó’  € V P                   P                  4       '       d   Q hV P                  P                  4       '       d   Q hV P                  e   Q hRV n        Wn        W n        V P                   P                  4        V P                  P                  4        RV n        V P                  P                  4        V P                  # )z5Called by HookUi functions in info collection thread.N)	r   Úis_setr	   r
   r   r   ÚsetÚwaitÚclear)r   ÚfnÚargss   &&*r   r   ÚHookUI._trigger_ui_requestR   s§   € ð ×&Ñ&×-Ñ-×/Ò/Ð/Ð/Ø×'Ñ'×.Ñ.×0Ò0Ð0Ð0Ø×ÑÒ'Ð'Ð'àˆŒØÔØ!ÔØ×Ñ×ÑÔ!Ø×Ñ×!Ñ!Ô#àˆÔØ×Ñ×"Ñ"Ô$à~‰~Ðr   c                ó’  € V P                   P                  R4       V P                   P                  4       '       g   R# V P                  P                  4       '       d   Q hV P                   P	                  4        \        V P                  V P                  4      ! V P                  !  V n	        V P                  P                  4        R# )z;Called by GUI thread to check and process hook UI requests.çš™™™™™¹?N)r   r-   r+   r	   r.   Úgetattrr   r
   r   r   r,   ©r   s   &r   Úprocess_eventÚHookUI.process_eventd   s’   € ð 	×Ñ× Ñ  Ô%Ø×"Ñ"×)Ñ)×+Ò+Ùà×'Ñ'×.Ñ.×0Ò0Ð0Ð0Ø×Ñ×!Ñ!Ô#Ü  §¡¨$×*:Ñ*:Ô;¸T×=OÑ=OÑPˆŒØ×Ñ× Ñ Ö"r   )r   r   r
   r   r	   r   N©F)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   r   r$   r(   r   r6   Ú__static_attributes__Ú__classdictcell__)Ú__classdict__s   @r   r   r      s6   ø‡ € ñòò$EòCô
WòBò÷$
#ð 
#r   r   c                   ój   a a€ ] tR t^qt oRtV 3R ltV3R lR ltR tR tRR lt	R t
R	 tR
tVtV ;t# )ÚNoninteractiveHookUIz8HookUI variant that does not ask the user any questions.c                ó&   <€ \         SV `  R 4       R # ©N)Úsuperr   )r   Ú	__class__s   &€r   r   ÚNoninteractiveHookUI.__init__t   s   ø€ Ü‰Ñ˜Ör   c                ó    <€ V ^8„  d   QhRS[ /# )é   Úreturn)Ústr)Úformatr@   s   "€r   Ú__annotate__Ú!NoninteractiveHookUI.__annotate__w   s   ø€ ÷ .ñ .™#ñ .r   c                ó4   € V P                   P                   R 2# )z())rF   r9   r5   s   &r   Ú__repr__ÚNoninteractiveHookUI.__repr__w   s   € Ø—.‘.×)Ñ)Ð*¨"Ð-Ð-r   c                ó   € R # rD   © r   s   &&r   r   Ú NoninteractiveHookUI.informationz   ó   € Ùr   c                ó   € R # rD   rS   r   s   &&r   r   ÚNoninteractiveHookUI.yesno}   rU   r   c                ó   € R # rD   rS   r!   s   &&&&r   r$   ÚNoninteractiveHookUI.choice€   rU   r   c                ó   € R # rD   rS   r   s   &&r   r(   ÚNoninteractiveHookUI.fileƒ   rU   r   c                ó2   € \         P                  ! R 4       R# )r3   N)ÚtimeÚsleepr5   s   &r   r6   Ú"NoninteractiveHookUI.process_event†   s   € ä
Š
3Žr   rS   r8   )r9   r:   r;   r<   r=   r   rP   r   r   r$   r(   r6   r>   r?   Ú__classcell__)rF   r@   s   @@r   rB   rB   q   s5   ù‡ € ÙBõ÷.ð .òòôò÷ò r   rB   )r=   r   r]   r   rB   rS   r   r   Ú<module>ra      s)   ðñ ?ã Û ÷^#ñ ^#ôB˜6ö r   