Beispiel #1
0
	def get(self):
		s = Stock()
		_d = s.iterDump()
		for line in _d:
			self.write(str(line))
			self.write("\n")
		s.Close()
Beispiel #2
0
	def get(self):
		try:
			s = Stock()
			reply = ""
			#Check for price/quantity
			price = self.get_argument('price','')
			quantity = self.get_argument('quantity','')
			value = self.get_argument('value','')
			if(price=='true'):
				#Get the egg unit price
				price = s.getItemPrice('egg')
				reply += "egg unit price: " + str(price)
			if(quantity=='true'):
				quantity = s.getItemQuantity('egg')
				reply += "egg stock level: " + str(quantity)
			if(value=='true'):
				#Get item total value
				total = s.getItemTotal('egg')
				reply += "egg total stock value: " + str(total)
			if(reply==""):
				reply = "OK"
			self.write(reply)
			s.Close()
		except Exception as e:
			print(e)
Beispiel #3
0
	def delete(self):
		s = Stock()
		self.write("OK")
		s.Close()