[Pykafe-commits] SF.net SVN: pykafe: [120] trunk/pykafe
Status: Pre-Alpha
Brought to you by:
jnmbk
|
From: <jn...@us...> - 2007-06-10 23:07:55
|
Revision: 120
http://pykafe.svn.sourceforge.net/pykafe/?rev=120&view=rev
Author: jnmbk
Date: 2007-06-10 16:07:58 -0700 (Sun, 10 Jun 2007)
Log Message:
-----------
quick fix
Modified Paths:
--------------
trunk/pykafe/client/session.py
trunk/pykafe/server/session.py
Modified: trunk/pykafe/client/session.py
===================================================================
--- trunk/pykafe/client/session.py 2007-06-10 22:28:07 UTC (rev 119)
+++ trunk/pykafe/client/session.py 2007-06-10 23:07:58 UTC (rev 120)
@@ -21,8 +21,11 @@
notConnected, notReady, ready, loggedIn, requestedOpening, waitingMoney = range(6)
def __init__(self):
self.state = 0
+ self.settings = None
+ self.initialize()
+
+ def initialize(self):
self.user = None
- self.settings = None
self.startTime = None
self.endTime = None
self.orders = []
@@ -35,13 +38,16 @@
price = float(config.price_fixedprice)
else:
price = float(config.price_onehourprice)/3600 * time
- return int(price/config.price_rounding)*config.price_rounding
+ return int(price/float(config.price_rounding))*float(config.price_rounding)
def calculateTotal(self, config):
total = self.calculatePrice(config)
for i in self.orders:
- total += i
+ total += i[1]
return total
+
+ def addOrder(self, productName, price):
+ self.orders.append([productName, price])
def toString(self):
"""returns current state as a string"""
Modified: trunk/pykafe/server/session.py
===================================================================
--- trunk/pykafe/server/session.py 2007-06-10 22:28:07 UTC (rev 119)
+++ trunk/pykafe/server/session.py 2007-06-10 23:07:58 UTC (rev 120)
@@ -38,7 +38,7 @@
price = float(config.price_fixedprice)
else:
price = float(config.price_onehourprice)/3600 * time
- return int(price/config.price_rounding)*config.price_rounding
+ return int(price/float(config.price_rounding))*float(config.price_rounding)
def calculateTotal(self, config):
total = self.calculatePrice(config)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|