+
     iV  c                   sN   ^ RI t ^ RIt^ RIt^ RIt^ RIHtHtHtHt ^ RI	H
t
 ^ RIHt ^ RIHtHt ^ RIHtHt ^ RIHt ^ RIHt ^ R	IHt ^ R
IHt ^ RIHt ^ RIHt ^ RIH t  ^ RI!H"t" ^ RI#H$t$H%t%H&t&H't' ^ RI(H)t) ^ RI*H+t+ ^ RI,H-t-H.t. ^ RI/H0t0 ] ! R4      t1]2t3]2t4 ! R R4      t5R# )i    N)OptionalListTupleSet)GLib)GlobalConfig)InputCombinationInputConfig)	UIMappingMappingData)	PathUtils)Preset)KeyboardLayout)DaemonProxy)DataManagementError)_Group)_)MessageBroker)UInputsData	GroupData
PresetDataCombinationUpdate)ReaderClient)GlobalUInputs)InjectorStateInjectorStateMessage)loggerz
new presetc                   st  a  ] tR t^>t o RtV 3R lR ltR tR tR tR t	R t
R	 tR
 t]V 3R lR l4       t]V 3R lR l4       t]V 3R lR l4       t]V 3R lR l4       tV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR  lt]3V 3R! lR" lltV 3R# lR$ ltV 3R% lR& ltV 3R' lR( ltV 3R) lR* ltV 3R+ lR, ltV 3R- lR. lt V 3R/ lR0 lt!R1 t"R2 t#V 3R3 lR4 lt$R5 t%R6 t&R7 t'R8 t(R9 t)R: t*V 3R; lR< lt+V 3R= lR> lt,V 3R? lR@ lt-RA t.V 3RB lRC lt/RDt0V t1RE# )FDataManagerzDataManager provides an interface to create and modify configurations as well
as modify the state of the Service.

Any state changes will be announced via the MessageBroker.
c                s>   < V ^8  d   QhRS[ RS[RS[RS[RS[RS[/# )   message_brokerconfigreader_clientdaemonuinputskeyboard_layout)r   r   r   r   r   r   Zformat__classdict__   "C/usr/lib/python3.14/site-packages/inputremapper/gui/data_manager.py__annotate__DataManager.__annotate__E   sO     @ @%@ @ $	@
 @ @ (@    c                s    Wn         W0n        W@n        WPn        W`n        VP                  4        W n        V P                  P                  4        R V n        R V n	        R V n
        R # N)r   _reader_client_daemon_uinputs_keyboard_layoutZprepare_all_configZload_config_active_preset_active_mapping_active_input_config)selfr   r   r   r    r!   r"   s   &&&&&&&r&   __init__ZDataManager.__init__E   sY     -+ /  ";?48;?!r)   c                s    V P                   P                  \        V P                  P                  V P                  4       4      4       R# )zSend active group to the MessageBroker.

This is internally called whenever the group changes.
It is usually not necessary to call this explicitly from
outside DataManager.
N)r   publishr   active_groupkeyget_preset_namesr3      &r&   publish_groupZDataManager.publish_group\   s7     	##d''++T-B-B-DE	
r)   c                s    V P                   P                  \        V P                  P                  V P                  4       V P                  4       4      4       R# )zSend active preset to the MessageBroker.

This is internally called whenever the preset changes.
It is usually not necessary to call this explicitly from
outside DataManager.
N)r   r5   r   active_presetnameget_mappingsget_autoloadr9   r:   r&   publish_presetZDataManager.publish_presetg   sE     	##""''):):)<d>O>O>Q	
r)   c                s    V P                   '       d6   V P                  P                  V P                   P                  4       4       R# R# )zSend active mapping to the MessageBroker

This is internally called whenever the mapping changes.
It is usually not necessary to call this explicitly from
outside DataManager.
N)active_mappingr   r5   get_bus_messager9   r:   r&   publish_mappingZDataManager.publish_mappingt   s8     ''(;(;(K(K(MN r)   c                s    V P                   '       dO   V P                   V P                  P                  9   g   Q hV P                  P	                  V P                   4       R# R# )zSend active event to the MessageBroker.

This is internally called whenever the event changes.
It is usually not necessary to call this explicitly from
outside DataManager
N)active_input_configrA   input_combinationr   r5   r9   r:   r&   publish_eventZDataManager.publish_event~   sO     ###++t/B/B/T/TTTT''(@(@A $r)   c                s    V P                   P                  \        V P                  P                  P                  4        UUu/ uF  w  rWP                  4       bK  	  upp4      4       R# u uppi )z0Send the "uinputs" message on the MessageBroker.N)r   r5   r   r-   ZdevicesitemsZcapabilities)r3   r=   Zuinputs   &  r&   publish_uinputsZDataManager.publish_uinputs   sa    ## )-(=(=(C(C(E(E --//(E	
s   A+c                :    V P                   P                  4        R# )z2Publish the "groups" message on the MessageBroker.N)r+   publish_groupsr9   r:   r&   rJ   ZDataManager.publish_groups   s    **,r)   c                s    V P                   '       g   R# V P                  P                  \        V P	                  4       4      4       R# )z:Publish the "injector_state" message for the active_group.N)r6   r   r5   r   	get_stater9   r:   r&   publish_injector_stateZ"DataManager.publish_injector_state   s2       ##$89I$JKr)   c                0   < V ^8  d   QhRS[ S[,          /# r   return)r    r   r#   r%   r&   r'   r(      s     ) )hv. )r)   c                s.    V P                   P                  # )zThe currently loaded group.)r+   groupr9   r:   r&   r6   ZDataManager.active_group   s     ""(((r)   c                @   < V ^8  d   QhRS[ S[S[,          ,          /# rN   )r    r   r   r#   r%   r&   r'   r(      s     # #xy(9: #r)   c                    V P                   # )zThe currently loaded preset.)r0   r9   r:   r&   r<   ZDataManager.active_preset   s     """r)   c                rM   rN   )r    r   r#   r%   r&   r'   r(      s     $ $ 3 $r)   c                rR   )zThe currently loaded mapping.)r1   r9   r:   r&   rA   ZDataManager.active_mapping   s     ###r)   c                rM   rN   )r    r   r#   r%   r&   r'   r(      s     ) )Xk%: )r)   c                rR   )zThe currently loaded event.)r2   r9   r:   r&   rD   ZDataManager.active_input_config   s     (((r)   c                4   < V ^8  d   QhRS[ S[R3,          /# r   rO   .)r   GroupKeyr#   r%   r&   r'   r(      s      Q Qhm 4 Qr)   c                s    \         ;QJ d6    . R V P                  P                  P                  4        4       F  NK  	  5# ! R V P                  P                  P                  4        4       4      # )z%Get all group keys (plugged devices).c              3   s8   "   T F  qP                   x  K  	  R # 5ir*   r7   )Z.0rP      & r&   Z	<genexpr>Z-DataManager.get_group_keys.<locals>.<genexpr>   s     P,O5YY,Os   )tupler+   groupsZfilterr9   r:   r&   get_group_keysZDataManager.get_group_keys   sN    uPD,?,?,F,F,M,M,OPuPuPD,?,?,F,F,M,M,OPPPr)   c                rS   rT   )r   Namer#   r%   r&   r'   r(      s      %c	"2 r)   c                sv   V P                   '       g   \        R4      h\        P                  ! V P                   P                  4      p\        P
                  ! V4       \        P                  ! \        P                  P                  \        P                  ! V4      R4      4      p\        V\        P                  P                  R7       Uu. uFF  p\        P                  P                  \        P                  P                  V4      4      ^ ,          NKH  	  ppVP                  4        \!        V4      # u upi )zEGet all preset names for active_group and current user sorted by age.z%Cannot find presets: Group is not set*.jsonrV   )r6   r   r
   get_preset_pathr=   ZmkdirglobospathjoinescapeZsortedgetmtimeZsplitextbasenameZreverserX   )r3   Zdevice_folderpathsr`   Zpresets   &    r&   r8   ZDataManager.get_preset_names   s       %&MNN!11$2C2C2H2HI&		"'',,t{{='A8LM u"''*:*:;
; GGRWW--d34Q77; 	 

 	W~
s   AD6c                rQ   rN   )r    r   r	   r#   r%   r&   r'   r(      s!     N NhtK'89 Nr)   c                s    V P                   '       g   R# V P                    Uu. uF  qP                  4       NK  	  up# u upi )z$All mappings from the active_preset.N)r0   rB   )r3   mappingrW   r&   r>   ZDataManager.get_mappings   s8    """9=9L9LM9Lg'')9LMMMs   >c                    < V ^8  d   QhRS[ /# rN   Zboolr#   r%   r&   r'   r(      s     
 
d 
r)   c                s    V P                   '       d   V P                  '       g   R# V P                  P                  V P                  P                  V P                   P
                  4      # )z)The autoload status of the active_preset.F)r<   r6   r/   is_autoloadedr7   r=   r9   r:   r&   r?   ZDataManager.get_autoload   sP    !!!):):):||))!!4#5#5#:#:
 	
r)   c                rh   )r   statusri   r#   r%   r&   r'   r(      s      4 r)   c                s   V P                   '       d   V P                  '       g   \        R4      hV'       dF   V P                  P	                  V P                  P
                  V P                   P                  4       MFV P                  4       '       d1   V P                  P	                  V P                  P
                  R4       V P                  4        R# )z`Set the autoload status of the active_preset.

Will send "preset" message on the MessageBroker.
z-Cannot set autoload status: Preset is not setN)	r<   r6   r   r/   set_autoload_presetr7   r=   r?   r@   )r3   rk      &&r&   set_autoloadZDataManager.set_autoload   s    
 !!!):):):%&UVVLL,,!!%%t'9'9'>'>   LL,,T->->-B-BDIr)   c                rh   rN   )rU   r#   r%   r&   r'   r(      s     - -h -r)   c                s>   . p\         P                  P                  \        P                  ! \
        P                  ! 4       4      R4      p\        P                  ! V4       F|  pV P                  P                  P                  \
        P                  ! V4      R,          R7      '       g   KL  VP                  V\         P                  P                  V4      34       K~  	  V'       g   \        4       h\        VR R7      w  r4\
        P                  ! V4      R,          # )z>group_key of the group with the most recently modified preset.z*/*.jsonrV   c                     V ^,          # i    Zxr:   r&   <lambda>Z2DataManager.get_newest_group_key.<locals>.<lambda>       1Q4r)   i)r_   r`   ra   r^   rb   r
   r]   r+   rY   findZ	split_allZappendrc   FileNotFoundErrormax)r3   re   patternr`   r   rf   r&   get_newest_group_keyZ DataManager.get_newest_group_key   s    '',,KK	1134
 IIg&D""))..93F3Ft3LR3P.QQdBGG$4$4T$:;< ' #%%e0""4(,,r)   c                rh   rN   r[   r#   r%   r&   r'   r(      s     5 5 5r)   c                s@   V P                   '       g   \        R4      h\        P                  P	                  \
        P                  ! \        P                  ! V P                   P                  4      4      R4      p\
        P
                  ! V4       Uu. uF#  q"\        P                  P                  V4      3NK%  	  ppV'       g   \        4       h\        VR R7      w  r$\        P                  P                  V4      R,          P                  R4      ^ ,          # u upi )zEPreset name of the most recently modified preset in the active group.z+Cannot find newest preset: Group is not setr\   c                 ro   rp   rq   rr   r:   r&   rs   Z4DataManager.get_newest_preset_name.<locals>.<lambda>  rt   r)   rV   .i)r6   r   r_   r`   ra   r^   rb   r
   r]   r=   rc   rv   rw   split)r3   rx   r`   re   r   rf   r&   get_newest_preset_nameZ"DataManager.get_newest_preset_name   s       %&STT'',,KK	11$2C2C2H2HIJ
 =AIIg<NO<ND((./<NO#%%e0ww}}T"2&,,S1!44 Ps   )Dc                rh   rN   rz   r#   r%   r&   r'   r(     s      T r)   c                sN   V P                   '       g   \        R4      hVP                  4       p\        P                  P                  \        P                  ! V P                   P                  V4      4      '       d   \        P                  ! RV4      pV'       d$   V^,          p\        V^,          4      ^,           pM^p\        P                  P                  \        P                  ! V P                   P                  V RV 24      4      '       d   V^,          pK^  V RV 2# V# )z/The first available preset in the active group.z)Unable find preset name. Group is not setz^(.+) (\d+)$Z )r6   r   Zstripr_   r`   existsr
   r]   r=   rematchZint)r3   r=   r   Zi   &&  r&   get_available_preset_nameZ%DataManager.get_available_preset_name  s       %&QRRzz| 77>>)33D4E4E4J4JDQRR HH_d3EQxaMA%''..))$*;*;*@*@TF!A3-P  QV1QC= r)   c                rh   )r   	group_keystrr#   r%   r&   r'   r(   #  s     & &C &r)   c                s^   WP                  4       9  d   \        R4      h\        P                  ! RV4       RV n        RV n        RV n        V P                  P                  P                  VR7      pV P                  P                  V4       V P                  4        V P                  4        R# )zLoad a group. will publish "groups" and "injector_state" messages.

This will render the active_mapping and active_preset invalid.
z!Unable to load non existing groupzLoading group "%s"NrV   )rZ   r   r   infor2   r1   r0   r+   rY   ru   Z	set_groupr;   rL   )r3   r   rP      && r&   
load_groupZDataManager.load_group#  s    
 //11%&IJJ()4$(!#"##**//I/>%%e,##%r)   c                rh   r   r=   r   r#   r%   r&   r'   r(   5  s       r)   c                sN   V P                   '       g   \        R4      h\        P                  ! RV4       \        P
                  ! V P                   P                  V4      p\        V\        R7      pVP                  4        RV n
        RV n        W0n        V P                  4        R# )znLoad a preset. Will send "preset" message on the MessageBroker.

This will render the active_mapping invalid.
z'Unable to load preset. Group is not setzLoading preset "%s")Zmapping_factoryN)r6   r   r   r   r
   r]   r=   r   r   Zloadr2   r1   r0   r@   )r3   r=   preset_pathZpresetr   r&   load_presetZDataManager.load_preset5  s    
    %&OPP)40//0A0A0F0FMY?$(!#$r)   c                rh   )r   combination)r   r#   r%   r&   r'   r(   G  s      (8 r)   c                s<   V P                   '       g   \        R4      hV P                   P                  V4      pV'       g?   RV: RV P                   P                   2p\        P
                  ! V4       \        V4      hRV n        W n        V P                  4        R# )zALoad a mapping. Will send "mapping" message on the MessageBroker.z)Unable to load mapping. Preset is not setzthe mapping with combination = z does not exist in the N)
r0   r   Zget_mappingr`   r   errorZKeyErrorr2   r1   rC   )r3   r   rg   Zmsgr   r&   load_mappingZDataManager.load_mappingG  s    """%&QRR%%11+>2K#3 4  $ 3 3 8 89;  LL3-$(!&r)   c                rh   )r   input_configr   r#   r%   r&   r'   r(   Y  s      k r)   c                s    V P                   '       g   \        R4      hWP                   P                  9  d%   \        V RV P                   P                   24      hWn        V P                  4        R# )zpLoad a InputConfig from the combination in the active mapping.

Will send "event" message on the MessageBroker,
z(Unable to load event. Mapping is not setz4 is not member of active_mapping.input_combination: N)rA   r   rE   
ValueErrorr2   rF   )r3   r   rm   r&   load_input_configZDataManager.load_input_configY  sn    
 """%&PQQ22DDD. T&&889;  %1!r)   c                rh   )r   new_namer   r#   r%   r&   r'   r(   h  s     " "c "r)   c                s   V P                   '       d   V P                  '       g   \        R4      hV P                   P                  \        P
                  ! V P                  P                  V4      8X  d   R# V P                   P                  pVf   Q h\        P                  P                  V4      P                  R4      ^ ,          p\        P
                  ! V P                  P                  V4      p\        P                  P                  V4      '       d   \        RV RV R24      h\        P                  ! RW$4       \        P                  ! W$4       \        P                  ! 4       p\        P                   ! WEV34       V P"                  P%                  V P                  P&                  V4      '       d1   V P"                  P)                  V P                  P&                  V4       \        P
                  ! V P                  P                  V4      V P                   n        V P+                  4        V P-                  4        R# )zwRename the current preset and move the correct file.

Will send "group" and then "preset" message on the MessageBroker
z'Unable rename preset: Preset is not setNr{   zcannot rename z to z, preset already existszMoving "%s" to "%s")r<   r6   r   r`   r
   r]   r=   r_   rd   r|   r~   r   r   r   ZrenametimeZutimer/   rj   r7   rl   r;   r@   )r3   r   Zold_pathZold_namenew_pathZnows   &&    r&   rename_presetZDataManager.rename_preseth  s   
 !!!):):):%&OPP""i&?&?""H'
 
 %%**###77##H-33C8;,,T->->-C-CXN77>>(## 
$8*<ST  	)8>
		(%iik
:&<<%%d&7&7&;&;XFFLL,,T->->-B-BHM"+";";""H#
 	r)   c                rh   r   r   r#   r%   r&   r'   r(     s       r)   c                sd   V P                   '       d   V P                  '       g   \        R4      hV P                   P                  \        P
                  ! V P                  P                  V4      8X  d   R# WP                  4       9   d   \        RV R24      h\        P
                  ! V P                  P                  V4      p\        P                  ! RV P                   P                  V4       W P                   n        V P                  4        V P                  4        V P                  4        R# )zzCopy the current preset to the given name.

Will send "group" and "preset" message to the MessageBroker and load the copy
z(Unable to copy preset: Preset is not setNza preset with the name z already exitszCopy "%s" to "%s")r<   r6   r   r`   r
   r]   r=   r8   r   r   r   saver;   r@   )r3   r=   r   r   r&   copy_presetZDataManager.copy_preset  s     !!!):):):%&PQQ""i&?&?""D'
 
 ((**6tfNKLL,,T->->-C-CTJ'););)@)@(K"*		r)   c                rh   r   r   r#   r%   r&   r'   r(     s      # r)   c                sH   V P                   '       g   \        R4      h\        P                  ! V P                   P                  V4      p\
        P                  P                  V4      '       d   \        R4      h\        V4      P                  4        V P                  4        R# )zYCreate empty preset in the active_group.

Will send "group" message to the MessageBroker
z&Unable to add preset. Group is not setz#Unable to add preset. Preset existsN)r6   r   r
   r]   r=   r_   r`   r~   r   r   r;   )r3   r=   r`   r   r&   create_presetZDataManager.create_preset  su    
    %&NOO(():):)?)?F77>>$%&KLLtr)   c                s    V P                   P                  p\        P                  ! RV4       \        P
                  ! V4       RV n        RV n         V P                  4        R# )zsDelete the active preset.

Will send "group" message to the MessageBroker
this will invalidate the active mapping,
zRemoving "%s"N)r0   r`   r   r   r_   remover1   r;   )r3   r   rW   r&   delete_presetZDataManager.delete_preset  sK     ))..O[1
		+#"r)   c                sV   V P                   '       g   \        R4      hVP                  R4      ;p'       d   V P                  P	                  V4      VR&   V P
                  P                  pVP                  4        F  w  rE\        V P                   WE4       K  	  RV9   dZ   W0P
                  P                  8w  d@   RV n	        V P                  P                  \        W0P                   P                  4      4       RV9   d   VR,          V P                   n        V P                  4        R# )zUpdate the active mapping with the given keywords and values.

Will send "mapping" message to the MessageBroker. In case of a new
input_combination. This will first send a "combination_update" message.
z)Cannot modify Mapping: Mapping is not setZoutput_symbolrE   Nmapping_type)r1   r   Zgetr.   Zcorrect_caserA   rE   rG   Zsetattrr2   r   r5   r   r   rC   )r3   ZkwargsZsymbolr   r7   Zvalues   &,    r&   update_mappingZDataManager.update_mapping  s     ###%&QRRZZ0060&*&;&;&H&H&PF?#));; ,,.JCD((#5 )  6)22DDD(,D%''!+/C/C/U/UV V# 17~0FD  -r)   c                rh   )r   new_input_configr   r#   r%   r&   r'   r(     s      K r)   c                s>   V P                   '       d   V P                  '       g   \        R4      h\        V P                   P                  4      pWVP                  V P                  4      &   V P                  \        V4      R7       Wn        V P                  4        R# )zUpdate the active input configuration.

Will send "combination_update", "mapping" and "event" messages to the
MessageBroker (in that order)
z%Cannot modify event: Event is not set)rE   N)
rA   rD   r   ZlistrE   Zindexr   r   r2   rF   )r3   r   r   r   r&   update_input_configZDataManager.update_input_config  s     """$*B*B*B%&MNN4..@@ACSK%%d&>&>?@.>{.KL$4!r)   c                s    V P                   '       g   \        R4      hV P                   P                  \        4       4       V P	                  4        R# )z\Create empty mapping in the active preset.

Will send "preset" message to the MessageBroker
z(Cannot create mapping: Preset is not setN)r0   r   Zaddr   r@   r9   r:   r&   create_mappingZDataManager.create_mapping  s>    
 """%&PQQ	,r)   c                s    V P                   '       g   \        R4      hV P                  P                  V P                   P                  4       RV n         V P                  4        R# )zLDelete the active mapping.

Will send "preset" message to the MessageBroker
z7cannot delete active mapping: active mapping is not setN)r1   r   r0   r   rE   r@   r9   r:   r&   delete_mappingZDataManager.delete_mapping  sV    
 ###%I  	""4#7#7#I#IJ#r)   c                sb    V P                   '       d   V P                   P                  4        R# R# )zSave the active preset.N)r0   r   r9   r:   r&   r   ZDataManager.save  s%    $$& r)   c                rI   )zRefresh the groups (plugged devices).

Should send "groups" message to MessageBroker this will not happen immediately
because the system might take a bit until the groups are available
N)r+   refresh_groupsr9   r:   r&   r   ZDataManager.refresh_groups       	**,r)   c                rI   )zRecord user input.

Will send "combination_recorded" messages as new input arrives.
Will eventually send a "recording_finished" message.
N)r+   Zstart_recorderr9   r:   r&   start_combination_recordingZ'DataManager.start_combination_recording  r   r)   c                rI   )z]Stop recording user input.

Will send a recording_finished signal if a recording is running.
N)r+   Zstop_recorderr9   r:   r&   stop_combination_recordingZ&DataManager.stop_combination_recording  s    
 	))+r)   c                s   < V ^8  d   QhRR/# )r   rO   Nrq   r#   r%   r&   r'   r(   #  s     	
 	
 	
r)   c                s    V P                   '       g   \        R4      hV P                  P                  V P                   P                  4       V P                  \        P                  0V P                  4       R# )zgStop injecting for the active group.

Will send "injector_state" message once the injector has stopped.z'Cannot stop injection: Group is not setN)	r6   r   r,   stop_injectingr7   do_when_injector_stater   ZSTOPPEDrL   r9   r:   r&   r   ZDataManager.stop_injecting#  s\        %&OPP##D$5$5$9$9:##""#T%@%@	
r)   c                rh   rN   ri   r#   r%   r&   r'   r(   .  s       r)   c                sF   V P                   '       d   V P                  '       g   \        R4      hV P                  P	                  V P
                  P                  4       4       V P                   P                  f   Q hV P                  P                  V P                  P                  V P                   P                  4      '       d[   V P                  \        P                  \        P                  \        P                  \        P                  0V P                   4       R# R# )zStart injecting the active preset for the active group.

returns if the startup was successfully initialized.
Will send "injector_state" message once the startup is complete.
z)Cannot start injection: Preset is not setTF)r<   r6   r   r,   set_config_dirr/   get_dirr=   start_injectingr7   r   r   ZRUNNINGZERRORZNO_GRABZUPGRADE_EVDEVrL   r9   r:   r&   r   ZDataManager.start_injecting.  s     !!!):):):%&QRR##DLL$8$8$:;!!&&222<<''(9(9(=(=t?Q?Q?V?VWW''!))!''!))!//	 ++ r)   c                rh   rN   )r   r#   r%   r&   r'   r(   F  s     = == =r)   c                s    V P                   '       g   \        R4      hV P                  P                  V P                   P                  4      # )zThe state of the injector.z#Cannot read state: Group is not set)r6   r   r,   rK   r7   r9   r:   r&   rK   ZDataManager.get_stateF  s;       %&KLL||%%d&7&7&;&;<<r)   c                sl    V P                   P                  V P                  P                  4       4       R# )z,Tell the service to refresh its config path.N)r,   r   r/   r   r9   r:   r&   refresh_service_config_pathZ'DataManager.refresh_service_config_pathL  s!    ##DLL$8$8$:;r)   c                rM   )r   states)r   r   r#   r%   r&   r'   r(   P  s     " "S-? "r)   c                sx   a aaa \         P                   ! 4       oVV VV3R lp\        P                  ! ^dV4       R# )z6Run callback once the injector state is one of states.c                  s   < \         P                   ! 4       S,
          ^8  d   \        P                  ! RS4       R# SP                  4       S9   d
   S ! 4        R# R# )i   z-Timed out while waiting for injector state %sFT)r   r   r   rK   )callbackr3   startr   s   r&   doZ.DataManager.do_when_injector_state.<locals>.doT  sD    yy{U"Q& LfU~~6)
r)   N)r   r   Ztimeout_add)r3   r   r   r   r   s   fff @r&   r   Z"DataManager.do_when_injector_stateP  s*    			 	 	b!r)   )	r2   r1   r0   r/   r,   r.   r+   r-   r   N)2Z__name__Z
__module__Z__qualname__Z__firstlineno__Z__doc__r4   r;   r@   rC   rF   rH   rJ   rL   Zpropertyr6   r<   rA   rD   rZ   r8   r>   r?   rn   ry   r}   DEFAULT_PRESET_NAMEr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rK   r   r   Z__static_attributes__Z__classdictcell__)r$   s   @r&   r   r   >   s    @ @.	

O	B	
-L ) ) # # $ $ ) )Q Q  N N
 
 "- -"5 5  .A  6& &$ $ $ " "H 0 @ '
--,	
 	
 0= =<" "r)   r   )6r^   r_   r   r   Ztypingr    r   r   r   Zgi.repositoryr   Z#inputremapper.configs.global_configr   Z"inputremapper.configs.input_configr   r   Zinputremapper.configs.mappingr   r	   Zinputremapper.configs.pathsr
   Zinputremapper.configs.presetr   Z%inputremapper.configs.keyboard_layoutr   Zinputremapper.daemonr   Zinputremapper.exceptionsr   Zinputremapper.groupsr   Zinputremapper.gui.gettextr   Z)inputremapper.gui.messages.message_brokerr   Z'inputremapper.gui.messages.message_datar   r   r   r   Zinputremapper.gui.reader_clientr   Z&inputremapper.injection.global_uinputsr   Z inputremapper.injection.injectorr   r   Zinputremapper.logging.loggerr   r   r   r[   rU   r   rq   r)   r&   <module>r      s}   (  	 	  - -  < L @ 1 / @ , 8 ' '  9 @ 0o  c" c"r)   