Merge pull request #175 from tyjak/master

minor improvment
This commit is contained in:
enkore 2015-03-21 15:55:03 +01:00
commit eae741fd6e
3 changed files with 7 additions and 2 deletions

View File

@ -28,7 +28,7 @@ class Backlight(File):
"max_brightness": (int, "max_brightness"), "max_brightness": (int, "max_brightness"),
} }
transforms = { transforms = {
"percentage": lambda cdict: (cdict["brightness"] / cdict["max_brightness"]) * 100, "percentage": lambda cdict: round((cdict["brightness"] / cdict["max_brightness"]) * 100),
} }
def init(self): def init(self):

View File

@ -28,6 +28,7 @@ class Bitcoin(IntervalModule):
* {last_tx_value} * {last_tx_value}
* {balance_btc} * {balance_btc}
* {balance_fiat} * {balance_fiat}
* {symbol}
""" """
@ -42,10 +43,12 @@ class Bitcoin(IntervalModule):
("leftclick", "URL to visit or command to run on left click"), ("leftclick", "URL to visit or command to run on left click"),
("rightclick", "URL to visit or command to run on right click"), ("rightclick", "URL to visit or command to run on right click"),
("interval", "Update interval."), ("interval", "Update interval."),
("symbol", "Symbol for bitcoin sign"),
"status" "status"
) )
format = "฿ {status}{last_price}" format = "{symbol} {status}{last_price}"
currency = "USD" currency = "USD"
symbol = "฿"
wallet_addresses = "" wallet_addresses = ""
color = "#FFFFFF" color = "#FFFFFF"
colorize = False colorize = False
@ -79,6 +82,7 @@ class Bitcoin(IntervalModule):
def run(self): def run(self):
price_data = self._fetch_price_data() price_data = self._fetch_price_data()
fdict = { fdict = {
"symbol": self.symbol,
"daily_average": price_data["24h_avg"], "daily_average": price_data["24h_avg"],
"ask_price": price_data["ask"], "ask_price": price_data["ask"],
"bid_price": price_data["bid"], "bid_price": price_data["bid"],

View File

@ -156,6 +156,7 @@ class NetworkInfo():
info["quality"] = quality["quality"] info["quality"] = quality["quality"]
info["quality"] *= 100 info["quality"] *= 100
info["quality_bar"] = make_bar(info["quality"]) info["quality_bar"] = make_bar(info["quality"])
info["quality"] = round(info["quality"])
return info return info