Skip to content

Commit

Permalink
Update paxo dependency for xdg support and quick fix for new Mac OS s…
Browse files Browse the repository at this point in the history
…ystems
  • Loading branch information
cwoebker committed Aug 28, 2018
1 parent 6865ee2 commit 7af86d0
Show file tree
Hide file tree
Showing 7 changed files with 196 additions and 17 deletions.
18 changes: 18 additions & 0 deletions Pipfile
@@ -0,0 +1,18 @@
[[source]]

url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"


[packages]

paxo = ">=0.2.1"
python-dateutil = "*"
python-crontab = "*"
tablib = "*"
requests = "*"


[dev-packages]

166 changes: 166 additions & 0 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -93,5 +93,5 @@ Also, follow or tweet [@cwoebker](https://twitter.com/cwoebker).

---

Copyright (c) 2012-2018, Cecil Woebker.
Copyright (c) 2012-2018, Cecil Wöbker.
License: BSD (see LICENSE for details)
14 changes: 7 additions & 7 deletions como/battery.py
Expand Up @@ -77,12 +77,13 @@ def get_battery():
battery['serial'] = subprocess.check_output(
'ioreg -w0 -l | grep BatterySerialNumber',
shell=True).translate(None, '\n "|').lstrip('BatterySerialNumber=')
battery['temp'] = int(subprocess.check_output(
'ioreg -w0 -l | grep Temperature',
shell=True).translate(None, '\n "|').lstrip('Temperature='))
battery['maxcap'] = int(bat[0].lstrip('MaxCapacity='))
battery['curcap'] = int(bat[1].lstrip('CurrentCapacity='))
legacy = bat[2].lstrip('LegacyBatteryInfo=')
# battery['temp'] = int(subprocess.check_output(
# 'ioreg -w0 -l | grep Temperature',
# shell=True).translate(None, '\n "|').lstrip('Temperature='))
battery['maxcap'] = int(bat[1].lstrip('MaxCapacity='))
battery['curcap'] = int(bat[2].lstrip('CurrentCapacity='))
legacy = bat[3].lstrip('LegacyBatteryInfo=')
battery['designcap'] = int(bat[4].lstrip('DesignCapacity='))
battery['cycles'] = int(
legacy.translate(
None, '{}=').split(',')[5].lstrip('CycleCount'))
Expand All @@ -94,7 +95,6 @@ def get_battery():
battery['voltage'] = int(
legacy.translate(
None, '{}=').split(',')[4].lstrip('Voltage'))
battery['designcap'] = int(bat[3].lstrip('DesignCapacity='))
elif is_lin:
battery['serial'] = subprocess.check_output(
"grep \"^serial number\" " +
Expand Down
2 changes: 1 addition & 1 deletion como/core.py
Expand Up @@ -258,7 +258,7 @@ def cmd_info(args):
puts("Mac model: %s" % subprocess.check_output(
"sysctl -n hw.model", shell=True).rstrip("\n"))
puts("Age of Computer: %s months" % get_age())
puts("Temperature: %s ℃" % (int(bat['temp']) / 100.))
# puts("Temperature: %s ℃" % (int(bat['temp']) / 100.))
if is_osx or is_win:
puts("Voltage: %s" % bat['voltage'])
puts("Amperage: %s" % bat['amperage'])
Expand Down
5 changes: 3 additions & 2 deletions como/settings.py
Expand Up @@ -5,7 +5,7 @@

import os

from paxo.util import DEBUG_MODE
from paxo.util import DEBUG_MODE, XDG_DATA_HOME

LOCATION_CODES = [
'1C', '2Z', '4H', '5K', '8H', '5D', '7J', 'CK', 'E', 'EE',
Expand All @@ -15,7 +15,8 @@

DEV_URL = 'http://127.0.0.1:5000'
REAL_URL = 'https://como.cwoebker.com'
COMO_BATTERY_FILE = os.path.expanduser('~/.como')

COMO_BATTERY_FILE = os.path.join(XDG_DATA_HOME, 'como/como')

if DEBUG_MODE:
SERVER_URL = DEV_URL
Expand Down
6 changes: 0 additions & 6 deletions reqs.txt

This file was deleted.

0 comments on commit 7af86d0

Please sign in to comment.