LoginSignup
0
0

SeedSigner OS Emulator

Posted at

趣旨

SeedSignerのHowTo動画を作るにあたって画面のスクショがあったほうがスムーズな編集ができるのでエミュレータを探して実践してみたので、忘れないために備忘録を残しておきます。

以下、Githubページです。

実践

まずはSeedSignerをダウンロードします。

git clone https://github.com/SeedSigner/seedsigner.git
cd seedsigner/src

次に専用のエミュレータをダウンロードします。

git clone http://github.com/enteropositivo/seedsigner-emulator.git
rsync -a seedsigner-emulator/seedsigner ./

仮想環境を用意します。

python3 -m venv myenv
source myenv/bin/activate

必要なライブラリをインストールします。

python3 -m pip install --upgrade Pillow
python3 -m pip install --upgrade setuptools
sudo apt-get install python3-tk
sudo apt install libzbar0
pip3 install git+https://github.com/jreesun/urtypes.git@e0d0db277ec2339650343eaf7b220fffb9233241
pip3 install git+https://github.com/enteropositivo/pyzbar.git@a52ff0b2e8ff714ba53bbf6461c89d672a304411#egg=pyzbar
pip3 install embit dataclasses qrcode tk opencv-python

もしエラーが出るのならおそらく以下のファイルに原因があるので編集します。

cd /Desktop/seedsigner/src/seedsigner/views
nano views.py

ライブラリを一部追加して、クラスの一部を○○書き換えます。

python view.py
from dataclasses import dataclass, field
from typing import Type
from seedsigner.gui.components import FontAwesomeIconConstants, SeedSignerIconConstants
from seedsigner.gui.screens import RET_CODE__POWER_BUTTON, RET_CODE__BACK_BUTTON
from seedsigner.gui.screens.screen import BaseScreen, DireWarningScreen, LargeButtonScreen, PowerOffScreen, PowerOffNotRequiredScreen, ResetScreen, WarningScreen
from seedsigner.models.settings import Settings, SettingsConstants
from seedsigner.models.settings_definition import SettingsDefinition
from seedsigner.models.threads import BaseThread

# ... (rest of your imports and code)

@dataclass
class ErrorView(View):
    title: str = "Error"
    show_back_button: bool = True
    status_headline: str = None
    text: str = None
    button_text: str = None
    next_destination: Destination = field(default_factory=lambda: Destination(MainMenuView, clear_history=True))

    def run(self):
        self.run_screen(
            WarningScreen,
            title=self.title,
            status_headline=self.status_headline,
            text=self.text,
            button_data=[self.button_text],
            show_back_button=self.show_back_button,
        )

        return self.next_destination

@dataclass
class NetworkMismatchErrorView(ErrorView):
    title: str = "Network Mismatch"
    show_back_button: bool = False
    button_text: str = "Change Setting"
    next_destination: Destination = field(default_factory=lambda: None)

    def __post_init__(self):
        super().__post_init__()
        if not self.text:
            self.text = f"Current network setting ({self.settings.get_value_display_name(SettingsConstants.SETTING__NETWORK)}) doesn't match current action."

        if not self.next_destination:
            from seedsigner.views.settings_views import SettingsEntryUpdateSelectionView
            self.next_destination = Destination(SettingsEntryUpdateSelectionView, view_args=dict(attr_name=SettingsConstants.SETTING__NETWORK), clear_history=True)

そのあと実行します。

cd /Desktop/seedsigner/src
python3 main.py

成功例

上手くいくと起動できます。
image.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0