Skip to content

Commit

Permalink
Changed setup script to allow python3 and added refresh button
Browse files Browse the repository at this point in the history
  • Loading branch information
blaverick62 authored and samayer12 committed Dec 28, 2021
1 parent 27d6e14 commit a73162a
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
@@ -2,8 +2,8 @@

cd app/ 2>/dev/null || true
echo "Creating virtual environment in: $(pwd)"
python3.8 -m pip install --user virtualenv
virtualenv venv --python=python3.8
python3 -m pip install --user virtualenv
virtualenv venv --python=python3
source venv/bin/activate
pip install -r requirements.txt
echo "If running locally, try sudo -E venv/bin/python3.8 src/main.py recipes log.txt"
echo "If running locally, try sudo -E venv/bin/python3 src/main.py recipes log.txt"
4 changes: 4 additions & 0 deletions src/printer.py
Original file line number Diff line number Diff line change
@@ -37,6 +37,9 @@ def print_notes(notes: pd.Series) -> str:
notes_message += '</ul>'
return notes_message

def print_refresh_button() -> str:
message = '<div><button type="button" onclick="window.location.reload();">New Cocktail</button></div>'
return message

def print_recipe_info(recipe: pd.DataFrame) -> str:
message = ''
@@ -45,5 +48,6 @@ def print_recipe_info(recipe: pd.DataFrame) -> str:
message += f'\n{print_steps(recipe.steps.values)}'
message += f'\n{print_yield(recipe.yields.values[0])}'
message += f'\n{print_notes(recipe.notes.values[0])}'
message += f'\n{print_refresh_button()}'

return message

0 comments on commit a73162a

Please sign in to comment.