allista / WakatimeBlender

This is a plugin for the Blender that sends statistics to the Wakatime time tracking service.
MIT License
27 stars 16 forks source link

some config file and other changes #2

Closed alanhamlett closed 8 years ago

alanhamlett commented 8 years ago
allista commented 8 years ago

Understood. I'll be away for several hours. Then I'll make appropriate changes to use the correct config file. Also, Sublime's plugin attempts to use yet another config location on Windows; shouldn't I do the same here? That was the primary reason why I chose to use plugin directory to store the config: so it would work on Windows as well.

alanhamlett commented 8 years ago

The Sublime plugin looks for the api key in ~/.wakatime.cfg and uses that as the default when prompting the user, but it uses the WakaTime.sublime-settings file from then on:

https://github.com/wakatime/sublime-wakatime/blob/master/WakaTime.py#L185

It uses the same file locations on Windows, Linux, and OS X because ~ is replaced with the user's home folder on the respective OS.

The only reason it uses the WakaTime.sublime-settings is because Sublime users are used to that convention and they look there for plugin settings. Since Blender doesn't have a well known convention like Sublime, we should use the common config file in the user's home folder.

Hope this helps. The last commit (e03ec7a80983c2ac1aed24b6afb5798eebde31de) should be good to merge but let me know if I should update anything in this PR.

allista commented 8 years ago

I will close this PR as I have manually applied the crucial change -- the use of the .wakatime.cfg file; but left alone the code restyling and refactoring. Instead I've found some minor bugs and figured out how to show the API Key dialog automatically on plugin start, or if the key is incorrect (I interpret the error 104 as the indication of that). I also updated the README accordingly.