I haven't used the plugin because I have written my own, but I want to encourage someone to release an officially supported one (I have too many plugins right now as is and am not looking to release another one right now).
I did want to give some suggestions that may or may not help you. Feel free to disregard any of my suggestions .
- I can't really see people needing per second resolution for theme changing. Probably hour and minute is enough.
- Also, I think it would be nice if you could just allow the time to be configured in a simple manner like this:
"theme": "Packages/Color Scheme - Default/Monokai Bright.tmTheme",
"theme": "Packages/User/Color Scheme/Tomorrow-Night-Eighties.tmTheme",
Even though the theme file is not defining seconds, it is easy to convert this to a time object with in python, and even convert it to just seconds (which is what I do as well). Here is an example:
[pre=#2D2D2D] 1 from datetime import datetime, timedelta
12 def total_seconds(t):
13 return (t.microseconds + (t.seconds + t.days * 24 * 3600) * 10 ** 6) / 10 ** 6
22 def translate_time(t):
23 # Translate a string from format "H:M" into seconds
24 tm = time.strptime(t + ":00", '%H:%M:%S')
25 return total_seconds(timedelta(hours=tm.tm_hour, minutes=tm.tm_min, seconds=tm.tm_sec))[/pre]
- Also, I see you are having a settings file reload issue. This is not a bug in ST2. There is a simple solution provided in the API. You can use add_on_change to define an function to run when the settings file changes. You just give it a pointer to the function or a lambda.
[pre=#2D2D2D] 8 # Init the settings object
9 SETTINGS = sublime.load_settings('ThemeScheduler.sublime-settings')
153 # Reset the theme scheduler object if the settings file has changed
154 SETTINGS.add_on_change('reload', ThemeScheduler.init)[/pre]
Maybe these suggestions will help, anyways, good luck with your plugin.