-
Notifications
You must be signed in to change notification settings - Fork 1
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
Added static file folder #41
Conversation
Sort of - But either way, you're right that we shouldn't require people to type that out each time. Let's add a |
@jaidhyani I added |
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.
This looks good to me. Minor follow-up tasks (edit: added as issue #42). These aren't blockers, code can be merged
- We shouldn't necessarily force the output into the
STATIC_ASSETS_DIR
. Especially if the user specified a full path or a partial path with directory references, e.g.:
/home/me/Desktop/tokens.csv
subdir/tokens.csv
In the first case, the user has specified a full path, and we should use it. In the second, we can assume they're referring to a relative path from the current working directory, and we should output there.
We can get that behavior by calling os.path.split
on the path arg, which returns a (head,tail) tuple. If head
is empty, the user just passed a filename and we can probably throw it in the default output dir. If head isn't empty, we can call os.path.expandvars
on the path arg to get the path we should output to.
-
We should also print the full path before writing, just to be explicit with the user about what file is being created and they know exactly where to look for it when it's done.
-
We should print out something when the export has completed successfully.
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.
This branch is behind main branch, so a rebase is necessary
@joshuawe I rebased, not sure if I did that correctly. Does it look ok? |
0ee3075
to
b45d63f
Compare
b45d63f
to
df48f25
Compare
Is there a way to default to using the
delphi/static
folder instead of thedelphi
folder from thefrom importlibs.resources import files
@jaidhyani ? In here I just join the path withstatic
every time.