/snap/core22/2437/usr/share/subiquity/subiquitycore/ui/__pycache__
NameSizeModeActions
actionmenu.cpython-310.pyc46350644editdlrm
anchors.cpython-310.pyc15870644editdlrm
buttons.cpython-310.pyc16350644editdlrm
container.cpython-310.pyc126220644editdlrm
form.cpython-310.pyc161050644editdlrm
frame.cpython-310.pyc17130644editdlrm
interactive.cpython-310.pyc36110644editdlrm
selector.cpython-310.pyc79160644editdlrm
spinner.cpython-310.pyc16740644editdlrm
stretchy.cpython-310.pyc56220644editdlrm
table.cpython-310.pyc139490644editdlrm
utils.cpython-310.pyc105380644editdlrm
width.cpython-310.pyc11300644editdlrm
__init__.cpython-310.pyc1790644editdlrm
Edit: /snap/core22/2437/usr/share/subiquity/subiquitycore/ui/__pycache__/form.cpython-310.pyc (16105B)
o K^:@sJddlZddlZddlmZddlmZmZmZmZm Z m Z m Z m Z mZddlmZmZddlmZmZddlmZmZmZmZddlmZddlmZmZmZdd l m!Z!m"Z"m#Z#m$Z$dd l%m&Z&e'd Z(e)Z*e)Z+Gd d d edeZ,GdddeZ-Gdddej.Z/Gddde)Z0deddiZ1Gddde)Z2ddZ3e3eZ4e3eZ5e3eZ6e3eZ7Gddde Z8Gddde/Z9Gd d!d!ee0Z:e3e:Z;Gd"d#d#e/ZGd(d)d)eZ?Gd*d+d+e/Z@Gd,d-d-e ZAGd.d/d/e)eAd0ZBGd1d2d2eZCGd3d4d4e/ZDGd5d6d6eBZEdS)7N)urlparse) CheckBoxconnect_signaldelegate_to_widget_mixin emit_signal MetaSignalsPadding RadioButtonTextWidgetDecoration) cancel_btndone_btn)Pile WidgetWrap)PasswordEditor IntegerEditor StringEditor EmailEditor)Selector)ColSpec TablePileTableRow) button_pileColordisabledscreen) widget_widthzsubiquitycore.ui.formc@s2eZdZdZddZeddZejddZdS) ToggleableTcCs||_d|_d|_dS)NFT)original_enabledenabled)selfrr"-/usr/share/subiquity/subiquitycore/ui/form.py__init__Ns zToggleable.__init__cC|jSNrr!r"r"r#r SzToggleable.enabledcCs4|r |js |j|_n |s|jrt|j|_||_dSr&)rroriginal_widgetrr!valr"r"r#r Ws     N)__name__ __module__ __qualname__has_original_widthr$propertyr setterr"r"r"r#rIs r_original_widgetcs,eZdZfddZddZddZZS) _Validatorcs||_t|dSr&)fieldsuperr$)r!r5w __class__r"r#r$bz_Validator.__init__cC t|jSr&)r_wr(r"r"r#get_natural_widthf z_Validator.get_natural_widthcCs4d|j_t|jjdd}|dur||jdS)NF lost_focus)r5 showing_extragetattrr< base_widgetvalidate)r!lfr"r"r#r?is z_Validator.lost_focus)r-r.r/r$r=r? __classcell__r"r"r8r#r4`s r4c@s8eZdZdZdZdZd ddZejddZ dd Z dS) FormFieldrTNcCs&||_||_tj|_tjd7_dS)N)captionhelprF next_indexindex)r!rHrIr"r"r#r$wszFormField.__init__cCsdSr&r"r!formr"r"r# _make_widget}szFormField._make_widgetcCs||}t|||Sr&)rNBoundFormField)r!rMwidgetr"r"r#binds  zFormField.bindNN) r-r.r/rJtakes_default_style caption_firstr$abcabstractmethodrNrQr"r"r"r#rFqs   rFc@eZdZdZddZdS)WantsToKnowFormFieldzA marker class.cC ||_dSr&)bff)r!rZr"r"r#set_bound_form_fieldr>z)WantsToKnowFormField.set_bound_form_fieldN)r-r.r/__doc__r[r"r"r"r#rXs rXrGF)packc@seZdZddZddZddZddZd d Zdd d ZddZ e ddZ e j ddZ e ddZ e j ddZ e ddZej ddZe ddZej ddZdS)rOcCsl||_||_||_d|_d|_d|_d|_|dt|dgvr(t |d|j t |t r4| |dSdS)NFTchangesignals)r5rMrPin_errorr_helpr@ _build_tablerAr_change isinstancerXr[)r!r5rMrPr"r"r#r$s zBoundFormField.__init__cCs|j}|jjr t|}|jturt|j|_ntd|_|jj t ur2dt ||fg}d|jfg}n0tt |jj |_ |jjrLd|j _|j t ||g}nt |t|dt|d|j g}td|jg}|g}|jturo||dd|D|_t|jdtd|_dS)Nright)alignwidthcSsg|]}tt|qSr")rr).0rowr"r"r# sz/BoundFormField._build_table..)spacingcolspecs)rPr5rSr string_inputrINO_HELPr under_textrH NO_CAPTIONr4_ caption_textrTrh UrwidPaddingrappend_rowsr form_colspecs_table)r!rP first_row second_rowrowsr"r"r#rbs8      zBoundFormField._build_tablecCs*t|jd|jjd}|dur||}|S)Nclean_)rArMr5name)r!valuecleanerr"r"r#cleanszBoundFormField.cleancCsf|js|jr1d|_||_|}|`|durdSd|_|js*|jtur*|j|j|j dSdS)NF) r`r@tmpval _validaterIrprqset_textrM validated)r!sendernew_valrr"r"r#rcs zBoundFormField._changec Csj|jsdSz|jWnty }z t|WYd}~Sd}~wwt|jd|jjd}|dur3|SdS)N validate_)rr ValueErrorstrrArMr5r~)r!e validatorr"r"r#rs zBoundFormField._validateTcCs\|}|durd|_|js|jtur|j|jn d|_|r'|d|f|j dS)NFT info_error) rr`r@rIrprqr show_extrarMr)r! show_errorrr"r"r#rCszBoundFormField.validatecCsd|_|j|dS)NT)r@rqr)r! extra_markupr"r"r#rr:zBoundFormField.show_extracCs|t|d|jjS)Nr)rrArPrr(r"r"r#rszBoundFormField.valuecCs ||j_dSr&)rPrr+r"r"r#rs cCsB|jdur|jS|jjdurt|jjtrt|jjS|jjSdSNre)rar5rIrdrrsr(r"r"r#rIs   zBoundFormField.helpcCs"|durd}||_|j|dSr)rarqrr+r"r"r#rIscCs|jjSr&)rttextr(r"r"r#rHszBoundFormField.captioncCs|j|dSr&)rtrr+r"r"r#rHscCr%r&r'r(r"r"r#r !r)zBoundFormField.enabledcCs||_|jD]}||_qdSr&)rrwr )r!r,rkr"r"r#r %s N)T)r-r.r/r$rbrrcrrCrr1rr2rIrHr r"r"r"r#rOs0%        rOcsGfdddt}|S)NcseZdZfddZdS)zsimple_field..FieldcsSr&r"rL widget_makerr"r#rN.sz(simple_field..Field._make_widgetN)r-r.r/rNr"rr"r#Field-sr)rF)rrr"rr# simple_field,src@*eZdZdZeddZejddZdS)RadioButtonEditorcCr%r&stater(r"r"r#r=r)zRadioButtonEditor.valuecCrYr&rr+r"r"r#rA Nr-r.r/reserve_columnsr1rr2r"r"r"r#r9  rcs.eZdZdZdZdfdd ZddZZS)RadioButtonFieldFNcs.|durg}||||_t||dSr&)rvgroupr6r$)r!rrHrIr8r"r#r$Ks  zRadioButtonField.__init__cCs2|jD]}|j|jvr|jj}nqg}t|dSr)_fieldsr5rrPr)r!rMbfrr"r"r#rNRs   zRadioButtonField._make_widgetrR)r-r.r/rTrSr$rNrEr"r"r8r#rFs rcs8eZdZeddgffdd ZejjddZZS) URLEditorhttphttpscs||_tdSr&)allowed_schemesr6r$)r!rr8r"r#r$]szURLEditor.__init__cCs|}|dkr |St|}|j|jvr\g}t|jD]}||qt|dkr;d|ddtd|d}nt|dkrN|dtd|d}n|d}t td j |d |S) Nrerfz, z, or rz or rGz#This field must be a {schemes} URL.)schemes) get_edit_textrschemersortedrvlenjoinrsrformat)r!vparsedrsr"r"r#ras&   $ zURLEditor.value) r-r.r/ frozensetr$rrgetterrEr"r"r8r#r\srcs0eZdZdZddgffdd ZddZZS) ChoiceFieldFNcst||||_dSr&)r6r$choices)r!rHrIrr8r"r#r$~s zChoiceField.__init__cCr;r&)rrrLr"r"r#rNr>zChoiceField._make_widgetr-r.r/rSr$rNrEr"r"r8r#rzsrc@s&eZdZeddZejddZdS)ReadOnlyWidgetcCr%r&)rr(r"r"r#rr)zReadOnlyWidget.valuecCs||dSr&)rr+r"r"r#rsN)r-r.r/r1rr2r"r"r"r#rs  rc@rW) ReadOnlyFieldFcCtdSr)rrLr"r"r#rNzReadOnlyField._make_widgetN)r-r.r/rSrNr"r"r"r#rs rc@r)CheckBoxEditorrcCr%r&rr(r"r"r#rr)zCheckBoxEditor.valuecCrYr&rr+r"r"r#rrNrr"r"r"r#rrrc@seZdZdZdZddZdS) BooleanFieldFcCrr)rrLr"r"r#rNrzBooleanField._make_widgetN)r-r.r/rTrSrNr"r"r"r#rs rceZdZfddZZS)MetaFormcsnt|||g}|D]\}}t|tr)||_|jdur$|d|_||q|jddd||_ dS)N:cSr%r&)rK)fr"r"r#sz#MetaForm.__init__..)key) r6r$itemsrdrFr~rHrvsort_unbound_fields)r!r~basesattrsrkrr8r"r#r$s     zMetaForm.__init__r-r.r/r$rEr"r"r8r#rrc@sreZdZddgZedZedZifddZddZd d Z d d Z d dZ ddZ dddZ ddZddZdS)FormsubmitcancelDoneCancelcCsttt|j|jd|_ttt|j|jd|_t|j|jg|_ g|_ |j D] }| |}t ||jj||j ||j|vrI||j|_q)|j D]}|jddqM|dS)N)on_pressF)r)rr rsok_label _click_doner cancel_label _click_cancelrbuttonsrrrQsetattrr5r~rvrrCr)r!initialr5rr"r"r#r$s$          z Form.__init__cCs,|jD]}|jj|vr||jj|j_qdSr&)rr5r~r)r!datarr"r"r# enter_datas  zForm.enter_datacCt|d|dS)Nrrr!rr"r"r#rzForm._click_donecCr)Nrrrr"r"r#rrzForm._click_cancelcCs8g}|jD] }|jj|kr||q||jdd<dSr&)rr5r~rv)r! field_name new_fieldsrr"r"r# remove_fields    zForm.remove_fieldcCsdt|jdkr gS|jdj}|g}|jddD]}|td|j}||||q|S)NrrGre)rrryrvr rQ)r!t0r|r5tr"r"r#as_rowss   z Form.as_rowsTNFcCst||j|||dS)N) focus_buttonsexcerpt narrow_rows)rrr)r!rrrr"r"r# as_screens  zForm.as_screencCs\d}|jD] }|jrd}nq|r"d|jjjdd_d|jj_dSd|jjjdd_dS)NFTrrG)rr`rrBcontentsr focus_position)r!r`rr"r"r#rs zForm.validatedcCs(i}|jD] }|jr|j||jj<q|Sr&)rr rr5r~)r!rr5r"r"r#as_datas  z Form.as_data)TNF)r-r.r/r_rsrrr$rrrrrrrrr"r"r"r#rs   r) metaclasscs6eZdZfddZeddZejddZZS) SubFormWidgetcs||_tt|dSr&)rMr6r$rrrLr8r"r#r$szSubFormWidget.__init__cCs |jSr&)rMrr(r"r"r#rrzSubFormWidget.valuecCs$|D] \}}|t|j|_qdSr&)rrArMr)r!rrrr"r"r#rs)r-r.r/r$r1rr2rEr"r"r8r#rs   rcs*eZdZdZdfdd ZddZZS) SubFormFieldFNcstj||d||_dS)N)rHrI)r6r$form_cls)r!rrHrIr8r"r#r$"s zSubFormField.__init__cCs||}t|Sr&)rrrLr"r"r#rN&s zSubFormField._make_widgetrRrr"r"r8r#rsrcr)SubFormc s||_tjdi|dS)Nr")parentr6r$)r!rkwr8r"r#r$-szSubForm.__init__rr"r"r8r#r+rr)FrUlogging urllib.parserurwidrrrrrrrur r r subiquitycore.ui.buttonsr r subiquitycore.ui.containerrrsubiquitycore.ui.interactiverrrrsubiquitycore.ui.selectorrsubiquitycore.ui.tablerrrsubiquitycore.ui.utilsrrrrsubiquitycore.ui.widthr getLoggerlogobjectrrrprr4ABCrFrXrxrOr StringField PasswordField IntegerField EmailFieldrrrURLFieldrrrrrrrrrrr"r"r"r#sT ,         P