Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated copyright year on MIT license in some .py files #311

Merged
merged 1 commit into from
Jan 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion firmware/font/bdftohex.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion firmware/font/font_icons/pbm2bdf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion firmware/font/hexfill.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion firmware/font/hexmerge.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion firmware/font/hextokff.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion firmware/scripts/krux_colors.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion firmware/scripts/minify.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions i18n/i18n.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -187,7 +187,7 @@ def bake_translations():
translations.write(
"""# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/boot.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/krux/baseconv.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/krux/buttons.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/krux/camera.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/krux/context.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/krux/display.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -308,7 +308,7 @@
if not max_lines:
max_lines = self.total_lines
if len(lines) > max_lines:
lines = lines[: max_lines - 1] + ["..."]

Check warning on line 311 in src/krux/display.py

View check run for this annotation

Codecov / codecov/patch

src/krux/display.py#L311

Added line #L311 was not covered by tests
for i, line in enumerate(lines):
if len(line) > 0:
offset_x = self._obtain_hcentered_offset(line)
Expand Down
2 changes: 1 addition & 1 deletion src/krux/encryption.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/krux/firmware.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/krux/format.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/krux/i2c.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/krux/input.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -183,7 +183,7 @@
"""
start_time = time.ticks_ms()
if self.flushed_flag:
self.debounce_time = 0

Check warning on line 186 in src/krux/input.py

View check run for this annotation

Codecov / codecov/patch

src/krux/input.py#L186

Added line #L186 was not covered by tests
while time.ticks_ms() < self.debounce_time + DEBOUNCE:
self.flush_events()
if not self.flushed_flag or block:
Expand Down
2 changes: 1 addition & 1 deletion src/krux/key.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/krux/krux_settings.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/krux/light.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/krux/metadata.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/krux/pages/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -548,10 +548,10 @@

def screensaver(self):
"""Loads and starts screensaver"""
from .screensaver import ScreenSaver

Check warning on line 551 in src/krux/pages/__init__.py

View check run for this annotation

Codecov / codecov/patch

src/krux/pages/__init__.py#L551

Added line #L551 was not covered by tests

screen_saver = ScreenSaver(self.ctx)
screen_saver.start()

Check warning on line 554 in src/krux/pages/__init__.py

View check run for this annotation

Codecov / codecov/patch

src/krux/pages/__init__.py#L553-L554

Added lines #L553 - L554 were not covered by tests

def run_loop(self, start_from_index=None):
"""Runs the menu loop until one of the menu items returns either a MENU_EXIT
Expand Down Expand Up @@ -621,9 +621,9 @@
self.menu_view.move_forward()
elif btn == SWIPE_DOWN:
self.menu_view.move_backward()
elif btn is None and not self.menu_offset:

Check warning on line 624 in src/krux/pages/__init__.py

View check run for this annotation

Codecov / codecov/patch

src/krux/pages/__init__.py#L624

Added line #L624 was not covered by tests
# Activates screensaver if there's no info_box(other things draw on the screen)
self.screensaver()

Check warning on line 626 in src/krux/pages/__init__.py

View check run for this annotation

Codecov / codecov/patch

src/krux/pages/__init__.py#L626

Added line #L626 was not covered by tests

def _clicked_item(self, selected_item_index):
if self.menu_view[selected_item_index][1] is None:
Expand Down
2 changes: 1 addition & 1 deletion src/krux/pages/addresses.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/krux/pages/capture_entropy.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -45,12 +45,12 @@
board_type = board.config["type"]

if board_type == "m5stickv":
img.lens_corr(strength=1.0, zoom=0.56)
lcd.display(img, oft=(0, 0), roi=(68, 52, 185, 135))

Check warning on line 49 in src/krux/pages/capture_entropy.py

View check run for this annotation

Codecov / codecov/patch

src/krux/pages/capture_entropy.py#L48-L49

Added lines #L48 - L49 were not covered by tests
elif board_type.startswith("amigo"):
lcd.display(img, oft=(40, 40))
else:
lcd.display(img, oft=(0, 0), roi=(0, 0, 304, 240))

Check warning on line 53 in src/krux/pages/capture_entropy.py

View check run for this annotation

Codecov / codecov/patch

src/krux/pages/capture_entropy.py#L53

Added line #L53 was not covered by tests

def _callback(self):
"""
Expand All @@ -66,7 +66,7 @@
def rms_value(self, data):
"""Calculates the RMS value of a list of numbers"""
if not data:
return 0

Check warning on line 69 in src/krux/pages/capture_entropy.py

View check run for this annotation

Codecov / codecov/patch

src/krux/pages/capture_entropy.py#L69

Added line #L69 was not covered by tests
square_sum = sum(x**2 for x in data)
mean_square = square_sum / len(data)
rms = math.sqrt(mean_square)
Expand Down
2 changes: 1 addition & 1 deletion src/krux/pages/encryption_ui.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -140,8 +140,8 @@
camera_entropy = CameraEntropy(self.ctx)
entropy = camera_entropy.capture(show_entropy_details=False)
if entropy is None:
self.flash_text(t("Mnemonic was not encrypted"))
return

Check warning on line 144 in src/krux/pages/encryption_ui.py

View check run for this annotation

Codecov / codecov/patch

src/krux/pages/encryption_ui.py#L143-L144

Added lines #L143 - L144 were not covered by tests
i_vector = entropy[:AES_BLOCK_SIZE]
self.ctx.display.clear()
mnemonic_storage = MnemonicStorage()
Expand Down Expand Up @@ -201,8 +201,8 @@
camera_entropy = CameraEntropy(self.ctx)
entropy = camera_entropy.capture(show_entropy_details=False)
if entropy is None:
self.flash_text(t("Mnemonic was not encrypted"))
return

Check warning on line 205 in src/krux/pages/encryption_ui.py

View check run for this annotation

Codecov / codecov/patch

src/krux/pages/encryption_ui.py#L204-L205

Added lines #L204 - L205 were not covered by tests
i_vector = entropy[:AES_BLOCK_SIZE]
mnemonic_id = None
self.ctx.display.clear()
Expand Down
2 changes: 1 addition & 1 deletion src/krux/pages/files_manager.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/krux/pages/files_operations.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/krux/pages/home.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/krux/pages/keypads.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/krux/pages/login.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/krux/pages/mnemonic_view.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/krux/pages/new_mnemonic/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/krux/pages/new_mnemonic/dice_rolls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/krux/pages/print_page.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/krux/pages/pub_key_view.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/krux/pages/qr_view.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/krux/pages/screensaver.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/krux/pages/settings_page.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -72,12 +72,12 @@
location = Settings().persist.location
if location == SD_PATH:
if self.has_sd_card():
self.flash_text(

Check warning on line 75 in src/krux/pages/settings_page.py

View check run for this annotation

Codecov / codecov/patch

src/krux/pages/settings_page.py#L75

Added line #L75 was not covered by tests
t("Your changes will be kept on the SD card."),
duration=SD_MSG_TIME,
)
else:
self.flash_text(

Check warning on line 80 in src/krux/pages/settings_page.py

View check run for this annotation

Codecov / codecov/patch

src/krux/pages/settings_page.py#L80

Added line #L80 was not covered by tests
t("SD card not detected.")
+ "\n\n"
+ t("Changes will last until shutdown."),
Expand All @@ -87,7 +87,7 @@
try:
# Check for flash
os.listdir("/" + FLASH_PATH + "/.")
self.flash_text(

Check warning on line 90 in src/krux/pages/settings_page.py

View check run for this annotation

Codecov / codecov/patch

src/krux/pages/settings_page.py#L90

Added line #L90 was not covered by tests
t("Your changes will be kept on device flash storage."),
duration=SD_MSG_TIME,
)
Expand Down Expand Up @@ -171,12 +171,12 @@
# Check for SD hot-plug
with SDHandler():
if store.save_settings():
self.flash_text(

Check warning on line 174 in src/krux/pages/settings_page.py

View check run for this annotation

Codecov / codecov/patch

src/krux/pages/settings_page.py#L174

Added line #L174 was not covered by tests
t("Changes persisted to SD card!"),
duration=SD_MSG_TIME,
)
except OSError:
self.flash_text(

Check warning on line 179 in src/krux/pages/settings_page.py

View check run for this annotation

Codecov / codecov/patch

src/krux/pages/settings_page.py#L179

Added line #L179 was not covered by tests
t("SD card not detected.")
+ "\n\n"
+ t("Changes will last until shutdown."),
Expand All @@ -186,12 +186,12 @@
self.ctx.display.clear()
try:
if store.save_settings():
self.flash_text(

Check warning on line 189 in src/krux/pages/settings_page.py

View check run for this annotation

Codecov / codecov/patch

src/krux/pages/settings_page.py#L189

Added line #L189 was not covered by tests
t("Changes persisted to Flash!"),
duration=SD_MSG_TIME,
)
except:
self.flash_text(

Check warning on line 194 in src/krux/pages/settings_page.py

View check run for this annotation

Codecov / codecov/patch

src/krux/pages/settings_page.py#L194

Added line #L194 was not covered by tests
t("Unexpected error saving to Flash.")
+ "\n\n"
+ t("Changes will last until shutdown."),
Expand Down
2 changes: 1 addition & 1 deletion src/krux/pages/sign_message_ui.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/krux/pages/stack_1248.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/krux/pages/tools.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -116,29 +116,29 @@
def erase_spiffs(self):
"""Erase all SPIFFS, removing all saved configs and mnemonics"""

import flash
from ..firmware import FLASH_SIZE, SPIFFS_ADDR, ERASE_BLOCK_SIZE

Check warning on line 120 in src/krux/pages/tools.py

View check run for this annotation

Codecov / codecov/patch

src/krux/pages/tools.py#L119-L120

Added lines #L119 - L120 were not covered by tests

empty_buf = b"\xff" * ERASE_BLOCK_SIZE
for address in range(SPIFFS_ADDR, FLASH_SIZE, ERASE_BLOCK_SIZE):
if flash.read(address, ERASE_BLOCK_SIZE) == empty_buf:
continue
flash.erase(address, ERASE_BLOCK_SIZE)

Check warning on line 126 in src/krux/pages/tools.py

View check run for this annotation

Codecov / codecov/patch

src/krux/pages/tools.py#L122-L126

Added lines #L122 - L126 were not covered by tests

def wipe_device(self):
"""Fully formats SPIFFS memory"""
self.ctx.display.clear()
if self.prompt(

Check warning on line 131 in src/krux/pages/tools.py

View check run for this annotation

Codecov / codecov/patch

src/krux/pages/tools.py#L130-L131

Added lines #L130 - L131 were not covered by tests
t(
"Permanently remove all stored encrypted mnemonics and settings from flash?"
),
self.ctx.display.height() // 2,
):
self.ctx.display.clear()
self.ctx.display.draw_centered_text(t("Wiping Device.."))
self.erase_spiffs()

Check warning on line 139 in src/krux/pages/tools.py

View check run for this annotation

Codecov / codecov/patch

src/krux/pages/tools.py#L137-L139

Added lines #L137 - L139 were not covered by tests
# Reboot so default settings take place and SPIFFS is formatted.
self.ctx.power_manager.reboot()

Check warning on line 141 in src/krux/pages/tools.py

View check run for this annotation

Codecov / codecov/patch

src/krux/pages/tools.py#L141

Added line #L141 was not covered by tests

def print_test(self):
"""Handler for the 'Print Test QR' menu item"""
Expand Down
2 changes: 1 addition & 1 deletion src/krux/pages/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/krux/power.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -64,16 +64,16 @@
charge = max(0, ((mv - MIN_BATTERY_MV) / (MAX_BATTERY_MV - MIN_BATTERY_MV)))

# Dirty trick to avoid showing 100% when battery is not fully charged
if self.pmu.charging():
charge -= 0.35 # compensates for the batt voltage raise when charging

Check warning on line 68 in src/krux/power.py

View check run for this annotation

Codecov / codecov/patch

src/krux/power.py#L67-L68

Added lines #L67 - L68 were not covered by tests
# limits in 90% when still charging to let user know it's not fully charged
charge = min(0.9, charge)

Check warning on line 70 in src/krux/power.py

View check run for this annotation

Codecov / codecov/patch

src/krux/power.py#L70

Added line #L70 was not covered by tests

return min(1, charge)

def usb_connected(self):
"""Returns True if USB connected, False otherwise"""
return self.pmu.usb_connected()

Check warning on line 76 in src/krux/power.py

View check run for this annotation

Codecov / codecov/patch

src/krux/power.py#L76

Added line #L76 was not covered by tests

def set_screen_brightness(self, value):
"""Sets the screen brightness by modifying the backlight voltage"""
Expand Down
2 changes: 1 addition & 1 deletion src/krux/printers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/krux/printers/cnc.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion src/krux/printers/thermal.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

# Copyright (c) 2021-2023 Krux contributors
# Copyright (c) 2021-2024 Krux contributors

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading
Loading