[UI] Add favicon #13
					 3 changed files with 8 additions and 3 deletions
				
			
		| 
						 | 
					@ -4,6 +4,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from flask import Flask
 | 
					from flask import Flask
 | 
				
			||||||
from flask import render_template
 | 
					from flask import render_template
 | 
				
			||||||
 | 
					from flask import send_from_directory
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# pylint: disable=invalid-name
 | 
					# pylint: disable=invalid-name
 | 
				
			||||||
app = Flask(__name__)
 | 
					app = Flask(__name__)
 | 
				
			||||||
| 
						 | 
					@ -22,6 +23,10 @@ def index(hours=None, minutes=None):
 | 
				
			||||||
    data = render_template('beer.html', hours=hours, minutes=minutes)
 | 
					    data = render_template('beer.html', hours=hours, minutes=minutes)
 | 
				
			||||||
    return data
 | 
					    return data
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@app.route('/favicon.ico')
 | 
				
			||||||
 | 
					def favicon():
 | 
				
			||||||
 | 
					    """ serve the favicon """
 | 
				
			||||||
 | 
					    return send_from_directory('static', 'favicon.ico')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def main():
 | 
					def main():
 | 
				
			||||||
    """ main func """
 | 
					    """ main func """
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										
											BIN
										
									
								
								beer/static/favicon.ico
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								beer/static/favicon.ico
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 5.5 KiB  | 
| 
						 | 
					@ -8,17 +8,17 @@ echo "testing URL: ${TEST_URL}"
 | 
				
			||||||
CURL_OPTS='-s'
 | 
					CURL_OPTS='-s'
 | 
				
			||||||
# default
 | 
					# default
 | 
				
			||||||
curl ${CURL_OPTS} ${TEST_URL} | grep -q 'setHours( 17, 0);'
 | 
					curl ${CURL_OPTS} ${TEST_URL} | grep -q 'setHours( 17, 0);'
 | 
				
			||||||
[ $? -ne 0 ] && exit 1
 | 
					[ $? -ne 0 ] && echo "Failed with default" && exit 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# set 1 parameter
 | 
					# set 1 parameter
 | 
				
			||||||
hours=18
 | 
					hours=18
 | 
				
			||||||
curl ${CURL_OPTS} ${TEST_URL}/${hours} | grep -q "setHours( ${hours}, 0);"
 | 
					curl ${CURL_OPTS} ${TEST_URL}/${hours} | grep -q "setHours( ${hours}, 0);"
 | 
				
			||||||
[ $? -ne 0 ] && exit 1
 | 
					[ $? -ne 0 ] && echo "Failed with 1 parameter set" && exit 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# set 2 parameters
 | 
					# set 2 parameters
 | 
				
			||||||
minutes=30
 | 
					minutes=30
 | 
				
			||||||
curl ${CURL_OPTS} ${TEST_URL}/${hours}/${minutes} | grep -q "setHours( ${hours}, ${minutes});"
 | 
					curl ${CURL_OPTS} ${TEST_URL}/${hours}/${minutes} | grep -q "setHours( ${hours}, ${minutes});"
 | 
				
			||||||
[ $? -ne 0 ] && exit 1
 | 
					[ $? -ne 0 ] && echo "Failed with 2 parameters set" && exit 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
echo "OK"
 | 
					echo "OK"
 | 
				
			||||||
exit 0
 | 
					exit 0
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue