backlightindicator.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:backlight-indicator 作者: atareao 项目源码 文件源码
def read_preferences(self):
        configuration = Configuration()
        self.first_time = configuration.get('first-time')
        self.version = configuration.get('version')
        self.autostart = configuration.get('autostart')
        self.theme = configuration.get('theme')
        self.show_notifications = configuration.get('show-notifications')
        self.show_value = configuration.get('show-value')
        self.minimum_backlight = configuration.get('minimum-backlight')
        self.maximum_backlight = configuration.get('maximum-backlight')
        self.backlight = configuration.get('backlight')
        self.sample_time = configuration.get('sample-time')
        self.autoworking = configuration.get('autoworking')
        self.change_on_ac = configuration.get('change-backlight-on-ac')
        self.value_on_ac = configuration.get('backlight-on-ac')
        self.change_on_low_power = configuration.get(
            'reduce-backlight-on-low-power')
        self.low_battery_value = configuration.get('low-battery-value')
        self.value_on_low_power = configuration.get('backlight-on-low-power')
        backlight = self.backlightManager.get_backlight()
        self.set_backlight(backlight)
        if self.show_value:
            self.indicator.set_label(str(int(self.backlight)), '')
        else:
            self.indicator.set_label('', '')
        if self.wid > 0:
            self.active_icon = comun.STATUS_ICON[self.theme][0]
            GLib.source_remove(self.wid)
            self.do_the_work()
            self.wid = GLib.timeout_add_seconds(self.sample_time * 60,
                                                self.do_the_work)
        else:
            if self.autoworking:
                self.start_automatically()
            else:
                self.active_icon = comun.STATUS_ICON[self.theme][1]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号