Guest User

Untitled

a guest
Dec 10th, 2024
33
0
36 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.35 KB | None | 0 0
  1.                 # find and load the gui
  2.                 gui_file = self.inifile.find('DISPLAY', 'GUI') or False
  3.                 if gui_file: # gui is in the ini file
  4.                         gui_path = os.path.join(os.path.dirname(self.status.ini_filename), gui_file)
  5.                         if not os.path.isfile(gui_path): # gui not found
  6.                                 gui_path = os.path.join(self.gui_path, 'flex_default.ui')
  7.                                 gui_file = 'flex_default.ui'
  8.                 else: # no gui specified
  9.                         gui_path = os.path.join(self.gui_path, 'flex_default.ui')
  10.                         gui_file = 'flex_default.ui'
  11.  
  12.                 # Tried commenting this out for gentoo
  13.                 #results = subprocess.run(['dpkg-query', '-W', 'flexgui'], text=True, capture_output=True)
  14.                 #if results.stdout:
  15.                 #       self.flex_version = results.stdout.split()[1]
  16.                 #else:
  17.                         self.flex_version = 'Unknown'
  18.  
  19.                 loadUi(gui_path, self)
  20.                 machine = self.inifile.find('EMC', 'MACHINE') or False
  21.                 if machine:
  22.                         self.setWindowTitle(f'{machine} Flex GUI V{self.flex_version}')
  23.                 else:
  24.                         self.setWindowTitle(f'Flex GUI - Version: {self.flex_version} - Using {gui_file}')
Advertisement
Add Comment
Please, Sign In to add comment