本文整理汇总了Python中kupfer.objects.Leaf.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Leaf.__init__方法的具体用法?Python Leaf.__init__怎么用?Python Leaf.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kupfer.objects.Leaf
的用法示例。
在下文中一共展示了Leaf.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from kupfer.objects import Leaf [as 别名]
# 或者: from kupfer.objects.Leaf import __init__ [as 别名]
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__
# 需要导入模块: from kupfer.objects import Leaf [as 别名]
# 或者: from kupfer.objects.Leaf import __init__ [as 别名]
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)
示例3: __init__
# 需要导入模块: from kupfer.objects import Leaf [as 别名]
# 或者: from kupfer.objects.Leaf import __init__ [as 别名]
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']}
示例4: __init__
# 需要导入模块: from kupfer.objects import Leaf [as 别名]
# 或者: from kupfer.objects.Leaf import __init__ [as 别名]
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__
# 需要导入模块: from kupfer.objects import Leaf [as 别名]
# 或者: from kupfer.objects.Leaf import __init__ [as 别名]
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__
# 需要导入模块: from kupfer.objects import Leaf [as 别名]
# 或者: from kupfer.objects.Leaf import __init__ [as 别名]
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__
# 需要导入模块: from kupfer.objects import Leaf [as 别名]
# 或者: from kupfer.objects.Leaf import __init__ [as 别名]
def __init__(self, info, name):
"""Init with track collection
@info: Should be a sequence of song information dictionaries
"""
Leaf.__init__(self, info, name)
示例8: __init__
# 需要导入模块: from kupfer.objects import Leaf [as 别名]
# 或者: from kupfer.objects.Leaf import __init__ [as 别名]
def __init__(self, obj, name, description):
Leaf.__init__(self, obj, name)
self.description = description
示例9: __init__
# 需要导入模块: from kupfer.objects import Leaf [as 别名]
# 或者: from kupfer.objects.Leaf import __init__ [as 别名]
def __init__(self, obj, name):
Leaf.__init__(self, obj, name)
self.links = [self]
示例10: __init__
# 需要导入模块: from kupfer.objects import Leaf [as 别名]
# 或者: from kupfer.objects.Leaf import __init__ [as 别名]
def __init__(self, package, desc):
Leaf.__init__(self, package, package)
self.desc = desc
示例11: __init__
# 需要导入模块: from kupfer.objects import Leaf [as 别名]
# 或者: from kupfer.objects.Leaf import __init__ [as 别名]
def __init__(self, tag):
Leaf.__init__(self, tag, tag)
示例12: __init__
# 需要导入模块: from kupfer.objects import Leaf [as 别名]
# 或者: from kupfer.objects.Leaf import __init__ [as 别名]
def __init__(self, obj, desc, category):
Leaf.__init__(self, obj, obj)
self.description = desc
if desc:
self.name_aliases.add(desc.splitlines()[0])
示例13: __init__
# 需要导入模块: from kupfer.objects import Leaf [as 别名]
# 或者: from kupfer.objects.Leaf import __init__ [as 别名]
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
示例14: __init__
# 需要导入模块: from kupfer.objects import Leaf [as 别名]
# 或者: from kupfer.objects.Leaf import __init__ [as 别名]
def __init__(self, path, name, description=None):
Leaf.__init__(self, path, name)
self._description = description
示例15: __init__
# 需要导入模块: from kupfer.objects import Leaf [as 别名]
# 或者: from kupfer.objects.Leaf import __init__ [as 别名]
def __init__(self, obj):
Leaf.__init__(
self,
obj,
service_name(obj) + ': ' + user_name(obj))