def page_activated(self, advancing): if advancing: if self.main.plan.state.objectCreationParams.get("CreateInDB", True): self._copy_db.set_active(True) else: self._copy_db.set_active(False) self.refresh_table_list() for k in self.main.plan.state.dataBulkTransferParams.keys(): del self.main.plan.state.dataBulkTransferParams[k] if sys.platform == "win32": filename = mforms.Utilities.get_special_folder(mforms.Desktop)+"\\copy_migrated_tables.cmd" else: filename = mforms.Utilities.get_special_folder(mforms.Desktop)+"/copy_migrated_tables.sh" self.CopyScript_entry.set_value(filename) self.CopyScript_check_duplicate = True source_os = self.main.plan.migrationSource.get_os() if not source_os: self.BulkCopyScript_radiobutton.set_enabled(False) bulk_copy_filename = '' grt.send_warning('Cannot get operating system of source server.') elif source_os == "windows": bulk_copy_filename = os.path.join(mforms.Utilities.get_special_folder(mforms.Desktop), 'bulk_copy_tables.cmd') else: bulk_copy_filename = os.path.join(mforms.Utilities.get_special_folder(mforms.Desktop), 'bulk_copy_tables.sh') self.BulkCopyScript_entry.set_value(bulk_copy_filename) self.BulkCopyScript_check_duplicate = True WizardPage.page_activated(self, advancing)
def page_activated(self, advancing): WizardPage.page_activated(self, advancing) if advancing: self.doesSupportCatalogs = self.main.plan.migrationSource.rdbms.doesSupportCatalogs match_str = r"\%s\.\%s" % (self.main.plan.migrationSource._db_module.quoteIdentifier('(.+)\\'), self.main.plan.migrationSource._db_module.quoteIdentifier('(.+)\\')) if self.doesSupportCatalogs > 0: catalog_schemata_list = [ (catalog_name, schema_name) for catalog_name, schema_name in (re.match(match_str, full_name).groups() for full_name in self.main.plan.migrationSource.schemaNames) ] self.catalog_schemata = {} for catalog_name, schema_name in catalog_schemata_list: self.catalog_schemata.setdefault(catalog_name, []).append(schema_name) self.catalog_schemata = self.catalog_schemata.items() self._optionspanel.show(True) #self.advanced_button.show(True) else: self.catalog_schemata = [ schema_name for catalog_name, schema_name in (re.match(match_str, full_name).groups() for full_name in self.main.plan.migrationSource.schemaNames) ] self._optionspanel.show(False) #self.advanced_button.show(False) if self.schema_selector: self.content.remove(self.schema_selector) self.schema_selector = DatabaseSchemaSelector(self.catalog_schemata, tree_checked_callback=self.update_next_button) self.content.add(self.schema_selector, True, True) self.next_button.set_enabled(False)
def page_activated(self, advancing): if advancing: if self.main.plan.state.objectCreationParams.get( "CreateInDB", True): self._copy_db.set_active(True) else: self._copy_db.set_active(False) self.refresh_table_list() for k in self.main.plan.state.dataBulkTransferParams.keys(): del self.main.plan.state.dataBulkTransferParams[k] if sys.platform == "win32": filename = mforms.Utilities.get_special_folder( mforms.Desktop) + "\\copy_migrated_tables.cmd" else: filename = mforms.Utilities.get_special_folder( mforms.Desktop) + "/copy_migrated_tables.sh" self.copy_script_entry.set_value(filename) self.copy_script_check_duplicate = True if self.main.plan.migrationSource.get_os() == "windows": bulk_copy_filename = os.path.join( mforms.Utilities.get_special_folder(mforms.Desktop), 'bulk_copy_tables.cmd') else: bulk_copy_filename = os.path.join( mforms.Utilities.get_special_folder(mforms.Desktop), 'bulk_copy_tables.sh') self.bulk_copy_script_entry.set_value(bulk_copy_filename) self.bulk_copy_script_check_duplicate = True WizardPage.page_activated(self, advancing)
def page_activated(self, advancing): WizardPage.page_activated(self, advancing) if advancing: supported_types = tuple( otype[0] for otype in self.main.plan.migrationSource.supportedObjectTypes) database_objects = {} ui_settings = {} for otype in supported_types: database_objects[ otype] = self.main.plan.migrationSource.selectedObjectsOfType( otype) if otype != 'tables' and self.main.plan.migrationSource.rdbms.__id__ != 'com.mysql.rdbms.mysql': ui_settings[otype] = {'group_selected': False} if self._scrollpanel: self.content.remove(self._scrollpanel) self._scrollpanel = mforms.newScrollPanel() self.db_selector = DatabaseObjectSelector(supported_types, database_objects, ui_settings) self._scrollpanel.add(self.db_selector) self.content.add(self._scrollpanel, True, True)
def page_activated(self, advancing): WizardPage.page_activated(self, advancing) if advancing: self.doesSupportCatalogs = self.main.plan.migrationSource.rdbms.doesSupportCatalogs if self.doesSupportCatalogs: catalog_schemata_list = [ (catalog_name, schema_name) for catalog_name, dot, schema_name in (full_name.rpartition('.') for full_name in self.main.plan.migrationSource.schemaNames) ] self.catalog_schemata = {} for catalog_name, schema_name in catalog_schemata_list: self.catalog_schemata.setdefault(catalog_name, []).append(schema_name) self.catalog_schemata = self.catalog_schemata.items() self._optionspanel.show(True) #self.advanced_button.show(True) else: self.catalog_schemata = [ schema_name for catalog_name, dot, schema_name in (full_name.rpartition('.') for full_name in self.main.plan.migrationSource.schemaNames) ] self._optionspanel.show(False) #self.advanced_button.show(False) if self.schema_selector: self.content.remove(self.schema_selector) self.schema_selector = DatabaseSchemaSelector(self.catalog_schemata, tree_checked_callback=self.update_next_button) self.content.add(self.schema_selector, True, True) self.next_button.set_enabled(False)
def page_activated(self, advancing): if advancing: if self.main.plan.state.objectCreationParams.get("CreateInDB", True): self._copy_db.set_active(True) else: self._copy_db.set_active(False) self.refresh_table_list() for k in self.main.plan.state.dataBulkTransferParams.keys(): del self.main.plan.state.dataBulkTransferParams[k] if sys.platform == "win32": filename = mforms.Utilities.get_special_folder(mforms.Desktop) + "\\copy_migrated_tables.cmd" else: filename = mforms.Utilities.get_special_folder(mforms.Desktop) + "/copy_migrated_tables.sh" self.copy_script_entry.set_value(filename) self.copy_script_check_duplicate = True source_os = self.main.plan.migrationSource.get_os() if not source_os: self.bulk_copy_script_radiobutton.set_enabled(False) bulk_copy_filename = "" grt.send_warning("Cannot get operating system of source server.") elif source_os == "windows": bulk_copy_filename = os.path.join( mforms.Utilities.get_special_folder(mforms.Desktop), "bulk_copy_tables.cmd" ) else: bulk_copy_filename = os.path.join( mforms.Utilities.get_special_folder(mforms.Desktop), "bulk_copy_tables.sh" ) self.bulk_copy_script_entry.set_value(bulk_copy_filename) self.bulk_copy_script_check_duplicate = True WizardPage.page_activated(self, advancing)
def page_activated(self, advancing): if advancing: self.generate_migration_report() if "GenerateBulkCopyScript" in self.main.plan.state.dataBulkTransferParams.keys(): self.advanced_button.set_text("Open folder that contain generated script") self.advanced_button.show(True) else: self.advanced_button.show(False) WizardPage.page_activated(self, advancing)
def page_activated(self, advancing): if advancing: self.generate_migration_report() if "GenerateBulkCopyScript" in self.main.plan.state.dataBulkTransferParams.keys(): self.advanced_button.set_text("Open folder that contains generated script") self.advanced_button.show(True) else: self.advanced_button.show(False) WizardPage.page_activated(self, advancing)
def page_activated(self, advancing): WizardPage.page_activated(self, advancing) if advancing: self.doesSupportCatalogs = self.main.plan.migrationSource.rdbms.doesSupportCatalogs match_str = r"\%s\.\%s" % (self.main.plan.migrationSource. _db_module.quoteIdentifier('(.+)\\'), self.main.plan.migrationSource. _db_module.quoteIdentifier('(.+)\\')) if self.doesSupportCatalogs > 0: catalog_schemata_list = [ (catalog_name, schema_name) for catalog_name, schema_name in ( re.match(match_str, full_name).groups() for full_name in self.main.plan.migrationSource.schemaNames) ] self.catalog_schemata = {} for catalog_name, schema_name in catalog_schemata_list: self.catalog_schemata.setdefault(catalog_name, []).append(schema_name) self.catalog_schemata = self.catalog_schemata.items() self._optionspanel.show(True) #self.advanced_button.show(True) else: self.catalog_schemata = [ schema_name for catalog_name, schema_name in ( re.match(match_str, full_name).groups() for full_name in self.main.plan.migrationSource.schemaNames) ] self._optionspanel.show(False) #self.advanced_button.show(False) if self.schema_selector: self.content.remove(self.schema_selector) self.schema_selector = DatabaseSchemaSelector( self.catalog_schemata, tree_checked_callback=self.update_next_button) self.content.add(self.schema_selector, True, True) self.next_button.set_enabled(False)
def page_activated(self, advancing): WizardPage.page_activated(self, advancing) if advancing: supported_types = tuple(otype[0] for otype in self.main.plan.migrationSource.supportedObjectTypes) database_objects = {} ui_settings = {} for otype in supported_types: database_objects[otype] = self.main.plan.migrationSource.selectedObjectsOfType(otype) if otype != 'tables' and self.main.plan.migrationSource.rdbms.__id__ != 'com.mysql.rdbms.mysql': ui_settings[otype] = { 'group_selected' : False } if self._scrollpanel: self.content.remove(self._scrollpanel) self._scrollpanel = mforms.newScrollPanel() self.db_selector = DatabaseObjectSelector(supported_types, database_objects, ui_settings) self._scrollpanel.add(self.db_selector) self.content.add(self._scrollpanel, True, True)
def page_activated(self, advancing): if advancing: if self.main.plan.state.objectCreationParams.get("CreateInDB", True): self._copy_db.set_active(True) else: self._copy_db.set_active(False) self.refresh_table_list() for k in self.main.plan.state.dataBulkTransferParams.keys(): del self.main.plan.state.dataBulkTransferParams[k] if sys.platform == "win32": filename = mforms.Utilities.get_special_folder(mforms.Desktop)+"\\copy_migrated_tables.cmd" else: filename = mforms.Utilities.get_special_folder(mforms.Desktop)+"/copy_migrated_tables.sh" self.copy_script_entry.set_value(filename) self.copy_script_check_duplicate = True WizardPage.page_activated(self, advancing)
def page_activated(self, advance): WizardPage.page_activated(self, advance) if advance: self._filter_changed() self.refresh()
def page_activated(self, advance): WizardPage.page_activated(self, advance) if advance: self._filter_changed() self.refresh()
def page_activated(self, advancing): if advancing: self.generate_migration_report() WizardPage.page_activated(self, advancing)
def page_activated(self, advancing): if advancing: self.refresh() WizardPage.page_activated(self, advancing)
def page_activated(self, advancing): if advancing: self.generate_migration_report() WizardPage.page_activated(self, advancing)
def page_activated(self, advancing): if advancing: self.refresh() WizardPage.page_activated(self, advancing)