Beispiel #1
0
    def recipe_rate_recv(self, environ, start_response):
        formdata = environ["QUERY_STRING"]
        results = urlparse.parse_qs(formdata)

        print results
        print results["name"]
        print results["name"][0]

        name = results["name"][0]
        rating = results["rating"][0]

        r = db.get_recipe(name)

        if r != None:
            print "rating" + rating
            r.rate(rating)

        print "rating done"

        content_type = "text/html"

        data = """\

<head><title>Form Results</title>
<style type="text/css">
h1 {color:red;}
</style>
</head>
<body>
<h1>Form Results</h1>"""

        data += "Name: " + name
        data += "Rating: " + rating
        data += """
Visit:
<a href='index'>Index</a>

"""

        start_response("200 OK", list(html_headers))
        return [data]
Beispiel #2
0
if db._check_bottle_type_exists('Anheuser-Busch', 'Bud Light'):
  presen = 'Bud Light'

                                                
r = recipes.Recipe() 

d = r.need_ingredients()

for k in d:
  print d[k]


i = 0


value = db.get_recipe('scotch on the rocks')


try:
  os.mkdir('html')
  print "Created html folder" 
except OSError:
    # already exists
    pass

###

fp = open('html/index.html', 'w')
print >>fp, """<html>
 <head>
 <title>Party Favors</title>