def create(self): """ Override method for creating FormBaseNewWithMenu form """ try: self.api_action = Action() except DockerException as de: # pragma: no cover notify_confirm(str(de), title='Docker Error', form_color='DANGER', wrap=True) MainForm.exit() self.add_handlers({'^T': self.help_form, '^Q': MainForm.exit}) # all forms that can toggle view by group self.view_togglable = [ 'inventory', 'remove', 'update', 'enable', 'disable', 'build' ] ####################### # MAIN SCREEN WIDGETS # ####################### self.addfield = self.add(npyscreen.TitleFixedText, name='Date:', labelColor='DEFAULT', value=Timestamp()) self.addfield2 = self.add(npyscreen.TitleFixedText, name='Uptime:', labelColor='DEFAULT', value=Uptime()) self.cpufield = self.add(npyscreen.TitleFixedText, name='Logical CPUs:', labelColor='DEFAULT', value=Cpu()) self.gpufield = self.add(npyscreen.TitleFixedText, name='GPUs:', labelColor='DEFAULT', value=Gpu()[1]) self.location = self.add(npyscreen.TitleFixedText, name='User Data:', value=PathDirs().meta_dir, labelColor='DEFAULT') self.file_drop = self.add(npyscreen.TitleFixedText, name='File Drop:', value=DropLocation()[1], labelColor='DEFAULT') self.addfield3 = self.add(npyscreen.TitleFixedText, name='Containers:', labelColor='DEFAULT', value='0 ' + ' running') self.addfield4 = self.add(npyscreen.TitleFixedText, name='Status:', labelColor='CAUTION', value='Idle') self.addfield5 = self.add(npyscreen.TitleFixedText, name='Core Tools:', labelColor='DANGER', value='Not built') self.addfield6 = self.add(npyscreen.TitleFixedText, name='Plugin Tools:', labelColor='DEFAULT', value='Not built') self.addfield7 = self.add(npyscreen.TitleFixedText, name='Jobs:', value='0 jobs running (0 tool containers),' ' 0 completed jobs', labelColor='DEFAULT') self.multifield1 = self.add(npyscreen.MultiLineEdit, max_height=22, editable=False, value=""" '., 'b * '$ #. $: #: *# @): :@,@): ,.**:' , :@@*: ..**' '#o. .:(@'.@*"' 'bq,..:,@@*' ,* ,p$q8,:@)' .p*' ' '@@Pp@@*' Y7'.' :@):. .:@:'. .::(@:. _ __ _____ _ __ | |_ \ \ / / _ \ '_ \| __| \ V / __/ | | | |_ \_/ \___|_| |_|\__| """) ################ # MENU OPTIONS # ################ # Core Tools Menu Items self.m2 = self.add_menu(name='Core Tools', shortcut='c') self.m2.addItem(text='Add all latest core tools', onSelect=MainForm.core_tools, arguments=['install'], shortcut='i') self.m2.addItem(text='Build core tools', onSelect=self.perform_action, arguments=['build_core'], shortcut='b') self.m2.addItem(text='Clean core tools', onSelect=self.perform_action, arguments=['clean_core'], shortcut='c') self.m2.addItem(text='Configure core tools', onSelect=self.perform_action, arguments=['configure_core'], shortcut='t') self.m2.addItem(text='Disable core tools', onSelect=self.perform_action, arguments=['disable_core'], shortcut='d') self.m2.addItem(text='Enable core tools', onSelect=self.perform_action, arguments=['enable_core'], shortcut='e') self.m2.addItem(text='Inventory of core tools', onSelect=self.perform_action, arguments=['inventory_core'], shortcut='v') self.m2.addItem(text='Remove core tools', onSelect=self.perform_action, arguments=['remove_core'], shortcut='r') self.m2.addItem(text='Start core tools', onSelect=self.perform_action, arguments=['start_core'], shortcut='s') self.m2.addItem(text='Stop core tools', onSelect=self.perform_action, arguments=['stop_core'], shortcut='p') self.m2.addItem(text='Update core tools', onSelect=self.perform_action, arguments=['update_core'], shortcut='u') # Plugin Menu Items self.m3 = self.add_menu(name='Plugins', shortcut='p') self.m3.addItem(text='Add new plugin', onSelect=self.perform_action, arguments=['add'], shortcut='a') self.m3.addItem(text='Build plugin tools', onSelect=self.perform_action, arguments=['build'], shortcut='b') self.m3.addItem(text='Clean plugin tools', onSelect=self.perform_action, arguments=['clean'], shortcut='c') self.m3.addItem(text='Configure plugin tools', onSelect=self.perform_action, arguments=['configure'], shortcut='t') self.m3.addItem(text='Disable plugin tools', onSelect=self.perform_action, arguments=['disable'], shortcut='d') self.m3.addItem(text='Enable plugin tools', onSelect=self.perform_action, arguments=['enable'], shortcut='e') self.m3.addItem(text='Inventory of installed plugins', onSelect=self.perform_action, arguments=['inventory'], shortcut='i') self.m3.addItem(text='Remove plugins', onSelect=self.perform_action, arguments=['remove'], shortcut='r') self.m3.addItem(text='Start plugin tools', onSelect=self.perform_action, arguments=['start'], shortcut='s') self.m3.addItem(text='Stop plugin tools', onSelect=self.perform_action, arguments=['stop'], shortcut='p') self.m3.addItem(text='Update plugins', onSelect=self.perform_action, arguments=['update'], shortcut='u') # Log Menu Items self.m4 = self.add_menu(name='Logs', shortcut='l') self.m4.addItem(text='Get container logs', arguments=['logs'], onSelect=self.perform_action) # Services Menu Items self.m5 = self.add_menu(name='Services Running', shortcut='s') self.m5.addItem(text='Core Services', onSelect=self.perform_action, arguments=['services_core'], shortcut='c') self.m5.addItem(text='External Services', onSelect=self.perform_action, arguments=['services_external'], shortcut='e') self.m5.addItem(text='Plugin Services', onSelect=self.perform_action, arguments=['services'], shortcut='p') # System Commands Menu Items self.m6 = self.add_menu(name='System Commands', shortcut='y') self.m6.addItem(text='Backup', onSelect=self.system_commands, arguments=['backup'], shortcut='b') self.m6.addItem(text='Change vent configuration', onSelect=self.system_commands, arguments=['configure'], shortcut='c') self.m6.addItem(text='Detect GPUs', onSelect=self.system_commands, arguments=['gpu'], shortcut='g') self.m6.addItem(text='Enable Swarm Mode (To Be Implemented...)', onSelect=self.system_commands, arguments=['swarm'], shortcut='s') self.m6.addItem(text='Factory reset', onSelect=self.system_commands, arguments=['reset'], shortcut='r') self.s6 = self.m6.addNewSubmenu(name='Network Tap Interface', shortcut='n') self.m6.addItem(text='Restore', onSelect=self.system_commands, arguments=['restore'], shortcut='t') self.m6.addItem(text='Upgrade (To Be Implemented...)', onSelect=self.system_commands, arguments=['upgrade'], shortcut='u') self.s6.addItem(text='Create', onSelect=self.system_commands, shortcut='c', arguments=['ntapcreate']) self.s6.addItem(text='Delete', onSelect=self.system_commands, shortcut='d', arguments=['ntapdelete']) self.s6.addItem(text='List', onSelect=self.system_commands, shortcut='l', arguments=['ntaplist']) self.s6.addItem(text='NICs', onSelect=self.system_commands, shortcut='n', arguments=['ntapnics']) self.s6.addItem(text='Start', onSelect=self.system_commands, shortcut='s', arguments=['ntapstart']) self.s6.addItem(text='Stop', onSelect=self.system_commands, shortcut='t', arguments=['ntapstop']) # Tutorial Menu Items self.m7 = self.add_menu(name='Tutorials', shortcut='t') self.s1 = self.m7.addNewSubmenu(name='About Vent', shortcut='v') self.s1.addItem(text='Background', onSelect=self.switch_tutorial, arguments=['background'], shortcut='b') self.s1.addItem(text='Terminology', onSelect=self.switch_tutorial, arguments=['terminology'], shortcut='t') self.s1.addItem(text='Getting Setup', onSelect=self.switch_tutorial, arguments=['setup'], shortcut='s') self.s2 = self.m7.addNewSubmenu(name='Working with Cores', shortcut='c') self.s2.addItem(text='Building Cores', onSelect=self.switch_tutorial, arguments=['building_cores'], shortcut='b') self.s2.addItem(text='Starting Cores', onSelect=self.switch_tutorial, arguments=['starting_cores'], shortcut='c') self.s3 = self.m7.addNewSubmenu(name='Working with Plugins', shortcut='p') self.s3.addItem(text='Adding Plugins', onSelect=self.switch_tutorial, arguments=['adding_plugins'], shortcut='a') self.s4 = self.m7.addNewSubmenu(name='Files', shortcut='f') self.s4.addItem(text='Adding Files', onSelect=self.switch_tutorial, arguments=['adding_files'], shortcut='a') self.s5 = self.m7.addNewSubmenu(name='Help', shortcut='s') self.s5.addItem(text='Basic Troubleshooting', onSelect=self.switch_tutorial, arguments=['basic_troubleshooting'], shortcut='t')
def test_gpu(): """ Test the gpu function """ gpu = Gpu() assert isinstance(gpu, tuple) gpu = Gpu(pull=True) assert isinstance(gpu, tuple)
def system_commands(self, action): """ Perform system commands """ if action == 'backup': status = self.api_action.backup() if status[0]: notify_confirm('Vent backup successful') else: notify_confirm('Vent backup could not be completed') elif action == 'configure': form_args = { 'name': 'Change vent configuration', 'get_configure': self.api_action.get_configure, 'save_configure': self.api_action.save_configure, 'restart_tools': self.api_action.restart_tools, 'vent_cfg': True } add_kargs = { 'form': EditorForm, 'form_name': 'CONFIGUREVENT', 'form_args': form_args } self.add_form(**add_kargs) elif action == 'reset': okay = npyscreen.notify_ok_cancel( "This factory reset will remove ALL of Vent's user data, " 'containers, and images. Are you sure?', title='Confirm system command') if okay: status = self.api_action.reset() if status[0]: notify_confirm('Vent reset complete. ' 'Press OK to exit Vent Manager console.') else: notify_confirm(status[1]) MainForm.exit() elif action == 'gpu': gpu = Gpu(pull=True) if gpu[0]: notify_confirm('GPU detection successful. ' 'Found: ' + gpu[1]) else: if gpu[1] == 'Unknown': notify_confirm('Unable to detect GPUs, try `make gpu` ' 'from the vent repository directory. ' 'Error: ' + str(gpu[2])) else: notify_confirm('No GPUs detected.') elif action == 'restore': backup_dir_home = os.path.expanduser('~') backup_dirs = [ f for f in os.listdir(backup_dir_home) if f.startswith('.vent-backup') ] form_args = { 'restore': self.api_action.restore, 'dirs': backup_dirs, 'name': 'Pick a version to restore from' + '\t' * 8 + '^T to toggle main', 'color': 'CONTROL' } add_kargs = { 'form': BackupForm, 'form_name': 'CHOOSEBACKUP', 'form_args': form_args } self.add_form(**add_kargs) elif action == 'swarm': # !! TODO # add notify_cancel_ok popup once implemented pass elif action == 'upgrade': # !! TODO # add notify_cancel_ok popup once implemented pass # deal with all network tap actions elif 'ntap' in action: # check if the tool is installed, built, and running output = self.api_action.tool_status_output('network_tap') # create a dict with substring as keys and forms as values ntap_form = { 'create': CreateNTap, 'delete': DeleteNTap, 'list': ListNTap, 'nics': NICsNTap, 'start': StartNTap, 'stop': StopNTap } if output[0]: if output[1]: notify_confirm(output[1]) else: # action regarding ntap come in the form of 'ntapcreate' # 'ntapdelete', etc tap_action = action.split('ntap')[1] form_args = { 'color': 'CONTROL', 'name': 'Network Tap Interface ' + tap_action + '\t' * 6 + '^T to toggle main' } self.add_form(ntap_form[tap_action], 'Network Tap ' + tap_action.title(), form_args) return
def test_gpu(): """ Test the gpu function """ gpu = Gpu() assert type(gpu) == str
def create(self): """ Override method for creating FormBaseNewWithMenu form """ try: self.api_action = System() except DockerException as de: # pragma: no cover notify_confirm(str(de), title='Docker Error', form_color='DANGER', wrap=True) MainForm.exit() self.add_handlers({'^T': self.help_form, '^Q': MainForm.exit}) # all forms that can toggle view by group self.view_togglable = ['inventory', 'remove'] ####################### # MAIN SCREEN WIDGETS # ####################### self.addfield = self.add(npyscreen.TitleFixedText, name='Date:', labelColor='DEFAULT', value=Timestamp()) self.addfield2 = self.add(npyscreen.TitleFixedText, name='Uptime:', labelColor='DEFAULT', value=Uptime()) self.cpufield = self.add(npyscreen.TitleFixedText, name='Logical CPUs:', labelColor='DEFAULT', value=Cpu()) self.gpufield = self.add(npyscreen.TitleFixedText, name='GPUs:', labelColor='DEFAULT', value=Gpu()[1]) self.location = self.add(npyscreen.TitleFixedText, name='User Data:', value=PathDirs().meta_dir, labelColor='DEFAULT') self.file_drop = self.add(npyscreen.TitleFixedText, name='File Drop:', value=DropLocation()[1], labelColor='DEFAULT') self.addfield3 = self.add(npyscreen.TitleFixedText, name='Containers:', labelColor='DEFAULT', value='0 ' + ' running') self.multifield1 = self.add(npyscreen.MultiLineEdit, max_height=22, editable=False, value=""" '., 'b * '$ #. $: #: *# @): :@,@): ,.**:' , :@@*: ..**' '#o. .:(@'.@*"' 'bq,..:,@@*' ,* ,p$q8,:@)' .p*' ' '@@Pp@@*' Y7'.' :@):. .:@:'. .::(@:. _ __ _____ _ __ | |_ \ \ / / _ \ '_ \| __| \ V / __/ | | | |_ \_/ \___|_| |_|\__| """) ################ # MENU OPTIONS # ################ # Tool Menu Items self.m3 = self.add_menu(name='Tools', shortcut='p') self.m3.addItem(text='Add New Tool', onSelect=self.perform_action, arguments=['add'], shortcut='a') self.m3.addItem(text='Configure Tools', onSelect=self.perform_action, arguments=['configure'], shortcut='t') self.m3.addItem(text='Inventory', onSelect=self.perform_action, arguments=['inventory'], shortcut='i') self.m3.addItem(text='Remove Tools', onSelect=self.perform_action, arguments=['remove'], shortcut='r') self.m3.addItem(text='Start Tools', onSelect=self.perform_action, arguments=['start'], shortcut='s') self.m3.addItem(text='Stop Tools', onSelect=self.perform_action, arguments=['stop'], shortcut='p') # Services Menu Items self.m5 = self.add_menu(name='Services Running', shortcut='s') self.m5.addItem(text='External Services', onSelect=self.perform_action, arguments=['services_external'], shortcut='e') self.m5.addItem(text='Tool Services', onSelect=self.perform_action, arguments=['services'], shortcut='t') # System Commands Menu Items self.m6 = self.add_menu(name='System Commands', shortcut='y') self.m6.addItem(text='Backup', onSelect=self.system_commands, arguments=['backup'], shortcut='b') self.m6.addItem(text='Change Vent Configuration', onSelect=self.system_commands, arguments=['configure'], shortcut='c') self.m6.addItem(text='Detect GPUs', onSelect=self.system_commands, arguments=['gpu'], shortcut='g') self.m6.addItem(text='Factory Reset', onSelect=self.system_commands, arguments=['reset'], shortcut='r') self.m6.addItem(text='Restore (To Be Implemented...', onSelect=self.system_commands, arguments=['restore'], shortcut='t') # TODO this should be either or depending on whether or not it's running already self.m6.addItem(text='Start', onSelect=self.system_commands, arguments=['start'], shortcut='s') self.m6.addItem(text='Stop', onSelect=self.system_commands, arguments=['stop'], shortcut='o') self.m6.addItem(text='Upgrade (To Be Implemented...)', onSelect=self.system_commands, arguments=['upgrade'], shortcut='u') # Tutorial Menu Items self.m7 = self.add_menu(name='Tutorials', shortcut='t') self.s1 = self.m7.addNewSubmenu(name='About Vent', shortcut='v') self.s1.addItem(text='Background', onSelect=self.switch_tutorial, arguments=['background'], shortcut='b') self.s1.addItem(text='Terminology', onSelect=self.switch_tutorial, arguments=['terminology'], shortcut='t') self.s1.addItem(text='Getting Setup', onSelect=self.switch_tutorial, arguments=['setup'], shortcut='s') self.s2 = self.m7.addNewSubmenu(name='Working with Tools', shortcut='c') self.s2.addItem(text='Starting Tools', onSelect=self.switch_tutorial, arguments=['starting_tools'], shortcut='s') self.s3 = self.m7.addNewSubmenu(name='Working with Plugins', shortcut='p') self.s3.addItem(text='Adding Tools', onSelect=self.switch_tutorial, arguments=['adding_tools'], shortcut='a') self.s4 = self.m7.addNewSubmenu(name='Files', shortcut='f') self.s4.addItem(text='Adding Files', onSelect=self.switch_tutorial, arguments=['adding_files'], shortcut='a') self.s5 = self.m7.addNewSubmenu(name='Help', shortcut='s') self.s5.addItem(text='Basic Troubleshooting', onSelect=self.switch_tutorial, arguments=['basic_troubleshooting'], shortcut='t')
def system_commands(self, action): """ Perform system commands """ if action == 'backup': status = self.api_action.backup() if status[0]: notify_confirm('Vent backup successful') else: notify_confirm('Vent backup could not be completed') elif action == 'start': status = self.api_action.start() if status[0]: notify_confirm('System start complete. ' 'Press OK.') else: notify_confirm(status[1]) elif action == 'stop': status = self.api_action.stop() if status[0]: notify_confirm('System stop complete. ' 'Press OK.') else: notify_confirm(status[1]) elif action == 'configure': # TODO form_args = { 'name': 'Change vent configuration', 'get_configure': self.api_action.get_configure, 'save_configure': self.api_action.save_configure, 'restart_tools': self.api_action.restart_tools, 'vent_cfg': True } add_kargs = { 'form': EditorForm, 'form_name': 'CONFIGUREVENT', 'form_args': form_args } self.add_form(**add_kargs) elif action == 'reset': okay = npyscreen.notify_ok_cancel( "This factory reset will remove ALL of Vent's user data, " 'containers, and images. Are you sure?', title='Confirm system command') if okay: status = self.api_action.reset() if status[0]: notify_confirm('Vent reset complete. ' 'Press OK to exit Vent Manager console.') else: notify_confirm(status[1]) MainForm.exit() elif action == 'gpu': gpu = Gpu(pull=True) if gpu[0]: notify_confirm('GPU detection successful. ' 'Found: ' + gpu[1]) else: if gpu[1] == 'Unknown': notify_confirm('Unable to detect GPUs, try `make gpu` ' 'from the vent repository directory. ' 'Error: ' + str(gpu[2])) else: notify_confirm('No GPUs detected.') elif action == 'restore': backup_dir_home = os.path.expanduser('~') backup_dirs = [ f for f in os.listdir(backup_dir_home) if f.startswith('.vent-backup') ] form_args = { 'restore': self.api_action.restore, 'dirs': backup_dirs, 'name': 'Pick a version to restore from' + '\t' * 8 + '^T to toggle main', 'color': 'CONTROL' } add_kargs = { 'form': BackupForm, 'form_name': 'CHOOSEBACKUP', 'form_args': form_args } self.add_form(**add_kargs) return
def create(self): """ Override method for creating FormBaseNewWithMenu form """ self.add_handlers({"^T": self.change_forms, "^Q": self.exit}) ####################### # MAIN SCREEN WIDGETS # ####################### self.addfield = self.add(npyscreen.TitleFixedText, name='Date:', labelColor='DEFAULT', value=Timestamp()) self.addfield2 = self.add(npyscreen.TitleFixedText, name='Uptime:', labelColor='DEFAULT', value=Uptime()) self.cpufield = self.add(npyscreen.TitleFixedText, name='Logical CPUs:', labelColor='DEFAULT', value=Cpu()) self.gpufield = self.add(npyscreen.TitleFixedText, name='GPUs:', labelColor='DEFAULT', value=Gpu()) self.addfield3 = self.add(npyscreen.TitleFixedText, name='Containers:', labelColor='DEFAULT', value="0 " + " running") self.addfield4 = self.add(npyscreen.TitleFixedText, name='Status:', labelColor='CAUTION', value="Idle") self.addfield5 = self.add(npyscreen.TitleFixedText, name='Core Tools:', labelColor='DANGER', value="Not built") self.addfield6 = self.add( npyscreen.TitleFixedText, name='Jobs:', value="0 jobs running (0 tool containers), 0 completed jobs", labelColor='DEFAULT') self.multifield1 = self.add(npyscreen.MultiLineEdit, max_height=22, editable=False, value=""" '., 'b * '$ #. $: #: *# @): :@,@): ,.**:' , :@@*: ..**' '#o. .:(@'.@*"' 'bq,..:,@@*' ,* ,p$q8,:@)' .p*' ' '@@Pp@@*' Y7'.' :@):. .:@:'. .::(@:. _ __ _____ _ __ | |_ \ \ / / _ \ '_ \| __| \ V / __/ | | | |_ \_/ \___|_| |_|\__| """) ################ # MENU OPTIONS # ################ # Core Tools Menu Items self.m2 = self.add_menu(name="Core Tools", shortcut="c") self.m2.addItem(text='Add all latest core tools', onSelect=self.core_tools, arguments=['install'], shortcut='i') self.m2.addItem(text='Build core tools', onSelect=self.core_tools, arguments=['build'], shortcut='b') self.m2.addItem(text='Clean core tools', onSelect=self.core_tools, arguments=['clean'], shortcut='c') self.m2.addItem(text='Inventory of core tools', onSelect=self.core_tools, arguments=['inventory'], shortcut='v') self.m2.addItem(text='Remove core tools', onSelect=self.core_tools, arguments=['remove'], shortcut='r') self.m2.addItem(text='Start core tools', onSelect=self.core_tools, arguments=['start'], shortcut='s') self.m2.addItem(text='Stop core tools', onSelect=self.core_tools, arguments=['stop'], shortcut='p') self.m2.addItem(text='Update core tools', onSelect=self.core_tools, arguments=['update'], shortcut='u') # Plugin Menu Items self.m3 = self.add_menu(name="Plugins", shortcut="p") self.m3.addItem(text='Add new plugin', onSelect=self.perform_action, arguments=['add'], shortcut='a') self.m3.addItem(text='Build plugin tools', onSelect=self.perform_action, arguments=['build'], shortcut='b') self.m3.addItem(text='Clean plugin tools', onSelect=self.perform_action, arguments=['clean'], shortcut='c') self.m3.addItem(text='Inventory of installed plugins', onSelect=self.perform_action, arguments=['inventory'], shortcut='i') self.m3.addItem(text='Remove plugins', onSelect=self.perform_action, arguments=['remove'], shortcut='r') self.m3.addItem(text='Start plugin tools', onSelect=self.perform_action, arguments=['start'], shortcut='s') self.m3.addItem(text='Stop plugin tools', onSelect=self.perform_action, arguments=['stop'], shortcut='p') self.m3.addItem(text='Update plugins', onSelect=self.perform_action, arguments=['update'], shortcut='u') # Log Menu Items self.m4 = self.add_menu(name="Logs", shortcut="l") self.m4.addItem(text='Get container logs', arguments=[], onSelect=self.logs_form) # Services Menu Items self.m5 = self.add_menu(name="Services Running", shortcut='s') self.m5.addItem(text='Core Services', onSelect=self.services_form, arguments=['core'], shortcut='c') self.m5.addItem(text='Plugin Services (To be implemented...)', onSelect=self.services_form, arguments=['plugins'], shortcut='p') # System Commands Menu Items self.m6 = self.add_menu(name="System Commands") self.m6.addItem(text='Factory reset', onSelect=self.system_commands, arguments=['reset'], shortcut='r') self.m6.addItem(text='Upgrade (To Be Implemented...)', onSelect=self.system_commands, arguments=['upgrade'], shortcut='u') # Tutorial Menu Items self.m7 = self.add_menu(name="Tutorials", shortcut="t") self.s1 = self.m7.addNewSubmenu(name="About Vent", shortcut='v') self.s1.addItem(text="Background", onSelect=self.perform_action, arguments=['background'], shortcut='b') self.s1.addItem(text="Terminology", onSelect=self.perform_action, arguments=['terminology'], shortcut='t') self.s1.addItem(text="Getting Setup", onSelect=self.perform_action, arguments=['setup'], shortcut='s') self.s2 = self.m7.addNewSubmenu(name="Working with Cores", shortcut='c') self.s2.addItem(text="Building Cores", onSelect=self.perform_action, arguments=['building_cores'], shortcut='b') self.s2.addItem(text="Starting Cores", onSelect=self.perform_action, arguments=['starting_cores'], shortcut='c') self.s3 = self.m7.addNewSubmenu(name="Working with Plugins", shortcut='p') self.s3.addItem(text="Adding Plugins", onSelect=self.perform_action, arguments=['adding_plugins'], shortcut='a') self.s4 = self.m7.addNewSubmenu(name="Files", shortcut='f') self.s4.addItem(text="Adding Files", onSelect=self.perform_action, arguments=['adding_files'], shortcut='a') self.s5 = self.m7.addNewSubmenu(name="Services", shortcut='s') self.s5.addItem(text="Setting up Services", onSelect=self.perform_action, arguments=['setting_up_services'], shortcut='s')