Merge pull request #193 from fredj/misc_cleanup
Miscellaneous code cleanup
This commit is contained in:
commit
38920a783a
5 changed files with 6 additions and 7 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
sudo: false
|
||||||
language: python
|
language: python
|
||||||
python:
|
python:
|
||||||
- "2.7"
|
- "2.7"
|
||||||
|
|
|
@ -71,7 +71,7 @@ class Config(bumblebee.store.Store):
|
||||||
self._args = parser.parse_args(args if args else [])
|
self._args = parser.parse_args(args if args else [])
|
||||||
|
|
||||||
if not self._args.debug:
|
if not self._args.debug:
|
||||||
logger = logging.getLogger().disabled = True
|
logging.getLogger().disabled = True
|
||||||
|
|
||||||
for param in self._args.parameters:
|
for param in self._args.parameters:
|
||||||
key, value = param.split("=")
|
key, value = param.split("=")
|
||||||
|
|
|
@ -20,7 +20,6 @@ Note: source and destination names right now must correspond to the names used b
|
||||||
import bumblebee.input
|
import bumblebee.input
|
||||||
import bumblebee.output
|
import bumblebee.output
|
||||||
import bumblebee.engine
|
import bumblebee.engine
|
||||||
import json
|
|
||||||
import time
|
import time
|
||||||
try:
|
try:
|
||||||
import requests
|
import requests
|
||||||
|
@ -59,9 +58,9 @@ class Module(bumblebee.engine.Module):
|
||||||
|
|
||||||
def update(self, widgets):
|
def update(self, widgets):
|
||||||
timestamp = int(time.time())
|
timestamp = int(time.time())
|
||||||
if self._nextcheck < int(time.time()):
|
if self._nextcheck < timestamp:
|
||||||
self._data = []
|
self._data = []
|
||||||
self._nextcheck = int(time.time()) + self._interval*60
|
self._nextcheck = timestamp + self._interval*60
|
||||||
for symbol in self._symbols:
|
for symbol in self._symbols:
|
||||||
url = API_URL.format(self._base, symbol)
|
url = API_URL.format(self._base, symbol)
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -83,9 +83,9 @@ class Module(bumblebee.engine.Module):
|
||||||
|
|
||||||
def update(self, widgets):
|
def update(self, widgets):
|
||||||
timestamp = int(time.time())
|
timestamp = int(time.time())
|
||||||
if self._nextcheck < int(time.time()):
|
if self._nextcheck < timestamp:
|
||||||
try:
|
try:
|
||||||
self._nextcheck = int(time.time()) + self._interval*60
|
self._nextcheck = timestamp + self._interval*60
|
||||||
weather_url = "http://api.openweathermap.org/data/2.5/weather?appid={}".format(self._apikey)
|
weather_url = "http://api.openweathermap.org/data/2.5/weather?appid={}".format(self._apikey)
|
||||||
weather_url = "{}&units={}".format(weather_url, self._unit)
|
weather_url = "{}&units={}".format(weather_url, self._unit)
|
||||||
if self._location == "auto":
|
if self._location == "auto":
|
||||||
|
|
|
@ -102,7 +102,6 @@ class I3BarOutput(object):
|
||||||
padding = self._theme.padding(widget)
|
padding = self._theme.padding(widget)
|
||||||
prefix = self._theme.prefix(widget, padding)
|
prefix = self._theme.prefix(widget, padding)
|
||||||
suffix = self._theme.suffix(widget, padding)
|
suffix = self._theme.suffix(widget, padding)
|
||||||
minwidth = self._theme.minwidth(widget)
|
|
||||||
if prefix:
|
if prefix:
|
||||||
full_text = u"{}{}".format(prefix, full_text)
|
full_text = u"{}{}".format(prefix, full_text)
|
||||||
if suffix:
|
if suffix:
|
||||||
|
|
Loading…
Reference in a new issue