Beispiel #1
0
	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)
Beispiel #2
0
	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)
Beispiel #4
0
 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)
Beispiel #5
0
	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()
Beispiel #6
0
    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()
Beispiel #7
0
	def __init__(self, obj, name=None):
		"""Create SourceLeaf for source @obj"""
		if not name:
			name = unicode(obj)
		Leaf.__init__(self, obj, name)
Beispiel #8
0
	def content_source(self, alternate=False):
		if self.is_dir():
			return _directory_content(self.object, alternate)
		else:
			return Leaf.content_source(self)
Beispiel #9
0
	def has_content(self):
		return self.is_dir() or Leaf.has_content(self)
Beispiel #10
0
	def __init__(self, action):
		Leaf.__init__(self, action, unicode(action))
Beispiel #11
0
	def __init__(self, obj, name):
		Leaf.__init__(self, frozenset(obj), name)
Beispiel #12
0
 def content_source(self, alternate=False):
     if self.is_dir():
         return _directory_content(self.object, alternate)
     else:
         return Leaf.content_source(self)
Beispiel #13
0
 def __init__(self, shortcut):
     Leaf.__init__(self, shortcut, _(" %s (%s)" % (shortcut["desc"], shortcut["keys"])))
     self.desc = shortcut["desc"]
Beispiel #14
0
	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
Beispiel #15
0
 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)
Beispiel #16
0
 def __init__(self, obj=None, name=None):
     Leaf.__init__(self, obj, name)
Beispiel #17
0
 def __init__(self, obj, name=None):
     """Create SourceLeaf for source @obj"""
     if not name:
         name = unicode(obj)
     Leaf.__init__(self, obj, name)
Beispiel #18
0
	def __init__(self, obj=None, name=None):
		Leaf.__init__(self, obj, name)
Beispiel #19
0
 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
Beispiel #20
0
 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)
Beispiel #21
0
 def has_content(self):
     return self.is_dir() or Leaf.has_content(self)
 def __init__(self, shortcut):
     Leaf.__init__(self, shortcut, _(u" %s (%s)" % (shortcut["desc"], shortcut["keys"])))
     self.desc = shortcut["desc"]
Beispiel #23
0
 def __init__(self, action):
     Leaf.__init__(self, action, str(action))