Giter VIP home page Giter VIP logo

power's Introduction

Power

Power is a module for python (currently supports only 2.7) that provides short, obvious and generic interface to power capabilities of the the system. It's crossplatform and supports Mac OS X, Windows and Linux. If your target system is missed, please creat new issue.

Since accessing power information requires acccess to system functions, it's vital to be fault tolerant. If Power is unable to access data it needs, it returns some generic value and logs error via warnings module. Using warnings module makes it easier for you to turn generic values into exceptions to suite your needs.

Current feature-set allows you to get the following information about power:

  • Power source type

  • Battery warning level

  • Time remaining estimate

Since the system may have more than one battery, Power should take that into account and calculate some avergae. Current implementation just trusts system functions where possible (Mac OS X, Windows) or uses some naive approach (Linux). You're encouraged to review code and ask questions (by creating issues) if you feel it may affect behavior of your app.

Power also includes generic interface to create observers for changes in power configuration. E.g. when you attach/detach battery, connect system to power wall or battery warning level is changed.
This feature is only supported in Mac OS X. It's also possible to add support for Windows 8 on demand (create an issue). Research is needed to add this feature to other systems.
If your application targets multiple systems, it probably would be easier to just use timer. Note to set timer to some reasonable long value like 5min, because Power should be efficient in terms of power (obviously).

power's People

Contributors

kentzo avatar

Watchers

 avatar  avatar

Forkers

linecomparison

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.