예제 #1
0
    def create(self):

        self.add(npyscreen.FixedText, value="OPTIONS:")
        self.how_exited_handers[
            npyscreen.wgwidget.EXITED_ESCAPE] = self.exit_application

        self.Options = npyscreen.OptionList()
        # just for convenience so we don't have to keep writing Options.options
        options = self.Options.options

        options.append(
            npyscreen.OptionMultiFreeText('Votre message chiffré', value=''))
        options.append(
            npyscreen.OptionSingleChoice(
                'Type de chiffrement', choices=ChiffSymHelper.getAvailable()))
        # options.append(npyscreen.TitlePassword('Votre Mot de passe', value=''))

        self.add(npyscreen.OptionListDisplay,
                 name="Liste d'options",
                 values=options,
                 scroll_exit=True,
                 max_height=2)
        self.pwd = self.add(npyscreen.TitlePassword, name="Mot de passe:")

        self.output = self.add(npyscreen.BoxTitle,
                               name="Sortie de texte:",
                               max_height=4)
        self.output.values = []

        # The menus are created here.
        self.mMain = self.add_menu(name="Menu")
        self.mMain.addItemsFromList([
            ("Retour", self.retour),
        ])
예제 #2
0
    def create(self):
        self._optionlist = npyscreen.OptionList(filename=self.FILE)

        self._optionlist.options.extend([
            npyscreen.OptionFreeText(
                'FreeText',
                value='',
                documentation='This is some documentation',
            ),
            npyscreen.OptionMultiChoice(
                'MultiChoice',
                choices=['Choice 1', 'Choice 2', 'Choice 3'],
            ),
            npyscreen.OptionFilename('Filename'),
            npyscreen.OptionDate('Date'),
            npyscreen.OptionMultiFreeText(
                'MultilineText',
                value='',
            ),
            npyscreen.OptionMultiFreeList('MultilineList'),
        ])

        self.add(
            npyscreen.OptionListDisplay,
            name="Option List",
            values=self._optionlist.options,
            scroll_exit=True,
            max_height=None,
        )
예제 #3
0
    def main(self):
        Options = npyscreen.OptionList()

        # just for convenience so we don't have to keep writing Options.options
        options = Options.options
        options.append(npyscreen.OptionFilename('Filename', self.default_file))

        options.append(
            npyscreen.OptionFreeText(
                'FreeText',
                value='',
                documentation="This is some documentation."))
        options.append(
            npyscreen.OptionMultiChoice(
                'Multichoice', choices=['Choice 1', 'Choice 2', 'Choice 3']))
        options.append(npyscreen.OptionDate('Date', ))
        options.append(
            npyscreen.OptionMultiFreeText('Multiline Text', value=''))
        options.append(npyscreen.OptionMultiFreeList('Multiline List'))

        try:
            Options.reload_from_file(self.default_file)
        except FileNotFoundError:
            pass

        F = npyscreen.Form(name="Welcome to Npyscreen", )

        ms = F.add(npyscreen.OptionListDisplay,
                   name="Option List",
                   values=options,
                   scroll_exit=True,
                   max_height=None)

        F.edit()

        Options.write_to_file(self.default_file)
예제 #4
0
    def create(self):

        self.add(npyscreen.FixedText, value="OPTIONS:")
        self.how_exited_handers[
            npyscreen.wgwidget.EXITED_ESCAPE] = self.exit_application

        self.Options = npyscreen.OptionList()
        # just for convenience so we don't have to keep writing Options.options
        options = self.Options.options

        options.append(npyscreen.OptionMultiFreeText('Hash', value=''))
        options.append(
            npyscreen.OptionSingleChoice('Fonction de hachage',
                                         choices=HachageHelper.getAvailable()))

        self.wordListFile = self.add(
            npyscreen.TitleFilenameCombo,
            name="Choisir votre dictionnaire des mots",
            label=True)

        self.add(npyscreen.OptionListDisplay,
                 name="Liste d'options",
                 values=options,
                 scroll_exit=True,
                 max_height=6)

        self.output = self.add(npyscreen.BoxTitle,
                               name="Sortie de texte:",
                               max_height=7)
        self.output.values = []

        # The menus are created here.
        self.mMain = self.add_menu(name="Menu")
        self.mMain.addItemsFromList([
            ("Retour", self.retour),
        ])