Comments (3)
Currently the 20 second loop roughly does this:
- Calculate the sunrise and sunset times for the current time to determine it is day or night.
- Get the color scheme and theme that belong to that day part (day or night) from SunCycle settings.
- Transform these filenames to be either in ST2 or ST3 format.
- Match these filenames to what is stored in global sublime settings (your current color scheme/theme).
- If they don't match, change them and save global sublime settings.
So, a lot of overhead.
This loop should indeed only detect day part change (day -> night, night -> day).
But that means more caching (in memory).
You will need to cache the sunset/sunrise calculations. But they are subject to changes in:
- coordinates (SunCycle settings file change or IP change)
- timezone (coordinates change, but also to DST change!)
If you can accomplish that, you can indeed leave the current color scheme/theme untouched until the next day part change (as you won't use the current color scheme/theme to derive the current day part).
from sublime-suncycle.
Could we do this in a new file/class structure? See #7.
I have no idea how unit testing works in Python, but with the differences between ST2 and ST3 that sounds more useful than ever. Travis CI can then run tests on both Python versions.
from sublime-suncycle.
Yes, I was looking for unit tests when I started to develop but couldn't find any. It would be awesome to have that into the project. Saves a lot of headaches :-)
from sublime-suncycle.
Related Issues (10)
- A bit confused about why this config isn't working... HOT 3
- Theme stays on day setting, potential IP issue. HOT 2
- Error loading colour scheme, happens as soon as the package is installed HOT 3
- not working in ST3 HOT 8
- cache timezone & ip-to-coordinates lookup results HOT 3
- IP address to coordinates lookup
- split up classes HOT 1
- gracefully fail on missing connection
- Google Maps lookup fails on Linux versions of ST
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sublime-suncycle.