Esempio n. 1
0
	def __init__(self, bot_panel, top_panel, parent, scroll=True):
		assert type(top_panel) == unicode
		guid = ''.join([unicode(random.randint(0,9)) for i in range(32)])
		Tree.__init__(self, guid, bot_panel, parent)
		self.top_panel = top_panel
		self.render    = SearchRender(scroll)
		self.render.curry(self.bot_panel, self.top_panel)
Esempio n. 2
0
class SearcherPanel(Tree):
	top_panel = None
	bot_bold  = 0

	@property
	def bot_panel(self):
		return self.label

	@bot_panel.setter
	def bot_panel(self, label):
		if label == self.label:
			return
		self.label = label

	def __init__(self, bot_panel, top_panel, parent, scroll=True):
		assert type(top_panel) == unicode
		guid = ''.join([unicode(random.randint(0,9)) for i in range(32)])
		Tree.__init__(self, guid, bot_panel, parent)
		self.top_panel = top_panel
		self.render    = SearchRender(scroll)
		self.render.curry(self.bot_panel, self.top_panel)

	def __str__(self):
		return "%s (query = %s)" % (self.bot_panel, self.top_panel)
	
	def __cmp__(self, other):
		if self.guid == other.guid:
			return 0
		if self.guid < other.guid:
			return -1
		return 1

	def curry(self):
		self.render.curry(self.bot_panel, self.top_panel, self.bot_bold)
		return (self.guid, self.render)

	def ticker(self):
		return (self.guid, self.render)