当前位置: 首页>>代码示例>>Python>>正文


Python UI.errorMessageBox方法代码示例

本文整理汇总了Python中UI.errorMessageBox方法的典型用法代码示例。如果您正苦于以下问题:Python UI.errorMessageBox方法的具体用法?Python UI.errorMessageBox怎么用?Python UI.errorMessageBox使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UI的用法示例。


在下文中一共展示了UI.errorMessageBox方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: runApp

# 需要导入模块: import UI [as 别名]
# 或者: from UI import errorMessageBox [as 别名]
def runApp():

	conn = data.connectDB()
	c = conn.cursor()

	sheetName = "DBMS Enrollment Data.xls"		#name of the excel spreadsheet

	tuitionGrantSheetName = "Course Tuition and Grant Revenue Totals"
	programTotalsSheetName = "Course Breakdown Based on Program"
	programPercentTotalsSheetName = "Course Percentage Breakdown based on Faculty"
	planTotalsSheetName = "Course Breakdown Based on All Plans"
	sigPlanTotalsSheetName = "Course Breakdown Based on Plans (with >10 enrollments)"
	yearTotalsSheetName = "Course Breakdown Based on Year"
	planBreakdownSheetName = "Course Breakdown Based on Selected Plans"
	programYearSheetName = "Program Breakdown Based on Year"
	programInfoSheetName = "Program Info"


	sheetsOrderedDict = OrderedDict([
									(tuitionGrantSheetName, 0),
									(programTotalsSheetName, 1),
									(planTotalsSheetName, 2),
									(sigPlanTotalsSheetName, 3),
									(yearTotalsSheetName, 4),
									(planBreakdownSheetName, 5),
									(programYearSheetName, 6),
									(programInfoSheetName, 7),
									])

	cdLocation = os.getcwd()
	excelLocation = cdLocation + "\\" + sheetName

	try:
		os.remove(excelLocation)		#TESTING PURPOSES, REMOVES THE OLD SPREADSHEET EVERY [email protected]@@@@@@@@@@@
	except WindowsError:
		pass

	'''	Asks user for information that needs to be shown
	'''

	selectedSheets = UI.sheetsOptionsCheckBox.runScrollingApp(sheetsOrderedDict)		#UI module asks for sheets
	while not checkError(selectedSheets):
		UI.errorMessageBox.runApp(selectedSheets)
		selectedSheets = UI.sheetsOptionsCheckBox.runScrollingApp(sheetsOrderedDict)
	
	selectedSheetsKey = []			#used to store the keys of the selected sheets

	for name in selectedSheets:

		selectedSheetsKey.append(sheetsOrderedDict[name])

	''' Sheets that will be written to the outputted workbook
	'''

	book = xlwt.Workbook()

	if sheetsOrderedDict[tuitionGrantSheetName] in selectedSheetsKey:

		ExcelOutput.tuitionGrantTotals.write(c,book)

	if sheetsOrderedDict[programTotalsSheetName] in selectedSheetsKey:	

		ExcelOutput.programTotals.write(c,book)

	if sheetsOrderedDict[planTotalsSheetName] in selectedSheetsKey:

		ExcelOutput.planExpandedTotals.write(c,book)

	if sheetsOrderedDict[sigPlanTotalsSheetName] in selectedSheetsKey:

		ExcelOutput.planSignificantTotals.write(c,book)

	if sheetsOrderedDict[yearTotalsSheetName] in selectedSheetsKey:

		ExcelOutput.yearTotals.write(c,book)

	if sheetsOrderedDict[planBreakdownSheetName] in selectedSheetsKey:
		#Make list of plans with only the plan code e.g. "BCHM"
		rawPlanList = data.grabFullPlanList(c)

		checkPlanList = []
		for plan in rawPlanList:
			plan = plan[0]			#unpack the tuple
			
			breakPoint = plan.index('-')	#find the first occurence of "-" that separates BCHM-M-BSH
			plan = plan[0:breakPoint]		#splice the string to get just BCHM
			
			try: 
				temp = checkPlanList.index(plan)		#check if the course code BCHM exists in the list

			except ValueError:
				checkPlanList.append(plan)			#if not, it is added to the list

		selectedPlans = UI.planOptionsCheckBox.runScrollingApp(checkPlanList)
		while not checkError(selectedPlans):			#ensure plans are chosen to be output
			UI.errorMessageBox(selectedPlans)
			selectedPlans = UI.planOptionsCheckBox.runScrollingApp(checkPlanList)

		for plan in selectedPlans:

#.........这里部分代码省略.........
开发者ID:mattsimpson,项目名称:DBMS_Enrollment,代码行数:103,代码来源:writeToExcel.py


注:本文中的UI.errorMessageBox方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。