-
Notifications
You must be signed in to change notification settings - Fork 3
open data folder from other directory, relate #106 #181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That will be more complicated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did you not use the safe with open format for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the trends are already a FileStorage type, can't use open function.
wiggum_app/config.py
Outdated
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this / resolve correctly on windows and mac?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, that is moving the hard code directory from controller.py to config.py.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.