diff --git a/parts/server.py b/parts/server.py index fde1e58..94e5e20 100755 --- a/parts/server.py +++ b/parts/server.py @@ -13,6 +13,7 @@ from io import BytesIO from os import listdir from os.path import isfile, join from werkzeug.utils import secure_filename +import random app = Flask(__name__) @@ -22,6 +23,11 @@ parts = {} octopartURL ="" baseURL = "/parts" +taglines = [] +with open('taglines.txt', 'r') as infile: + for line in infile: + taglines.append(line[:-1]) + def getContainers(): query = "select id, name from containers order by UPPER(name);" r = db_engine.execute(text(query)) @@ -68,7 +74,7 @@ def serveImage(img): @app.route(baseURL, strict_slashes=True) def index(): - return render_template('partsearch.html', containers=getContainers(), baseURL=baseURL) + return render_template('partsearch.html', containers=getContainers(), baseURL=baseURL, tagline=random.choice(taglines)) @app.route(baseURL+'/getlocationsInContainer/') def get_locations_in_container(containerID): diff --git a/parts/taglines.txt b/parts/taglines.txt new file mode 100644 index 0000000..5b6c167 --- /dev/null +++ b/parts/taglines.txt @@ -0,0 +1,32 @@ +Looking for obsolete ICs that were discontinued years ago? Just start typing! +Looking for obsolete ICs that were discontinued years ago? Just start typing! +Looking for obsolete ICs that were discontinued years ago? Just start typing! +Looking for obsolete ICs that were discontinued years ago? Just start typing! +Looking for obsolete ICs that were discontinued years ago? Just start typing! +Start typing to find your part +Start typing to find your part +Start typing to find your part +Start typing to find your part +Start typing to find your part +Try typing "mosfet" +Try typing "arduino" +Try typing "led driver" +Try typing "resistor" +Try typing "regulator" +Try typing "led" +Try typing "78L05" +Try typing "drv8833" +Try typing "stm32" +Try typing "logic analyzer" +Try typing "programmer" +Try typing "connector" +Try typing "motor" +Try typing "spring" +Try typing "usb" +Try typing "Flux capacitor". We don't have one, but you can try. +You can also search for tools +Now with emoji support! +I know it's here somwhere! +For every part you find, there is 1000 you won't! +'); DROP TABLE parts;-- +Help! I'm trapped in a tagline randomiser! \ No newline at end of file diff --git a/parts/templates/partsearch.html b/parts/templates/partsearch.html index 60f5b88..30f087c 100755 --- a/parts/templates/partsearch.html +++ b/parts/templates/partsearch.html @@ -19,7 +19,7 @@

ELAB Part Search Engine

-

Looking for obsolete ICs that were discontinued years ago? Just start typing!

+

{{ tagline }}

SEARCH IN