Commit 6b54118d86ec281fd556610a383b77e7fb4734f5
1 parent
cfd19045
Exists in
master
python3 sys.platform returns linux
Showing
7 changed files
with
16 additions
and
16 deletions
Show diff stats
app.py
| ... | ... | @@ -50,7 +50,7 @@ from wx.lib.pubsub import setuparg1# as psv1 |
| 50 | 50 | from wx.lib.pubsub import pub as Publisher |
| 51 | 51 | |
| 52 | 52 | #import wx.lib.agw.advancedsplash as agw |
| 53 | -#if sys.platform == 'linux2': | |
| 53 | +#if sys.platform.startswith('linux'): | |
| 54 | 54 | # _SplashScreen = agw.AdvancedSplash |
| 55 | 55 | #else: |
| 56 | 56 | # if sys.platform != 'darwin': |
| ... | ... | @@ -80,7 +80,7 @@ USER_LOG_DIR = os.path.join(USER_INV_DIR, u'logs') |
| 80 | 80 | |
| 81 | 81 | # ------------------------------------------------------------------ |
| 82 | 82 | |
| 83 | -if sys.platform in ('linux2', 'win32'): | |
| 83 | +if sys.platform in ('linux2', 'linux', 'win32'): | |
| 84 | 84 | try: |
| 85 | 85 | tmp_var = wx.GetXDisplay |
| 86 | 86 | except AttributeError: | ... | ... |
invesalius/data/viewer_slice.py
| ... | ... | @@ -1264,7 +1264,7 @@ class Viewer(wx.Panel): |
| 1264 | 1264 | self.interactor.SetCursor(wx.StockCursor(wx.CURSOR_SIZEWE)) |
| 1265 | 1265 | |
| 1266 | 1266 | def SetSizeNWSECursor(self, pubsub_evt): |
| 1267 | - if sys.platform == 'linux2': | |
| 1267 | + if sys.platform.startswith('linux'): | |
| 1268 | 1268 | self.interactor.SetCursor(wx.StockCursor(wx.CURSOR_SIZENWSE)) |
| 1269 | 1269 | else: |
| 1270 | 1270 | self.interactor.SetCursor(wx.StockCursor(wx.CURSOR_SIZING)) | ... | ... |
invesalius/gui/default_viewers.py
invesalius/gui/dialogs.py
| ... | ... | @@ -292,7 +292,7 @@ def ShowOpenProjectDialog(): |
| 292 | 292 | def ShowImportDirDialog(self): |
| 293 | 293 | current_dir = os.path.abspath(".") |
| 294 | 294 | |
| 295 | - if (sys.platform == 'win32') or (sys.platform == 'linux2'): | |
| 295 | + if sys.platform == 'win32' or sys.platform.startswith('linux'): | |
| 296 | 296 | session = ses.Session() |
| 297 | 297 | |
| 298 | 298 | if (session.GetLastDicomFolder()): |
| ... | ... | @@ -333,7 +333,7 @@ def ShowImportDirDialog(self): |
| 333 | 333 | def ShowImportBitmapDirDialog(self): |
| 334 | 334 | current_dir = os.path.abspath(".") |
| 335 | 335 | |
| 336 | - if (sys.platform == 'win32') or (sys.platform == 'linux2'): | |
| 336 | + if sys.platform == 'win32' or sys.platform.startswith('linux'): | |
| 337 | 337 | session = ses.Session() |
| 338 | 338 | |
| 339 | 339 | if (session.GetLastDicomFolder()): |
| ... | ... | @@ -1454,7 +1454,7 @@ def ExportPicture(type_=""): |
| 1454 | 1454 | project = proj.Project() |
| 1455 | 1455 | |
| 1456 | 1456 | project_name = "%s_%s" % (project.name, type_) |
| 1457 | - if not sys.platform in ('win32', 'linux2'): | |
| 1457 | + if not sys.platform in ('win32', 'linux2', 'linux'): | |
| 1458 | 1458 | project_name += ".jpg" |
| 1459 | 1459 | |
| 1460 | 1460 | dlg = wx.FileDialog(None, | ... | ... |
invesalius/gui/widgets/slice_menu.py
| ... | ... | @@ -90,7 +90,7 @@ class SliceMenu(wx.Menu): |
| 90 | 90 | |
| 91 | 91 | |
| 92 | 92 | #------------ Sub menu of the pseudo colors ---------------- |
| 93 | - if sys.platform == 'linux2': | |
| 93 | + if sys.platform.startswith('linux'): | |
| 94 | 94 | mkind = wx.ITEM_CHECK |
| 95 | 95 | else: |
| 96 | 96 | mkind = wx.ITEM_RADIO |
| ... | ... | @@ -166,7 +166,7 @@ class SliceMenu(wx.Menu): |
| 166 | 166 | # It doesn't work in Linux |
| 167 | 167 | self.Bind(wx.EVT_MENU, self.OnPopup) |
| 168 | 168 | # In Linux the bind must be putted in the submenu |
| 169 | - if sys.platform == 'linux2' or sys.platform == 'darwin': | |
| 169 | + if sys.platform.startswith('linux') or sys.platform == 'darwin': | |
| 170 | 170 | submenu_wl.Bind(wx.EVT_MENU, self.OnPopup) |
| 171 | 171 | submenu_pseudo_colours.Bind(wx.EVT_MENU, self.OnPopup) |
| 172 | 172 | submenu_image_tiling.Bind(wx.EVT_MENU, self.OnPopup) |
| ... | ... | @@ -226,7 +226,7 @@ class SliceMenu(wx.Menu): |
| 226 | 226 | Publisher.sendMessage('Change colour table from background image', values) |
| 227 | 227 | Publisher.sendMessage('Update slice viewer') |
| 228 | 228 | |
| 229 | - if sys.platform == 'linux2': | |
| 229 | + if sys.platform.startswith('linux'): | |
| 230 | 230 | for i in self.pseudo_color_items: |
| 231 | 231 | it = self.pseudo_color_items[i] |
| 232 | 232 | if it.IsChecked(): |
| ... | ... | @@ -241,7 +241,7 @@ class SliceMenu(wx.Menu): |
| 241 | 241 | Publisher.sendMessage('Change colour table from background image from plist', values) |
| 242 | 242 | Publisher.sendMessage('Update slice viewer') |
| 243 | 243 | |
| 244 | - if sys.platform == 'linux2': | |
| 244 | + if sys.platform.startswith('linux'): | |
| 245 | 245 | for i in self.pseudo_color_items: |
| 246 | 246 | it = self.pseudo_color_items[i] |
| 247 | 247 | if it.IsChecked(): |
| ... | ... | @@ -273,7 +273,7 @@ class SliceMenu(wx.Menu): |
| 273 | 273 | else: |
| 274 | 274 | self.cdialog.Show(self._gen_event) |
| 275 | 275 | |
| 276 | - if sys.platform == 'linux2': | |
| 276 | + if sys.platform.startswith('linux'): | |
| 277 | 277 | for i in self.pseudo_color_items: |
| 278 | 278 | it = self.pseudo_color_items[i] |
| 279 | 279 | if it.IsChecked(): | ... | ... |
invesalius/utils.py
| ... | ... | @@ -254,7 +254,7 @@ def calculate_resizing_tofitmemory(x_size,y_size,n_slices,byte): |
| 254 | 254 | if ram_total>1400000000: |
| 255 | 255 | ram_total=1400000000 |
| 256 | 256 | |
| 257 | - if (sys.platform == 'linux2'): | |
| 257 | + if sys.platform.startswith('linux'): | |
| 258 | 258 | if (platform.architecture()[0] == '32bit'): |
| 259 | 259 | if ram_free>3500000000: |
| 260 | 260 | ram_free=3500000000 |
| ... | ... | @@ -313,7 +313,7 @@ def predict_memory(nfiles, x, y, p): |
| 313 | 313 | |
| 314 | 314 | return (x/porcent, y/porcent) |
| 315 | 315 | |
| 316 | - elif(sys.platform == 'linux2'): | |
| 316 | + elif sys.platform.startswith('linux'): | |
| 317 | 317 | |
| 318 | 318 | if (platform.architecture()[0] == '32bit'): |
| 319 | 319 | # 839000000 = 800 MB |
| ... | ... | @@ -461,4 +461,4 @@ def encode(text, encoding, *args): |
| 461 | 461 | try: |
| 462 | 462 | return text.encode(encoding, *args) |
| 463 | 463 | except AttributeError: |
| 464 | - return text | |
| 465 | 464 | \ No newline at end of file |
| 465 | + return text | ... | ... |
setup.py