瀏覽代碼

Cleanup.

Removed unneeded pass statements and done TODO tags.
Heikki Hokkanen 17 年之前
父節點
當前提交
7c13d11970
共有 1 個文件被更改,包括 2 次插入6 次删除
  1. 2
    6
      gitstats

+ 2
- 6
gitstats 查看文件

40
 	"""Manages data collection from a revision control repository."""
40
 	"""Manages data collection from a revision control repository."""
41
 	def __init__(self):
41
 	def __init__(self):
42
 		self.stamp_created = time.time()
42
 		self.stamp_created = time.time()
43
-		pass
44
 	
43
 	
45
 	##
44
 	##
46
 	# This should be the main function to extract data from the repository.
45
 	# This should be the main function to extract data from the repository.
132
 				except ValueError:
131
 				except ValueError:
133
 					stamp = 0
132
 					stamp = 0
134
 				self.tags[tag] = { 'stamp': stamp, 'hash' : hash, 'date' : datetime.datetime.fromtimestamp(stamp).strftime('%Y-%m-%d') }
133
 				self.tags[tag] = { 'stamp': stamp, 'hash' : hash, 'date' : datetime.datetime.fromtimestamp(stamp).strftime('%Y-%m-%d') }
135
-			pass
136
 
134
 
137
 		# Collect revision statistics
135
 		# Collect revision statistics
138
 		# Outputs "<stamp> <author>"
136
 		# Outputs "<stamp> <author>"
187
 			# author stats
185
 			# author stats
188
 			if author not in self.authors:
186
 			if author not in self.authors:
189
 				self.authors[author] = {}
187
 				self.authors[author] = {}
190
-			# TODO commits
188
+			# commits
191
 			if 'last_commit_stamp' not in self.authors[author]:
189
 			if 'last_commit_stamp' not in self.authors[author]:
192
 				self.authors[author]['last_commit_stamp'] = stamp
190
 				self.authors[author]['last_commit_stamp'] = stamp
193
 			self.authors[author]['first_commit_stamp'] = stamp
191
 			self.authors[author]['first_commit_stamp'] = stamp
376
 		ReportCreator.create(self, data, path)
374
 		ReportCreator.create(self, data, path)
377
 		self.title = data.projectname
375
 		self.title = data.projectname
378
 
376
 
379
-		# TODO copy the CSS if it does not exist
377
+		# copy the CSS if it does not exist
380
 		if not os.path.exists(path + '/gitstats.css'):
378
 		if not os.path.exists(path + '/gitstats.css'):
381
 			shutil.copyfile('gitstats.css', path + '/gitstats.css')
379
 			shutil.copyfile('gitstats.css', path + '/gitstats.css')
382
-			pass
383
 
380
 
384
 		f = open(path + "/index.html", 'w')
381
 		f = open(path + "/index.html", 'w')
385
 		format = '%Y-%m-%d %H:%m:%S'
382
 		format = '%Y-%m-%d %H:%m:%S'
664
 		f.close()
661
 		f.close()
665
 
662
 
666
 		self.createGraphs(path)
663
 		self.createGraphs(path)
667
-	pass
668
 	
664
 	
669
 	def createGraphs(self, path):
665
 	def createGraphs(self, path):
670
 		print 'Generating graphs...'
666
 		print 'Generating graphs...'