本文整理汇总了Python中miro.frontends.widgets.widgetstatestore.WidgetStateStore.get_columns_available方法的典型用法代码示例。如果您正苦于以下问题:Python WidgetStateStore.get_columns_available方法的具体用法?Python WidgetStateStore.get_columns_available怎么用?Python WidgetStateStore.get_columns_available使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类miro.frontends.widgets.widgetstatestore.WidgetStateStore
的用法示例。
在下文中一共展示了WidgetStateStore.get_columns_available方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _update_view_menu
# 需要导入模块: from miro.frontends.widgets.widgetstatestore import WidgetStateStore [as 别名]
# 或者: from miro.frontends.widgets.widgetstatestore.WidgetStateStore import get_columns_available [as 别名]
def _update_view_menu(self):
display = app.display_manager.get_current_display()
# using hasattr because not all displays have ids and types
# TODO: refactor the display type / id system
if not (hasattr(display, 'type') and hasattr(display, 'id')):
return
enabled = set(app.widget_state.get_sorts_enabled(display.type, display.id))
checks = dict(('ToggleColumn-' + column, column in enabled)
for column in WidgetStateStore.get_columns())
self.emit('checked-changed', 'ListView', checks)
for column in WidgetStateStore.get_columns_available(display.type):
self.enabled_groups.add('column-%s' % column)
示例2: test_default_column_widths
# 需要导入模块: from miro.frontends.widgets.widgetstatestore import WidgetStateStore [as 别名]
# 或者: from miro.frontends.widgets.widgetstatestore.WidgetStateStore import get_columns_available [as 别名]
def test_default_column_widths(self):
# test that all available columns have widths set for them
# calculate all columns that available for some display/view
# combination
available_columns = set()
display_id = None # this isn't used yet, just set it to a dummy value
for display_type in self.display_types:
for view_type in (WidgetStateStore.get_list_view_type(),
WidgetStateStore.get_standard_view_type(),
WidgetStateStore.get_album_view_type()):
available_columns.update(
WidgetStateStore.get_columns_available(
display_type, display_id, view_type))
# make sure that we have widths for those columns
self.assertEqual(available_columns,
set(WidgetStateStore.DEFAULT_COLUMN_WIDTHS.keys()))
示例3: get_column_info
# 需要导入模块: from miro.frontends.widgets.widgetstatestore import WidgetStateStore [as 别名]
# 或者: from miro.frontends.widgets.widgetstatestore.WidgetStateStore import get_columns_available [as 别名]
def get_column_info(self):
available = WidgetStateStore.get_columns_available(self.type, self.id,
self.controller.selected_view)
enabled = app.widget_state.get_columns_enabled(self.type, self.id,
self.controller.selected_view)
return enabled, available
示例4: setUp
# 需要导入模块: from miro.frontends.widgets.widgetstatestore import WidgetStateStore [as 别名]
# 或者: from miro.frontends.widgets.widgetstatestore.WidgetStateStore import get_columns_available [as 别名]
def setUp(self):
MiroTestCase.setUp(self)
self.display_types = set(WidgetStateStore.get_display_types())
self.columns = set()
for display_type in self.display_types:
self.columns.update(WidgetStateStore.get_columns_available(display_type))