本文整理汇总了Python中task.Task.status方法的典型用法代码示例。如果您正苦于以下问题:Python Task.status方法的具体用法?Python Task.status怎么用?Python Task.status使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类task.Task
的用法示例。
在下文中一共展示了Task.status方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: onApply
# 需要导入模块: from task import Task [as 别名]
# 或者: from task.Task import status [as 别名]
def onApply(self, data):
"""Reads the information from the dialog and saves the task."""
# Get the information from the dialog and save it to the database
t = Task()
# Make sure that there was text in the text box
if len(self.widgets.get_widget('TaskEntry').get_text()) > 1:
# Set the task name to the value of the text box
t.name = self.widgets.get_widget('TaskEntry').get_text()
# Set the priority to the value of the combo box
t.priority = self.widgets.get_widget('PriorityEntry').get_active()
# Set the status to not completed
t.status = self.widgets.get_widget('StatusEntry').get_active()
# Set the id of the task
t.id = self.taskid
# Set the due date of the task
t.duedate = self.widgets.get_widget('DateEntry').get_date()
# Save the task in the database
self.db.saveTask(t)
# Close the dialog
self.dialog.destroy()
示例2: Task
# 需要导入模块: from task import Task [as 别名]
# 或者: from task.Task import status [as 别名]
# If there was an error, display an error dialog
except sqlite.Error, message:
errordialog = gtk.MessageDialog(None, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, 'Error in reading a task from database:\n\n' + message.message)
errordialog.run()
errordialog.destroy()
# Fetch one result and store it
result = cursor.fetchone()
# Create a Task object to store the information in
t = Task()
# Set the values from the database results
t.name = result[0]
t.priority = result[1]
t.status = result[2]
t.id = result[3]
t.duedate = (result[4], result[5], result[6])
# Return the task object
return t
def readTasks(self):
"""Reads all of the tasks from the database and returns them in a list"""
# Create a cursor for the database
cursor = sqlite.connect(DBPATH).cursor()
# Create a tuple with the constant for completed tasks for the query
data = task.TASK_COMPLETED,
# Try to get all of the tasks that are not completed