diff vixm/stats.py @ 46:2d570448aba5 pure

Abstract out the stats code a little bit more This is in preparation for moving the stats code completely out of player code
author Josef "Jeff" Sipek <jeffpc@josefsipek.net>
date Mon, 06 Nov 2006 05:19:23 -0500
parents bc6db55448e1
children
line wrap: on
line diff
--- a/vixm/stats.py	Mon Nov 06 05:10:37 2006 -0500
+++ b/vixm/stats.py	Mon Nov 06 05:19:23 2006 -0500
@@ -9,7 +9,7 @@
 			self.__stats = {}
 		self.__new_songs = 0
 
-		self.current = None
+		self.__current = None
 	
 	def __del__(self):
 		self.sync()
@@ -21,8 +21,11 @@
 
 		self.__new_songs = 0
 
+	def playing(self, s):
+		self.__current = s
+
 	def played(self):
-		s = str(self.current)
+		s = str(self.__current)
 
 		if not self.__stats.has_key(s):
 			self.__stats[s] = 0
@@ -32,4 +35,4 @@
 		self.__new_songs += 1
 		if self.__new_songs >= NEW_SONGS_SYNC:
 			self.sync()
-	
+