rubys 2004/03/27 10:52:09
Modified: python/gump/output statsdb.py
Log:
Some implementations seem to freak out at simple strings encapsulated
in unicode objects.
Revision Changes Path
1.18 +7 -13 gump/python/gump/output/statsdb.py
Index: statsdb.py
===================================================================
RCS file: /home/cvs/gump/python/gump/output/statsdb.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- statsdb.py 15 Mar 2004 22:07:07 -0000 1.17
+++ statsdb.py 27 Mar 2004 18:52:09 -0000 1.18
@@ -172,19 +172,13 @@
""" Hopefully means it wasn't there... """
def get(self,key):
- val=''
- if self.db.has_key(key): val=self.db[key]
- return val
+ return self.db.get(str(key),'')
def getInt(self,key):
- val=0
- if self.db.has_key(key): val=self.db[key]
- return int(val)
+ return int(self.db.get(str(key),0))
def getFloat(self,key):
- val=0
- if self.db.has_key(key): val=self.db[key]
- return float(val)
+ return float(self.db.get(str(key),0.0))
def getDate(self,key):
dateF=self.getFloat(key)
@@ -197,13 +191,13 @@
return dateF
def put(self,key,val=''):
- self.db[key]=val
+ self.db[str(key)]=val
def putInt(self,key,val=0):
- self.db[key]=str(val)
+ self.db[str(key)]=str(val)
def putDate(self,key,val=-1):
- self.putInt(key,val)
+ self.putInt(str(key),val)
def loadStatistics(self,workspace):
log.debug('--- Loading Statistics')
@@ -458,4 +452,4 @@
self.projectsByFOGFactor=createOrderedList(workspace.getProjects(),compareProjectsByFOGFactor)
self.projectsByLastUpdated=createOrderedList(workspace.getProjects(),compareProjectsByLastUpdated)
self.projectsBySequenceInState=createOrderedList(workspace.getProjects(),compareProjectsBySequenceInState)
-
\ No newline at end of file
+
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]