From b0fe7063f4424ecca39b35341264bf05bed4e489 Mon Sep 17 00:00:00 2001 From: Thiago Franco de Moraes Date: Sat, 19 Jun 2021 14:39:30 -0300 Subject: [PATCH] Removed prints and some format --- invesalius/data/slice_.py | 1 - invesalius/gui/language_dialog.py | 74 +++++++++++++++++++++++++++++++++++++++----------------------------------- invesalius/reader/dicom_grouper.py | 3 --- 3 files changed, 39 insertions(+), 39 deletions(-) diff --git a/invesalius/data/slice_.py b/invesalius/data/slice_.py index 3e6c943..1d094e4 100644 --- a/invesalius/data/slice_.py +++ b/invesalius/data/slice_.py @@ -381,7 +381,6 @@ class Slice(metaclass=utils.Singleton): return proj = Project() index = proj.mask_dict.get_key(self.current_mask) - print(f"\n\n\n{index=}\n\n\n") self.num_gradient += 1 self.current_mask.matrix[:] = 0 self.current_mask.clear_history() diff --git a/invesalius/gui/language_dialog.py b/invesalius/gui/language_dialog.py index c089ec7..26a0972 100644 --- a/invesalius/gui/language_dialog.py +++ b/invesalius/gui/language_dialog.py @@ -1,10 +1,10 @@ -#-------------------------------------------------------------------------- +# -------------------------------------------------------------------------- # Software: InVesalius - Software de Reconstrucao 3D de Imagens Medicas # Copyright: (C) 2001 Centro de Pesquisas Renato Archer # Homepage: http://www.softwarepublico.gov.br # Contact: invesalius@cti.gov.br # License: GNU - GPL 2 (LICENSE.txt/LICENCA.txt) -#-------------------------------------------------------------------------- +# -------------------------------------------------------------------------- # Este programa e software livre; voce pode redistribui-lo e/ou # modifica-lo sob os termos da Licenca Publica Geral GNU, conforme # publicada pela Free Software Foundation; de acordo com a versao 2 @@ -15,11 +15,12 @@ # COMERCIALIZACAO ou de ADEQUACAO A QUALQUER PROPOSITO EM # PARTICULAR. Consulte a Licenca Publica Geral GNU para obter mais # detalhes. -#-------------------------------------------------------------------------- +# -------------------------------------------------------------------------- import os import sys import wx + try: from wx.adv import BitmapComboBox except ImportError: @@ -29,49 +30,53 @@ import invesalius.i18n as i18n file_path = os.path.split(__file__)[0] -if hasattr(sys,"frozen") and (sys.frozen == "windows_exe"\ - or sys.frozen == "console_exe"): - abs_file_path = os.path.abspath(file_path + os.sep + ".." +\ - os.sep + ".." + os.sep + ".." + os.sep + "..") - ICON_DIR = os.path.abspath(os.path.join(abs_file_path, 'icons')) +if hasattr(sys, "frozen") and ( + sys.frozen == "windows_exe" or sys.frozen == "console_exe" +): + abs_file_path = os.path.abspath( + file_path + os.sep + ".." + os.sep + ".." + os.sep + ".." + os.sep + ".." + ) + ICON_DIR = os.path.abspath(os.path.join(abs_file_path, "icons")) else: - ICON_DIR = os.path.abspath(os.path.join(file_path, '..', '..','icons')) + ICON_DIR = os.path.abspath(os.path.join(file_path, "..", "..", "icons")) # MAC App if not os.path.exists(ICON_DIR): - ICON_DIR = os.path.abspath(os.path.join(file_path, '..', '..', '..', '..', '..', 'icons')) + ICON_DIR = os.path.abspath( + os.path.join(file_path, "..", "..", "..", "..", "..", "icons") + ) -class ComboBoxLanguage: +class ComboBoxLanguage: def __init__(self, parent): """Initialize combobox bitmap""" - - # Retrieve locales dictionary + + # Retrieve locales dictionary dict_locales = i18n.GetLocales() - + # Retrieve locales names and sort them self.locales = dict_locales.values() self.locales = sorted(self.locales) - + # Retrieve locales keys (eg: pt_BR for Portuguese(Brazilian)) self.locales_key = [dict_locales.get_key(value) for value in self.locales] # Find out OS locale self.os_locale = i18n.GetLocaleOS() - + try: os_lang = self.os_locale[0:2] except TypeError: os_lang = None # Default selection will be English - selection = self.locales_key.index('en') + selection = self.locales_key.index("en") # Create bitmap combo self.bitmapCmb = bitmapCmb = BitmapComboBox(parent, style=wx.CB_READONLY) for key in self.locales_key: # Based on composed flag filename, get bitmap - filepath = os.path.join(ICON_DIR, "%s.png" % (key)) + filepath = os.path.join(ICON_DIR, "%s.png" % (key)) bmp = wx.Bitmap(filepath, wx.BITMAP_TYPE_PNG) # Add bitmap and info to Combo bitmapCmb.Append(dict_locales[key], bmp, key) @@ -86,6 +91,7 @@ class ComboBoxLanguage: def GetLocalesKey(self): return self.locales_key + class LanguageDialog(wx.Dialog): """Class define the language to be used in the InVesalius, exist chcLanguage that list language EN and PT. The language @@ -94,26 +100,26 @@ class LanguageDialog(wx.Dialog): def __init__(self, parent=None, startApp=None): super(LanguageDialog, self).__init__(parent, title="") self.__TranslateMessage__() - self.SetTitle(_('Language selection')) + self.SetTitle(_("Language selection")) self.__init_gui() self.Centre() - - #def __init_combobox_bitmap__(self): + + # def __init_combobox_bitmap__(self): # """Initialize combobox bitmap""" - - # # Retrieve locales dictionary + + # # Retrieve locales dictionary # dict_locales = i18n.GetLocales() - + # # Retrieve locales names and sort them # self.locales = dict_locales.values() # self.locales.sort() - + # # Retrieve locales keys (eg: pt_BR for Portuguese(Brazilian)) # self.locales_key = [dict_locales.get_key(value)[0] for value in self.locales] # # Find out OS locale # self.os_locale = i18n.GetLocaleOS() - + # os_lang = self.os_locale[0:2] # # Default selection will be English @@ -135,10 +141,8 @@ class LanguageDialog(wx.Dialog): def GetComboBox(self): return self.bitmapCmb - def __init_gui(self): - self.txtMsg = wx.StaticText(self, -1, - label=_('Choose user interface language')) + self.txtMsg = wx.StaticText(self, -1, label=_("Choose user interface language")) btnsizer = wx.StdDialogButtonSizer() @@ -150,7 +154,7 @@ class LanguageDialog(wx.Dialog): btnsizer.AddButton(btn) btnsizer.Realize() - #self.__init_combobox_bitmap__() + # self.__init_combobox_bitmap__() self.cmb = ComboBoxLanguage(self) self.bitmapCmb = self.cmb.GetComboBox() @@ -174,12 +178,12 @@ class LanguageDialog(wx.Dialog): """Translate Messages of the Window""" os_language = i18n.GetLocaleOS() - if(os_language[0:2] == 'pt'): - _ = i18n.InstallLanguage('pt_BR') - elif(os_language[0:2] == 'es'): - _ = i18n.InstallLanguage('es') + if os_language[0:2] == "pt": + _ = i18n.InstallLanguage("pt_BR") + elif os_language[0:2] == "es": + _ = i18n.InstallLanguage("es") else: - _ = i18n.InstallLanguage('en') + _ = i18n.InstallLanguage("en") def Cancel(self, event): """Close Frm_Language""" diff --git a/invesalius/reader/dicom_grouper.py b/invesalius/reader/dicom_grouper.py index 660f247..dbf9907 100644 --- a/invesalius/reader/dicom_grouper.py +++ b/invesalius/reader/dicom_grouper.py @@ -131,7 +131,6 @@ class DicomGroup: filelist = [dicom.image.file for dicom in self.slices_dict.values()] - print(f"\n\n\n{filelist=}\n\n\n") # Sort slices using GDCM #if (self.dicom.image.orientation_label != "CORONAL"): #Organize reversed image @@ -141,7 +140,6 @@ class DicomGroup: try: sorter.Sort([utils.encode(i, const.FS_ENCODE) for i in filelist]) except TypeError as e: - print(f"\n\n\nError: {e=}\n\n\n") sorter.Sort(filelist) filelist = sorter.GetFilenames() @@ -149,7 +147,6 @@ class DicomGroup: if list(self.slices_dict.values())[0].parser.GetManufacturerName() == "Koning": filelist.sort() - print(f"\n\n\n{filelist=}\n\n\n") return filelist def GetHandSortedList(self): -- libgit2 0.21.2