ó Þ@Qc @seddlTddlmZddlZddlZedddddd ƒZejd d d d ejdƒgdddgƒej ej ej j ƒd„ƒƒZ ejdd dd ejdƒgdddgƒej ej ej j ƒd„ƒƒZd„Zd„Zejdd dd ejƒgdddgƒej ej ej jƒd„ƒƒZdS(iÿÿÿÿ(t*(tAppNtnamet WbTableUtilstauthors MySQL Teamtversions1.0s#wb.table.util.copyInsertToClipboardtcaptionsCopy Inserts to Clipboardtinputsdb.TabletgroupssCatalog/Utilitiess Menu/ObjectscCsw|jƒ}|dkrGtjjj|jƒƒtjƒjdƒn,tjƒjd|jj d|j dƒdS(NttReadys The table t.s% has no records for insert statementsi( tinsertstgrttmodulest WorkbenchtcopyToClipboardRtgettset_status_texttownerR(ttableR ((s..\modules\table_utils_grt.pytcopyInsertToClipboard!s   ,s+wb.table.util.copyInsertTemplateToClipboards!Copy Insert Template to ClipboardcCsñd|jjd|jd}d}xH|jD]=}|dkrU|d|j7}n|d|j7}d}q/W|d7}d}x:|jD]/}|dkr©|d 7}n |d 7}d}qŠW|d 7}tjjj|ƒtjƒj d ƒdS(Ns INSERT INTO `s`.`s` (iis`, `t`s `) VALUES (s, tNULLs);R s, NULL( RRtcolumnsR RRRRRR(Rtcodetfirsttcol((s..\modules\table_utils_grt.pytcopyInsertTemplateToClipboard0s$        c CsÍg}|jƒjdƒ}x«|D]£}|jƒjdƒ\}}}g}xc|jƒjdƒD]L}|jƒjdƒ\} }} | rb|j| jƒ| jƒfƒqbqbW|j||fƒq"W|S(Ns t t,(tstriptsplitt partitiontappend( RtdefsttablesttRtsepRt column_defstcolumntcntct((s..\modules\table_utils_grt.pyt_parse_table_definitionsMs &c Cs»|j}|jdƒ}||_x“|D]‹\}}tjjƒ}||_|jdƒre|dn||_|r‡|j||ƒn|j |ƒ|jdƒr(|j |ƒq(q(W|S(Nsdb.mysqlRi( tsimpleDatatypest addNewTableRR tclassestdb_mysql_ColumnRt startswitht setParseTypet addColumntaddPrimaryKeyColumn( tcatalogtschemaRRttypesttbltcnametctypeR(((s..\modules\table_utils_grt.pyt _create_table]s   " swb.table.util.quickTablessCreate Multiple Tablesc s²tjdtjƒ‰tjdƒ}tjtƒ}|jdƒ|jdƒ|j |ttƒtj tj ƒ}|j |t t ƒˆj |ƒˆjdƒtjƒ}|jdƒtjƒ}|jdƒtjt ƒ}tjj|||ƒ|jdƒ|j|tt ƒˆjddƒˆjƒ|jd }|j‡fd †ƒˆjd|ƒr®t|jƒƒ}x0|D](\} } | r~t||| | ƒq~q~Wd Sd S( NsìYou can create multiple tables by giving their outline in the following format: table1 *column1 int,column2 varchar(32),column3 table2 column1,column2 table3 ... * denotes a primary key column. Column type is optional.i sCreate Multiple TablestOKtCanceliiXi^ics ˆjtƒS(N(t end_modaltTrue((tform(s..\modules\table_utils_grt.pyt”si(tmformstFormtNonetFormDialogFrametnewLabeltnewBoxtFalset set_spacingt set_paddingtaddt newTextBoxtVerticalScrollBarR>t set_contentt set_titlet newButtontset_textt Utilitiestadd_end_ok_cancel_buttonstadd_endtset_sizetcentertschematatadd_clicked_callbackt run_modalR+tget_string_valueR:( R4tlabeltboxttexttoktcanceltbboxR5t tabledefsRR((R?s..\modules\table_utils_grt.pytquickTablesInCatalogos<            (twbRARR t DefineModulet ModuleInfotplugintwbinputst objectOfClasstexporttINTR.tdb_TableRRR+R:tcurrentCatalogt db_CatalogRa(((s..\modules\table_utils_grt.pyts   0'0'  -