Skip to content

Commit

Permalink
Fixed path issue & added pyinstaller spec
Browse files Browse the repository at this point in the history
  • Loading branch information
cspang1 committed Jul 22, 2021
1 parent 0bd0292 commit bfb926b
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 4 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ MANIFEST
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
Expand Down
41 changes: 41 additions & 0 deletions Pectin.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# -*- mode: python ; coding: utf-8 -*-


block_cipher = None


a = Analysis(['main.py'],
pathex=['f:\\pectin\\src'],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)

exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='Pectin',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=False,
disable_windowed_traceback=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon='../res/icons/pectin.ico')
Binary file added res/icons/pectin.ico
Binary file not shown.
10 changes: 7 additions & 3 deletions src/info_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ def __init__(self, recovered, parent=None):

self.mnem_list_path = Path(__file__).parents[1] / "res" / "mnemonics.json" # noqa: E501
os.makedirs(os.path.dirname(self.mnem_list_path), exist_ok=True)
if not os.path.isfile(self.mnem_list_path):
with open(self.mnem_list_path, 'w') as mnem_file:
mnem_file.write('{"mnemonics": ["Modify the mnemonics.json file", "in the res directory", "to change this list"]}') # noqa: E501
print('doesn\'t exist')

self.cur_mnemonics = None
self.load_mnemonics()
Expand All @@ -195,7 +199,7 @@ def load_mnemonics(self, active=None):
try:
self.cur_mnemonics = json.load(mnem_list)
except Exception:
self.new_mnem_file()(self.mnem_list_path)
self.new_mnem_file(self.mnem_list_path)
# How can we handle this kind of recursive try?
self.cur_mnemonics = json.load(mnem_list)

Expand Down Expand Up @@ -248,8 +252,8 @@ def mnem_selected(self, index):
else:
named = True
mnemonic = selected[0]
self.add_mnemonic()(mnemonic)
self.load_mnemonics()(mnemonic)
self.add_mnemonic(mnemonic)
self.load_mnemonics(mnemonic)

def new_mnem_file(self, mnem_list_path):
default = json.dumps({'mnemonics': ['XXA', 'XXB']})
Expand Down

0 comments on commit bfb926b

Please sign in to comment.