本文整理汇总了Python中lib.db.DB.exportTasks方法的典型用法代码示例。如果您正苦于以下问题:Python DB.exportTasks方法的具体用法?Python DB.exportTasks怎么用?Python DB.exportTasks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lib.db.DB
的用法示例。
在下文中一共展示了DB.exportTasks方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Workload
# 需要导入模块: from lib.db import DB [as 别名]
# 或者: from lib.db.DB import exportTasks [as 别名]
#.........这里部分代码省略.........
qmodel=self.ui.taskList.indexFromItem(item)
taskheight=self.ui.taskList.rowHeight(qmodel)
else:
taskheight=22
if init:
winheight=320
listheight=252
else:
winheight=self.height()
listheight=self.ui.taskList.height()
desiredHeight=taskheight*len(tasks)+winheight-listheight+6
if ( desiredHeight>self.height() or downSize ) and desiredHeight<QtGui.QApplication.desktop().height():
self.resize(self.width(),desiredHeight)
def closeEvent(self, e=None):
self.hide()
if e:
e.ignore()
###### MENU FUNCTIONS
def importTasklist(self):
fname=QtGui.QFileDialog.getOpenFileName(self, QtGui.QApplication.translate("ui","Open"), "", QtGui.QApplication.translate("ui","Workload Import File (*.w)"))
if fname[0]:
filename=fname[0]
from lib import importexport
importexport.importTasks(self,filename,self.settings["dateFormat"])
def exportTaskList(self):
fname=QtGui.QFileDialog.getSaveFileName(self,QtGui.QApplication.translate("ui","Save"), "", QtGui.QApplication.translate("ui","Workload Export File (*.w)"))
if fname[0]:
includeArchive=self.questionPopup(QtGui.QApplication.translate("ui","Exporting tasks"), QtGui.QApplication.translate("ui","Do you want to include completed tasks?"))
tasks=self.db.exportTasks(self.currentContext, includeArchive)
from lib import importexport
filename=fname[0]
importexport.export(tasks, filename,self.settings["dateFormat"])
def about(self):
f=open("about.html")
text=f.read()
f.close()
QtGui.QMessageBox.information(self, QtGui.QApplication.translate("ui","About"), text, buttons=QtGui.QMessageBox.Ok )
def exit(self,exitcode=0):
exit_=False
if self.settings["askOnExit"]:
if self.questionPopup(QtGui.QApplication.translate("ui","Exit"), QtGui.QApplication.translate("ui","Are you sure?")):
exit_=True
else: exit_=True
if exit_==True:
self.settings.setCurrentContextAsLast()
self.shortcuts.terminate()
self.app.exit(exitcode)
def createTask(self):
Task(self,taskid=0)
def completeTasks(self):
if self.ui.taskList.hasFocus():
tasks=self.ui.taskList.selectedItems()
for i in tasks:
self.db.completeTask(i.data(0,32))
index = self.ui.taskList.indexOfTopLevelItem(i)
self.ui.taskList.takeTopLevelItem(index)
self.ui.statusbar.showMessage(QtGui.QApplication.translate("ui","Task completed."),3300)