本文整理汇总了Python中kupfer.obj.base.Action类的典型用法代码示例。如果您正苦于以下问题:Python Action类的具体用法?Python Action怎么用?Python Action使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Action类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, name=None, is_running=False, open_new=False):
"""
If @is_running, style as if the app is running (Show application)
If @open_new, always start a new instance.
"""
if not name:
name = _("Launch")
Action.__init__(self, name)
self.is_running = is_running
self.open_new = open_new
示例2: __init__
def __init__(self, desktop_item, is_default=False):
"""
Construct an "Open with application" item:
Application of @name should open, if
@is_default, it means it is the default app and
should only be styled "Open"
"""
if not desktop_item:
raise InvalidDataError
name = desktop_item.get_name()
action_name = _("Open") if is_default else _("Open with %s") % name
Action.__init__(self, action_name)
self.desktop_item = desktop_item
self.is_default = is_default
# add a name alias from the package name of the application
if is_default:
self.rank_adjust = 5
self.name_aliases.add(_("Open with %s") % name)
package_name, ext = os.path.splitext(self.desktop_item.get_id() or "")
if package_name:
self.name_aliases.add(_("Open with %s") % package_name)
示例3: __init__
def __init__(self, name=_("Open")):
Action.__init__(self, name)
示例4: __init__
def __init__(self):
Action.__init__(self, _("Verify Signature"))
示例5: __init__
def __init__(self, leaf=None, retry = 0):
Action.__init__(self, _("Restart aplication"))
self.retry = retry
if leaf != None:
self.activate(leaf)
示例6: __init__
def __init__(self):
Action.__init__(self, _("Execute shortcuts"))
示例7: __init__
def __init__(self):
Action.__init__(self, u"Debug Info")
示例8: __init__
def __init__(self):
Action.__init__(self, _('Create Link In Public and Get Url'))
self._dropbox_public = _get_dropbox_subdir('Public')
示例9: get_icon_name
def get_icon_name(self):
if self.is_running:
return "gtk-jump-to-ltr"
return Action.get_icon_name(self)