Skip to content

Instantly share code, notes, and snippets.

View sambhav's full-sized avatar
🛠️
building cool stuff

Sambhav Kothari sambhav

🛠️
building cool stuff
View GitHub Profile
Number Commit
1 PICARD-851: Correctly update parent items on save
2 PICARD-855: Adds errorhandler for missing meta-data
3 PICARD-857: Add themeing support for GNOME-3 and remove deprecated checks
4 Remove quotes from theme name
5 Add support for nosetests
6 PICARD-857: Remove deprecated checks and add…
7 PICARD-546,287:
@sambhav
sambhav / basic.spec.py
Created February 16, 2018 13:19
Basic Pyinstaller Spec file
# -*- mode: python -*-
block_cipher = None
a = Analysis(['entry_point.py'],
pathex=['/path/to/package_dir'],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=[],
def get_resources():
data_files = []
for file_name in os.listdir('resources'):
data_files.append((os.path.join('resources', file_name), 'resources'))
return data_files
# -*- mode: python -*-
import os
block_cipher = None
def get_resources():
data_files = []
for file_name in os.listdir('resources'):
data_files.append((os.path.join('resources', file_name), 'resources'))
return data_files
# These variables are set by pyinstaller if running from a frozen
# build. See http://pyinstaller.readthedocs.io/en/stable/runtime-information.html
is_frozen = getattr(sys, 'frozen', False)
frozen_temp_path = getattr(sys, '_MEIPASS', '')
import os
from package.main import main
from package.utils import is_frozen, frozen_temp_path
# This is needed to find resources when using pyinstaller
if is_frozen:
basedir = frozen_temp_path
else:
basedir = os.path.dirname(os.path.abspath(__file__))
def main(resource_dir):
...
bar_file = open(os.path.join(resource_dir, 'bar.dat')
...
# -*- mode: python -*-
import os
import platform
block_cipher = None
def get_resources():
data_files = []
for file_name in os.listdir('resources'):
# -*- mode: python -*-
import platform
block_cipher = None
a = Analysis(['entry_point.py'],
pathex=['/path/to/package_dir'],
binaries=get_binaries(),
datas=get_resources(),
hiddenimports=[],