Power
Power copied to clipboard
Requested pull request..
Here you go - hey, I made the changes to setup.py that you requested.....
Updated..
@oskarirauta Why did you need to remove implementation for other platforms?
If you want to exclude them for packaging, it should be possible by modifying setup.py to read some external variable and exclude inclusion of unneeded files. So there won't be any need for multiple forks.
I excluded them because I worked only with Linux version, you see, I changed it fundamentally, it is no longer "compatible" with previous releases since I "renamed" one of key functions. And even return no longer is compatible. This is why I made a version bump.
Second, the reason for excluding: I only worked with Linux, since that was only platform I at the moment can test (although, I do have OS X platform and Window 10 "available" but at the moment, they are utilized in a way that I'd better not to tamper with them). To tell you the truth - I didn't even look at them, since I can't provide any testing. Tell you what, if you want to make an "official" v1.5 based on my work; I am more than happy, since I provided this for another project (adeskbar update 0.5.1 -> 0.5.2, also on my repository, battery applet uses this module).
But unfortunately I am not able to provide similar updates for another platforms, so I cannot fulfill that. If other platforms receive same information, you could update them and use my math, or even better, see if you can make it even shorter code, since it's no doubt, that you are far more better with Python than me, after all, this is 3rd time in my whole life that I use python (ofcourse, I've used it more, but now we talk about creating or changing something)..
So I kinda excluded them because I felt there was no choice since I cannot provide the same for other platforms.
Edit: Err.. when I told I have windows 10 and OS X available, they cannot be used for this, since they don't utilize a battery.
OS X(darwin) version holds these keys that possibly can be used: status: kIOPSACPowerValue kIOPSPowerSourceStateKey kIOPSIsPresentKey kIOPSIsChargedKey kIOPSIsChargingKey kIOPSIsFinishingChargeKey time_remaining: kIOPSTimeToEmptyKey kIOPSTimeToFullChargeKey capacity: kIOPSCurrentCapacityKey kIOPSDesignCapacityKey
But I have no idea how these work and what they contain so cannot say how to use the information. I didn't find anything similar for freebsd or win32 from source.
@oskarirauta It should be possible to extend version for linux with functions you need while preserving common interface and logic this package has and making it compatible with modern version of linux.
If you need some more methods for linux only, just add them to linux.py
I'm willing to merge this PR if anyone can make it so it won't break implementations for other platforms.
It's more the situation that the module won't work in the future for anyone...