Clean up freeze.py.

This commit is contained in:
Florian Bruhin 2015-09-18 22:33:50 +02:00
parent 7d6c39d64b
commit 957116658d

View File

@ -85,6 +85,22 @@ def get_build_exe_options(skip_html=False):
} }
def get_exe(base, target_name):
return cx.Executable('qutebrowser/__main__.py', base=base,
targetName=target_name, shortcutName='qutebrowser',
shortcutDir='ProgramMenuFolder',
icon=os.path.join(BASEDIR, 'icons',
'qutebrowser.ico'))
def main():
if sys.platform.startswith('win'):
base = 'Win32GUI'
target_name = 'qutebrowser.exe'
else:
base = None
target_name = 'qutebrowser'
bdist_msi_options = { bdist_msi_options = {
# random GUID generated by uuid.uuid4() # random GUID generated by uuid.uuid4()
'upgrade_code': '{a7119e75-4eb7-466c-ae0d-3c0eccb45196}', 'upgrade_code': '{a7119e75-4eb7-466c-ae0d-3c0eccb45196}',
@ -101,23 +117,6 @@ bdist_mac_options = {
'bundle_name': 'qutebrowser', 'bundle_name': 'qutebrowser',
} }
def get_exe(base, target_name):
return cx.Executable('qutebrowser/__main__.py', base=base,
targetName=target_name, shortcutName='qutebrowser',
shortcutDir='ProgramMenuFolder',
icon=os.path.join(BASEDIR, 'icons',
'qutebrowser.ico'))
if __name__ == '__main__':
if sys.platform.startswith('win'):
base = 'Win32GUI'
target_name = 'qutebrowser.exe'
else:
base = None
target_name = 'qutebrowser'
try: try:
setupcommon.write_git_file() setupcommon.write_git_file()
cx.setup( cx.setup(
@ -134,3 +133,7 @@ if __name__ == '__main__':
path = os.path.join(BASEDIR, 'qutebrowser', 'git-commit-id') path = os.path.join(BASEDIR, 'qutebrowser', 'git-commit-id')
if os.path.exists(path): if os.path.exists(path):
os.remove(path) os.remove(path)
if __name__ == '__main__':
main()