def create(self): npyscreen.setTheme(ColorfulTheme) self.dbname = self.add(npyscreen.TitleText, begin_entry_at=24, name="Database Name:", value="myapp") self.dbuser = self.add(npyscreen.TitleText, begin_entry_at=24, name="Database User:"******"myapp") self.dbpass = self.add(npyscreen.TitleText, begin_entry_at=24, name="Database Password:"******"dbpass") self.dbhost = self.add(npyscreen.TitleText, begin_entry_at=24, name="Database Host:", value="0.0.0.0") self.dbport = self.add(npyscreen.TitleText, begin_entry_at=24, name="Database Port:", value="5432")
def onStart(self): npyscreen.setTheme(npyscreen.Themes.ElegantTheme) self.addForm("MAIN", MainScreen, name='DoToDo App') self.addForm("TASK", TaskDetail, name='Detail') self.addForm("APPOINTMENT", AppointmentDetail, name='Detail') self.addForm("DEADLINE", DeadlineDetail, name='Detail') self.addForm("UNBOUND", UnboundDetail, name='Detail')
def main(self): # These lines create the form and populate it with widgets. # A fairly complex screen in only 8 or so lines of code - a line for each control. npyscreen.setTheme(npyscreen.Themes.ColorfulTheme) F = npyscreen.ActionFormWithMenus(name = "Welcome to Npyscreen",) t1 = F.add(self.__class__.__TEXT_WIDGET, name = "Text:", ) t2 = F.add(self.__class__.__TEXT_WIDGET, name = "Text:", ) t3 = F.add(self.__class__.__TEXT_WIDGET, name = "Text:", ) t4 = F.add(self.__class__.__TEXT_WIDGET, name = "Text:", ) m1 = F.add(npyscreen.MultiLine, name = "Mutliline", scroll_exit=True, max_height=5) me = F.add(npyscreen.MultiLineEdit, name="Testing", autowrap=False) t1.value = u"This is a \n test" t2.value = u"This is a é test" t3.value = u"This is ∑ a test" t1.value = u"Testing tripple width \u3111 stuff." t2.value = u"Testing double width stuff \u1000 <- there" t4.value = u"another test is \u1D656 this one." m1.values = [t1.value, t2.value, t3.value, 'another test \u24AF is here', 'another test is \u1D666 this one.'] me.value = '\n'.join([t1.value, t2.value, t3.value, 'another test is \u1D656 this one.']) # This lets the user play with the Form. F.edit()
def main(self): """ Main loop of the application """ npyscreen.setTheme(npyscreen.Themes.ColorfulTheme) super(PlayClApp, self).main()
def main(self): npyscreen.setTheme(BeautifulTheme) Form = npyscreen.Form(name="GNU/Linux Magazine") text = Form.add(npyscreen.FixedText, value="Exemple de formulaire minimal") user_text = Form.add(npyscreen.TitleText, name="Saisir texte:") Form.edit() npyscreen.notify_wait("Valeur saisie : " + user_text.value, title="Vérification")
def onStart(self): # Set the theme. DefaultTheme is used by default npyscreen.setTheme(AppTheme) self.addForm("MAIN", PasswordForm, name="Welcome to Pdiary 0.80") self.addForm("MAINMENU", MainMenuForm, name="Welcome to Pdiary") self.addForm("NEWENTRY", NewEntryForm, name="New Entry", draw_line_at=5) self.addForm("LISTENTRIES", ListEntriesForm, name="View Last Entries", draw_line_at=3) self.addForm("VIEWENTRIES", ViewEntriesForm, name="View Entry", draw_line_at=5) self.addForm("EDITENTRY", EditEntryForm, name="Edit Entry", draw_line_at=5)
def onStart(self): npyscreen.setTheme(npyscreen.Themes.ColorfulTheme) self.PostgreDB = PostgreSQL() self.dbset = DBSettings() # self.mysql_db = MySQL_DB() # self.addForm("MAIN", LoginForm, name = "Login Page", lines = 13, columns = 50, draw_line_at = 6) self.selectDBForm = self.addForm("MAIN", DBSelector, name = "Select Database", lines = 13, columns = 50, draw_line_at = 6) self.selectTableForm = self.addForm("TABLESELECTION", DisplayTables, name = "Select Table") self.showTableForm = self.addForm("TESTDISPLAY", DisplayTableValues, name = "Display Table")
def on_ok(self): option = npyscreen.notify_yes_no("Do you want to apply the changes?\n" "Else theme will be set to Default", editw=1) if option: npyscreen.notify_wait("Changes saved :)") self.parentApp.change_theme(self.select_theme.get_selected_objects()[0]) self.parentApp.switchForm("MAIN") else: npyscreen.setTheme(npyscreen.Themes.DefaultTheme) self.parentApp.switchForm("MAIN")
def onStart(self): npyscreen.setTheme(npyscreen.Themes.ColorfulTheme) env_vars = get_environment_file_dict() self.zeek_script_config = config.ScriptConfigManager( env_vars['ZEEK_SCRIPTS'], backup_configuration_directory=os.path.join( const.CONFIG_BACKUP_PATH)) self.addForm('MAIN', ZeekScriptSettingsForm, name='Zeek Script Configuration')
def main(self): # These lines create the form and populate it with widgets. # A fairly complex screen in only 8 or so lines of code - a line for each control. npyscreen.setTheme(npyscreen.Themes.ColorfulTheme) F = npyscreen.SplitForm(name = "Welcome to Npyscreen",) t = F.add(npyscreen.Textfield, name = "Text:", ) t1 = F.add(npyscreen.TitleText, name = "Text:", ) t2 = F.add(npyscreen.TitleMultiSelect, name="Testing", values=range(200)) # This lets the user play with the Form. F.edit()
def main(self): npyscreen.setTheme(self._get_theme()) # time(ms) to wait for user interactions self.keypress_timeout_default = 10 if self.refresh_rate < 1000: self.keypress_timeout_default = int(self.refresh_rate / 100) self.draw()
def onStart(self): npyscreen.setTheme(npyscreen.Themes.ColorfulTheme) self.dbset = DBSettings() self.editForm = '' self.newTableColNum = self.addForm("TABLECOLUMNS", NewTableColNum, draw_line_at = 5) self.newTable = '' self.addForm("MAIN", LoginForm, name = "Database Application", draw_line_at = 14) self.addForm("TABLESELECTION", DisplayTables, draw_line_at = 5) self.addForm("POSTGRES", RecordListDisplay, draw_line_at = 4) self.TableForm = self.addForm("TESTDISPLAY", RecordListDisplay)
def onStart(self): npyscreen.setTheme(npyscreen.Themes.ColorfulTheme) self.myDatabase = PostgreSQL() self.dbset = DBSettings() self.addForm("MAIN", LoginForm, name = "Database Application", lines = 13, columns = 50) self.addForm("TABLESELECTION", DisplayTables) self.addForm("POSTGRES", RecordListDisplay, draw_line_at = 4) #self.addForm("MYSQLDB", MySQLClassHere) self.addForm("EDITRECORDFM", EditRecord) self.addForm("EDITRECORDFMCAR", EditRecordCars) self.addForm("EDITRECORDFMSTATE", EditRecordStates) self.TableForm = self.addForm("TESTDISPLAY", RecordListDisplay)
def main(self): npyscreen.setTheme(npyscreen.Themes.TransparentThemeLightText) buy_sell = npyscreen.Form(name = "Buy & Sell Stocks",) pick = buy_sell.add(npyscreen.TitleFixedText, name = "Please choose an option",) option= buy_sell.add(npyscreen.TitleSelectOne, max_height =-2, value = [1,], name="Option", values = ["Buy","Sell"], scroll_exit=True) buy_sell.edit() if str(option.get_selected_objects()) == "['Buy']": self.buy() elif str(option.get_selected_objects()) == "['Sell']": self.sell()
def onStart(self): npyscreen.setTheme(npyscreen.Themes.ColorfulTheme) env_vars = get_environment_file_dict() self.suricata_config = config.ConfigManager( env_vars['SURICATA_CONFIG'], backup_configuration_directory=os.path.join( const.CONFIG_BACKUP_PATH)) self.addForm('MAIN', SuricataInstanceSettingsForm, name='Suricata Instance Configuration') self.addForm('EDITINTERFACEFM', EditInterfaceForm, name='Edit Suricata Network Interface')
def onStart(self): npyscreen.setTheme(npyscreen.Themes.TransparentThemeLightText) self.db = IvDB() self.addForm("MAIN", MainMenuForm) self.addForm("PRODUCTFORM", ProductForm) self.addForm("PRODUCTEDITFORM", ProductEditForm) self.addForm("ORDERFORM", OrderForm) self.addForm("ORDEREDITFORM", OrderEditForm) self.addForm("ORDEREDITPRODUCTFORM", OrderEditProductForm); self.addForm("CUSTOMERFORM", CustomerForm) self.addForm("CUSTOMEREDITFORM", CustomerEditForm)
def onStart(self): # When Application starts, set up the Forms that will be used. # These two forms are persistent between each edit. npyscreen.setTheme(npyscreen.Themes.ColorfulTheme) self.addForm( "MAIN", MainForm, name="Banking Management System", color="IMPORTANT", ) self.addForm("USER", UserHomeViewForm, name="User View") self.addForm("AMAN", ManageAccountForm, name="Manage Account") self.addForm("NUSER", AddNewUserForm, name="Add new User")
def onStart(self): initialiseDB() npyscreen.setTheme(npyscreen.Themes.ElegantTheme) self.add_repo = sqlite_utils.add_repo self.list_repos = sqlite_utils.list_repos self.registerForm('MAIN', MainForm()) self.registerForm('EDIT', EditForm()) self.registerForm('STAGE', StageForm()) self.registerForm('COMMIT', CommitForm()) self.registerForm('MERGE', MergeForm()) self.registerForm('REMOTES', RemoteForm()) self.registerForm('CHECKOUT', CheckoutForm()) self.registerForm('UNTRACKED', UntrackedForm()) self.registerForm('BRANCH', BranchForm())
def onStart(self): npyscreen.setTheme(AppTheme) self.addForm("MAIN", MainForm, name="Sistema de Reservas de passagens") self.addForm("PassengerForm", PassengerForm, name="Sistema de Reservas de passagens") self.addForm("BookingForm", BookingForm, name="Sistema de Reservas de passagens") self.addForm("InsertBookingForm", InsertBookingForm, name="Sistema de Reservas de passagens") self.addForm("VehicleForm", VehicleForm, name="Sistema de Reservas de passagens") self.addForm("InsertVehicleForm", InsertVehicleForm, name="Sistema de Reservas de passagens") self.addForm("EditRemoveVehicleForm", EditRemoveVehicleForm, name="Sistema de Reservas de passagens") self.addForm("DisplayVehicleForm", DisplayVehicleForm, name="Sistema de Reservas de passagens") self.addForm("StationForm", StationForm, name="Sistema de Reservas de passagens") self.addForm("InsertStationForm", InsertStationForm, name="Sistema de Reservas de passagens") self.addForm("EditRemoveStationForm", EditRemoveStationForm, name="Sistema de Reservas de passagens") self.addForm("DisplayStationForm", DisplayStationForm, name="Sistema de Reservas de passagens") self.addForm("InsertSpanForm", InsertSpanForm, name="Sistema de Reservas de passagens") self.addForm("EditRemoveSpanForm", EditRemoveSpanForm, name="Sistema de Reservas de passagens") self.addForm("DisplaySpanForm", DisplaySpanForm, name="Sistema de Reservas de passagens") self.addForm("SearchSpanForm", SearchSpanForm, name="Sistema de Reservas de passagens")
def onStart(self): npyscreen.setTheme(npyscreen.Themes.ColorfulTheme) self.myDatabase = PostgreSQL() self.dbset = DBSettings() self.addForm("MAIN", LoginForm, name="Database Application", lines=13, columns=50) self.addForm("TABLESELECTION", DisplayTables) self.addForm("POSTGRES", RecordListDisplay, draw_line_at=4) #self.addForm("MYSQLDB", MySQLClassHere) self.addForm("EDITRECORDFM", EditRecord) self.addForm("EDITRECORDFMCAR", EditRecordCars) self.addForm("EDITRECORDFMSTATE", EditRecordStates) self.TableForm = self.addForm("TESTDISPLAY", RecordListDisplay)
def onStart(self): env_vars = get_environment_file_dict() npyscreen.setTheme(npyscreen.Themes.ColorfulTheme) self.filebeat_config = config.ConfigManager( env_vars.get('FILEBEAT_HOME'), backup_configuration_directory=os.path.join( const.CONFIG_BACKUP_PATH)) self.addForm('MAIN', FilebeatInstanceSettingsForm, name='FileBeat Configuration') self.addForm('EDITTARGETTYPEFM', EditTargetTypeOutputForm, name='Select between LogStash or Kafka Output.') self.addForm('EDITTARGETFM', EditTargetsForm, name='Edit FileBeat Targets')
def onStart(self): # When Application starts, set up the Forms that will be used. cfg = yaml.safe_load(open('config.yaml')) if cfg["database"]["engine"] == "sqlite": engine_string = "sqlite:///%s" % (path.join(getcwd(), cfg["database"]["path"])) else: engine_string = "%s://%s" % (cfg["database"]["engine"], cfg["database"]["path"]) self.application_logic = Application(printer_name=cfg["printer"]["name"], db_path=engine_string) npyscreen.setTheme(eval("npyscreen.Themes.%s" % cfg["gui"]["theme"])) self.addForm("MAIN", ItemListDisplay, name="Items") self.addForm("BOXES", BoxListDisplay, name="Boxes") self.addForm("POPUPITEM", PopupItemEditor, name="Item editor") self.addForm("POPUPBOX", PopupBoxEditor, name="Box editor")
def onStart(self): npyscreen.setTheme(npyscreen.Themes.ColorfulTheme) self.addForm("MAIN", MainWindow) self.addForm("Register", Register) self.addForm("Log In", LogIn) self.addForm("Logged", Logged) self.addForm("List", FileListDisplay) self.addForm("Download", Download) self.addForm("Options", Options) self.addForm("Upload", Upload) self.addForm("WhoIsShared", WhoIsShared) self.addForm("Share", Share) self.addForm("Unshare", Unshare) self.addForm("FileDiffDisplay", FileDiffDisplay) self.addForm("Get", GetKeyAndFile) self.addForm("PIN", Pin)
def create(self): npyscreen.setTheme(npyscreen.Themes.ColorfulTheme) self.file_menu = self.add_menu(name='Menu') file = self.add(FileGrid) self.download_menu = self.file_menu.addNewSubmenu(name='Download Menu', shortcut='^D') self.download_menu.addItemsFromList([ ('Copy the download link', file.copy_download_link, '^C'), ('Download file', file.download, '^D'), ('Aria2', file.aria2, '^A') ]) self.file_menu.addItemsFromList([ ('Show file details', file.show_file_info, '^X'), ('Cast screen to TV', file.dlna, '^A'), ('Search', file.search, '^F'), ('Remove', file.remove, '^R'), ('Mkdir', file.mkdir, 'm') ])
def main(self): npyscreen.setTheme(npyscreen.Themes.ColorfulTheme) self.LoginForm = self.addForm("LoginScreen", LoginScreen.LoginScreen) self.MainForm = self.addForm("MainScreen", MainScreen.MainScreen) self.MainForm.SetScreenValue(self.LoginForm.value) self.MainForm.name = 'MAiN' authResult = self.MainForm.Auth() if authResult: alert = self.addForm("Alert", AlertPopup.AlertPopup) alert.DisplayText(authResult) alert.edit() else: self.MainForm.display() self.MainForm.edit() pass
def main(self): # These lines create the form and populate it with widgets. # A fairly complex screen in only 8 or so lines of code - a line for each control. npyscreen.setTheme(npyscreen.Themes.ColorfulTheme) F = npyscreen.ActionFormWithMenus(name="Welcome to Npyscreen", ) t1 = F.add( self.__class__.__TEXT_WIDGET, name="Text:", ) t2 = F.add( self.__class__.__TEXT_WIDGET, name="Text:", ) t3 = F.add( self.__class__.__TEXT_WIDGET, name="Text:", ) t4 = F.add( self.__class__.__TEXT_WIDGET, name="Text:", ) m1 = F.add(npyscreen.MultiLine, name="Mutliline", scroll_exit=True, max_height=5) me = F.add(npyscreen.MultiLineEdit, name="Testing", autowrap=False) t1.value = u"This is a \n test" t2.value = u"This is a é test" t3.value = u"This is ∑ a test" t1.value = u"Testing tripple width \u3111 stuff." t2.value = u"Testing double width stuff \u1000 <- there" t4.value = u"another test is \u1D656 this one." m1.values = [ t1.value, t2.value, t3.value, 'another test \u24AF is here', 'another test is \u1D666 this one.' ] me.value = '\n'.join([ t1.value, t2.value, t3.value, 'another test is \u1D656 this one.' ]) # This lets the user play with the Form. F.edit()
def main(self): # These lines create the form and populate it with widgets. # A fairly complex screen in only 8 or so lines of code - a line for each control. npyscreen.setTheme(npyscreen.Themes.BlackOnWhiteTheme) F = npyscreen.ActionFormWithMenus(name = "Welcome to Npyscreen",) t = F.add(npyscreen.TitleText, name = "Text:", ) fn = F.add(npyscreen.TitleFilename, name = "Filename:") dt = F.add(npyscreen.TitleDateCombo, name = "Date:") s = F.add(npyscreen.TitleSlider, out_of=12, name = "Slider") ml= F.add(npyscreen.MultiLineEdit, value = """try typing here! Mutiline text, press ^R to reformat.\n""", max_height=5, rely=9) ms= F.add(npyscreen.TitleSelectOne, max_height=4, value = [1,], name="Pick One", values = ["Option1","Option2","Option3"], scroll_exit=True) # This lets the user play with the Form. F.edit()
def main(self): # These lines create the form and populate it with widgets. # A fairly complex screen in only 8 or so lines of code - a line for each control. npyscreen.setTheme(npyscreen.Themes.ColorfulTheme) F = npyscreen.SplitForm(name="Welcome to Npyscreen", ) t = F.add( npyscreen.Textfield, name="Text:", ) t1 = F.add( npyscreen.TitleText, name="Text:", ) t2 = F.add(npyscreen.TitleMultiSelect, name="Testing", values=range(200)) # This lets the user play with the Form. F.edit()
def main(self): npyscreen.setTheme(npyscreen.Themes.TransparentThemeDarkText) # These lines create the form and populate it with widgets. # A fairly complex screen in only 8 or so lines of code - a line for each control. F = npyscreen.Form(name = "Welcome to Npyscreen",) t = F.add(npyscreen.TitleText, name = "Text:",) fn = F.add(npyscreen.TitleFilename, name = "Filename:") dt = F.add(npyscreen.TitleDateCombo, name = "Date:") s = F.add(npyscreen.TitleSlider, out_of=12, name = "Slider") ml= F.add(npyscreen.MultiLineEdit, value = """try typing here!\nMutiline text, press ^R to reformat.\n""", max_height=5, rely=9) ms= F.add(npyscreen.TitleSelectOne, max_height=4, value = [1,], name="Pick One", values = ["Option1","Option2","Option3"], scroll_exit=True) ms2= F.add(npyscreen.TitleMultiSelect, max_height =-2, value = [1,], name="Pick Several", values = ["Option1","Option2","Option3"], scroll_exit=True) # This lets the user play with the Form. F.edit()
def onStart(self): # When Application starts, set up the Forms that will be used. cfg = yaml.safe_load(open('config.yaml')) if cfg["database"]["engine"] == "sqlite": engine_string = "sqlite:///%s" % (path.join( getcwd(), cfg["database"]["path"])) else: engine_string = "%s://%s" % (cfg["database"]["engine"], cfg["database"]["path"]) self.application_logic = Application( printer_name=cfg["printer"]["name"], db_path=engine_string) npyscreen.setTheme(eval("npyscreen.Themes.%s" % cfg["gui"]["theme"])) self.addForm("MAIN", ItemListDisplay, name="Items") self.addForm("BOXES", BoxListDisplay, name="Boxes") self.addForm("POPUPITEM", PopupItemEditor, name="Item editor") self.addForm("POPUPBOX", PopupBoxEditor, name="Box editor")
def onStart(self): npyscreen.setTheme(npyscreen.Themes.ColorfulTheme) env_vars = get_environment_file_dict() self.zeek_config = config.NodeConfigManager(env_vars['ZEEK_HOME']) self.addForm('MAIN', ZeekNodeSettingsForm, name='Zeek Cluster Configuration') self.addForm('EDITWORKERFM', EditWorkerForm, name='Edit Zeek Worker') self.addForm('EDITLOGGERFM', EditLoggerManagerProxy, name='Edit Logger', component_type='logger') self.addForm('EDITMANAGERFM', EditLoggerManagerProxy, name='Edit Manager', component_type='manager') self.addForm('EDITPROXYFM', EditLoggerManagerProxy, name='Edit Proxy', component='proxy')
def onStart(self): self.FluoDev = FluoDevice() npyscreen.setTheme(npyscreen.Themes.ElegantTheme) self.registerForm(MAIN_FORM, \ FluoForm()) self.registerForm(BIND_DEVICES_FORM, \ ConfigDevicesPathsForm()) self.registerForm(CONFIG_FLUO_FORM, \ FluorimeterSetupForm()) self.registerForm(CONFIG_LTR11_FORM, \ Ltr11SetupForm()) self.registerForm(CONFIG_LTR210_FORM, \ Ltr210SetupForm()) self.registerForm(TEST_PANEL_FORM, \ ControlPanel())
def change_theme(self, theme): if theme == "Colorful": npyscreen.setTheme(npyscreen.Themes.ColorfulTheme) self.onStart() elif theme == "Black and White": npyscreen.setTheme(npyscreen.Themes.BlackOnWhiteTheme) self.onStart() elif theme == "Elegant": npyscreen.setTheme(npyscreen.Themes.ElegantTheme) self.onStart() elif theme == "Default": npyscreen.setTheme(npyscreen.Themes.DefaultTheme) self.onStart()
def main(self): npyscreen.setTheme(npyscreen.Themes.TransparentThemeLightText) self.keypress_timeout_default = 10 if self.rr < 1000: self.keypress_timeout_default = int(self.rr / 100) self.window = WindowForm(parentApp=self, name="Glance") global last_height global last_width get_max_y, get_max_x = self.window.curses_pad.getmaxyx() last_height = get_max_y last_width = get_max_x self.static_y = float(get_max_y) / 28 self.static_x = float(get_max_x) / 104 self.cpu_chart = self.window.add(TheBox, name="CPU Usage History", relx=155, rely=5, max_height=int(get_max_y) - 10, max_width=int(100 * self.static_x * 0.35)) self.cpu_chart.value = "" self.pGrid = self.window.add(ButtonBox, name="Processes", relx=10, rely=5, max_height=int(get_max_y) - 10, max_width=int( (get_max_x - 20) * 0.65) - 5) self.pGrid.entry_widget.values = [] self.pGrid.entry_widget.scroll_exit = False self.buttons = self.window.add(npyscreen.FixedText, relx=10, rely=int(get_max_y) - 5) self.buttons.value = "ctrl+n: Sort by Usage ^ctrl+k: Kill Processes" self.buttons.display() self.can_height = int(get_max_y) - 10 self.can_width = int((get_max_x - 20) * 0.65) - 5 self.data_cpu = [0] * self.can_width self.window.edit()
def main(self): npyscreen.setTheme(npyscreen.Themes.TransparentThemeDarkText) F = npyscreen.ActionForm(name="MiSSH - " + self.fn) F.on_ok = self.on_ok F.while_editing = self.on_switch self.host = F.add(npyscreen.TitleText, name="Host:", value=self.hostn) # self.port = F.add(npyscreen.TitleText, name = "Port:", value=self.portn ) self.password = F.add(npyscreen.TitlePassword, name="Password:"******"Other options:", height=1) self.options = F.add(npyscreen.MultiLineEdit, value=self.optn, max_height=12) # self.forward_only = F.add(npyscreen.Checkbox, name="Forward only?", value=self.fwdn) # self.forward_only= F.add(npyscreen.TitleMultiSelect, value=self.fwdn, # name="Mode",values=["Forward only?"],scroll_exit=True) self.connect = False F.edit()
def onStart(self): signal.signal(signal.SIGINT, self.signal_handler) self.signal_names = dict((k, v) for v, k in reversed(sorted(signal.__dict__.items())) \ if v.startswith('SIG') and not v.startswith('SIG_')) self.dev_handle = None self.rtm_handle = None self.ui_sock = UISocket() self.log_lock = threading.Lock() npyscreen.setTheme(npyscreen.Themes.ElegantTheme) self.addForm("MAIN", MainForm, name="Main Form", minimum_lines=50) self.addForm("AUTO", AutoForm, name="Auto Mode", minimum_lines=50) self.addForm("DEMO", DemoForm, name="Demo Mode", minimum_lines=50) self.addForm("TSG", TestGenForm, name="Test Script Generator", minimum_lines=40) self.formChange = threading.Event() self.message_thread = threading.Thread(target=self.message_handler, args=(self.formChange,)) self.message_thread.start()
def onStart(self): # Set the theme. DefaultTheme is used by default npyscreen.setTheme(npyscreen.Themes.ColorfulTheme) self.addForm("MAIN", MainForm, name="Methylstar") #self.addForm("DMR", D.DMR, name="DMR") self.addForm("JBrowser", J.JBrowser, name="JBrowser") self.addForm("Help", H.Help, name="Help") #forms and popups of Configuration self.addForm("Configuration", C.Configuration, name="Configuration") self.addForm("ConfigurationPopup_raw_files", C.ConfigurationPopup_raw_files, name="Raw Files Configuration") self.addForm("ConfigurationPopup_result_files", C.ConfigurationPopup_result_files, name="Result Files Configuration") self.addForm("ConfigurationPopup_genome", C.ConfigurationPopup_genome, name="Genome Configuration") self.addForm("ConfigurationPopup_trimmomatic", C.ConfigurationPopup_trimmomatic, name="Trimmomatic Configuration") self.addForm("ConfigurationPopup_QC_fastq_path", C.ConfigurationPopup_QC_fastq_path, name="QC fastq path Config") self.addForm("ConfigurationPopup_Bismark_parameters", C.ConfigurationPopup_Bismark_parameters, name="Bismark parameters Config") self.addForm("ConfigurationPopup_Parallel_mode", C.ConfigurationPopup_Parallel_mode, name="Parallel mode config") self.addForm("Illum_parameters_popup", C.Illum_parameters_popup, name="Illum parameters popup") self.addForm("SlidingWindow_parameters_popup", C.SlidingWindow_parameters_popup, name="SlidingWindow parameters popup") self.addForm("Trimmomatic_leading_popup", C.Trimmomatic_leading_popup, name="Trimmomatic leading popup") self.addForm("Trimmomatic_threading_popup", C.Trimmomatic_threading_popup, name="Trimmomatic threading popup") self.addForm("Trimmomatic_minlen_popup", C.Trimmomatic_minlen_popup, name="Trimmomatic minlen popup") self.addForm("Trimmomatic_trailing_popup", C.Trimmomatic_trailing_popup, name="Trimmomatic trailing popup") self.addForm("Bismark_parallel_popup", C.Bismark_parallel_popup, name="Bismark parallel popup") self.addForm("Bismark_buffer_size_popup", C.Bismark_buffer_size_popup, name="Bismark buffer size popup") self.addForm("Parallel_jobs_popup", C.Parallel_jobs_popup, name="Parallel jobs popup") self.addForm("ConfigurationPopup_Methimpute", C.ConfigurationPopup_Methimpute, name="Methimpute Configuration") #forms and popups of Run_pipeline self.addForm("Run_pipeline", RP.Run_pipeline, name="Run pipeline") self.addForm("Run_popup", RP.Run_popup, name="Run_popup") #forms and popups of Outputs self.addForm("Outputs", O.Outputs, name="Outputs") self.addForm("Outputs_popup", O.Outputs_popup, name="Outputs_popup") #forms and popups of Run_pipeline self.addForm("Clean_directories", CD.CleanFiles, name="Clean_directories") self.addForm("Clean_popup", CD.Clean_popup, name="Clean_popup")
def onStart(self): npyscreen.setTheme(npyscreen.Themes.ElegantTheme) # When Application starts, set up the Forms that will be used. # These two forms are persistent between each edit. self.addForm( "MAIN", MainForm, name="Screen 1", color="NORMAL", ) self.addForm( "SECOND", MainForm, name="Screen 2", color="IMPORTANT", ) # This one will be re-created each time it is edited. self.addFormClass( "ABOUT", MainForm, name="Screen 3", color="WARNING", )
def main(self): # These lines create the form and populate it with widgets. # A fairly complex screen in only 8 or so lines of code - a line for each control. npyscreen.setTheme(npyscreen.Themes.ColorfulTheme) F = npyscreen.ActionFormWithMenus(name = "Welcome to Npyscreen",) self.t = F.add(npyscreen.TitleText, name = "Run Number:", value=str(int(self.run_number_pv.get()))) self.rc = F.add(npyscreen.TitleText, name = "Run Charge:", value=str(float(self.run_charge_pv.get()))) fn = F.add(npyscreen.TitleFilename, name = "Filename:") dt = F.add(npyscreen.TitleDateCombo, name = "Date:", value=datetime.datetime.now(), use_datetime=True) s = F.add(npyscreen.TitleSlider, out_of=12, name = "Slider") ml_value= str(datetime.datetime.now())+ "\n"; ml= F.add(npyscreen.MultiLineEdit, value = ml_value, max_height=5, rely=9) ms= F.add(npyscreen.TitleSelectOne, max_height=4, value = [1,], name="Pick One", values = ["Option1","Option2","Option3"], scroll_exit=True) ms2= F.add(npyscreen.TitleMultiSelect, max_height=4, value = [1,], name="Pick Several", values = ["Option1","Option2","Option3"], scroll_exit=True) # This lets the user play with the Form. F.edit()
def onStart(self): npyscreen.setTheme(AMDPPTTheme) self.tree_form = self.addForm("MAIN", AMDPPTTreeForm, name=self.file_path) max_x, max_y = self.tree_form._max_physical() columns = min(80, max_y) lines = 12 pos_x = min(10, int(max(0, (max_y - 80)) / 2)) pos_y = 2 self.file_form = self.addForm( "FILE", AMDPPTFileForm, show_atx=pos_x, show_aty=pos_y, lines=lines, columns=columns, ) self.show_load_form() if not self.file_path: self.exit_application()
def main(self): npyscreen.setTheme(self.get_theme()) # time(ms) to wait for user interactions self.keypress_timeout_default = 10 # setting the main window form self.window = WindowForm(parentApp=self, name="ptop ( http://github.com/black-perl/ptop) ") self.logger.info(self.window.curses_pad.getmaxyx()) max_y,max_x = self.window.curses_pad.getmaxyx() self.Y_SCALING_FACTOR = float(max_y)/27 self.X_SCALING_FACTOR = float(max_x)/104 self.basic_stats = self.window.add(MultiLineWidget, name="Overview", relx=1, rely=1, max_height=int(math.ceil(5*self.Y_SCALING_FACTOR)), max_width=int(100*self.X_SCALING_FACTOR) ) self.basic_stats.value = "" self.basic_stats.entry_widget.editable = False self.memory_chart = self.window.add(MultiLineWidget, name="Memory Usage", relx=1, rely=int(math.ceil(5*self.Y_SCALING_FACTOR)+1), max_height=int(10*self.Y_SCALING_FACTOR), max_width=int(50*self.X_SCALING_FACTOR) ) self.memory_chart.value = "" self.memory_chart.entry_widget.editable = False self.cpu_chart = self.window.add(MultiLineWidget, name="CPU Usage", relx=int(52*self.X_SCALING_FACTOR), rely=int(math.ceil(5*self.Y_SCALING_FACTOR)+1), max_height=int(10*self.Y_SCALING_FACTOR), max_width=int(49*self.X_SCALING_FACTOR) ) self.cpu_chart.value = "" self.cpu_chart.entry_widget.editable = False self.processes_table = self.window.add(MultiLineActionWidget, name="Processes", relx=1, rely=int(16*self.Y_SCALING_FACTOR), max_height=int(8*self.Y_SCALING_FACTOR), max_width=int(100*self.X_SCALING_FACTOR) ) self.processes_table.entry_widget.values = [] self.processes_table.entry_widget.scroll_exit = False self.actions = self.window.add(npyscreen.FixedText, relx=1, rely=int(24*self.Y_SCALING_FACTOR) ) self.actions.value = "^K : Kill ^N : Sort by Memory ^H : Sort by Time g : top q : quit " self.actions.display() self.actions.editable = False self.CHART_LENGTH = int(self.CHART_LENGTH*self.X_SCALING_FACTOR) self.CHART_HEIGHT = int(self.CHART_HEIGHT*self.Y_SCALING_FACTOR) # add subwidgets to the parent widget self.window.edit()
def onStart(self): npyscreen.setTheme(npyscreen.Themes.ColorfulTheme) self.addForm('MAIN', MainForm, name='CS419 Project') self.addFormClass('DISPLAY1', DisplayTimes, name='Display Times') self.addFormClass('DISPLAY2', DisplayPersons, name='Display Available Persons') self.addFormClass(None, SQL, name='CS419 Project')
def onStart(self): npyscreen.setTheme(npyscreen.Themes.ElegantTheme) self.dialog_list = TG.sender.dialog_list(retry_connect=True) self.contacts_list = TG.sender.contacts_list() self.addForm('MAIN', PyGramForm, name='Welcome PyGram ({})'.format(__version__), TG=TG)
def setup(stdscr, func,*args,**kwargs): """Used to set the npyscreen theme""" npyscreen.setTheme(theme) return func(stdscr, *args, **kwargs)
def onStart(self): self.__initTicketProvider__() npyscreen.setTheme(npyscreen.Themes.ColorfulTheme) self.addForm('MAIN', Forms.ViewTicketForm, name='Tickets') self.addForm('ADD_TICKET', Forms.AddTicketForm, name='Add Ticket')
def create(self): npyscreen.setTheme(npyscreen.Themes.TransparentThemeLightText) self.add_action('^/.*', self.write2main, True)
def onStart(self): npyscreen.setTheme(npyscreen.Themes.ElegantTheme) self.addForm("MAIN", EavesdropForm, name="Sniffing Parameters") self.addForm('CONFIRMATION',EavesdropConfirmation,name='confirmation Screen') self.addForm('SNIFFER',activateEavesdrop,name='Sniffing Network')
def create(self): npyscreen.setTheme(npyscreen.Themes.TransparentThemeLightText) npyscreen.notify_confirm('Your portfolio will be refreshed every 10 seconds') self.read_stocks = self.add(npyscreen.MultiLineEdit, value=read_(), editable=True)