Giter Club home page Giter Club logo

Comments (3)

smhg avatar smhg commented on July 28, 2024

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.

smhg avatar smhg commented on July 28, 2024

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.

stijnster avatar stijnster commented on July 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.