本文整理汇总了Python中kupfer.objects.Leaf类的典型用法代码示例。如果您正苦于以下问题:Python Leaf类的具体用法?Python Leaf怎么用?Python Leaf使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Leaf类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, serverid, name):
try:
obj = gio.unix.DesktopAppInfo("gvim.desktop")
except RuntimeError:
obj = gio.AppInfo(VIM)
Leaf.__init__(self, obj, name)
self.serverid = serverid
示例2: __init__
def __init__(self, account, service_name, show_content=True):
Leaf.__init__(self, account['id'], service_name)
self._show_content = show_content
# TRANS: Account description, similar to "John on Identi.ca"
self._description = _("%(user)s on %(service)s") % {
'user': account.get('site_display_name') or account['username'],
'service': account['service']}
示例3: __init__
def __init__(self, default_book, book_id, title, author, path, metadata_file):
Leaf.__init__(self, os.path.join(path, default_book), title)
self.book_id = book_id
self.author = author
self.path = path
self.metadata_file = metadata_file
self.kupfer_add_alias(path)
示例4: __init__
def __init__(self, info, name=None):
"""Init with song info
@info: Song information dictionary
"""
if not name:
name = info["title"]
Leaf.__init__(self, info, name)
示例5: __init__
def __init__ (self, data, name):
self.name = name
obj = {
'name' : name,
'descr' : _("Connectable object %(name)s"),
'icon_name': 'system'
}
obj.update(data)
Leaf.__init__(self, obj, name)
示例6: __init__
def __init__(self, location, name=None, description=None, icon_name=None):
"""Special location with @location and
@name. If unset, we find @name from filesystem
@description is Leaf description"""
gfile = gio.File(location)
info = gfile.query_info(gio.FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME)
name = (info.get_attribute_string(gio.FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME) or location)
Leaf.__init__(self, location, name)
self.description = description
self.icon_name = icon_name
示例7: __init__
def __init__(self, page_id, page_name, notebook_path, notebook_name):
Leaf.__init__(self, page_id, page_name)
self.page = page_name
self.notebook = notebook_path
self.notebook_name = notebook_name
示例8: __init__
def __init__(self, obj, desc, category):
Leaf.__init__(self, obj, obj)
self.description = desc
if desc:
self.name_aliases.add(desc.splitlines()[0])
示例9: __init__
def __init__(self, obj, name, description):
Leaf.__init__(self, obj, name)
self.description = description
示例10: __init__
def __init__(self, leaf):
Leaf.__init__(self, leaf.object, _("Last Result"))
vars(self).update(vars(leaf))
self.name = _("Last Result")
self.__orignal_leaf = leaf
self.__class__.__bases__ = (leaf.__class__, Leaf)
示例11: __init__
def __init__(self, name):
Leaf.__init__(self, name, name)
示例12: __init__
def __init__(self, package, desc):
Leaf.__init__(self, package, package)
self.desc = desc
示例13: __init__
def __init__(self, obj):
Leaf.__init__(obj, _("Plugin Leaf Name"))
示例14: __init__
def __init__(self, obj, name):
Leaf.__init__(self, obj, name)
示例15: __init__
def __init__(self, tag):
Leaf.__init__(self, tag, tag)