示例#1
0
def get_company(company_name):
    memory_storage = get_vault()["memory_storage"]
    for company in memory_storage.get_companies():
        if company.lower() == company_name.lower():
            return json.dumps(
                {"company": {"id": company_name, "text": memory_storage.get_original_company_name(company_name)}}
            )
    return json.dumps({})
示例#2
0
def get_company(company_name):
    memory_storage = get_vault()['memory_storage']
    for company in memory_storage.get_companies():
        if company.lower() == company_name.lower():
            return {
                'id': company_name,
                'text': memory_storage.get_original_company_name(company_name)
            }
    flask.abort(404)
示例#3
0
def get_company(company_name):
    memory_storage = get_vault()['memory_storage']
    for company in memory_storage.get_companies():
        if company.lower() == company_name.lower():
            return {
                'id': company_name,
                'text': memory_storage.get_original_company_name(company_name)
            }
    flask.abort(404)
示例#4
0
def get_company(company_name):
    memory_storage = get_vault()['memory_storage']
    for company in memory_storage.get_companies():
        if company.lower() == company_name.lower():
            return json.dumps({
                'company': {
                    'id': company_name,
                    'text': memory_storage.get_original_company_name(
                company_name)}
            })
    return json.dumps({})
示例#5
0
def get_company(company_name):
    memory_storage = get_vault()['memory_storage']
    for company in memory_storage.get_companies():
        if company.lower() == company_name.lower():
            return json.dumps({
                'company': {
                    'id': company_name,
                    'text':
                    memory_storage.get_original_company_name(company_name)
                }
            })
    return json.dumps({})