本文整理汇总了Python中kivy.app.Builder类的典型用法代码示例。如果您正苦于以下问题:Python Builder类的具体用法?Python Builder怎么用?Python Builder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Builder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, **kwargs):
Builder.load_file(WIRELESS_CONFIG_VIEW_KV)
super(WirelessConfigView, self).__init__(**kwargs)
self.register_event_type("on_config_updated")
self.base_dir = kwargs.get("base_dir")
btEnable = kvFind(self, "rcid", "btEnable")
btEnable.bind(on_setting=self.on_bt_enable)
btEnable.setControl(SettingsSwitch())
# btConfig = kvFind(self, 'rcid', 'btconfig')
# btConfig.bind(on_setting=self.on_bt_configure)
# btConfig.setControl(SettingsButton(text='Configure', disabled=True))
cellEnable = kvFind(self, "rcid", "cellEnable")
cellEnable.bind(on_setting=self.on_cell_enable)
cellEnable.setControl(SettingsSwitch())
cellProvider = kvFind(self, "rcid", "cellprovider")
cellProvider.bind(on_setting=self.on_cell_provider)
apnSpinner = SettingsMappedSpinner()
self.loadApnSettingsSpinner(apnSpinner)
self.apnSpinner = apnSpinner
cellProvider.setControl(apnSpinner)
self.apnHostField = kvFind(self, "rcid", "apnHost")
self.apnUserField = kvFind(self, "rcid", "apnUser")
self.apnPassField = kvFind(self, "rcid", "apnPass")
示例2: __init__
def __init__(self, **kwargs):
Builder.load_file(DASHBOARD_VIEW_KV)
super(DashboardView, self).__init__(**kwargs)
self.register_event_type('on_tracks_updated')
self._databus = kwargs.get('dataBus')
self._settings = kwargs.get('settings')
self.init_view()
示例3: __init__
def __init__(self, **kwargs):
Builder.load_string(FLYIN_PANEL_LAYOUT)
super(FlyinPanel, self).__init__(**kwargs)
self.hide_decay = Clock.create_trigger(lambda dt: self.hide(), self.SESSION_HIDE_DELAY)
Window.bind(mouse_pos=self.on_mouse_pos)
Window.bind(on_motion=self.on_motion)
Clock.schedule_once(lambda dt: self.show())
示例4: __init__
def __init__(self, **kwargs):
Builder.load_file(CAN_CONFIG_VIEW_KV)
super(CANConfigView, self).__init__(**kwargs)
self.register_event_type('on_config_updated')
btEnable = self.ids.can_enabled
btEnable.bind(on_setting=self.on_can_enabled)
btEnable.setControl(SettingsSwitch())
示例5: __init__
def __init__(self, **kwargs):
Builder.load_file(ANALYSIS_VIEW_KV)
super(AnalysisView, self).__init__(**kwargs)
self.register_event_type('on_tracks_updated')
self._databus = kwargs.get('dataBus')
self._settings = kwargs.get('settings')
self._trackmanager = kwargs.get('trackmanager')
self.init_view()
示例6: __init__
def __init__(self, track_manager, status_pump, **kwargs):
Builder.load_file(STATUS_KV_FILE)
super(StatusView, self).__init__(**kwargs)
self.track_manager = track_manager
self.register_event_type("on_tracks_updated")
self._menu_node = self.ids.menu
self._menu_node.bind(selected_node=self._on_menu_select)
status_pump.add_listener(self.status_updated)
示例7: __init__
def __init__(self, **kwargs):
Builder.load_file(LAPSTATS_VIEW_KV)
super(LapStatsView, self).__init__(**kwargs)
self.register_event_type("on_config_updated")
self.ids.lapstats.setControl(SettingsSwitch())
self.ids.lapstats.bind(on_setting=self.on_lapstats_enabled)
self.ids.predtime.setControl(SettingsSwitch())
self.ids.predtime.bind(on_setting=self.on_predtime_enabled)
示例8: __init__
def __init__(self, **kwargs):
Builder.load_file(IMU_CHANNELS_VIEW_KV)
super(ImuChannelsView, self).__init__(**kwargs)
self.register_event_type('on_config_updated')
imu_container = self.ids.imu_channels
self.appendImuChannels(imu_container, self.editors, IMU_ACCEL_CHANNEL_IDS)
self.appendImuChannels(imu_container, self.editors, IMU_GYRO_CHANNEL_IDS)
self.ids.sr.bind(on_sample_rate = self.on_sample_rate)
示例9: __init__
def __init__(self, settings, **kwargs):
Builder.load_file(PREFERENCES_KV_FILE)
super(PreferencesView, self).__init__(**kwargs)
self.settings = settings
self.base_dir = kwargs.get('base_dir')
self.settings_view = SettingsWithNoMenu()
self.settings_view.add_json_panel('Preferences', self.settings.userPrefs.config, os.path.join(self.base_dir, 'resource', 'settings', 'settings.json'))
self.content = kvFind(self, 'rcid', 'preferences')
self.content.add_widget(self.settings_view)
示例10: __init__
def __init__(self, **kwargs):
Builder.load_file(SCRIPT_VIEW_KV)
super(LuaScriptingView, self).__init__(**kwargs)
self.register_event_type('on_config_updated')
self.register_event_type('on_run_script')
self.register_event_type('on_poll_logfile')
self.register_event_type('on_logfile')
self.register_event_type('on_set_logfile_level')
self.logfileView = kvFind(self, 'rcid', 'logfile')
self.script_view = kvFind(self, 'rcid', 'script')
self.logfileScrollView = kvFind(self, 'rcid', 'logfileSv')
示例11: __init__
def __init__(self, **kwargs):
Builder.load_file(TELEMETRY_CONFIG_VIEW_KV)
super(TelemetryConfigView, self).__init__(**kwargs)
self.register_event_type('on_config_updated')
deviceId = kvFind(self, 'rcid', 'deviceId')
deviceId.bind(on_setting=self.on_device_id)
deviceId.setControl(SettingsTextField())
bgStream = kvFind(self, 'rcid', 'bgStream')
bgStream.bind(on_setting=self.on_bg_stream)
bgStream.setControl(SettingsSwitch())
示例12: __init__
def __init__(self, **kwargs):
Builder.load_file(OBD2_CHANNELS_VIEW_KV)
super(OBD2ChannelsView, self).__init__(**kwargs)
self.register_event_type("on_config_updated")
self.obd2_grid = self.ids.obd2grid
obd2_enable = self.ids.obd2enable
obd2_enable.bind(on_setting=self.on_obd2_enabled)
obd2_enable.setControl(SettingsSwitch())
self.base_dir = kwargs.get("base_dir")
self.obd2_settings = OBD2Settings(base_dir=self.base_dir)
self.update_view_enabled()
示例13: __init__
def __init__(self, **kwargs):
Builder.load_file(ANALYSIS_VIEW_KV)
super(AnalysisView, self).__init__(**kwargs)
self._datastore = CachingAnalysisDatastore()
self.register_event_type('on_tracks_updated')
self._databus = kwargs.get('dataBus')
self._settings = kwargs.get('settings')
self._track_manager = kwargs.get('track_manager')
self.ids.sessions_view.bind(on_lap_selected=self.lap_selected)
self.ids.channelvalues.color_sequence = self._color_sequence
self.ids.mainchart.color_sequence = self._color_sequence
self.stream_connecting = False
self.init_view()
示例14: __init__
def __init__(self, **kwargs):
Builder.load_file(CONFIG_VIEW_KV)
super(ConfigView, self).__init__(**kwargs)
self._databus = kwargs.get('databus')
self.rc_config = kwargs.get('rcpConfig', None)
self.rc_api = kwargs.get('rc_api', None)
self._settings = kwargs.get('settings')
self.base_dir = kwargs.get('base_dir')
self.register_event_type('on_config_updated')
self.register_event_type('on_channels_updated')
self.register_event_type('on_config_written')
self.register_event_type('on_tracks_updated')
self.register_event_type('on_config_modified')
self.register_event_type('on_read_config')
self.register_event_type('on_write_config')
示例15: __init__
def __init__(self, **kwargs):
Builder.load_file(TRACK_CONFIG_VIEW_KV)
super(TrackConfigView, self).__init__(**kwargs)
self._databus = kwargs.get('databus')
self.register_event_type('on_config_updated')
self.manualTrackConfigView = ManualTrackConfigScreen(name='manual', databus=self._databus)
self.manualTrackConfigView.bind(on_modified=self.on_modified)
self.autoConfigView = AutomaticTrackConfigScreen(name='auto')
self.autoConfigView.bind(on_modified=self.on_modified)
screenMgr = kvFind(self, 'rcid', 'screenmgr')
screenMgr.add_widget(self.manualTrackConfigView)
self.screenManager = screenMgr
autoDetect = kvFind(self, 'rcid', 'autoDetect')
autoDetect.bind(on_setting=self.on_auto_detect)
autoDetect.setControl(SettingsSwitch())
self.autoConfigView.track_manager = kwargs.get('track_manager')