Ñò +z2Wc @s­dZddkZddklZddklZddklZddkl Z ddk l Z l Z l Z lZlZddklZddkZd d d „ƒYZdS( sTUI Ethernet Interface ModuleiÿÿÿÿN(t NetworkDevice(t getDeviceList(tgetProfileList(tgetHardwareList(tETHERNETtISDNtMODEMtQETHt getDebugLevel(tgetDeviceFactorytNCPluginDevicesTuicBsDeZdZd„Zd„Zd„Zd„Zd„Zd„ZRS(sTUI Device ListcCs d|_dS(s  The constructor @screen A snack screen instance @devicelist A NCDeviceList @modem The modem device. If none given, the first modem in devicelist will be used. If none are there, one will be added. N(tNonetmscreen(tself((sB/usr/share/system-config-network/netconfpkg/tui/NCPluginDevices.pyt__init__s c Csztidddƒ|_d}|iid}|djo d}ntƒiƒ}xútƒD]ï}t|dƒ p|i ƒ oq^nd}|i ƒ|jo d}n|d7}x“t ƒD]X}|i |i jo?|io5|iid ||i|i |if| |ƒPqÁqÁW|iid ||i|i |if| |ƒq^W|pd S|iitd ƒd ƒd S( s+ Build the list of devices it returnExitiiit getDialogt txs[%s] %s (%s) - %ss N(tsnacktListboxtliR twidthRtgetRthasattrRtgetDeviceAliasRtNametDevicet DescriptiontappendtDeviceIdtTypeR t_(R tltletactivedevicelisttdevtisactivethw((sB/usr/share/system-config-network/netconfpkg/tui/NCPluginDevices.pytsetStates4       c CsÞtidtdƒƒ}ti|tdƒdftdƒdffƒ}tidddd d ƒ}|itd ƒtƒtiƒd }|d jp |djo|itdƒt ƒn-|itdƒt ƒ|itdƒt ƒti |tdƒd dƒ}|i |ddƒ|i |dd ƒ|i |ddƒ|iƒ}|iƒ|i|ƒdjon|iƒ}tƒ} d} | i|ƒ} tƒ} | pdS| ƒ} | o| i| ƒt| _| SndS(sT Displays the main screen @screen The snack screen instance is%Which device type do you want to add?tAddtaddtCanceltcanceliRRitEthernetits390ts390xRtModemRsNetwork ConfigurationiiiiÿÿÿÿiþÿÿÿN(RtTextboxReflowedR t ButtonBarRRRtostunameRRRtGridFormR)trunt popWindowt buttonPressedtcurrentR R tgetDeviceClassRtFalset NMControlled( R R tttbbRtmachinetgtresttodotdfR$tdevclasstdevlist((sB/usr/share/system-config-network/netconfpkg/tui/NCPluginDevices.pyt newDeviceAs:0         cCsdS(sQ Extracts info from the screen, and puts it into a device object N((R ((sB/usr/share/system-config-network/netconfpkg/tui/NCPluginDevices.pyt processInfogscCs!ti|tdƒddƒ}ti|tdƒiddƒdftdƒiddƒd ftd ƒiddƒd ffƒ}ti|td ƒd ftdƒdffƒ}|i|iddƒ|i|ddddƒ|i|ddddƒ|iƒ}|iƒ|i |ƒd jod}d }nã|i |ƒdjod}d}n½|i |ƒdjo|ii ƒ}d}nŽ|i |ƒd jo|ii ƒ}d }n_|i |ƒd jo|ii ƒ}d }n0|ii ƒ}|p|i |ƒ}nd}||fS(NsSelect A Deviceiit _ActivateR ttactivatet _Deactivatet deactivatet_DeletetdeletetSavetsaveR*R+iitgrowxitedit( RR4R R1treplaceR)RR5R6R7R R8RE(R R R?R=tbb2R@R$taction((sB/usr/share/system-config-network/netconfpkg/tui/NCPluginDevices.pyt selectDevicemsB $        c Cs™||_tƒ}tƒ}tƒ}|iƒxdto\|iƒ|i|ƒ\}}|djotS|djotS|pq1n|djoP|iƒ}|i |ƒo&|i |i |i ƒi dtƒq|iƒq1|djo[xš|D]L}|i |ijo#|ii|i ƒ} |i| =n||i|ƒ=qúWq1|djo|id|ƒq1|djo|id|ƒq1q1Wd S( sB Show and run the screen, save files if necesarry ROR+RQtstateRMRItdialogRKN(R RRRR'tTrueRUR:RtrunIttactivateDeviceRtgetActiveProfilet ProfileNametrollbackt ActiveDevicestindexRIRK( R R t devicelistthwlisttplisttdeviceRTRWtproftpos((sB/usr/share/system-config-network/netconfpkg/tui/NCPluginDevices.pyRY’sB               ( t__name__t __module__t__doc__RR'RERFRURY(((sB/usr/share/system-config-network/netconfpkg/tui/NCPluginDevices.pyR s $ &  %((RhRtnetconfpkg.ControlRtnetconfpkg.NCDeviceListRtnetconfpkg.NCProfileListRtnetconfpkg.NCHardwareListRtnetconfpkg.NC_functionsRRRRRtnetconfpkg.NCDeviceFactoryR R2R (((sB/usr/share/system-config-network/netconfpkg/tui/NCPluginDevices.pyts (