コード例 #1
0
	def update_subtasks(self, total=0, on=0):
		if total != 0:
			percent = (on * 100) / total
		else:
			percent = 0

		count = "%d/%d" % (on, total)
		self.title = REGEX_SUBTASK.sub("[%s]" % (count), self.title)
		self.title = REGEX_SUBTASK_PERCENT.sub("[%d%%]" % (percent), self.title)
		d = self._heading.document.write_checkbox(self, including_children=False)
コード例 #2
0
ファイル: checkboxes.py プロジェクト: Yixf-Self/vim-orgmode
	def update_subtasks(self, total=0, on=0):
		if total != 0:
			percent = (on * 100) / total
		else:
			percent = 0

		count = "%d/%d" % (on, total)
		self.title = REGEX_SUBTASK.sub("[%s]" % (count), self.title)
		self.title = REGEX_SUBTASK_PERCENT.sub("[%d%%]" % (percent), self.title)
		d = self._heading.document.write_checkbox(self, including_children=False)
コード例 #3
0
ファイル: headings.py プロジェクト: Yixf-Self/vim-orgmode
	def update_subtasks(self, total=0, on=0):
		u""" Update subtask information for current heading
		:total:	total # of top level checkboxes
		:on:	# of top level checkboxes which are on
		"""
		if total != 0:
			percent = (on * 100) / total
		else:
			percent = 0

		count = "%d/%d" % (on, total)
		self.title = REGEX_SUBTASK.sub("[%s]" % (count), self.title)
		self.title = REGEX_SUBTASK_PERCENT.sub("[%d%%]" % (percent), self.title)
		self.document.write_heading(self, including_children=False)
コード例 #4
0
	def update_subtasks(self, total=0, on=0):
		u""" Update subtask information for current heading
		:total:	total # of top level checkboxes
		:on:	# of top level checkboxes which are on
		"""
		if total != 0:
			percent = (on * 100) / total
		else:
			percent = 0

		count = "%d/%d" % (on, total)
		self.title = REGEX_SUBTASK.sub("[%s]" % (count), self.title)
		self.title = REGEX_SUBTASK_PERCENT.sub("[%d%%]" % (percent), self.title)
		self.document.write_heading(self, including_children=False)