Mini Shell

Direktori : /lib64/python3.6/site-packages/pyanaconda/__pycache__/
Upload File :
Current File : //lib64/python3.6/site-packages/pyanaconda/__pycache__/anaconda.cpython-36.pyc

3

Z��ee,�@s�ddlZddlZddlmZddlmZddlZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZdd	lmZmZdd
lmZddlmZe�ZddlmZee�ZGd
d�de�ZdS)�N)�glob)�mkstemp)�addons)�DisplayModes)�	constants)�AnacondaDBusLauncher)�open_with_perm)�
SourceFactory�PayloadSourceTypeUnrecognized)�FlatpakPayload)�get_stdout_logger)�get_module_loggerc@s�eZdZdd�Zdd�Zedd��Zedd��Zed	d
��Z	edd��Z
ed
d��Zejdd��Zedd��Z
e
jdd��Z
edd��Zedd��Zdd�Zdd�Zdd�Zdd�Zedd ��Zd!d"�Zd#S)$�AnacondacCsVd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
tj�|_
d|_dS)NTF)�
_display_mode�_interactive_modeZgui_startup_failed�_intf�ksdata�additional_repos�opts�_payload�	mehConfigZdbus_session_connectionZdbus_inhibit_id�	threadingZLock�gui_initialized�_dbus_launcher)�self�r� /usr/lib64/python3.6/anaconda.py�__init__*s
zAnaconda.__init__cCs||_|j|_dS)z*Load argument to variables from self.opts.N)r�addRepor)rrrrr�
set_from_optsAszAnaconda.set_from_optscCs|jst�|_|jS)N)rr)rrrr�
dbus_launcherFszAnaconda.dbus_launchercCs�|js�|jjjr<tj�r*ddlm}|}q�ddlm}|}nF|j	j
rVddlm}|}n,|jj
jrrddlm}|}nddlm}|}||j�|_|jS)Nr)�RPMOSTreePayloadWithFlatpaks)�RPMOSTreePayload)�
LiveOSPayload)�LiveImagePayload)�
DNFPayload)rrZostreesetup�seenrZis_availableZ#pyanaconda.payload.rpmostreepayloadr!r"rZliveinstZpyanaconda.payload.liver#Zliveimgr$Zpyanaconda.payload.dnfr%)rr!�klassr"r#r$r%rrr�payloadMs"

zAnaconda.payloadcCs�g}|jr6tj|j�r6|j|jdd�jdd�d�|jrhtj|j�rh|j|jdd�jdd�d�xD|jD]:}tj|�\}}tj|�rp|j|dd�jdd�d�qpWxt	d�D]}|j|�q�W|S)N��:rz
/dev/zram*)
�methodr	�is_harddrive�append�splitZstage2rr�_get_additional_repo_namer)rZspecsZadditional_repo�_name�repo_urlZzram_devrrr�get_protected_devicesgs  
"zAnaconda.get_protected_devicescCs>y|jddd�\}}Wntk
r4td�d�YnX||fS)N�,�)�maxsplitzVaddrepo boot option has incorrect format. Correct format is: inst.addrepo=<name>,<url>)r.�
ValueError�RuntimeError)�repo�name�restrrrr/~s
z"Anaconda._get_additional_repo_namecCs|jS)N)r)rrrr�display_mode�szAnaconda.display_modecCsRt|t�r@|jr*|j}tjd|j|j�ntjd|j�||_ntjd|j�dS)Nz#changing display mode from %s to %szsetting display mode to %sz-tried to set an unknown display mode name: %s)�
isinstancerr�log�debug�value�error)rZnew_modeZold_moderrrr;�s
cCs|jS)N)r)rrrr�interactive_mode�szAnaconda.interactive_modecCs.|j|kr*||_|r tjd�n
tjd�dS)Nzworking in interative modezworking in noninteractive mode)rr=r>)rr?rrrrA�s

cCs|jtjkS)z+Report if Anaconda should run with the GUI.)rrZGUI)rrrr�gui_mode�szAnaconda.gui_modecCs|jtjkS)z+Report if Anaconda should run with the TUI.)rrZTUI)rrrr�tui_mode�szAnaconda.tui_modecCs6|jstjd�dStjdtj|jtj|j�dS)NzDisplay mode is not set!zDisplay mode is set to '%s %s'.)r;r=r@�inforZINTERACTIVE_MODE_NAMErAZDISPLAY_MODE_NAME)rrrr�log_display_mode�s

zAnaconda.log_display_modecCs�ddlm}x�|jD]�}|j|�\}}ytj|�}Wn tk
rTtjd|�dSX|||dd�}|j	s�|j
s�|js�|js�|j
r�d|_n8|jr�d|_|j|_|j|_d|_ntjd|jj|�q|j|�|jjj�j|�qWdS)	Nr)�RepoDataz4Type for additional repository %s is not recognized!F)r9�baseurlZinstallTzfile://z=Source type %s for additional repository %s is not supported!)Zpyanaconda.kickstartrFrr/r	Zparse_repo_cmdline_stringr
r=r@Zis_nfsZis_httpZis_httpsZis_ftp�is_fileZenabledr,�	partition�pathZiso_pathrGZsource_typer?�_check_repo_name_uniquenessrr8�dataListr-)rrFZadd_repor9r1�sourcer8rrr�%add_additional_repositories_to_ksdata�s,
z.Anaconda.add_additional_repositories_to_ksdatacCs"||jjj�krtjd|j�dS)z�Log if we are adding repository with already used name

        In automatic kickstart installation this will result in using the first defined repo.
        zCRepository name %s is not unique. Only the first repo will be used!N)rr8rLr=Zwarningr9)rr8rrrrK�sz$Anaconda._check_repo_name_uniquenessc
Csddlm}ddlm}ddlm}ddlm}|�dd�}|j�||dd|�|j	�}d}x8t
j�j�D](\}}	|d|f7}|d	j
||	��7}qlWtd
dd�\}
}|j|�}||7}|jd
�}
tj|
|
�tj|
�tddd��"}|jd|�|j|d�WdQRXdS)Nr)�
ExceptionInfo)�ReverseExceptionDump)�stack)�format_stack�z
Threads
-------
z
Thread %s
�zanaconda-tb-z/tmp)�prefix�dirzutf-8z/tmp/anaconda-tb-all.logza+i�z--- traceback: %s ---
�
)ZmehrOZmeh.dumprP�inspectrQ�	tracebackrR�reverser�sys�_current_frames�items�joinrZtraceback_and_object_dump�encode�os�write�closer)rrOrPZ_stackrRrQZexnZthreadsZ	thread_id�frame�fd�filenameZ	dump_textZdump_text_bytes�frrr�	dumpState�s*


zAnaconda.dumpStatecCs|jS)zThe user interface.)r)rrrr�intfsz
Anaconda.intfcCs�|jrtd��|jrHddlm}|d|j|jdd�|_tjt	j
dd�}nP|jrzddlm
}|d|j�|_tjt	j
d	d�}n|js�td
��ntd|j��|r�|jj|�dS)Nz1Second attempt to initialize the InstallInterfacer)�GraphicalUserInterfaceF)Zgui_lockZ
fullscreenZgui)Z	ui_subdir)�TextUserInterfaceZtuizDisplay mode not set.zUnsupported display mode: %s)rr7rBZpyanaconda.ui.guirir(rrZcollect_addon_pathsrZADDON_PATHSrCZpyanaconda.ui.tuirjr;Zupdate_paths)rriZaddon_pathsrjrrr�
initInterfaces&



zAnaconda.initInterfaceN)�__name__�
__module__�__qualname__rr�propertyr r(�staticmethodr2r/r;�setterrArBrCrErNrKrgrhrkrrrrr)s$	
			#r)r`r[rZtempfilerrZ
pyanacondarZpyanaconda.core.constantsrZpyanaconda.corerZ%pyanaconda.core.startup.dbus_launcherrZpyanaconda.core.utilrZpyanaconda.payload.sourcer	r
Zpyanaconda.payload.flatpakrZpyanaconda.anaconda_loggersrZ	stdoutLogr
rlr=�objectrrrrr�<module>s