__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
�

��g#����SSKrSSKrSSKJrJr SSKrSSKrSSKrSSKrSSK	r	SSK
r
SSKrSSKrSSK
Jr SSKrSSKrSSKJr SSKJr SSKJr SSKJr SSKrSSKrSSKrSS	KJr SS
KJ r J!r!J"r" SSK#J$r$ SSK%J&r& SS
K'J(r( "SS\)5r*\+S:Xa/\*"5r,\-"\,R]55 \,R_S5 gg!\a \RrN�f=f!\a SSKrN�f=f!\a	 SSKJr N�f=f)�N)�md5�sha256)�	maketrans)�NamedTemporaryFile)�escape)�ConfigParser)�gettext�)�AptAuth)�SourcesList�SourceEntry�Deb822SourceEntry)�InvalidShortcutException)�shortcut_handler)�Gioc��\rSrSrSrSr\"\"S55urr	r
\S\	S\
S0rS>S	jrS
r
SrSrS
rSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSr Sr!Sr"S r#S!r$S"r%S#r&S$r'S%r(S&r)S'r*S(r+S)r,S*r-S+r.S,r/S-r0S.r1S/r2S0r3S1r4S2r5S3r6S4r7S?S5jr8S?S6jr9S@S7jr:S8r;S9r<S:r=S;r>\?SAS<j5r@S=rAg)B�SoftwareProperties�Dz /usr/share/app-install/channels/z$/etc/update-manager/release-upgrades��normal�lts�neverNc�H�US-UlX0lUS:wa [RR	SU5 US:XaSnX lXl[US9Ul[RR5Ul
/UlSUl
UR5 UR5 UR!5 /Ul[$R&"5Ul[+US9Ul[.R0"5Ul[4R6"UR85 g)	z�Provides the core functionality to configure the used software
repositories, the corresponding authentication keys and
update automation z/etc/popularity-contest.conf�/�DirNz/usr/share/software-properties/)�deb822F)�rootdir)�
popconfiler�apt_pkg�config�set�options�datadirr�sourceslist�
aptsources�distro�
get_distro�seen_server�modified_sourceslist�reload_sourceslist�backup_sourceslist�backup_apt_conf�custom_mirrors�queue�Queue�myqueuer�apt_keyr�Cancellable�cancellable�atexit�register�wait_for_threads)�selfr#r"rrs     �G/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py�__init__�SoftwareProperties.__init__Ws����<�<�D�O��L��#�~�
�n�n�����(��$��1�g��L��L�"�&�1�D���#�#�.�.�0�D�K��D�� %�D���������������D���;�;�=�D�L��7�+�D�L����(�D��
�O�O�D�)�)�*�c��[R"5HBnUR[R"5R:wdM2UR	5 MD g)z8wait for all running threads (PPA key fetchers) to exit N)�	threading�	enumerate�ident�current_thread�join)r7�ts  r8r6�#SoftwareProperties.wait_for_threads�s9��
�
 �
 �
"��	
���I�,�,�.�4�4�	4�	����#r;c���0Ul[RR5HAn[R
R
[RU5nX RU'MC g)z$Backup all apt configuration optionsN)�apt_conf_backup�softwareproperties�CONF_MAP�keysrr �find_i)r7�option�values   r8r,�"SoftwareProperties.backup_apt_conf�sQ���D��$�-�-�2�2�4�����%�%�&8�&A�&A�&�&I�J��',���V�$�5r;c���URR5HJn[RR	[
RU[URU55 ML UR5 g)z$Restore the stored apt configurationN)	rErHrr r!rFrG�str�write_config)r7rJs  r8�restore_apt_conf�#SoftwareProperties.restore_apt_conf�s\���&�&�+�+�-�������-�6�6�v�>��t�3�3�F�;�<�	>�.�	���r;c��[RR[RS5S:�GaY[RR[RS5S:Xa4[
RRS5(a[R$[RR[RS5S:XaD[RR[RS5S:Xa[R$[RR[RS5S:XaD[RR[RS5S:Xa[R$g[RR[RS5S:XaD[RR[RS5S:Xa[R$g)z�Parse the apt cron configuration. Try to fit a predefined use case
and return it. Special case: if the user made a custom
configurtation, that we cannot represent it will return None �
autoupdater�
unattendedr
z/usr/bin/unattended-upgrade�autodownloadN)rr rIrFrG�os�path�exists�UPDATE_INST_SEC�UPDATE_DOWNLOAD�
UPDATE_NOTIFY�
UPDATE_MANUAL�r7s r8�get_update_automation_level�.SoftwareProperties.get_update_automation_level�sj���~�~���/�8�8��F�G�!�K��>�>� � �!3�!<�!<�\�!J�K�q�P��w�w�~�~�;�<�<�%�5�5�5�
�^�^�
"�
"�#5�#>�#>�~�#N�
O�ST�
T�
�^�^�
"�
"�#5�#>�#>�|�#L�
M�QR�
R�%�5�5�5�
�^�^�
"�
"�#5�#>�#>�|�#L�
M�QR�
R�
�^�^�
"�
"�#5�#>�#>�~�#N�
O�ST�
T�%�3�3�3��	���	�	�1�:�:�<�H�	I�Q�	N�	���	�	�1�:�:�>�J�	K�q�	P�!�/�/�/�r;c��U[R:Xav[RR	[R
S[
S55 [RR	[R
S[
S55 GO�U[R:Xav[RR	[R
S[
S55 [RR	[R
S[
S55 GO7U[R:Xau[RR	[R
S[
S55 [RR	[R
S[
S55 O�[RR	[R
S[
S55 [RR	[R
S[
S55 [RR	[R
S[
S55 UR5 g)z�Set the apt periodic configurtation to the selected
update automation level. To synchronize the cache update and the
actual upgrading function, the upgrade function, e.g. unattended,
will run every day, if enabled. rTr
rUrrSN)
rFrYrr r!rGrNrZr[�set_modified_config)r7�states  r8�set_update_automation_level�.SoftwareProperties.set_update_automation_level�s���

�"�2�2�2������-�6�6�|�D�c�!�f�M������-�6�6�~�F��A��O�	�$�4�4�	4������-�6�6�~�F��A��O������-�6�6�|�D�c�!�f�M�	�$�2�2�	2������-�6�6�~�F��A��O������-�6�6�|�D�c�!�f�M������-�6�6�|�D�c�!�f�M������-�6�6�|�D�c�!�f�M������-�6�6�~�F��A��O����r;c��U[RR[RS5:XdK[RR[RS[
U55 UR5 gg)z8Set the interval in which we check for available updatesrSN)rr rIrFrGr!rNra)r7�dayss  r8�set_update_interval�&SoftwareProperties.set_update_interval�s]���W�^�^�*�*�+=�+F�+F�|�+T�U�
U�
�.�.�
�
�/�8�8��F��D�	�
R�
�
"�
"�
$�Vr;c�b�[RR[RS5$)z2Returns the interval of the apt periodic cron job rS)rr rIrFrGr]s r8�get_update_interval�&SoftwareProperties.get_update_interval�s#���>�>� � �!3�!<�!<�\�!J�K�Kr;c��[RRUR5(dUR$[5nUR
UR5 URSS5(aLURSS5R5nURR5Hup4XB:XdMUs $ UR$)zm
return the release upgrade policy:
 RELEASE_UPGRADES_NORMAL,
 RELEASE_UPGRADES_LTS,
 RELEASE_UPGRADES_NEVER
�DEFAULT�Prompt)rVrWrX�RELEASE_UPGRADES_CONF�RELEASE_UPGRADES_NORMALr�read�
has_option�get�lower�release_upgrades_policy_map�items)r7�parser�type�k�vs     r8�get_release_upgrades_policy�.SoftwareProperties.get_release_upgrades_policy�s����7�7�>�>�$�4�4�5�5�
�
)�
)�)�
�^�F�
�K�K��*�*�+�
����8�,�,�
�Z�Z�	�(�
+�
1�
1�
3�d��2�2�8�8�:�$�!��9��(�;��'�'�'r;c�^�[RRUR5(dA[	URS5nURSURU-5 SSS5 g[	URS5n[SS9nUHnnUR5nUR5RS5(a#URS	URU-5 MZURUS
-5 Mp UR5 [R"URUR5 [R"URUR5 SSS5 SSS5 g!,(df   g=f!,(df   N(=f!,(df   g=f)zk
set the release upgrade policy:
 RELEASE_UPGRADES_NORMAL,
 RELEASE_UPGRADES_LTS,
 RELEASE_UPGRADES_NEVER
 �wz[DEFAULT]
Prompt=%s
NT�rzw+)�mode�promptz
Prompt=%s
�
)rVrWrXro�open�writerur�striprt�
startswith�flush�shutil�copymode�name�copy)r7�i�f�out�lines     r8�set_release_upgrades_policy�.SoftwareProperties.set_release_upgrades_policy�s1���7�7�>�>�$�4�4�5�5���*�*�3�/�1�	���(�$�*J�*J�1�*M�M�N�0�
�	
�d�(�(��	-��4F�D�4Q�UX��$��z�z�|���:�:�<�"�"�8�,�,�

�)�)�M�D�$D�$D�Q�$G�G�
H�

�)�)�D��I�
��
�i�i�k��o�o�d�0�0�#�(�(�;��k�k�#�(�(�D�6�6�7�5R�	-��0�/�
��4Q�4Q��	-�	-��s1�"E<�
F�CF
�+F�<
F
�
F	�F�
F,c��[RRUR5(a�[	UR5nUR5R
S5nSSS5 WHDnUR
S5upEUS:Xa'URS5R5S:Xa gMDMF g!,(df   NY=f![a Mgf=f)	z�Will return True if the user wants to participate in the popularity
contest. Otherwise it will return False. Special case: if no
popcon is installed it will return False r�N�=�PARTICIPATE�"�yesTF)
rVrWrXrr�rq�splitr�rt�
ValueError)r7r��linesr��keyrKs      r8�get_popcon_participation�+SoftwareProperties.get_popcon_participation�s���
�w�w�~�~�d�o�o�&�&�
�$�/�/�
"�a��&�&�(�.�.��&�%�#��D�
�"�j�j��o����-�'�E�K�K��,<�,B�,B�,D��,M��-N�'���#�
"���
��
�s� B7�2<C�7
C�
C�Cc	��US:XaSnOSn[RRUR5(aK[	URS5nUVs/sHn[
R"SSU-U5PM  nnSSS5 O�[5n[	SS	5nURURS
55 SSS5 UR5n/nURSU-5 URS[U5-5 URS
5 [	URS5nURW5 SSS5 gs snf!,(df   ND=f!,(df   N�=f!,(df   g=f)z>Enable or disable the participation in the popularity contest Tr��norz^(PARTICIPATE=)(".+?")z\1"%s"Nz/dev/urandom�rbizMY_HOSTID="%s"
zPARTICIPATE="%s"
zUSE_HTTP="yes"
r~)rVrWrXrr��re�subr�updaterq�	hexdigest�appendrN�
writelines)	r7�
is_helpfulrKrr�r��mr��ids	         r8�set_popcon_pariticipation�,SoftwareProperties.set_popcon_pariticipations/���T������	�w�w�~�~�d�o�o�&�&��$�/�/�3�
'�:�!+�-�!+���V�V�5�y�5�7H�$�O�!+�
�-�(�
'�

�E��
�.�$�
'�1�
�H�H�Q�V�V�D�\�"�(�
�[�[�]����
���)�B�.�/�
���+�c�%�j�8�9�
���)�*�	
�d�o�o�s�	#�q�	���U��
$�	#��-�(�
'��(�
'��
$�	#�s6�E�%E	�:E�!E�.E0�	E�
E�
E-�0
E>c�0�[URR5S:aSURlgSURl0n/nUR	URR
5 UR	URR5 UHfnURU;a2URH nXRRU5 M" ME[UR5XR'Mh [URR5S:�a,URRXRR'URRH�nURU;d�URU;dM%[[XR5[UR5-5S:XaMa[[UR5URR-5S:XaM�SURl g g)z�Return True if all distro componets are also available as
source code. Otherwise return Flase. Special case: If the
configuration cannot be represented return Noner
FTrN)�lenr&�source_code_sources�get_source_code�extend�main_sources�
child_sources�template�comps�addr!�
cdrom_sources�cdrom_comps�source_template�
enabled_comps)r7�	templates�sources�source�comps     r8�get_source_code_state�(SoftwareProperties.get_source_code_states���
�4�;�;�*�*�+�a�/�',����#��'+����#��	������t�{�{�/�/�0����t�{�{�0�0�1��F����)�+�"�L�L�D��o�o�.�2�2�4�8�)�.1����->�	�/�/�*���t�{�{�(�(�)�A�-�59�[�[�5L�5L�I�k�k�1�1�2��k�k�5�5�F����i�/����9�,��S��?�?�3�4�s�6�<�<�7H�H�I�Q�N���V�\�\�*�T�[�[�-F�-F�F�G�1�L�.3����+��
6�r;c��SUR4SUR4SUR(+4SUR(+44Hup#[	SU<SU<35 M UR
(aLSUR
R4SUR
R44Hup#[	SU<SU<35 M [	S5 g	)
z4Print the data of a source entry to the command linezURI:zComps:zEnabled:zValid:� z	MatchURI:zBaseURI:r�N)�urir��disabled�invalid�printr��	match_uri�base_uri)r7r��labelrKs    r8�print_source_entry�%SoftwareProperties.print_source_entryEs���"�F�J�J�/�$�f�l�l�3�&�F�O�O�(;�<�$�&�.�.�&8�9�;���	�%��'�(�	;�
��� +�V�_�_�-F�-F�G� *�F�O�O�,D�,D�E�G�N�U��e�U�+�,�G�
�$�Kr;c��[S5 URHn[UR55 M [S5 g)zPrint the complete sources.listzSTART SOURCES.LIST:zEND SOURCES.LIST
N)r�r$rN�r7r�s  r8�massive_debug_output�'SoftwareProperties.massive_debug_outputRs2��	�
� ��"�"��
�f�j�j�l��#�	�
�r;c�|�XRlURRU5nUR5 U$)z change the main download server )r&�default_server�
change_server�set_modified_sourceslist)r7�server�ress   r8�change_main_download_server�.SoftwareProperties.change_main_download_serverYs1��!'�K�K��
�+�+�
#�
#�F�
+�C��!�!�#��Jr;c�Z�URRU5 UR5 g)z Enable a component of the distroN)r&�enable_componentr��r7r�s  r8r��#SoftwareProperties.enable_component`s ���K�K� � ��&��!�!�#r;c�Z�URRU5 UR5 g)z!Disable a component of the distroN)r&�disable_componentr�r�s  r8r��$SoftwareProperties.disable_componentes ���K�K�!�!�$�'��!�!�#r;c�z�URRRHnURU:XdMUs $ g�N)r&r��childrenr�)r7r�r�s   r8�_find_template_from_string�-SoftwareProperties._find_template_from_stringjs-���K�K�/�/�8�8��	���$�	���9r;c��[U[5(aURU5nURRH0nUR
U:XdMURRU5 M2 URRH0nUR
U:XdMURRU5 M2 UR5 g)�7Enable a child repo of the distribution main repositoryN)
�
isinstancerNr�r&r�r�r$�remover�r�)r7r�r�s   r8�disable_child_source�'SoftwareProperties.disable_child_sourceos����(�C� � ��0�0��:�h��+�+�+�+���?�?�h�&����#�#�F�+�,��+�+�1�1���?�?�h�&����#�#�F�+�2�	�!�!�#r;c��[U[5(aURU5nURS:XaURR
nOURnURR
X!RS9 UR5 g)r�N)r��dist)	r�rNr�r�r&r��
add_sourcer�r�)r7r��	child_uris   r8�enable_child_source�&SoftwareProperties.enable_child_source|sn���(�C� � ��0�0��:�h����D� ��K�K�.�.�	��%�%�	��K�K���y�}�}��=��!�!�#r;c�,�/nURURR5 URURR5 URRHnUR
R
U5 M  UR5 g)z%Remove all distro source code sourcesN)r�r&r�r�r�r$r�r��r7r�r�s   r8�disable_source_code_sources�.SoftwareProperties.disable_source_code_sources�sg���G��N�N�4�;�;�+�+�,��N�N�4�;�;�,�,�-��+�+�1�1��������'�2��!�!�#r;c�X�/nURURR5 URURR5 URRHnUR
R
U5 M  UHgnUR
RSURURURSUR
RU5S-URUS9 Mi URRH�nUR
RSURRRURRR URSUR
RU5S-URUS9 M� UR#5 g)z0Enable source code source for all distro sources�deb-srczAdded by software-propertiesr
)�parentN)r�r&r�r�r�r$r�r�r�r�r��index�filer�r�r�r�r�r�s   r8�enable_source_code_sources�-SoftwareProperties.enable_source_code_sources�sQ���G��N�N�4�;�;�+�+�,��N�N�4�;�;�,�,�-��+�+�1�1��������'�2��������Y�#�Z�Z�#�[�[�#�\�\�;�!�-�-�3�3�F�;�A�=�#�[�[�$*�	�	,���+�+�+�+�������Y�!�[�[�8�8�A�A�!�[�[�8�8�=�=�#�\�\�;�!�-�-�3�3�F�;�A�=�#�[�[�$*�	�	,�,�	�!�!�#r;c�n�/UlURRH�n[U[5(a[	UR
URS9nOB[U[5(a[UR
URS9nO[SU35eURRU5 M� g)z+Store a backup of the source.list in memory�r�r���sectionr��Unknown source: N)
�sourceslist_backupr$�listr�r
r�r�r�	TypeErrorr�)r7r��
source_bkps   r8r+�%SoftwareProperties.backup_sourceslist�s��� �D���"�"�'�'���f�k�*�*�$�&�+�+�6�;�;�G�J�
�� 1�
2�
2�*�6�;�;�V�[�[�Q�J��.�v�h�7�8�8����&�&�z�2�(r;c��UR5 URRHn[U5U:XdMUs $ gr�)r*r$r�rN)r7r�r�s   r8�_find_source_from_string�+SoftwareProperties._find_source_from_string�s<��	�����"�"�'�'��	�V���	��
�(�r;c��[U[5(aURU5nUR(+UlUR	5 g)z&Enable or disable the selected channelN)r�rNrr�r�r�s  r8�toggle_source_use�$SoftwareProperties.toggle_source_use�s;���&�#����,�,�V�4�f� �/�/�)�F�O��!�!�#r;c��[URR5H�up4[U5U:XdMURRURn[U[5(a#[
X%5URRU'O"[X%5URRU'UR5  g g)NTF)	r>r$r�rNr�r�rr
r�)r7�	old_entry�	new_entryr��entryr�s      r8�replace_source_entry�'SoftwareProperties.replace_source_entry�s���#�D�$4�$4�$9�$9�:���	�U��y�	 ����$�$�U�+�0�0���e�.�/�/�+<�Y�+M�D���!�!�%�(�+6�y�+G�D���!�!�%�(��%�%�'��;�r;c�D�UR5 UR5 g)zFRevert all settings to the state when software-properties
was launchedN)rP�revert_sourceslistr]s r8�revert�SoftwareProperties.revert�s��	�������r;c���/URlURH�n[U[5(a[	UR
URS9nOB[U[5(a[UR
URS9nO[SU35eURRRU5 M� UR5 UR5 g)z6Restore the source list from the startup of the dialogr�r�r�N)r$r�r�r�r
r�r�rrr��save_sourceslistr*)r7r��source_resets   r8r�%SoftwareProperties.revert_sourceslist�s����D�����)�)���f�k�*�*�&�F�K�K�V�[�[�I�L�
�� 1�
2�
2�,�V�[�[�v�{�{�S�L��.�v�h�7�8�8������$�$�\�2�*�	�������r;c���SUlUR(a+URR(aUR5 UR	5 UR5 g)zCThe sources list was changed and now needs to be saved and reloadedTN)r)r"�
massive_debugr�rr*r]s r8r��+SoftwareProperties.set_modified_sourceslist�sA�� $�D���|�|����2�2��!�!�#��������r;c�$�UR5 g)z+Write the changed apt configuration to fileN)rOr]s r8ra�&SoftwareProperties.set_modified_config�s�����r;c��URS:XGa?UR(a�URRSS5R5SS[	UR5S:�aSOS-nS[U5<SUR<3n[	UR5S	:�aURHnUS
U--
nM
 URS;aUS
[S5--
nUS
UR--
nU$SUR<SUR<S3nURHnUS
U--
nM
 URS;aUS
[S5--
nU$SURR-nURS;aUS[S5--
nUR(aUS
UR--
nURRS:Xa~URHnnURRU5(aCURRH'nURU:XdMUS
UR--
nM) MfUS
U--
nMp U$)z5Render a nice output to show the source in a treeviewNr�r��Pu[…]�z<b>z</b> r
z %s)r�zrpm-srcz
(Source Code)z
%sz</b>z	<b>%s</b>z (%s)zSource CodeF)r��comment�replacer�r�rr�r�rx�_r��description�child�
has_component�
componentsr�)r7r�r�contents�cr�s      r8�
render_source� SoftwareProperties.render_source�s��
���$���>�>����&�&�t�S�1�7�7�9�#�2�>�!�&�.�.�1�B�6�7�B�@�
�*0���&�+�+�F�H��6�<�<� �1�$����A����	�)�H�&��{�{�4�4��E�A�o�$6�6�6�������+�+�H���'�*0���V�[�[�A�H��\�\���E�A�I�%��"��{�{�4�4��E�A�o�$6�6�6��������!<�!<�<���;�;�0�0���!�M�"2�2�2�H��>�>��u�v�~�~�-�-�H��?�?� � �E�)������?�?�0�0��6�6�$�_�_�7�7���6�6�T�>�$�����(>�>�H�8����
�-�H�%��r;c��SnSnSnSn[SS5nUR(a?SnURRnURRUR:XaSnO>UR
<SUR<SUR<3nUR(aSnURRS5(aSnX#XEURU54$)z&extract attributes to sort the sourcesr
�
0123456789�
9876543210rr��src)rr�r"�distributionr&r�r�r�rrx�find�	translate)r7r��cur_sys�has_template�has_comment�	is_source�revert_numbers�descs        r8�get_comparable�!SoftwareProperties.get_comparable(s����g��l��k��i� ��|�<�n�	��������*�*���?�?�'�'�4�;�;�6��G��%�z�z�6�;�;����E�$�
�^�^��k�	���	�	�%�	 �	 ��)��[��n�n�^�,�.�.r;c��/nURRH�nUR(aMX RR;dM1X RR
;dMLX RR;dMgX RR;dM�X RR;dM�URU5 M� U$)z>Return a list of sources that are not part of the distribution)
r$r�r�r&r�r�r��disabled_sourcesr�r�)r7�isv_sourcesr�s   r8�get_isv_sources�"SoftwareProperties.get_isv_sources=s����K��"�"�'�'���~�~�~��+�+�2�2�2��+�+�3�3�3��+�+�3�3�3��+�+�6�6�6����8�8�8����v�&�(��r;c�.�URR$)z-Return the list of CDROM based distro sources)r&r�r]s r8�get_cdrom_sources�$SoftwareProperties.get_cdrom_sourcesJs���;�;�$�$�$r;c�L�URURR;S4$)z�Return a tuple: the first value describes if a component is enabled
in the Internet repositories. The second value describes if the
first value is inconsistent.F)r�r&�download_compsr�s  r8�get_comp_download_state�*SoftwareProperties.get_comp_download_stateNs"��

�I�I����3�3�3�U�;�;r;c��/nURRH0nURU:XdMURUR5 M2 [U5S:�a0[URR[U5-5S:Xag[U5S:�a0[URR[U5-5S:wagg)z�Return a tuple: the first value describes if a component is enabled
in one of the child source that matcth the given template.
The second value describes if the first value is inconsistent.r)TF)FT)FF)r&r�r�r�r�r�r�r!)r7r�r�r#s    r8�get_comp_child_state�'SoftwareProperties.get_comp_child_stateUs���
�E����*�*���>�>�X�%��L�L����%�+��5�z�A�~��D�K�K�%�%��E�
�2�3�q�8��	�U��a���D�K�K�%�%��E�
�2�3�q�8��r;c��URR5 /UlURR	UR5 UR5 gr�)r$�refresh�sourceslist_visibler&�get_sourcesr�r]s r8r*�%SoftwareProperties.reload_sourceslistjs@���������D���K�K���D�,�,�-���� r;c��URS-URS-URS-/nUH)n[RRU5(dM) O� [	S5 [RRW5n[RR
U5(d#[R"U5RSS9 [USS5nURS	5 S
S
S
5 Sn[RR
U5(ad[R"U5[RnU[R-(d%[	SU-5 [R"US
5 UGHn/n[RRU5(dM,[US5nUR!5nS
S
S
5 ["R$R'S5n[US5nUHFn	UR)5Hn
U	R+SU
-5S:�dM M3 URU	5 MH UR)5H,nURSU<SUR-U5<S35 M. S
S
S
5 GM g
!,(df   GN�=f!,(df   N�=f!,(df   GMJ=f)z+Write the current apt configuration to filez/etc/apt/apt.conf.d/10periodicz#/etc/apt/apt.conf.d/20auto-upgradesz+/etc/apt/apt.conf.d/15adept-periodic-updatezNo config found, creating oneT)�parentsrr~rNz/etc/cron.daily/aptz file '%s' not executable, fixingi�rz
APT::PeriodiczAPT::Periodic::%szAPT::Periodic::z "z";
)rrVrW�isfiler��dirnamerX�pathlib�Path�mkdirr�r��stat�ST_MODE�S_IXUSR�chmod�	readlinesrr �subtreer�r/rI)r7�	conffilesr�rP�ac�perm�periodic�content�cnfr�r�r�s            r8rO�SoftwareProperties.write_configps�����>�>����C�C����K�K�M�I�
��	������	�	�
���+�,�������"�g�
�W�W�^�^�G�
$�
$����W��#�#�D�#�1��	�!��c�"�a�	�����#�
�B�	�w�w�~�~�b���
�W�W�R�[����
&�d��T�\�\�!�
�0�2�5�6�
����U�����g�	������	!�	!�
�(�C�
 �A��K�K�M�'�!��n�n�$�$�_�5���(�C�
 �A��d��x�x�z�����.�#�6�7�1�<��"��g�g�d�m���8�8�:�a�
�G�G�Q��
�
�1�
�F�G��!�
 ��#�"�� !�
 ��
!�
 �s+�J�:J+�>/J<�1AJ<�
J(�+
J9	�<
K	c�n�URRS5 URR5 g)zJBackup the existing sources.list files and write the current
configurationz.saveN)r$�backup�saver]s r8r�#SoftwareProperties.save_sourceslist�s*��	�����G�$������r;c�*�[U5n[RRUR5(a�[
R
"SUR-5H�n[
U5nUH�nUR5RS5(aM)U[U5:XdM:[RR[RRU55Ss sSSS5 s $ SSS5 M� g!,(df   M�=f)zg
helper that checks if a given line is in the source list
return the channel name or None if not found
z	%s/*.list�#rN)r
rVrWrX�CHANNEL_PATH�globr�r�r��splitext�basename)r7�srcline�srcentry�filenamer�r�s      r8�_get_channel_from_line�)SoftwareProperties._get_channel_from_line�s���
�7�#�H�	�w�w�~�~�d�'�'�(�(��i�i��d�.?�.?� ?�@�(�
�(�^�q��d��z�z�|�&�&�s�+�+���;�t�,�,��W�W�%�%�b�g�g�&6�&6�x�&@�A�!�D�D��^���^�A��
�^�s�+9D�(AD�4D�
D	c��UR5RnURU5nU(a&UR<SU<S3nUR	U5 gg)zw
helper that adds the gpg key of the channel to the apt
keyring *if* the channel is in /usr/share/app-install/channels
rz.keyTF)r
r�rnrg�add_key)r7�shortcutrk�channel�keyps     r8�&check_and_add_key_for_channel_shortcut�9SoftwareProperties.check_and_add_key_for_channel_shortcut�sM��
�"�"�$�)�)�G��)�)�'�2�G�� �-�-�w�
7�d�
�l�l�4��
�r;c��g)z(abstract interface to keep the UI alive N�r]s r8�update_interface�#SoftwareProperties.update_interface�s�r;c���URS5(dU$UR5SnURSS5SnSU<SURR<SU<3nU$![a SnN2f=f)z�
short cut - this:
  apt-add-repository http://packages.medibuntu.org free non-free
same as
  apt-add-repository 'deb http://packages.medibuntu.org/ '$(lsb_release -cs)' free non-free'
�httprr�r
�mainzdeb )r�r��
IndexErrorr&�codename)r7r��repo�areass    r8�expand_http_line�#SoftwareProperties.expand_http_line�su���?�?�6�"�"�
�k��:�:�<��?�D���
�
�3�q�!�!�$���#�D�K�K�$8�$8�%�A�D��K�������s�A&�&A5�4A5c�x�[UR55nURX25$![a gf=f)z"
Add a source for the given line.
F)rr�r�add_source_from_shortcut)r7r��enable_source_coderrs    r8�add_source_from_line�'SoftwareProperties.add_source_from_line�s>���#�D�J�J�L�1���(�(��F�F��$��
��s�,�
9�9c
��UR5RnURnURU5nU(aSOSnXSSS-n[X45n[Xd5nUR(dUR(agURU5(dUR
5 URRURURURURURURURS9 URRUURURURURURURS9 UR!5 UR"(aHUR"R$(a-SSKn	U	R)5n
U
R%URS9 g	)
z�
Add a source with the given shortcut and add the signing key if the
site is a known channel or the shortcut implementer adds it.
r�z	# deb-srcrNF)rr��
architecturesr)�sources_listT)r
r��sourceparts_filer�r�rurqr$r�rxr�r�r�rr�r�r�r"r��apt�Cache)r7rrr��deb_liner��debsrc_entry_type�debsrc_line�
new_deb_entry�new_debsrc_entryr��caches           r8r��+SoftwareProperties.add_source_from_shortcut�s����#�#�%�*�*�H��$�$�D��$�$�X�.�H�%7�	�[��#�q�r�l�2�K���/�M�"�;�5����� 0� 8� 8�
��6�6�x�@�@�����������+�+�&�*�*�&�+�+�&�,�,�!.�!6�!6�+�0�0�'4�'B�'B�
�D�	�����*�)�-�-�)�.�.�)�/�/�!1�!9�!9�.�3�3�'7�'E�'E�
�G�	�!�!�#��|�|����+�+���	�	���
���"2�"7�"7��8�r;c��U(a�[U[5(a$URU5nURUS5 gUbaURUS5 [R"U5nSUlSUlURUS5 SUlURUS5 g[U[5(aURU5nUcgUR[RRS5:wa�URRS5(a8URRR[SURS95 O7URRR[!SURS95 URR#U5 UR'5 g![$a Nf=f)	zRemove the given sourceTNFr�zDir::Etc::sourcelistz.sourcesr)r�)r�rNr�
remove_sourcer�rxr�r�rr �	find_file�endswithr$r�r�rr
r�r�r�)r7r��remove_source_codes   r8r�� SoftwareProperties.remove_source	sy���	�F�C�	 �	 ��.�.�v�6�����6�4�(�
������6�5�)����6�"�����������6�5�)�������6�5�)���&�#����,�,�V�4�f�
�~��
�{�{�g�n�n�.�.�/E�F�F�	���	�	�j�	)�	)������$�$�%6�r����%L�M������$�$�[��&�+�+�%F�G��
�����f�%�	�!�!�#��
��
��s�
F9�9
G�Gc��[RRU5(dgURR	U5nU$! g=f)z7Add a gnupg key to the list of trusted software vendorsF)rVrWrXr1r�)r7rWr�s   r8rq�SoftwareProperties.add_key4s@��
�7�7�>�>�$������l�l���t�$���
����s�A�Ac��[R"5nUR5RS5(a2US-[	URS55R
5-S-nO\[US5S;a2US-[	URS55R
5-S-nO[SU35 S	S	S	5 g
[US5nURU5 UR5 S	S	S	5 URWR5sS	S	S	5 $!,(df   N2=f!,(df   g	=f)z<Add a gnupg key from a utf-8 data string (e.g. copy-n-paste)z$-----BEGIN PGP PUBLIC KEY BLOCK-----rzutf-8z.ascr)����z.gpgzNot an OpenPGP certificate: NFr~)�tempfile�TemporaryDirectoryr�r�r�encoder��ordr�r�r�r�rqr�)r7�keydata�tmpdir�tmpfile�tmps     r8�add_key_from_data�$SoftwareProperties.add_key_from_data>s���	�	$�	$�	&�&��=�=�?�%�%�&L�M�M��s�l�V�G�N�N�7�,C�%D�%N�%N�%P�P�SY�Y�G�
����_� 2�
2��s�l�V�G�N�N�7�,C�%D�%N�%N�%P�P�SY�Y�G��0��	�:�;��
'�	&��'�3�
�3��I�I�g���I�I�K� ��|�|�C�H�H�%�
'�	&� �
��
'�	&�s*�B*D4�	D4�"D#�7"D4�#
D1	�-D4�4
Ec�J�URRU5 g! g=f)z<Remove a gnupg key from the list of trusted software vendorsTF)r1�rm)r7�keyids  r8�
remove_key�SoftwareProperties.remove_keyMs$��������������s��"c�J�[U[R5(deURnU(aURnUR
nO?[R"U5nURU5nURnUR
nUR<SU<SU<S3$)z!Return the PackageKit package id �;)	r�r�Package�current_ver�ver_str�arch�DepCache�get_candidate_verr�)r7�	apt_cache�pkg�cur_ver�verr��depcache�	candidates        r8�get_package_id�!SoftwareProperties.get_package_idUs|���c�7�?�?�+�+�+�+��o�o�G���o�o���|�|���#�#�I�.���.�.�s�3�	������~�~���(�(�C��.�.r;c�:�[R"U5nURU5n/nURR	S5H9nUH0upxn	URU5S:wdMUR
X5 M2 M; U$![[4a /s$f=f)zEGet the package dependencies, which can be filtered out by a pattern �Depends���)	rr�r��depends_list_strrsr/r��KeyErrorr)
r��package�patternr�r��dependencies�dep_list�dep_name�dep_ver�dep_ops
          r8�get_dependencies�#SoftwareProperties.get_dependenciescs������	�*�H��*�*�7�3�I��L��!�2�2�6�6�y�A�H�-5�)��6��=�=��)�R�/� �'�'�	�(;�<�.6�B����
�i� ���	��s�9B�(B�B�B)rEr1r3r-r#r&r)r0r"rrr(r$r�rJ)NNrF)F)Tr�)B�__name__�
__module__�__qualname__�__firstlineno__rgror��rangerp�RELEASE_UPGRADES_LTS�RELEASE_UPGRADES_NEVERrur9r6r,rPr^rcrgrjr{r�r�r�r�r�r�r�r�r�r�r�r�r�r�r+rrr
rrr�rar(r7r<r?rCrFr*rOrrnruryr�r�r�r�rqr�r�r��staticmethodr��__static_attributes__rxr;r8rrDsb��2�,�A���5��8�n�	�����h��e��g�!��'+�R�-���.�(%�L�(�&�0� �2%�N� ��$�
$�
�
$�$�$�$�<
3��$������(�T.�*�%�<��*!�/H�b�� �0��"	G�$�L)$�V�
&��/����r;r�__main__)0rr��hashlibrrr�rVrhr�r=r4r�rQ�stringr�ImportErrorrNrTr.r/r�xml.sax.saxutilsr�configparserrr	r!r%�aptsources.distrorFr�aptsources.sourceslistrr
r�"softwareproperties.shortcuthandlerr�softwareproperties.shortcutsr�
gi.repositoryr�objectrr��spr�r{r�rxr;r8�<module>r�s���4���	�	��
��
��������(�#�(�'�!�����P�P�G�9��n��n�b�z����"���&�&�(�)�� � ��#���]���m�m�)���������(�'�(�s4�C	�C!�C1�	C�C�!
C.�-C.�1D�?D

Filemanager

Name Type Size Permission Actions
AptAuth.cpython-313.pyc File 5.21 KB 0644
CountryInformation.cpython-313.pyc File 2.14 KB 0644
MirrorTest.cpython-313.pyc File 10.88 KB 0644
SoftwareProperties.cpython-313.pyc File 46.85 KB 0644
__init__.cpython-313.pyc File 628 B 0644
cloudarchive.cpython-313.pyc File 7.36 KB 0644
distro.cpython-313.pyc File 1.48 KB 0644
ppa.cpython-313.pyc File 11.7 KB 0644
shortcuthandler.cpython-313.pyc File 37.76 KB 0644
shortcuts.cpython-313.pyc File 1.01 KB 0644
sourceslist.cpython-313.pyc File 2.03 KB 0644
sourceutils.cpython-313.pyc File 3.26 KB 0644
uri.cpython-313.pyc File 1.84 KB 0644
Filemanager