예제 #1
0
파일: app.py 프로젝트: adamnieto/ideaPOP
def handle_data():
    textBox = request.form["ideaBox"]
    indexValues = getString.processString(textBox)
    searchTerms = getString.getSearchValues(indexValues, textBox)
    arrayLinks = getImage.main(searchTerms)
    termCounter = 0
    termInfo = ""
    code = ""
    for linkAddress in arrayLinks:
        linkAddress1 = linkAddress.strip("}")
        code += '<a href="' + linkAddress1 + '">' + '<img class="img-circle" src="'+ linkAddress1 + '" ></a>'

    for term in searchTerms:
        if termCounter == 0:
            termInfo += term.strip("\n")
            termInfo += " "
            termCounter += 1
        else:
            termInfo += ", " + term.strip("\n")
            termInfo += " "
    return render_template("product.html",images= Markup(code),termInfo=termInfo,textBox=textBox)
예제 #2
0
def handle_data():
    textBox = request.form["ideaBox"]
    indexValues = getString.processString(textBox)
    searchTerms = getString.getSearchValues(indexValues, textBox)
    arrayLinks = getImage.main(searchTerms)
    termCounter = 0
    termInfo = ""
    code = ""
    for linkAddress in arrayLinks:
        linkAddress1 = linkAddress.strip("}")
        code += '<a href="' + linkAddress1 + '">' + '<img class="img-circle" src="' + linkAddress1 + '" ></a>'

    for term in searchTerms:
        if termCounter == 0:
            termInfo += term.strip("\n")
            termInfo += " "
            termCounter += 1
        else:
            termInfo += ", " + term.strip("\n")
            termInfo += " "
    return render_template("product.html",
                           images=Markup(code),
                           termInfo=termInfo,
                           textBox=textBox)
예제 #3
0
def main(textBox):
    indexValues = processString(textBox.strip('\n'))
    searchTerms = getSearchValues(indexValues, textBox)
    getImage.main(searchTerms)
예제 #4
0
def main(textBox):
    indexValues = processString(textBox.strip('\n'))
    searchTerms = getSearchValues(indexValues, textBox)
    getImage.main(searchTerms)