def __init__(self, text, name=None): """@text *must* be unicode or UTF-8 str""" text = tounicode(text) if not name: lines = [l for l in text.splitlines() if l.strip()] name = lines[0] if lines else text Leaf.__init__(self, text, name)
def __init__(self, text, name=None): """@text *must* be unicode or UTF-8 str""" text = tounicode(text) if not name: name = self.get_first_text_line(text) if len(text) == 0 or not name: name = _("(Empty Text)") Leaf.__init__(self, text, name)
def __init__(self, keyid, owner, trust, expiration): Leaf.__init__(self, keyid, owner) desc = [_("Id:"), keyid[-8:]] if keyid else [] if trust: desc.extend((_("Trust:"), TRUST_NAMES.get(trust, trust))) if expiration and expiration != '-': desc.extend((_("Expire:"), expiration)) self._description = " ".join(desc)
def __init__(self, item=None, init_path=None, app_id=None): """Try constructing an Application for GAppInfo @item, for file @path or for package name @app_id. """ self.init_item = item self.init_path = init_path self.init_item_id = app_id and app_id + ".desktop" # finish will raise InvalidDataError on invalid item self.finish() Leaf.__init__(self, self.object, self.object.get_name()) self._add_aliases()
def __init__(self, item=None, init_path=None, app_id=None, require_x=True): """Try constructing an Application for GAppInfo @item, for file @path or for package name @app_id. @require_x: require executable file """ self.init_item = item self.init_path = init_path self.init_item_id = app_id and app_id + ".desktop" # finish will raise InvalidDataError on invalid item self.finish(require_x) Leaf.__init__(self, self.object, self.object.get_name()) self._add_aliases()
def __init__(self, obj, name=_("Multiple Objects")): # modifying the list of objects is strictly forbidden robj = list(datatools.UniqueIterator(obj)) Leaf.__init__(self, robj, name)
def __init__(self, obj=None, name=None): Leaf.__init__(self, obj, name)
def __init__(self, obj, name=None): """Create SourceLeaf for source @obj""" if not name: name = unicode(obj) Leaf.__init__(self, obj, name)
def __init__(self, action): Leaf.__init__(self, action, unicode(action))
def __init__(self, obj, name): Leaf.__init__(self, frozenset(obj), name)
def __init__(self, task_id, title, status): Leaf.__init__(self, task_id, title) self.status = status self.tags = None self.duedate = None self.startdate = None
def __init__(self, shortcut): Leaf.__init__(self, shortcut, _(" %s (%s)" % (shortcut["desc"], shortcut["keys"]))) self.desc = shortcut["desc"]
def __init__(self, shortcut): Leaf.__init__(self, shortcut, _(u" %s (%s)" % (shortcut["desc"], shortcut["keys"]))) self.desc = shortcut["desc"]
def __init__(self, action): Leaf.__init__(self, action, str(action))