Commit b0fe7063f4424ecca39b35341264bf05bed4e489
1 parent
0c1c228a
Exists in
master
Removed prints and some format
Showing
3 changed files
with
39 additions
and
39 deletions
Show diff stats
invesalius/data/slice_.py
... | ... | @@ -381,7 +381,6 @@ class Slice(metaclass=utils.Singleton): |
381 | 381 | return |
382 | 382 | proj = Project() |
383 | 383 | index = proj.mask_dict.get_key(self.current_mask) |
384 | - print(f"\n\n\n{index=}\n\n\n") | |
385 | 384 | self.num_gradient += 1 |
386 | 385 | self.current_mask.matrix[:] = 0 |
387 | 386 | self.current_mask.clear_history() | ... | ... |
invesalius/gui/language_dialog.py
1 | -#-------------------------------------------------------------------------- | |
1 | +# -------------------------------------------------------------------------- | |
2 | 2 | # Software: InVesalius - Software de Reconstrucao 3D de Imagens Medicas |
3 | 3 | # Copyright: (C) 2001 Centro de Pesquisas Renato Archer |
4 | 4 | # Homepage: http://www.softwarepublico.gov.br |
5 | 5 | # Contact: invesalius@cti.gov.br |
6 | 6 | # License: GNU - GPL 2 (LICENSE.txt/LICENCA.txt) |
7 | -#-------------------------------------------------------------------------- | |
7 | +# -------------------------------------------------------------------------- | |
8 | 8 | # Este programa e software livre; voce pode redistribui-lo e/ou |
9 | 9 | # modifica-lo sob os termos da Licenca Publica Geral GNU, conforme |
10 | 10 | # publicada pela Free Software Foundation; de acordo com a versao 2 |
... | ... | @@ -15,11 +15,12 @@ |
15 | 15 | # COMERCIALIZACAO ou de ADEQUACAO A QUALQUER PROPOSITO EM |
16 | 16 | # PARTICULAR. Consulte a Licenca Publica Geral GNU para obter mais |
17 | 17 | # detalhes. |
18 | -#-------------------------------------------------------------------------- | |
18 | +# -------------------------------------------------------------------------- | |
19 | 19 | |
20 | 20 | import os |
21 | 21 | import sys |
22 | 22 | import wx |
23 | + | |
23 | 24 | try: |
24 | 25 | from wx.adv import BitmapComboBox |
25 | 26 | except ImportError: |
... | ... | @@ -29,49 +30,53 @@ import invesalius.i18n as i18n |
29 | 30 | |
30 | 31 | file_path = os.path.split(__file__)[0] |
31 | 32 | |
32 | -if hasattr(sys,"frozen") and (sys.frozen == "windows_exe"\ | |
33 | - or sys.frozen == "console_exe"): | |
34 | - abs_file_path = os.path.abspath(file_path + os.sep + ".." +\ | |
35 | - os.sep + ".." + os.sep + ".." + os.sep + "..") | |
36 | - ICON_DIR = os.path.abspath(os.path.join(abs_file_path, 'icons')) | |
33 | +if hasattr(sys, "frozen") and ( | |
34 | + sys.frozen == "windows_exe" or sys.frozen == "console_exe" | |
35 | +): | |
36 | + abs_file_path = os.path.abspath( | |
37 | + file_path + os.sep + ".." + os.sep + ".." + os.sep + ".." + os.sep + ".." | |
38 | + ) | |
39 | + ICON_DIR = os.path.abspath(os.path.join(abs_file_path, "icons")) | |
37 | 40 | else: |
38 | - ICON_DIR = os.path.abspath(os.path.join(file_path, '..', '..','icons')) | |
41 | + ICON_DIR = os.path.abspath(os.path.join(file_path, "..", "..", "icons")) | |
39 | 42 | |
40 | 43 | # MAC App |
41 | 44 | if not os.path.exists(ICON_DIR): |
42 | - ICON_DIR = os.path.abspath(os.path.join(file_path, '..', '..', '..', '..', '..', 'icons')) | |
45 | + ICON_DIR = os.path.abspath( | |
46 | + os.path.join(file_path, "..", "..", "..", "..", "..", "icons") | |
47 | + ) | |
43 | 48 | |
44 | -class ComboBoxLanguage: | |
45 | 49 | |
50 | +class ComboBoxLanguage: | |
46 | 51 | def __init__(self, parent): |
47 | 52 | """Initialize combobox bitmap""" |
48 | - | |
49 | - # Retrieve locales dictionary | |
53 | + | |
54 | + # Retrieve locales dictionary | |
50 | 55 | dict_locales = i18n.GetLocales() |
51 | - | |
56 | + | |
52 | 57 | # Retrieve locales names and sort them |
53 | 58 | self.locales = dict_locales.values() |
54 | 59 | self.locales = sorted(self.locales) |
55 | - | |
60 | + | |
56 | 61 | # Retrieve locales keys (eg: pt_BR for Portuguese(Brazilian)) |
57 | 62 | self.locales_key = [dict_locales.get_key(value) for value in self.locales] |
58 | 63 | |
59 | 64 | # Find out OS locale |
60 | 65 | self.os_locale = i18n.GetLocaleOS() |
61 | - | |
66 | + | |
62 | 67 | try: |
63 | 68 | os_lang = self.os_locale[0:2] |
64 | 69 | except TypeError: |
65 | 70 | os_lang = None |
66 | 71 | |
67 | 72 | # Default selection will be English |
68 | - selection = self.locales_key.index('en') | |
73 | + selection = self.locales_key.index("en") | |
69 | 74 | |
70 | 75 | # Create bitmap combo |
71 | 76 | self.bitmapCmb = bitmapCmb = BitmapComboBox(parent, style=wx.CB_READONLY) |
72 | 77 | for key in self.locales_key: |
73 | 78 | # Based on composed flag filename, get bitmap |
74 | - filepath = os.path.join(ICON_DIR, "%s.png" % (key)) | |
79 | + filepath = os.path.join(ICON_DIR, "%s.png" % (key)) | |
75 | 80 | bmp = wx.Bitmap(filepath, wx.BITMAP_TYPE_PNG) |
76 | 81 | # Add bitmap and info to Combo |
77 | 82 | bitmapCmb.Append(dict_locales[key], bmp, key) |
... | ... | @@ -86,6 +91,7 @@ class ComboBoxLanguage: |
86 | 91 | def GetLocalesKey(self): |
87 | 92 | return self.locales_key |
88 | 93 | |
94 | + | |
89 | 95 | class LanguageDialog(wx.Dialog): |
90 | 96 | """Class define the language to be used in the InVesalius, |
91 | 97 | exist chcLanguage that list language EN and PT. The language |
... | ... | @@ -94,26 +100,26 @@ class LanguageDialog(wx.Dialog): |
94 | 100 | def __init__(self, parent=None, startApp=None): |
95 | 101 | super(LanguageDialog, self).__init__(parent, title="") |
96 | 102 | self.__TranslateMessage__() |
97 | - self.SetTitle(_('Language selection')) | |
103 | + self.SetTitle(_("Language selection")) | |
98 | 104 | self.__init_gui() |
99 | 105 | self.Centre() |
100 | - | |
101 | - #def __init_combobox_bitmap__(self): | |
106 | + | |
107 | + # def __init_combobox_bitmap__(self): | |
102 | 108 | # """Initialize combobox bitmap""" |
103 | - | |
104 | - # # Retrieve locales dictionary | |
109 | + | |
110 | + # # Retrieve locales dictionary | |
105 | 111 | # dict_locales = i18n.GetLocales() |
106 | - | |
112 | + | |
107 | 113 | # # Retrieve locales names and sort them |
108 | 114 | # self.locales = dict_locales.values() |
109 | 115 | # self.locales.sort() |
110 | - | |
116 | + | |
111 | 117 | # # Retrieve locales keys (eg: pt_BR for Portuguese(Brazilian)) |
112 | 118 | # self.locales_key = [dict_locales.get_key(value)[0] for value in self.locales] |
113 | 119 | |
114 | 120 | # # Find out OS locale |
115 | 121 | # self.os_locale = i18n.GetLocaleOS() |
116 | - | |
122 | + | |
117 | 123 | # os_lang = self.os_locale[0:2] |
118 | 124 | |
119 | 125 | # # Default selection will be English |
... | ... | @@ -135,10 +141,8 @@ class LanguageDialog(wx.Dialog): |
135 | 141 | def GetComboBox(self): |
136 | 142 | return self.bitmapCmb |
137 | 143 | |
138 | - | |
139 | 144 | def __init_gui(self): |
140 | - self.txtMsg = wx.StaticText(self, -1, | |
141 | - label=_('Choose user interface language')) | |
145 | + self.txtMsg = wx.StaticText(self, -1, label=_("Choose user interface language")) | |
142 | 146 | |
143 | 147 | btnsizer = wx.StdDialogButtonSizer() |
144 | 148 | |
... | ... | @@ -150,7 +154,7 @@ class LanguageDialog(wx.Dialog): |
150 | 154 | btnsizer.AddButton(btn) |
151 | 155 | btnsizer.Realize() |
152 | 156 | |
153 | - #self.__init_combobox_bitmap__() | |
157 | + # self.__init_combobox_bitmap__() | |
154 | 158 | self.cmb = ComboBoxLanguage(self) |
155 | 159 | self.bitmapCmb = self.cmb.GetComboBox() |
156 | 160 | |
... | ... | @@ -174,12 +178,12 @@ class LanguageDialog(wx.Dialog): |
174 | 178 | """Translate Messages of the Window""" |
175 | 179 | os_language = i18n.GetLocaleOS() |
176 | 180 | |
177 | - if(os_language[0:2] == 'pt'): | |
178 | - _ = i18n.InstallLanguage('pt_BR') | |
179 | - elif(os_language[0:2] == 'es'): | |
180 | - _ = i18n.InstallLanguage('es') | |
181 | + if os_language[0:2] == "pt": | |
182 | + _ = i18n.InstallLanguage("pt_BR") | |
183 | + elif os_language[0:2] == "es": | |
184 | + _ = i18n.InstallLanguage("es") | |
181 | 185 | else: |
182 | - _ = i18n.InstallLanguage('en') | |
186 | + _ = i18n.InstallLanguage("en") | |
183 | 187 | |
184 | 188 | def Cancel(self, event): |
185 | 189 | """Close Frm_Language""" | ... | ... |
invesalius/reader/dicom_grouper.py
... | ... | @@ -131,7 +131,6 @@ class DicomGroup: |
131 | 131 | filelist = [dicom.image.file for dicom in |
132 | 132 | self.slices_dict.values()] |
133 | 133 | |
134 | - print(f"\n\n\n{filelist=}\n\n\n") | |
135 | 134 | # Sort slices using GDCM |
136 | 135 | #if (self.dicom.image.orientation_label != "CORONAL"): |
137 | 136 | #Organize reversed image |
... | ... | @@ -141,7 +140,6 @@ class DicomGroup: |
141 | 140 | try: |
142 | 141 | sorter.Sort([utils.encode(i, const.FS_ENCODE) for i in filelist]) |
143 | 142 | except TypeError as e: |
144 | - print(f"\n\n\nError: {e=}\n\n\n") | |
145 | 143 | sorter.Sort(filelist) |
146 | 144 | filelist = sorter.GetFilenames() |
147 | 145 | |
... | ... | @@ -149,7 +147,6 @@ class DicomGroup: |
149 | 147 | if list(self.slices_dict.values())[0].parser.GetManufacturerName() == "Koning": |
150 | 148 | filelist.sort() |
151 | 149 | |
152 | - print(f"\n\n\n{filelist=}\n\n\n") | |
153 | 150 | return filelist |
154 | 151 | |
155 | 152 | def GetHandSortedList(self): | ... | ... |