Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 3
0
	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)
Ejemplo n.º 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)
Ejemplo n.º 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()
Ejemplo n.º 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()
Ejemplo n.º 7
0
	def __init__(self, obj, name=None):
		"""Create SourceLeaf for source @obj"""
		if not name:
			name = unicode(obj)
		Leaf.__init__(self, obj, name)
Ejemplo n.º 8
0
	def content_source(self, alternate=False):
		if self.is_dir():
			return _directory_content(self.object, alternate)
		else:
			return Leaf.content_source(self)
Ejemplo n.º 9
0
	def has_content(self):
		return self.is_dir() or Leaf.has_content(self)
Ejemplo n.º 10
0
	def __init__(self, action):
		Leaf.__init__(self, action, unicode(action))
Ejemplo n.º 11
0
	def __init__(self, obj, name):
		Leaf.__init__(self, frozenset(obj), name)
Ejemplo n.º 12
0
 def content_source(self, alternate=False):
     if self.is_dir():
         return _directory_content(self.object, alternate)
     else:
         return Leaf.content_source(self)
Ejemplo n.º 13
0
 def __init__(self, shortcut):
     Leaf.__init__(self, shortcut, _(" %s (%s)" % (shortcut["desc"], shortcut["keys"])))
     self.desc = shortcut["desc"]
Ejemplo n.º 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
Ejemplo n.º 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)
Ejemplo n.º 16
0
 def __init__(self, obj=None, name=None):
     Leaf.__init__(self, obj, name)
Ejemplo n.º 17
0
 def __init__(self, obj, name=None):
     """Create SourceLeaf for source @obj"""
     if not name:
         name = unicode(obj)
     Leaf.__init__(self, obj, name)
Ejemplo n.º 18
0
	def __init__(self, obj=None, name=None):
		Leaf.__init__(self, obj, name)
Ejemplo n.º 19
0
Archivo: gtg.py Proyecto: jablan/kupfer
 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
Ejemplo n.º 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)
Ejemplo n.º 21
0
 def has_content(self):
     return self.is_dir() or Leaf.has_content(self)
Ejemplo n.º 22
0
 def __init__(self, shortcut):
     Leaf.__init__(self, shortcut, _(u" %s (%s)" % (shortcut["desc"], shortcut["keys"])))
     self.desc = shortcut["desc"]
Ejemplo n.º 23
0
Archivo: debug.py Proyecto: guns/kupfer
 def __init__(self, action):
     Leaf.__init__(self, action, str(action))