Skip to content

Commit 1abe643

Browse files
committed
change icon-links and remove unimportant
1 parent 1d9ec9e commit 1abe643

File tree

1 file changed

+5
-24
lines changed

1 file changed

+5
-24
lines changed

btc_info.py

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,7 @@ def update_url(self):
4343
"https://mempool.space/api/mempool"
4444
)
4545

46-
def get_blockchair_data(self):
47-
url = "https://api.blockchair.com/bitcoin/stats"
48-
try:
49-
data = requests.get(url).json()
50-
suggested_fee_per_byte = data["data"]["suggested_transaction_fee_per_byte_sat"]
51-
return suggested_fee_per_byte
52-
except requests.RequestException as req_exc:
53-
print(f"Error retrieving data from Blockchair: {req_exc}")
54-
except KeyError as key_error:
55-
print(f"Error extracting data from Blockchair: {key_error}")
56-
except json.JSONDecodeError as json_error:
57-
print(f"Error decoding JSON data from Blockchair: {json_error}")
58-
except Exception as e:
59-
print(f"General error retrieving data from Blockchair: {e}")
60-
61-
return None
46+
6247

6348
def add_commas(self, number):
6449
"""Fügt Tausendertrennzeichen zu Zahlen hinzu (für bessere Lesbarkeit)."""
@@ -84,8 +69,6 @@ def get_bitcoin_price(self):
8469
if not response:
8570
return "Fehler beim Abrufen von Daten von einer der APIs."
8671

87-
# Füge den Aufruf für Blockchair Daten hinzu
88-
suggested_fee_per_byte = self.get_blockchair_data()
8972

9073
# Verarbeiten Sie die erhaltenen Daten
9174
block = json.loads(responses[1])
@@ -98,7 +81,6 @@ def get_bitcoin_price(self):
9881
hour_fee = fees_data['hourFee']
9982
half_hour_fee = fees_data['halfHourFee']
10083
fastest_fee = fees_data['fastestFee']
101-
10284
price_str = price_data['data']['amount']
10385
price = float(price_str.replace(',', ''))
10486

@@ -114,7 +96,6 @@ def get_bitcoin_price(self):
11496
output += f"Low Fee :{self.add_fees(hour_fee)} sat\n"
11597
output += f"Medium Fee :{self.add_fees(half_hour_fee)} sat\n"
11698
output += f"High Fee :{self.add_fees(fastest_fee)} sat\n\n"
117-
output += f"Suggested Fee :{self.add_fees(suggested_fee_per_byte)} sat\n\n"
11899
output += f"Block Height :{self.add_commas(int(block))}\n"
119100
output += f"Hashrate (PH) :{self.add_commas(hashrate_ehs)}\n"
120101
output += f"Unconfirmed :{self.add_commas(utx)}"
@@ -158,7 +139,7 @@ def __init__(self, callback):
158139
self.currency_menu.append(item)
159140

160141
self.currency_menu_item = Gtk.ImageMenuItem.new_with_label("")
161-
self.currency_menu_item.set_image(Gtk.Image.new_from_icon_name("globe", Gtk.IconSize.MENU))
142+
self.currency_menu_item.set_image(Gtk.Image.new_from_icon_name("mark-location-symbolic", Gtk.IconSize.MENU))
162143
self.currency_menu_item.set_submenu(self.currency_menu)
163144

164145

@@ -190,7 +171,7 @@ def __init__(self, callback):
190171

191172
self.interval_menu_item = Gtk.ImageMenuItem.new_with_label("")
192173
self.interval_menu_item.set_image(Gtk.Image.new_from_icon_name(
193-
"chronometer", Gtk.IconSize.MENU
174+
"document-open-recent-symbolic", Gtk.IconSize.MENU
194175
))
195176
self.interval_menu_item.set_submenu(self.interval_menu)
196177

@@ -209,7 +190,7 @@ def create_help_menu(self):
209190

210191
help_menu_item = Gtk.ImageMenuItem.new_with_label("")
211192
help_menu_item.set_image(Gtk.Image.new_from_icon_name(
212-
"help-about", Gtk.IconSize.MENU
193+
"help-about-symbolic", Gtk.IconSize.MENU
213194
))
214195
help_menu_item.set_submenu(help_menu)
215196

@@ -350,7 +331,7 @@ def setup_refresh_button(self):
350331
refresh_menuitem = Gtk.MenuItem()
351332
refresh_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=4)
352333
refresh_box.pack_start(Gtk.Image.new_from_icon_name(
353-
"reload", Gtk.IconSize.MENU), False, False, 0
334+
"view-refresh-symbolic", Gtk.IconSize.MENU), False, False, 0
354335
)
355336
refresh_box.pack_start(Gtk.Label(label=""), False, False, 0)
356337
refresh_menuitem.add(refresh_box)

0 commit comments

Comments
 (0)