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


Python DataBase.getDataCompetitor方法代码示例

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


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

示例1: Principal

# 需要导入模块: from database import DataBase [as 别名]
# 或者: from database.DataBase import getDataCompetitor [as 别名]

#.........这里部分代码省略.........
	def openEditZone(self):
		mainWindow = EditZone().exec_()

	def searchPath(self):
		"""Search the path where are the files .csv
		"""
		dir_ = QFileDialog.getExistingDirectory(None, 'Select a folder:', 'C:\\', QFileDialog.ShowDirsOnly)
		f = open('path.txt','w')
		f.write(dir_)
		f.close()
		self.mainWindow.lblPath.setText("Current Path: " + dir_)
		self.inputFiles()
	
	def inputFiles(self):
		"""This section open each .csv file, look in BD if this competitor alredy exist and
		if not, its add it into BD, then call mainTable
		"""
		f = open('path.txt')
		path = f.readline()
		self.mainWindow.lblPath.setText("Current Path: " + path)
		allFiles = glob.glob(path + "/*.csv")
		self.tmpCountFile = allFiles

		findWord = False

		for q,oneFile in enumerate(allFiles):
			zonePassed = []
			f = open( oneFile, 'r')
			allData = f.readlines()
			#try:
			numCompetitorStr = allData[2].split(";")[1]
			numCompetitor = re.sub("\D", "", numCompetitorStr)
			try:
				check = self.db.getDataCompetitor(int(numCompetitor))
			except:
				check = False
			if check == None:
				nameCompetitor = " "
				
				category = "Moto"
				if int(numCompetitor) >= self.minMoto and int(numCompetitor) <= self.maxMoto:
					category = "Moto"
				elif int(numCompetitor) >= self.minQuad and int(numCompetitor) <= self.maxQuad:
					category = "Quad"
				elif int(numCompetitor) >= self.minCar and int(numCompetitor) <= self.maxCar:
					category = "Car"
				if int(allData[8].split(";")[1]) == 0:
					wpt = "OK"
				else:
					wpt = "NOK"
				if int(allData[10].split(";")[1]) == 0:
					disc = "OK"
				else:
					disc = "NOK"
				try:
					if int(allData[15].split(";")[1]) == 0:
						dz = "OK"
				except:
					dz = "NOK"
					dzDismiss = allData[15].split(";")
					for i,dzValue in enumerate(dzDismiss):
						if i !=0:
							self.db.insertDz(int(numCompetitor),dzValue)
							
				codNum = int(allData[5].split(";")[1])
				version = "2.0"
开发者ID:rbistolfi,项目名称:gps-tracking,代码行数:70,代码来源:run.py


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