当前位置: 首页>>代码示例>>Python>>正文


Python filteredcommand.FilteredCommand类代码示例

本文整理汇总了Python中ubiquity.filteredcommand.FilteredCommand的典型用法代码示例。如果您正苦于以下问题:Python FilteredCommand类的具体用法?Python FilteredCommand怎么用?Python FilteredCommand使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了FilteredCommand类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: ok_handler

def ok_handler(self):
        if self.frontend.get_secure_mysql():
            mysql_root = self.frontend.get_mysql_root_password()
        else:
            mysql_root = ""
        self.preseed('mythtv/mysql_admin_password',mysql_root)
        if not self.frontend.get_uselivemysqlinfo():
            mysqluser = self.frontend.get_mysqluser()
        else:
            mysqluser = self.db.get('mythtv/mysql_mythtv_user')
        self.preseed('mythtv/mysql_mythtv_user', mysqluser)
        if not self.frontend.get_uselivemysqlinfo():
            mysqlpass = self.frontend.get_mysqlpass()
        else:
            mysqlpass = self.db.get('mythtv/mysql_mythtv_password')
        self.preseed('mythtv/mysql_mythtv_password', mysqlpass)
        if not self.frontend.get_uselivemysqlinfo():
            mysqldatabase = self.frontend.get_mysqldatabase()
        else:
            mysqldatabase = self.db.get('mythtv/mysql_mythtv_dbname')
        self.preseed('mythtv/mysql_mythtv_dbname', mysqldatabase)
        if not self.frontend.get_uselivemysqlinfo():
            mysqlserver = self.frontend.get_mysqlserver()
        else:
            mysqlserver = self.db.get('mythtv/mysql_host')
        self.preseed('mythtv/mysql_host', mysqlserver)
        auth = self.frontend.get_secure_mythweb()
        self.preseed_bool('mythweb/enable', auth)
        user = self.frontend.get_mythweb_username()
        self.preseed('mythweb/username', user)
        passw = self.frontend.get_mythweb_password()
        self.preseed('mythweb/password', passw)
        FilteredCommand.ok_handler(self)
开发者ID:guadalinex-archive,项目名称:guadalinex-v5,代码行数:33,代码来源:mythbuntu.py

示例2: ok_handler

    def ok_handler(self):
        fullname = self.frontend.get_fullname()
        username = self.frontend.get_username()
        password = self.frontend.get_password()
        password_confirm = self.frontend.get_verified_password()
        auto_login = self.frontend.get_auto_login()
        encrypt_home = self.frontend.get_encrypt_home()

        self.preseed('passwd/user-fullname', fullname)
        self.preseed('passwd/username', username)
        # TODO: maybe encrypt these first
        self.preseed('passwd/user-password', password)
        self.preseed('passwd/user-password-again', password_confirm)
        if self.frontend.oem_config:
            self.preseed('passwd/user-uid', '29999')
        else:
            self.preseed('passwd/user-uid', '')
        self.preseed_bool('passwd/auto-login', auto_login)
        self.preseed_bool('user-setup/encrypt-home', encrypt_home)
        
        hostname = self.frontend.get_hostname()
        if hostname is not None and hostname != '':
            hd = hostname.split('.', 1)
            self.preseed('netcfg/get_hostname', hd[0])
            if len(hd) > 1:
                self.preseed('netcfg/get_domain', hd[1])
            else:
                self.preseed('netcfg/get_domain', '')

        FilteredCommand.ok_handler(self)
开发者ID:jamieboo,项目名称:ubiquity,代码行数:30,代码来源:usersetup.py

示例3: ok_handler

    def ok_handler(self):
        # mythtv passwords
        passwords = self.frontend.get_mythtv_passwords()
        for this_password in passwords:
            self.preseed("mythtv/" + this_password, passwords[this_password])

        FilteredCommand.ok_handler(self)
开发者ID:jamieboo,项目名称:ubiquity,代码行数:7,代码来源:mythbuntu.py

示例4: run

    def run(self, priority, question):
        if self.done:
            return self.succeeded

        if question.startswith('partman/confirm'):
            if question == 'partman/confirm':
                self.db.set('ubiquity/partman-made-changes', 'true')
            else:
                self.db.set('ubiquity/partman-made-changes', 'false')
            self.preseed(question, 'true')
            return True

        elif question == 'partman/exception_handler':
            if priority == 'critical' or priority == 'high':
                response = self.frontend.question_dialog(
                    self.description(question),
                    self.extended_description(question),
                    self.choices(question), use_templates=False)
                self.preseed(question, response, seen=False)
            else:
                self.preseed(question, 'unhandled', seen=False)
            return True

        elif question == 'partman/exception_handler_note':
            if priority == 'critical' or priority == 'high':
                self.frontend.error_dialog(self.description(question),
                                           self.extended_description(question))
                return FilteredCommand.error(self, priority, question)
            else:
                return True

        elif self.question_type(question) == 'boolean':
            response = self.frontend.question_dialog(
                self.description(question),
                self.extended_description(question),
                ('ubiquity/text/go_back', 'ubiquity/text/continue'))

            answer_reversed = False
            if (question == 'partman-jfs/jfs_boot' or
                question == 'partman-jfs/jfs_root'):
                answer_reversed = True
            if response is None or response == 'ubiquity/text/continue':
                answer = answer_reversed
            else:
                answer = not answer_reversed
                self.succeeded = False
                self.done = True
                self.frontend.return_to_partitioning()
            if answer:
                self.preseed(question, 'true')
            else:
                self.preseed(question, 'false')
            return True

        else:
            return FilteredCommand.run(self, priority, question)
开发者ID:jamieboo,项目名称:ubiquity,代码行数:56,代码来源:partman_commit.py

示例5: ok_handler

 def ok_handler(self):
     zone = self.frontend.get_timezone()
     if zone is None:
         zone = self.db.get('time/zone')
     else:
         self.preseed('time/zone', zone)
     for location in self.tzdb.locations:
         if location.zone == zone:
             self.preseed('debian-installer/country', location.country)
             break
     FilteredCommand.ok_handler(self)
开发者ID:guadalinex-archive,项目名称:guadalinex-v5,代码行数:11,代码来源:timezone.py

示例6: run

    def run(self, priority, question):
        if self.done:
            return self.succeeded

        if question == 'console-setup/layout':
            # Reset this in case we just backed up from the variant
            # question.
            self.succeeded = True
            # TODO cjwatson 2006-09-07: no console-setup support for layout
            # choice translation yet
            self.frontend.set_keyboard_choices(
                self.choices_untranslated(question))
            self.frontend.set_keyboard(self.db.get(question))
            return True
        elif question == 'console-setup/variant':
            # TODO cjwatson 2006-10-02: no console-setup support for variant
            # choice translation yet
            self.frontend.set_keyboard_variant_choices(
                self.choices_untranslated(question))
            self.frontend.set_keyboard_variant(self.db.get(question))
            # console-setup preseeding is special, and needs to be checked
            # by hand. The seen flag on console-setup/layout is used
            # internally by console-setup, so we can't just force it to
            # true.
            if ('UBIQUITY_AUTOMATIC' in os.environ and
                self.db.fget('console-setup/layoutcode', 'seen') == 'true'):
                return True
            else:
                return FilteredCommand.run(self, priority, question)
        else:
            return True
开发者ID:guadalinex-archive,项目名称:guadalinex-v5,代码行数:31,代码来源:console_setup.py

示例7: run

 def run(self,priority,question):
     if question.startswith('lirc/remote'):
         device=self.frontend.get_lirc("remote")
         if question.startswith('lirc/remote_modules'):
             self.preseed('lirc/remote_modules',device["modules"])
         elif question.startswith('lirc/remote_lircd_conf'):
             self.preseed('lirc/remote_lircd_conf',device["lircd_conf"])
         elif question.startswith('lirc/remote_driver'):
             self.preseed('lirc/remote_driver',device["driver"])
         elif question.startswith('lirc/remote_device'):
             self.preseed('lirc/remote_device',device["device"])
         elif question.startswith('lirc/remote'):
             self.preseed('lirc/remote',device["remote"])
     elif question.startswith('lirc/transmitter'):
         device=self.frontend.get_lirc("transmitter")
         if question.startswith('lirc/transmitter_modules'):
             self.preseed('lirc/transmitter_modules',device["modules"])
         elif question.startswith('lirc/transmitter_lircd_conf'):
             self.preseed('lirc/transmitter_lircd_conf',device["lircd_conf"])
         elif question.startswith('lirc/transmitter_driver'):
             self.preseed('lirc/transmitter_driver',device["driver"])
         elif question.startswith('lirc/transmitter_device'):
             self.preseed('lirc/transmitter_device',device["device"])
         elif question.startswith('lirc/transmitter'):
             self.preseed('lirc/transmitter',device["transmitter"])
     return FilteredCommand.run(self, priority, question)
开发者ID:guadalinex-archive,项目名称:guadalinex-v5,代码行数:26,代码来源:mythbuntu.py

示例8: run

    def run(self, priority, question):
        if question == 'grub-installer/bootdev':
            # Force to the default in the case of an unsupported OS.
            if self.db.get(question) == '':
                self.preseed(question, misc.grub_default())

        return FilteredCommand.run(self, priority, question)
开发者ID:johannesthoma,项目名称:ubiquity,代码行数:7,代码来源:grubinstaller.py

示例9: progress_info

    def progress_info(self, progress_title, progress_info):
        # "Loading module ..." messages are boring. Hide them.
        if progress_info == 'hw-detect/load_progress_step':
            return True

        return FilteredCommand.progress_info(self,
                                             progress_title, progress_info)
开发者ID:27Paolo,项目名称:ubiquity,代码行数:7,代码来源:hw_detect.py

示例10: run

    def run(self, priority, question):
        if question == 'grub-installer/bootdev':
            # Force to (hd0) in the case of an unsupported OS.
            if self.db.get(question) == '':
                self.preseed(question, '(hd0)')

        return FilteredCommand.run(self, priority, question)
开发者ID:jamieboo,项目名称:ubiquity,代码行数:7,代码来源:grubinstaller.py

示例11: run

    def run(self, priority, question):
        if question.endswith('/apt-install-failed'):
            return self.error(priority, question)

        elif question == 'migration-assistant/failed-unmount':
            response = self.frontend.question_dialog(
                self.description(question),
                self.extended_description(question),
                ('ubiquity/text/go_back', 'ubiquity/text/continue'))
            if response is None or response == 'ubiquity/text/continue':
                self.preseed(question, 'true')
            else:
                self.preseed(question, 'false')
            return True
        elif question == 'ubiquity/install/copying_error/md5':
            response = self.frontend.question_dialog(
                self.description(question),
                # TODO evand 2008-02-14: i18n.
                self.extended_description(question),
                ('Abort', 'Retry', 'Skip'),
                use_templates=False)
            if response is None or response == 'Abort':
                self.preseed(question, 'abort')
            elif response == 'Retry':
                self.preseed(question, 'retry')
            elif response == 'Skip':
                self.preseed(question, 'skip')
            return True

        return FilteredCommand.run(self, priority, question)
开发者ID:jamieboo,项目名称:ubiquity,代码行数:30,代码来源:install.py

示例12: error

 def error(self, priority, question):
     if question == 'partman-partitioning/impossible_resize':
         # Back up silently.
         return False
     elif question == 'partman-partitioning/bad_new_partition_size':
         if self.creating_partition:
             # Break out of creating the partition.
             self.creating_partition['bad_size'] = True
     elif question in ('partman-partitioning/bad_new_size',
                       'partman-partitioning/big_new_size',
                       'partman-partitioning/small_new_size',
                       'partman-partitioning/new_size_commit_failed'):
         if self.editing_partition:
             # Break out of resizing the partition.
             self.editing_partition['bad_size'] = True
         else:
             # Break out of resizing the partition in cases where partman
             # fed us bad boundary values.  These are bugs in partman, but
             # we should handle the result as gracefully as possible.
             self.bad_auto_size = True
     elif question == 'partman-basicfilesystems/bad_mountpoint':
         # Break out of creating or editing the partition.
         if self.creating_partition:
             self.creating_partition['bad_mountpoint'] = True
         elif self.editing_partition:
             self.editing_partition['bad_mountpoint'] = True
     self.frontend.error_dialog(self.description(question),
                                self.extended_description(question))
     return FilteredCommand.error(self, priority, question)
开发者ID:guadalinex-archive,项目名称:guadalinex-v5,代码行数:29,代码来源:partman.py

示例13: run

    def run(self, priority, question):
        if question.endswith('/summary'):
            text = ''
            wrapper = textwrap.TextWrapper(width=76)
            for line in self.extended_description(question).split("\n"):
                text += wrapper.fill(line) + "\n"

            self.frontend.set_summary_text(text)

            if os.access('/usr/share/grub-installer/grub-installer', os.X_OK):
                # TODO cjwatson 2006-09-04: a bit inelegant, and possibly
                # Ubuntu-specific?
                self.frontend.set_summary_device('(hd0)')
            else:
                self.frontend.set_summary_device(None)

            self.frontend.set_grub_combo(grub_options())

            if will_be_installed('popularity-contest'):
                try:
                    participate = self.db.get('popularity-contest/participate')
                    self.frontend.set_popcon(participate == 'true')
                except debconf.DebconfError:
                    self.frontend.set_popcon(None)
            else:
                self.frontend.set_popcon(None)

            # This component exists only to gather some information and then
            # get out of the way.
            #return True
        return FilteredCommand.run(self, priority, question)
开发者ID:guadalinex-archive,项目名称:guadalinex-v5,代码行数:31,代码来源:summary.py

示例14: ok_handler

    def ok_handler(self):
        fullname = self.frontend.get_fullname()
        username = self.frontend.get_username()
        password = self.frontend.get_password()
        password_confirm = self.frontend.get_verified_password()

        self.preseed('passwd/user-fullname', fullname)
        self.preseed('passwd/username', username)
        # TODO: maybe encrypt these first
        self.preseed('passwd/user-password', password)
        self.preseed('passwd/user-password-again', password_confirm)
        if self.frontend.oem_config:
            self.preseed('passwd/user-uid', '29999')
        else:
            self.preseed('passwd/user-uid', '')

        FilteredCommand.ok_handler(self)
开发者ID:guadalinex-archive,项目名称:guadalinex-v5,代码行数:17,代码来源:usersetup.py

示例15: run

    def run(self, priority, question):
        syslog.syslog("-------> run guadaPrePartition")
        if question.startswith('guada-ubiquity/prepartition'):
            #advanced = self.frontend.get_advanced()
            #self.preseed_bool('mythbuntu/advanced_install', advanced)
            print "question"

        return FilteredCommand.run(self, priority, question)
开发者ID:guadalinex-archive,项目名称:guadalinex-v7,代码行数:8,代码来源:ubi-prepartition.py


注:本文中的ubiquity.filteredcommand.FilteredCommand类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。