ó ą@Qc@s’ddlZddlZddlZddlmZddlmZmZddlmZddl m Z m Z m Z d„Z ed„Zd„Zd „Zd efd „ƒYZd efd „ƒYZdefd„ƒYZdZdefd„ƒYZdS(i’’’’N(t DBLoginError(t WizardPagetWizardProgressPage(treplace_string_parameters(tget_connection_parameterstget_odbc_connection_stringtis_odbc_connectioncCsøddl}ddl}y‘|jdkrO|jddddd|gƒdkS|jd krƒ|jdd dd d |gƒdkS|jdd dd d |gƒdkSWntSXdS( Ni’’’’twin32tpings-nt1s-wt3000itdarwins-cs-tt3(tsyst subprocesstplatformtcalltFalse(thostnameR R((s(..\modules\migration_source_selection.pyt ping_hosts  %%)cCs°x©|jjD]›}|jdkr |jdkr™t|dtƒ}t|j|ƒjddƒ\}}tj j d||||ƒ\}}|r¤|Sn |j dSPq q WdS(Ntkeychaintpasswordtdo_not_transforms::isEnter password for user (Rspassword( tdrivert parameterst paramTypeRtTrueRtnametsplittmformst Utilitiestfind_or_ask_for_passwordtparameterValuestNone(t connectiont forget_oldtparamtconnection_paramstusernametstorage_stringtacceptedtpasswd((s(..\modules\migration_source_selection.pytrequest_password)s$% cCs2d}d}|jjjdkr[|jjdkr…|jd}|jjddƒ}q…n*|jjddƒ}|jjddƒ}|r.|r.ddl}|j|j|jƒ}|j dƒy|j ||fƒWnD|j k rg\}}|dkr,t j j|d d |d d d d ƒtSt j j|d|dddddd d d ƒtSn¹|jk r’}t|ƒrĮt j j|d|||fddddd d d ƒn:t j j|d||fdddddd d d ƒtS|jk r\}}|dkrØt|ƒrht j j|d||fddddd d d ƒqt j j|d|||fdddddd d d ƒnst|ƒrēt j j|d|ddddd d d ƒn4t j j|d|dddddd d d ƒtSX|jƒtSdS(NtMysqlt MysqlNativethostNametportiź i’’’’i is>Unable to connect to the provided host and port combination. sCould not resolve %s s>Make sure that the provided hostname or IP address is correct.tOKtsBUnable to connect to the provided host and port combination. %s sMake sure that: s1- the provided hostname or IP address is correct sK- the database server is running and listening in the provided port number s[- the machine hosting the database server allows external connections to the database port s1- your network connection is properly functioningsGTimed out connecting to %s:%s, although the host could be pinged. %s s0- the provided hostname or IP address is corrects Timed out connecting to %s:%s. i=sAConnection refused at %s:%s, although the host could be pinged. s Error connecting to %s:%s. %s shTimed out connecting to the provided host and port combination, although the host could be pinged. %s sETimed out connecting to the provided host and port combination. %s (R!RtownerRR tgettsockettAF_INETt SOCK_STREAMt settimeouttconnecttgaierrorRRt show_messageRttimeoutRterrortcloseR(R"t error_titleRR.R3tsterrnote((s(..\modules\migration_source_selection.pyttest_connectivity9sx                       cCs$tjjdd|dddƒdS(NsConnect to ODBC SourcesÆThe ODBC driver that was selected for the source connection was not found by the ODBC manager. Ensure that you have the proper ODBC driver installed and retry. Error Text: %sR/R0(RRt show_error(R@((s(..\modules\migration_source_selection.pytshow_missing_driver_errorŸs tSourceWizardPagecBs#eZd„Zd„Zd„ZRS(cCs6|jjƒr"|jjtƒn|jjtƒdS(N(t_store_connection_checkt get_activet_store_connection_entryt set_enabledRR(tself((s(..\modules\migration_source_selection.pyt_toggle_store_connection§scCs>|jjƒ}|sCtjjdddddƒtjkrCtSnt}x3tjj j j D]}|j |kr\t }Pq\q\Wx3tjj j jD]}|j |kr’t }Pq’q’W|rķtjjdd|dddƒtjkrķtSny|jj|ƒWn6tk r9}tjjdt|ƒdddƒtSXt S( NsStore Connections2A name must be provided for saving the connection.R/tSkipR0sDThere already is a connection named '%s'. Do you want to replace it?sReplace ConnectiontCancel(RGtget_string_valueRRR9tResultOkRtgrttroottwbt rdbmsMgmtt storedConnsRRtotherStoredConnstpaneltsaveConnectionAst ExceptionRBtstr(RIRtduptconR@((s(..\modules\migration_source_selection.pytsave_connection®s.'"c Cstjjƒj}|d|ƒt|jjd|ƒtkrQ|d|ƒdS|d|ƒt}d}d}t|jƒ}x{t rżyN|j ƒs§t dƒ‚n|d|ƒtj j d|d d ddƒPWqƒttfk rC}|dkr4d |jkr!d |jkr!|d ƒt|ƒdSnķ|dkr!t|tƒr_| r_t }q!|dƒ|r‹dt|j|jƒ}nt|ƒ} | jdƒrķd| krķy.t| d| jdƒd!iiƒd} WqķqķXntj j d|d|| |fd ddƒdSn|d7}t|j|ƒ|_qƒt k rł}|d|ƒ|r‚dt|j|jƒ}nt|ƒ} | jdƒrĢ| jdƒrĢt| dd!iiƒd} ntj j d|d| |fd ddƒqƒXqƒWdS(Ns,Testing network connectivity to %s Server...sTest %s DBMS Connections %s server could not be contacteds Testing connection to %s DBMS...iR0sCould not connect to DBMSs%s DBMS connection is OKsConnection succeded.R/s[Driver Manager]simage not foundsSpecified ODBC driver not founds ODBC connection string: %ssError(s: error calling is):is"Could not connect to %s DBMS. %s%ssCould not connect to DBMS: %st)ii’’’’s#Could not connect to the DBMS. %s%s(RtAppR2tset_status_textRARUR"RRRR7RWRR9Rt SystemErrortmessageRCt isinstanceRRRXt startswithtevaltrfindR*tendswith( RItsourcetcaptionR^tforce_passwordtattempttextratis_odbcR@tetext((s(..\modules\migration_source_selection.pyttest_connectionĖs^          .-   (t__name__t __module__RJR[Rm(((s(..\modules\migration_source_selection.pyRD¦s  tSourceMainViewcBs,eZd„Zd„Zd„Zd„ZRS(cCsxtj||dƒtjtjtjjjƒ|_x't j j ƒD]}|jj |ƒqDW|j j|ddƒdS(NsSource SelectionsSOURCE & TARGET(RDt__init__ROtListtOBJECTtclassest db_mgmt_Rdbmst__grtclassname__tsupported_sources_instancest migrationt MigrationPlantsupportedSourcestappendtmaintadd_wizard_page(RIR|trdbms((s(..\modules\migration_source_selection.pyRqs !cCs­|jjtƒtjtƒ|_|jjdƒtjdƒ}|jtj ƒ|jj |tt ƒt j jƒ|_|jjt jjj|jƒ|jjs³tdƒ‚ntj|jjƒ}|jj |t t ƒtjt ƒ}tjƒ|_|jjdƒ|jj|jƒ|j |jttƒtjƒ|_|j |jt t ƒ|jjtƒ|jj |ttƒ|jj |jt t ƒ|j jdƒdS(Nis"Source RDBMS Connection Parameterss NO PANEL!!!s%Store connection for future usage as sTest Connection(!t back_buttonRHRRtnewBoxtserver_instance_boxt set_spacingtnewLabelt set_stylet BoldStyletaddRRORttui_db_ConnectPanelRUtinitializeWithRDBMSSelectorRPRQRRRwtviewRWtfromgrtt newCheckBoxREtset_texttadd_clicked_callbackRJt newTextEntryRGtcontenttadvanced_button(RItinstance_labelR‰tbox((s(..\modules\migration_source_selection.pyt create_ui s. cCs6|jjj|jjƒ|j|jjjdƒdS(NtSource(R|tplantsetSourceConnectionRUR"RmtmigrationSource(RI((s(..\modules\migration_source_selection.pyt go_advanced*scCs\|jjƒr2|jƒsdS|jjtƒn|jjj|jj ƒt j |ƒdS(N( RERFR[t set_activeRR|R•R–RUR"RDtgo_next(RI((s(..\modules\migration_source_selection.pyRš.s  (RnRoRqR“R˜Rš(((s(..\modules\migration_source_selection.pyRps  ! tTargetMainViewcBs5eZd„Zd„Zd„Zd„Zd„ZRS(cCs-tj||dƒ|jj|ddƒdS(NsTarget SelectionsSOURCE & TARGET(RDRqR|R}(RIR|((s(..\modules\migration_source_selection.pyRq:scCsdS(N((RI((s(..\modules\migration_source_selection.pytjust_script_toggled@scCs|tjtƒ|_|jjdƒtjdƒ}|jtjƒ|jj|tt ƒt j j ƒ|_ |j jt jjjƒtj|j jƒ}|jj|t t ƒtjt ƒ}tjƒ|_|jjdƒ|jj|jƒ|j|jttƒtjƒ|_|j|jt t ƒ|jjtƒ|jj|ttƒ|jj|jt t ƒ|jjdƒdS(Nis"Target RDBMS Connection Parameterss%Store connection for future usage as sTest Connection(RR€RRR‚RƒR„R…R†RRORtR‡RUt initializeRPRQRRRŠR‰R‹RERŒRRJRŽRGRHRR(RIR‘R‰R’((s(..\modules\migration_source_selection.pyR“Cs( cCs\|jjƒr2|jƒsdS|jjtƒn|jjj|jj ƒt j |ƒdS(N( RERFR[R™RR|R•tsetTargetConnectionRUR"RDRš(RI((s(..\modules\migration_source_selection.pyRšfs  cCs6|jjj|jjƒ|j|jjjdƒdS(NtTarget(R|R•RžRUR"RmR—(RI((s(..\modules\migration_source_selection.pyR˜ps(RnRoRqRœR“RšR˜(((s(..\modules\migration_source_selection.pyR›9s    # s^The following tasks will now be performed. Please monitor the execution. The names of available schemas will be retrieved from the source RDBMS. The account used for the connection will need to have appropriate privileges for listing and reading the schemas you want to migrate. Target RDBMS connection settings will also be checked for validity. tFetchProgressViewcBs>eZd„Zd„Zd„Zd„Zd„Zd„ZRS(cCsltj||ddtƒ|j|jdƒ|j|jdƒ|j|jdƒ|jj |ddƒdS(NsFetch Schema Listt descriptionsConnect to source DBMSsCheck target DBMS connections Retrieve schema list from sourcesSOURCE & TARGETsFetch Schemata List( RRqtPAGE_DESCRIPTIONtadd_taskt task_connectttask_test_targettadd_threaded_taskttask_fetch_schemataR|R}(RIR|((s(..\modules\migration_source_selection.pyRq}s cCst|ƒjddƒS(Nt;s; (RXtreplace(RIR@((s(..\modules\migration_source_selection.pytformat_exception_text‡scCs%tjddƒt}d}xtr y<|jjjjƒsLtdƒ‚n|jjjj ƒPWqt t fk r}|dkr“d|j kr“d|j kr“t |ƒdSn|dkrčt|t ƒrß| rßt}qč|‚n|d7}t|jjjj|ƒ|jjj_qXqWdS(Ni’’’’sConnecting to source...is!Could not connect to source RDBMSs[Driver Manager]simage not foundi(ROt send_progressRRR|R•R—R7RWt checkVersionRR_R`RCRaR*R"R(RIRhRiR@((s(..\modules\migration_source_selection.pyR¤‹s(       cCs|jtƒtj|ƒdS(N(tresetRRtgo_back(RI((s(..\modules\migration_source_selection.pyR®£s cCst|jjjj}|jjdƒrA|jdrA|jdgng}|jjjj|ƒ|jjjjƒdS(Ntschema(R|R•R—R"R thas_keytdoFetchSchemaNamest disconnect(RIR"tonly_these_catalogs((s(..\modules\migration_source_selection.pyR§Øs /cCsgtjddƒd}|jjjjj|jjjjjkr–|jjjjjd|jjjjjdkr–|jjjj |jjj_ q–nt }xÄt rby<|jjjj ƒsĢt dƒ‚n|jjjjƒPWqŸttfk r^}|dkr-t|tƒr$| r$t }q-|‚n|d7}t|jjjjƒ|jjj_ qŸXqŸWdS(Ni’’’’sConnecting to target...ituserNames!Could not connect to target RDBMSi(ROR«R|R•tmigrationTargetR"thostIdentifierR—R RRRtcheckConnectionRWR¬RR_RaR*(RIRiRhR@((s(..\modules\migration_source_selection.pyR„°s&*2$     (RnRoRqRŖR¤R®R§R„(((s(..\modules\migration_source_selection.pyR |s     (RORRxRt workbench.uiRRtworkbench.utilsRtworkbench.db_driverRRRRRR*RARCRDRpR›R¢R (((s(..\modules\migration_source_selection.pyts     f Z9A