open data folder from other directory, relate #106#181
Conversation
| elif type(data) == list and meta ==None and results ==None: | ||
| # if files are uploaded from wiggum-app | ||
| filename = '' | ||
| for file in data: | ||
| filename = file.filename | ||
| if ('/' in filename): | ||
| # if file name contains '/', Wiggum runs in Windows system | ||
| # remove the directory and only use the file name | ||
| filename = filename.split('/')[1] | ||
|
|
||
| if filename == data_csv: | ||
| data = file | ||
| elif filename == meta_csv: | ||
| meta = file | ||
| elif filename == result_csv: | ||
| results = file | ||
| elif filename == trend_json: | ||
| trends = file |
There was a problem hiding this comment.
is there no way to do this on the app side? like have the upload step put the files in a temp directory and then pass that to the initialize function?
There was a problem hiding this comment.
That will be more complicated.
There was a problem hiding this comment.
but I think better and possibly more on the path to allowing the user to download and save their results where they would like.
| with open(trends, 'r') as tjson: | ||
| trend_content = json.load(tjson) | ||
| elif type(trends) is FileStorage: | ||
| trend_content = json.load(trends) |
There was a problem hiding this comment.
why did you not use the safe with open format for this?
There was a problem hiding this comment.
Because the trends are already a FileStorage type, can't use open function.
| DEBUG=True | ||
| SECRET_KEY="4zNNYuWQjNCHoCFrhEKqUDLB1Z5xGl2W/Yliy63tD8po9qOQ0YjPum5OaSDnPvNvB1eLzany73EHJfFlYEov1g==" | ||
| SERVER_NAME="127.0.0.1:5000" | ||
| SAVE_FOLDER="data/" No newline at end of file |
There was a problem hiding this comment.
does this / resolve correctly on windows and mac?
There was a problem hiding this comment.
No, that is moving the hard code directory from controller.py to config.py.
There was a problem hiding this comment.
then #95 is not closed, becase you are making the config as a place the user should do some setup, so:
- make it a template and provide instructions for the user
- make sure that where you use this you use something that safely puts the
/or\as appropriate per os (egos.path.join
|
@Shine226 you should resovle the conflicts in this branch and get it ready to merge |
|
@brownsarahm I don't remember what is the conflicts in this branch. |
|
When I click the save button I get the following traceback on the and then the same as a browser side error on clicking download. Also minor formatting issue, when the window is small, |
No description provided.