Example #1
0
def writeOrd():
	print "Writing new order to file"
	print "-------------------------"
	print newOrderDict
	
	fileOps.writeRecord(newOrderDict)
	summaryLabelVar.set("New Order Saved")
	forgetFrames()
Example #2
0
def writeOrd():
    print "Writing new order to file"
    print "-------------------------"
    print newOrderDict
    temp = int(fileOps.getNextOrderID())
    temp = str(temp + 1)
    fileOps.writeRecord(newOrderDict, temp)
    summaryLabelVar.set("New Order Saved")
    newCustProductsVar.set("")
    if (state == 0):
        addOrder()
    if (state == 1):
        showMain()
Example #3
0
def writeOrd():
	print "Writing new order to file"
	print "-------------------------"
	print newOrderDict
	temp = int(fileOps.getNextOrderID())
	temp = str(temp+1)
	fileOps.writeRecord(newOrderDict,temp)
	summaryLabelVar.set("New Order Saved")
	newCustProductsVar.set("")
	if(state == 0):
		addOrder()
	if(state == 1):
		showMain()
Example #4
0
				extraProdSim = extraProdSim / len(similarProducts)
				print "sim for :" + extraProd + ":"+ str(extraProdSim)
				if extraProdSim > 0.25:
					key = "n1"
					newOrderDict.setdefault(key, [])
					newOrderDict[key].append(extraProd)
					#print "_______________"
					#print newOrderDict
print "========="
print "Suggesting new order of:"+str(newOrderDict['n1'])
status = raw_input('Order Ok ?:')
if status == 'y':
	print "Writing new order to file"
	print "-------------------------"
	fileOps.writeRecord(newOrderDict)
if status == 'e':
	finishEdit = 1
	while finishEdit ==1:
		print "-----"
		remove = raw_input('Type product to remove from order:')
		print "-----"
		updatedOrder = {}
		for key, values in newOrderDict.items():
			updatedOrder.setdefault(key, [])
		        for value in values:
		            if value != remove:
		            		updatedOrder[key].append(value)
		newOrderDict = updatedOrder
		print "updated Order:"+str(newOrderDict)
		print "-----"
Example #5
0
                extraProdSim = extraProdSim / len(similarProducts)
                print "sim for :" + extraProd + ":" + str(extraProdSim)
                if extraProdSim > 0.25:
                    key = "n1"
                    newOrderDict.setdefault(key, [])
                    newOrderDict[key].append(extraProd)
                    # print "_______________"
                    # print newOrderDict
print "========="
print "Suggesting new order of:" + str(newOrderDict["n1"])
status = raw_input("Order Ok ?:")
if status == "y":
    print "Writing new order to file"
    print "-------------------------"
    fileOps.writeRecord(newOrderDict)
if status == "e":
    finishEdit = 1
    while finishEdit == 1:
        print "-----"
        remove = raw_input("Type product to remove from order:")
        print "-----"
        updatedOrder = {}
        for key, values in newOrderDict.items():
            updatedOrder.setdefault(key, [])
            for value in values:
                if value != remove:
                    updatedOrder[key].append(value)
        newOrderDict = updatedOrder
        print "updated Order:" + str(newOrderDict)
        print "-----"