本文整理汇总了Python中gi.repository.SugarExt.gconf_client_set_string_list方法的典型用法代码示例。如果您正苦于以下问题:Python SugarExt.gconf_client_set_string_list方法的具体用法?Python SugarExt.gconf_client_set_string_list怎么用?Python SugarExt.gconf_client_set_string_list使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gi.repository.SugarExt
的用法示例。
在下文中一共展示了SugarExt.gconf_client_set_string_list方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: tearDown
# 需要导入模块: from gi.repository import SugarExt [as 别名]
# 或者: from gi.repository.SugarExt import gconf_client_set_string_list [as 别名]
def tearDown(self):
client = GConf.Client.get_default()
if self._save_view_icons is None:
client.unset(_VIEW_KEY)
else:
SugarExt.gconf_client_set_string_list(client,
_VIEW_KEY,
self._save_view_icons)
if self._save_favorite_icons is None:
client.unset(_FAVORITE_KEY)
else:
SugarExt.gconf_client_set_string_list(client,
_FAVORITE_KEY,
self._save_favorite_icons)
示例2: _check_gconf_settings
# 需要导入模块: from gi.repository import SugarExt [as 别名]
# 或者: from gi.repository.SugarExt import gconf_client_set_string_list [as 别名]
def _check_gconf_settings():
client = GConf.Client.get_default()
# Zendesk
client.set_string('/desktop/sugar/services/zendesk/url',
'https://oneedu.zendesk.com')
client.set_string('/desktop/sugar/services/zendesk/token',
'eG8tc3VwcG9ydEBsYXB0b3Aub3JnLmF1L3Rva2VuOlZTaWM4'
'TThZbjZBRTJkMWxYNkFGbFhkZzUxSjlJSHFUQ01DYzNjOHY=')
try:
SugarExt.gconf_client_set_string_list(
client, '/desktop/sugar/services/zendesk/fields',
['21891880', '21729904', '21729914'])
except Exception as e:
_logger.error('Could not set zendesk fields: %s' % e)
示例3: set_option_group
# 需要导入模块: from gi.repository import SugarExt [as 别名]
# 或者: from gi.repository.SugarExt import gconf_client_set_string_list [as 别名]
def set_option_group(self, option_group):
"""Sets the supplied option for switching keyboard group"""
#XXX: Merge, not overwrite previous options
if not option_group:
options = ['']
elif isinstance(option_group, list):
options = option_group
else:
options = [option_group]
# FIXME, gconf_client_set_list not introspectable #681433
# self._gconf_client.set_list(_OPTIONS_KEY, GConf.ValueType.STRING,
# options)
SugarExt.gconf_client_set_string_list(self._gconf_client,
_OPTIONS_KEY, options)
self._configrec.set_options(options)
self._configrec.activate(self._engine)
示例4: set_layouts
# 需要导入模块: from gi.repository import SugarExt [as 别名]
# 或者: from gi.repository.SugarExt import gconf_client_set_string_list [as 别名]
def set_layouts(self, layouts):
"""Sets the supplied keyboard layouts (with variants)"""
if layouts is None or not layouts:
return
# FIXME, gconf_client_set_list not introspectable #681433
# self._gconf_client.set_list(_LAYOUTS_KEY, GConf.ValueType.STRING,
# layouts)
SugarExt.gconf_client_set_string_list(self._gconf_client,
_LAYOUTS_KEY, layouts)
layouts_list = []
variants_list = []
for layout in layouts:
layouts_list.append(layout.split('(')[0])
variants_list.append(layout.split('(')[1][:-1])
self._configrec.set_layouts(layouts_list)
self._configrec.set_variants(variants_list)
self._configrec.activate(self._engine)
示例5: _check_gconf_settings
# 需要导入模块: from gi.repository import SugarExt [as 别名]
# 或者: from gi.repository.SugarExt import gconf_client_set_string_list [as 别名]
def _check_gconf_settings():
from gi.repository import GConf
client = GConf.Client.get_default()
# Training server
client.set_string(
'/desktop/sugar/services/training/url',
'https://training.one-education.org/training/report ')
client.set_string('/desktop/sugar/services/training/api_key',
'SbCeK4nH8dpQJsHNn9djza9g')
# Zendesk
client.set_string('/desktop/sugar/services/zendesk/url',
'https://oneedu1392860248.zendesk.com')
client.set_string('/desktop/sugar/services/zendesk/token',
'eG8tc3VwcG9ydEBsYXB0b3Aub3JnLmF1L3Rva2VuOjdHRkV5'
'STF2MFNRVzJyYmdFVXFFUWRpOE1Cc1I0NGdHVURhTWg2QWU=')
try:
SugarExt.gconf_client_set_string_list(
client, '/desktop/sugar/services/zendesk/fields',
['21765610', '21605694', '21765620'])
except Exception as e:
_logger.error('Could not set zendesk fields: %s' % e)
示例6: save_to_gconf
# 需要导入模块: from gi.repository import SugarExt [as 别名]
# 或者: from gi.repository.SugarExt import gconf_client_set_string_list [as 别名]
def save_to_gconf(self, icon=False, name=False):
view_icons = []
favorite_icons = []
favorite_names = []
for button in self._view_buttons:
view_icons.append(self._view_icons[button])
favorite_icons.append(self._favorite_icons[button])
if self.favorite_names_enabled:
favorite_names.append(self._favorite_names[button])
client = GConf.Client.get_default()
SugarExt.gconf_client_set_string_list(client,
_FAVORITE_KEY,
favorite_icons)
SugarExt.gconf_client_set_string_list(client,
_VIEW_KEY,
view_icons)
if self.favorite_names_enabled:
SugarExt.gconf_client_set_string_list(client,
_FAVORITE_NAME_KEY,
favorite_names)
if icon:
for x in self.activity._alerts:
self.activity.remove_alert(x)
alert = NotifyAlert(5)
alert.props.title = _('Icon')
alert.props.msg = _('For see icons, restart sugar is needed.')
self.activity.add_alert(alert)
alert.connect('response',
lambda x, y: self.activity.remove_alert(x))
if name:
for x in self.activity._alerts:
self.activity.remove_alert(x)
alert = NotifyAlert(5)
alert.props.title = _('View Name')
alert.props.msg = _('For seeing View name changes, '
'restarting Sugar is required.')
self.activity.add_alert(alert)
alert.connect('response',
lambda x, y: self.activity.remove_alert(x))
示例7: test_set_views
# 需要导入模块: from gi.repository import SugarExt [as 别名]
# 或者: from gi.repository.SugarExt import gconf_client_set_string_list [as 别名]
def test_set_views(self):
self.target = _MOCK_LIST
with self.run_view("gtk_main"):
client = GConf.Client.get_default()
SugarExt.gconf_client_set_string_list(client, _VIEW_KEY,
_MOCK_LIST)