ó Ø@Qc@sdddlZddlZddlmZmZmZdefd„ƒYZdefd„ƒYZdS(iÿÿÿÿN(t WizardPagetWizardProgressPagetDatabaseSchemaSelectortSchemaMainViewcBs>eZd„Zd„Zd„Zd„Zd„Zd„ZRS(cCsHtj||dƒt|_|jj|ddƒtjtjƒ}|j dƒtj tƒ}|j dƒ|j dƒ|j tjdƒtƒdddg}tjjƒ}g|_xJ|D]B}tj|ƒ}|j|ƒ|j |tƒ|jj|ƒqÁW|jd jtƒ|j |ƒ||_|jj|tƒdS( NsSchemata SelectionsSOURCE & TARGETsSchema Name Mapping MethodisIChoose how the reverse engineered schemata and objects should be mapped. s?Keep schemata as they are: Catalog.Schema.Table -> Schema.Tables6Only one schema: Catalog.Schema.Table -> Catalog.TablesdOnly one schema, keep current schema names as a prefix: Catalog.Schema.Table -> Catalog.Schema_Tablei(Rt__init__tFalset _ui_createdtmaintadd_wizard_pagetmformstnewPaneltTitledBoxPanelt set_titletnewBoxt set_paddingt set_spacingtaddtnewLabelt RadioButtontnew_idtoptionstnewRadioButtontset_texttappendt set_activetTruet _optionspaneltcontenttadd_end(tselfRt optionspanelt optionsboxRtridtoptt radio_button((s(..\modules\migration_schema_selection.pyRs.          cCs‹tj||ƒ|r‡|jjjjj|_|jrÖgd„|jjjjDƒD]\}}}||f^qT}i|_x0|D](\}}|jj |gƒj |ƒq…W|jj ƒ|_|j j tƒnKgd„|jjjjDƒD]\}}}|^qó|_|j j tƒ|jr@|jj|jƒnt|jd|jƒ|_|jj|jttƒ|jjtƒndS(Ncss|]}|jdƒVqdS(t.N(t partition(t.0t full_name((s(..\modules\migration_schema_selection.pys Bscss|]}|jdƒVqdS(R#N(R$(R%R&((s(..\modules\migration_schema_selection.pys Lsttree_checked_callback(Rtpage_activatedRtplantmigrationSourcetrdbmstdoesSupportCatalogst schemaNamestcatalog_schematat setdefaultRtitemsRtshowRRtschema_selectorRtremoveRtupdate_next_buttonRt next_buttont set_enabled(Rt advancingt catalog_nametdott schema_nametcatalog_schemata_list((s(..\modules\migration_schema_selection.pyR(;s&  5   2 cCs?tjdƒ}|jtjƒ|jj|tƒd|_dS(Ns(Select the schemata you want to migrate:( R Rt set_stylet BoldStyleRRRtNoneR2(Rtlabel((s(..\modules\migration_schema_selection.pyt create_uiZscCs|jjt|ƒƒdS(N(R5R6tbool(Rtcount((s(..\modules\migration_schema_selection.pyR4ascCse|jjƒ}|jrWt|ƒdkr9tdƒ‚n|jƒd}|||fSd|fSdS(Nis7Cannot select multiple schemata from different catalogsitdef(R2t get_selectedR,tlent Exceptiontkeys(Rtselectedtcatalog((s(..\modules\migration_schema_selection.pytschemata_to_migrateds csÏy.ˆjƒ\ˆjjj_ˆjjj_Wn6tk rf}tjj dt |ƒdddƒdSX‡fd†}ˆj r¨dddg|ƒˆjjj j d(tidxt option_radio(R(s(..\modules\migration_schema_selection.pytfind_selected_optionys t drop_catalogt drop_schemat merge_schematschemaMappingMethod(RJRR)R*tselectedCatalogNametselectedSchemataNamesRFR t Utilitiest show_errortstrR,tstatetapplicationDataRtgo_next(RteRQ((Rs(..\modules\migration_schema_selection.pyR]rs." )(t__name__t __module__RR(R@R4RJR](((s(..\modules\migration_schema_selection.pyRs  "    tReverseEngineerProgressViewcBsAeZd„Zd„Zd„Zd„Zd„Zdd„ZRS(cCsltj||dddƒ|j|jdƒ|j|jdƒ|j|jdƒ|jj|ddƒdS(NsReverse Engineer Sourcet descriptions‚Selected schema metadata will now be fetched from the source RDBMS and reverse engineered so that its structure can be determined.sConnect to source DBMSs"Reverse engineer selected schematas.Post-processing of reverse engineered schematasSOURCE & TARGET( RRtadd_taskt task_connecttadd_threaded_taskt task_revengttask_post_processingRR(RR((s(..\modules\migration_schema_selection.pyR‰s cCs8tjddƒ|jjjjƒs4tdƒ‚ntS(Niÿÿÿÿs Connecting...s!Could not connect to source RDBMS(tgrtt send_progressRR)R*tconnectRFR(R((s(..\modules\migration_schema_selection.pyRd”scCs|jtƒtj|ƒdS(N(tresetRRtgo_back(R((s(..\modules\migration_schema_selection.pyRlšs cCs|jjjjƒtS(N(RR)R*treverseEngineerR(R((s(..\modules\migration_schema_selection.pyRfŸscCsq|jjjjjdƒ}|dkrAtjdƒ|jƒn,|dkrmtjdƒ|jddƒndS(NRURSsAMerging reverse engineered schema objects into a single schema...RTsNMerging and renaming reverse engineered schema objects into a single schema...tprefixR:(RR)R[R\tgetRht send_infot_merge_schemata(Rtselected_option((s(..\modules\migration_schema_selection.pyRg¤s     RLc s¸|jjjj}|jd‰ˆjˆ_|jjjjƒ}g|jjjjD]}|d^qS}|r|dkr„ˆjnˆj d}xÛ|D]|}xst ˆ|ƒD]b}|j ˆjƒd|j |jƒ|_|j} ||j|_t j d| |jfƒq®Wq˜WnTxQ|D]I}x@t ˆ|ƒD]/}|j ˆjƒd|j |jƒ|_q8Wq"W|jˆ_|s t‡fd†|Dƒƒ} nxôt|jƒdD]ß} | jˆjkr?t jd| jˆj| jˆjˆjfƒ|jjjjd| dd| jˆj| jˆjˆjfƒn| jˆjkrÄt jd | jˆj| jˆjˆjfƒ|jjjjd| dd | jˆj| jˆjˆjfƒnxÌ|D]Ä}t | |ƒ} |sÕ| |jd „| Dƒƒ} | r÷td „| Dƒƒ}xœ| D]”}||jd| j7_t jd i|d d6|d6||jd6ƒ|jjjjd| dd i|d d6|d6||jd6ƒq&W| |j| ƒq÷n"|dkrê| jnˆj d}t ˆ|ƒj| ƒx| D]w}|j |jjƒd|j |jƒ|_ˆ|_|r|j} ||j|_t j d| |jfƒqqWqËWq´W|jjƒ|jjˆƒdS(NiR:t_R#sObject %s was renamed to %sc3s4|]*}|td„tˆ|ƒDƒƒfVqdS(css|]}|jVqdS(N(tname(R%tobj((s(..\modules\migration_schema_selection.pys ÌsN(tsettgetattr(R%totype(tschema(s(..\modules\migration_schema_selection.pys ÌsisoWhile merging schema %s into %s: Default charset for schemata differs (%s vs %s). Setting default charset to %sssWhile merging schema %s into %s: Default collation for schemata differs (%s vs %s). Setting default collation to %scss|]}|jVqdS(N(Rt(R%Ru((s(..\modules\migration_schema_selection.pys Üscss|]}|j|fVqdS(N(Rt(R%Ru((s(..\modules\migration_schema_selection.pys ÞsseThe name of the %(otype)s "%(oname)s" conflicts with other %(otype)s names: renamed to "%(onewname)s"iÿÿÿÿRxtonametonewname(RR)R*RItschemataRttoldNamet module_dbtsupportedObjectTypest__id__RwtquoteIdentifierRhRptdicttlisttdefaultCharacterSetNamet send_warningR[taddMigrationLogEntryR>tdefaultCollationNamet intersectiontupdatetextendtownert remove_allR(RRnRIR~tsuptypetotypest actual_prefixRxRuRzt known_namest other_schemat other_objectstrepeated_object_namest objects_dicttrepeated_object_name((Rys(..\modules\migration_schema_selection.pyRq¯sn  )" ) % 1 /,/,  " ,  ) (R_R`RRdRlRfRgRq(((s(..\modules\migration_schema_selection.pyRaˆs     (RhR t workbench.uiRRRRRa(((s(..\modules\migration_schema_selection.pyts  q