Skip to content
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

Use appdirs module for platform specific best practices regarding file locations #36

Merged
merged 3 commits into from
Sep 19, 2016

Conversation

dtext
Copy link
Member

@dtext dtext commented Sep 12, 2016

Should be quite self explanatory. Fixes #20.

If there is anything missing, please let me know. If not, I think we can merge this rather quickly.

Uses the new module 'tools.dirs' to retrieve absolute paths of all
directories the application can write to. The variables of these folders
are quite self-explanatory.

Usage: path = dirs.data + "/myfile.txt"
@dtext dtext added this to the Version 0.2 milestone Sep 12, 2016
@denniseffing
Copy link
Member

Executing the dirs.py results in the following output on Windows 10 x64 Build 14393:

Log dir:      C:\Users\Dennis\AppData\Local\Logs
Config dir:   C:\Users\Dennis\AppData\Local
Cache dir:    C:\Users\Dennis\AppData\Local
Userdata dir: C:\Users\Dennis\AppData\Local

For some reason, appdirs.appname and appdirs.appauthor are not included in any filepath.

os.chdir(project_home)

_setup_logging()
_setup_logging(file=False)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logging to file should be on by default or atleast be configurable (and the config option should be turned on by default). This would make it easier to report crash reports for users who only use the gui option (and can not see the stracktrace in the commandline).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, however I didn't make any changes to the default here. This is the behavior we had before, and that is a seperate issue.

@dtext
Copy link
Member Author

dtext commented Sep 19, 2016

For some reason, appdirs.appname and appdirs.appauthor are not included in any filepath.

That is because I was doing it wrong. Should be fixed now though.

@dtext dtext merged commit d65ca53 into master Sep 19, 2016
dtext added a commit that referenced this pull request Sep 19, 2016
Use appdirs module for platform specific best practices regarding file locations
@dtext dtext mentioned this pull request Sep 19, 2016
@florianluediger florianluediger deleted the fix/directories branch April 20, 2017 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants