Git Product home page Git Product logo

caffeine's Introduction

Use this module to prevent your Mac OS X system from sleeping while executing
a long-running python script.

Quick Start
-----------

Just `import caffeine`.  That's it!  You Mac OS X system will not sleep as 
long as the interpreter remains alive.  No need to run any other commands.
But if you want slightly finer controls, a few functions are available.

`caffeine.on(display=False)`

Use the `on` function to create a power assertion.  Set display=True to also
keep your display from sleeping. The default of display=False will allow
your display to sleep but will keep your system awake so processing can
continue.  If a power assertion is active, calling `on()` with display set
to the other value will change the assertion.  Calling `on()` with the same 
value is a harmless no-op.

`caffeine.off()`

Use the `off` function to release any power assertion before your interpreter
exits.

`caffeine.verify()`

Calls `pmset -g assertions` to verify what power assertions are active.

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.