Skip to content

Commit

Permalink
format with Black
Browse files Browse the repository at this point in the history
  • Loading branch information
ChocoTonic committed Sep 24, 2021
1 parent 6ca8312 commit 78ccb51
Show file tree
Hide file tree
Showing 7 changed files with 423 additions and 277 deletions.
4 changes: 2 additions & 2 deletions Examples/cli_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
print("Food Search Results: {}".format(len(foods)))
print("{}\n".format(foods))

food = fs.food_get('1345')
food = fs.food_get("1345")
print("Food Item 1345")
print("{}\n".format(food))

recipes = fs.recipes_search("Tomato Soup")
print("Recipe Search Results:")
print("{}\n".format(recipes))

recipe = fs.recipe_get('88339')
recipe = fs.recipe_get("88339")
print("Recipe 88339")
print("{}\n".format(recipe))

Expand Down
21 changes: 13 additions & 8 deletions Examples/web_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,18 @@

@app.route("/")
def index():
if request.args.get('oauth_verifier'):
if request.args.get("oauth_verifier"):

session_token = fs.authenticate(request.args.get('oauth_verifier'))
session_token = fs.authenticate(request.args.get("oauth_verifier"))

return redirect(url_for('profile'))
return redirect(url_for("profile"))

else:
return "<ul><li><a href={0}>Authenticate Access Here</a></li>\
<li><a href={1}>Example Search: Chicken Soup</a></li>\
<li><a href={2}>Example Item Lookup: Item #1750</a></li>" \
.format(url_for('authenticate'), 'search/chicken%20soup', 'food/1750')
<li><a href={2}>Example Item Lookup: Item #1750</a></li>".format(
url_for("authenticate"), "search/chicken%20soup", "food/1750"
)


@app.route("/auth")
Expand All @@ -35,7 +36,9 @@ def authenticate():
def search(search_term):
search_results = fs.foods_search(search_term, page_number=1, max_results=10)

return "<h1>Search Results: {0}</h1><div>{1}</div>".format(search_term, search_results)
return "<h1>Search Results: {0}</h1><div>{1}</div>".format(
search_term, search_results
)


@app.route("/food/<item>")
Expand All @@ -49,8 +52,10 @@ def food(item):
def profile():
food = fs.foods_get_most_eaten()

return "<h1>Profile</h1><div><strong>Most Eaten Foods</strong><br>{}</div>".format(food)
return "<h1>Profile</h1><div><strong>Most Eaten Foods</strong><br>{}</div>".format(
food
)


if __name__ == "__main__":
app.run()
app.run()
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ $ easy_install fatsecret

## Config

Register for a developer account at [Fatsecret](https://platform.fatsecret.com/api/). You will need your Consumer Key and Consumer Secret key for your application.
Register for a developer account at [Fatsecret](https://platform.fatsecret.com/api/). You will need your Consumer Key and Consumer Secret key for your application.

## Usage

Expand Down
Loading

0 comments on commit 78ccb51

Please sign in to comment.