Skip to content

Commit

Permalink
Merge branch 'development' of github.com:usc-isi-i2/t2wml into develo…
Browse files Browse the repository at this point in the history
…pment
  • Loading branch information
zmbq committed Aug 11, 2020
2 parents dfab5d1 + 2068918 commit 35e82f1
Show file tree
Hide file tree
Showing 11 changed files with 2,312 additions and 77 deletions.
21 changes: 21 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,26 @@
],
"cwd": "${workspaceFolder}/backend",
},
{
"name": "Tests",
"type": "python",
"request": "launch",
"module": "pytest",
"args": [
"backend\\tests",
"-s",
"-v"
],
"cwd": "${workspaceFolder}",
},
{
"name": "Python: Current File (Integrated Terminal)",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"cwd": "${fileDirname}",
"env": {"PYTHONPATH": "${workspaceRoot}"}
},
]
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ The project has preconfigured settings file for Visual Studio Code. Before start
On Macs and Linux machines, copy `.vscode/settings.linux.json` to `.vscode/settings.json` . On Windows, copy `.vscode/settings.windows.json` to `.vscode/settings.json`
Start Visual Studio Code and open it in the t2wml-root/t2wml directory.

You can run the backend with F5 (choose the Backend launch configuration - the only one there). To run the Frontend, choose Terminal | Run Task | npm: start - frontend .
You can run the backend with F5 (choose the "Backend" launch configuration). To run the Frontend, choose Terminal | Run Task | npm: start - frontend .


## Usage with GUI
Expand Down
13 changes: 7 additions & 6 deletions backend/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def wikify_region(pid):
flag = int(request.form["flag"])
if action == "wikify_region":
if not project.current_file:
raise web_exception.WikifyWithoutDataFileException(
raise web_exceptions.WikifyWithoutDataFileException(
"Upload data file before wikifying a region")
sheet = project.current_file.current_sheet

Expand All @@ -257,7 +257,8 @@ def wikify_region(pid):
else:
data['problemCells'] = False

return data, 200
return data, 200
return {}, 404


@app.route('/api/yaml/<pid>', methods=['POST'])
Expand All @@ -284,7 +285,7 @@ def upload_yaml(pid):
response['yamlRegions'] = highlight_region(sheet, yf, project)
else:
response['yamlRegions'] = None
raise web_exception.YAMLEvaluatedWithoutDataFileException(
raise web_exceptions.YAMLEvaluatedWithoutDataFileException(
"Upload data file before applying YAML.")

return response, 200
Expand All @@ -303,7 +304,7 @@ def get_cell_statement(pid, col, row):
sheet = project.current_file.current_sheet
yaml_file = sheet.yaml_file
if not yaml_file:
raise web_exception.CellResolutionWithoutYAMLFileException(
raise web_exceptions.CellResolutionWithoutYAMLFileException(
"Upload YAML file before resolving cell.")
data = get_cell(sheet, yaml_file, project, col, row)
return data, 200
Expand All @@ -320,7 +321,7 @@ def downloader(pid, filetype):
sheet = project.current_file.current_sheet
yaml_file = sheet.yaml_file
if not yaml_file: # the frontend disables this, this is just another layer of checking
raise web_exception.CellResolutionWithoutYAMLFileException(
raise web_exceptions.CellResolutionWithoutYAMLFileException(
"Cannot download report without uploading YAML file first")
response = download(sheet, yaml_file, project, filetype, project.name)
return response, 200
Expand Down Expand Up @@ -357,7 +358,7 @@ def rename_project(pid):
}
ptitle = request.form["ptitle"]
project = get_project(pid)
project.title = ptitle
project.name = ptitle
project.modify()
data['projects'] = get_project_details()
return data, 200
Expand Down
Loading

0 comments on commit 35e82f1

Please sign in to comment.