diff options
author | Nate Buttke <nate-web@riseup.net> | 2023-08-12 21:16:47 -0700 |
---|---|---|
committer | Nate Buttke <nate-web@riseup.net> | 2023-08-12 21:16:47 -0700 |
commit | b2fbd3a758ad2c529f2b334656c081fcb072c29e (patch) | |
tree | c39b72bcf8f29da6142e407018ea8fb101e858fd /server.py | |
parent | c6f18dea08cdf48e1bff3f357ff9c51547f57157 (diff) |
added filetypes to server. going to make major changes
Diffstat (limited to 'server.py')
-rw-r--r-- | server.py | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -73,7 +73,8 @@ def get_code_structure(df): #df = pd.read_csv("./frontend/data/withsummary2.csv") # My line -df=pd.read_csv("./frontend/data/test_with_summary_and_embeddings.csv", converters={'embedding_summary': pd.eval}) +#df=pd.read_csv("./frontend/data/test_with_summary_and_embeddings.csv", converters={'embedding_summary': pd.eval}) +df=pd.read_csv("./frontend/data/rs.csv", converters={'embedding_summary': pd.eval}) # need to do funny stuff to read in the data frame correctly from csv. that's # why the eval() is below. and pd.eval is above. @@ -81,17 +82,13 @@ df=pd.read_csv("./frontend/data/test_with_summary_and_embeddings.csv", converter #df['summary_embeddings'] = df['summary_embeddings'].apply(lambda x: eval(x)) #df['embeddings'] = df['embeddings'].apply(lambda x: eval(x)) -filetypes = ['go'] - +filetypes = ['.sh', '.c', '.h', '.cpp', '.cxx', '.hxx', '.hpp', '.go', '.hs', '.js', '.py', '.rs'] # messed this area up for debugging @app.route('/') def home(): - stub = request.args.get('path', 'dirserver').strip() + stub = request.args.get('path', 'hello').strip() kids_structure, parents_structure = get_code_structure(df) - print('kids_structure', kids_structure) - print('parents_structure', parents_structure) - print('stub', stub) if stub not in kids_structure: loctype = "nan" text = [["Path not available!"], [""]] @@ -131,5 +128,5 @@ def explain(): if __name__ == '__main__': - app.run(port=5001, debug=True) + app.run(port=8080, debug=True) #app.run(host="0.0.0.0", port=5001, debug=True) |