diff --git a/.github/workflows/macos-test-build.yml b/.github/workflows/macos-test-build.yml index a6a2aa66f..7c1ee0dbb 100644 --- a/.github/workflows/macos-test-build.yml +++ b/.github/workflows/macos-test-build.yml @@ -4,6 +4,13 @@ on: branches: [master, development] push: branches: [master, development] + +permissions: + id-token: write + contents: read + +env: + AWS_REGION : us-east-1 jobs: check: @@ -57,6 +64,20 @@ jobs: run: | ls python $GITHUB_WORKSPACE/OpenBCI_GUI_UnitTests/run-unittests.py + + - name: Decrypt Certificate + run: | + openssl version + openssl enc -aes-256-cbc -a -d -pbkdf2 -in $GITHUB_WORKSPACE/release_script/mac_only/Certificates_2023.p12.enc -out $GITHUB_WORKSPACE/release_script/mac_only/Certificates.p12 -k "$OPENSSL_CERT_K" + openssl base64 -in $GITHUB_WORKSPACE/release_script/mac_only/Certificates.p12 -out $GITHUB_WORKSPACE/release_script/mac_only/Certificates.txt + env: + OPENSSL_CERT_K: ${{ secrets.OPENSSL_CERT_K }} + + - name: Add OSX Signing Certificate + uses: apple-actions/import-codesign-certs@v2 + with: + p12-filepath: ${{ github.workspace }}/release_script/mac_only/Certificates.p12 + p12-password: ${{ secrets.CERTIFICATE_P12_PASSWORD }} - name: Build GUI run: | @@ -66,3 +87,19 @@ jobs: python $GITHUB_WORKSPACE/release_script/make-release.py --no-prompts GUI_COMMIT_TIME=`cat temp/timestamp.txt` GUI_VERSION_STRING=`cat temp/versionstring.txt` + + - name: Store DMG on AWS + env: + AWS_DEFAULT_REGION: ${{ env.AWS_REGION }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_2023 }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_2023 }} + run: | + export CURRENT_BRANCH=`git branch --show-current` + export GUI_COMMIT_TIME=`cat temp/timestamp.txt` + export GUI_VERSION_STRING=`cat temp/versionstring.txt` + cd $GITHUB_WORKSPACE + ls + aws s3 rm s3://openbci-public-gui-v6/latest --recursive --exclude "*" --include "openbcigui_*_macosx.dmg" + aws s3 cp $GITHUB_WORKSPACE/. s3://openbci-public-gui-v6/${GUI_VERSION_STRING} --recursive --exclude "*" --include "openbcigui_*_macosx.dmg" + aws s3 cp $GITHUB_WORKSPACE/. s3://openbci-public-gui-v6/latest --recursive --exclude "*" --include "openbcigui_*_macosx.dmg" + diff --git a/appveyor.yml b/appveyor.yml index 5e9b5dc3d..42588b820 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -49,12 +49,12 @@ build_script: - set /p GUI_VERSION_STRING= < temp\versionstring.txt deploy_script: - - aws s3 rm s3://openbci-gui/%APPVEYOR_REPO_BRANCH%/latest --recursive --exclude "*" --include "openbcigui_*_windows64.zip" - - aws s3 cp %APPVEYOR_BUILD_FOLDER%\. s3://openbci-gui/%APPVEYOR_REPO_BRANCH%/%GUI_VERSION_STRING%_%GUI_COMMIT_TIME% --recursive --exclude "*" --include "openbcigui_*_windows64.zip" - - aws s3 cp %APPVEYOR_BUILD_FOLDER%\. s3://openbci-gui/%APPVEYOR_REPO_BRANCH%/latest --recursive --exclude "*" --include "openbcigui_*_windows64.zip" + #- aws s3 rm s3://openbci-gui/%APPVEYOR_REPO_BRANCH%/latest --recursive --exclude "*" --include "openbcigui_*_windows64.zip" + #- aws s3 cp %APPVEYOR_BUILD_FOLDER%\. s3://openbci-gui/%APPVEYOR_REPO_BRANCH%/%GUI_VERSION_STRING%_%GUI_COMMIT_TIME% --recursive --exclude "*" --include "openbcigui_*_windows64.zip" + #- aws s3 cp %APPVEYOR_BUILD_FOLDER%\. s3://openbci-gui/%APPVEYOR_REPO_BRANCH%/latest --recursive --exclude "*" --include "openbcigui_*_windows64.zip" # copy index.html and list.js back to s3 to refresh it and avoid it being deleted by the eviction policy - - aws s3 cp %APPVEYOR_BUILD_FOLDER%\release_script\index.html s3://openbci-gui/index.html - - aws s3 cp %APPVEYOR_BUILD_FOLDER%\release_script\list.js s3://openbci-gui/list.js + #- aws s3 cp %APPVEYOR_BUILD_FOLDER%\release_script\index.html s3://openbci-gui/index.html + #- aws s3 cp %APPVEYOR_BUILD_FOLDER%\release_script\list.js s3://openbci-gui/list.js notifications: - provider: Email diff --git a/release_script/mac_only/Certificates.p12.enc b/release_script/mac_only/Certificates.p12.enc deleted file mode 100644 index ed5ac6250..000000000 Binary files a/release_script/mac_only/Certificates.p12.enc and /dev/null differ diff --git a/release_script/mac_only/Certificates_2023.p12.enc b/release_script/mac_only/Certificates_2023.p12.enc new file mode 100644 index 000000000..861081323 --- /dev/null +++ b/release_script/mac_only/Certificates_2023.p12.enc @@ -0,0 +1,66 @@ +U2FsdGVkX19mrA/XuOw56q19fU60NF3QCFq5xEJ57Fto6MxMFG4o8+95cl1HP3rM +HCepjVTUCbh9T+S2m71hHPgDi4d6rIIKKxSa/GdQg8tNj0BtOi/k3757xZhfnfIK +tiDoBw9y3mT678jnXcj0nMKc9xIeUZXkyrfLPsTTddkhGFuPpFshMCpx1+57BuoL +EjueNyVPfN7vacU2SUjWMmNBK+fgR/cbL4H6Pw4P6pDIhS+95kl++MOw1y/Y20xI +6dAVCXHp7dXIos6XAqN/Pp8mSjOZtrHcNWDfzTkdPUgnCOwITeHXL3aOqBd3YOar +nLcNslU+wVYU3OcJQeYx1zv+H1/zyoEzqE3NSN7ERY1DdNry2YfWkEZB5RlS7k34 +dgUYjdTdZ027jgP6+qfBXI+1UuwL5PsVfi8+tjajwJNfIFEM3KCm7qNXMFPwnHJj +bFUUtfOXZouSJHl9WYbEqguLtUY6+Jh3MOshVZPBeDE5dv+ADvdWGhWto+2leHRX +Njw3oi5qimsY1aI2FdR2G/0eE0SU+Lq+WEfuvg3PQoX4ghlMRzjnkVzTHDiM0DUW +VBVjNlYpN0ZdG+9R+iMs3HO1TYQZHorPTeR6358knrXQmtQhVajIsCdYlurNmqwe +7Dna2lcQRcYcDhuMuPcrPh6JQeN597IgTRDs/zLZXjlqTnJqnY6WJFDxFQSXmtMi +tGxE1DHP/+Tc4h4ZDO1JUNv7ptTdi73Ey3b3aJXeN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UxP1sGctJyTsbsfcEbEXo59m1oC6oMwPPdFqynd6tGJUIyC0feNy0ZxhVWx7g+TR +HOVIfvm7YkcZL0uDQyCq6agReeRbxk7uedrGqxHt2yqiRcksrShwHljumLvV3VUu +JqmEuUGRgfsi7mHHTIEd1HDT9y4zMkvyjCr3aidQYA3oJQNBMJNbfeVp47KHNNqz +Gjh0oPil/cKwszpQZkUNC/R5JyvDTLb/FtKbb2P8LXtG5tOJcXHoWbZ+gdhWYcqW +YUhx1LEjJFGFhJGj/wK+E532EuXkCvpOcPWaFK2LO1uH0oVm+uNEjtEPJ4o1Hxld diff --git a/release_script/mac_only/dmgbuild_settings.py b/release_script/mac_only/dmgbuild_settings.py index 6e963b929..80854b57f 100644 --- a/release_script/mac_only/dmgbuild_settings.py +++ b/release_script/mac_only/dmgbuild_settings.py @@ -1,34 +1,34 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import biplist import os.path +import plistlib # -# Settings file for dmgbuild +# Example settings file for dmgbuild # # Use like this: dmgbuild -s settings.py "Test Volume" test.dmg -# You can actually use this file for any application (not just TextEdit) +# You can actually use this file for your own application (not just TextEdit) # by doing e.g. # # dmgbuild -s settings.py -D app=/path/to/My.app "My Application" MyApp.dmg # .. Useful stuff .............................................................. -application = defines.get('app', '/Applications/TextEdit.app') # default +application = defines.get("app", "/System/Applications/TextEdit.app") # noqa: F821 appname = os.path.basename(application) + def icon_from_app(app_path): - plist_path = os.path.join(app_path, 'Contents', 'Info.plist') - plist = biplist.readPlist(plist_path) - icon_name = plist['CFBundleIconFile'] - icon_root,icon_ext = os.path.splitext(icon_name) + plist_path = os.path.join(app_path, "Contents", "Info.plist") + with open(plist_path, "rb") as f: + plist = plistlib.load(f) + icon_name = plist["CFBundleIconFile"] + icon_root, icon_ext = os.path.splitext(icon_name) if not icon_ext: - icon_ext = '.icns' + icon_ext = ".icns" icon_name = icon_root + icon_ext - return os.path.join(app_path, 'Contents', 'Resources', icon_name) + return os.path.join(app_path, "Contents", "Resources", icon_name) + # .. Basics .................................................................... @@ -39,31 +39,38 @@ def icon_from_app(app_path): # volume_name = 'Test' # Volume format (see hdiutil create -help) -format = defines.get('format', 'UDBZ') +format = defines.get("format", "UDBZ") # noqa: F821 + +# Compression level (if relevant) +# compression_level = 9 # Volume size -size = defines.get('size', None) +size = defines.get("size", None) # noqa: F821 # Files to include -files = [ application ] +files = [application] # Symlinks to create -symlinks = { 'Applications': '/Applications' } +symlinks = {"Applications": "/Applications"} + +# Files to hide +# hide = [ 'Secret.data' ] + +# Files to hide the extension of +# hide_extension = [ 'README.rst' ] # Volume icon # # You can either define icon, in which case that icon file will be copied to the # image, *or* you can define badge_icon, in which case the icon file you specify -# will be used to badge the system's Removable Disk icon +# will be used to badge the system's Removable Disk icon. Badge icons require +# pyobjc-framework-Quartz. # -#icon = '/path/to/icon.icns' +# icon = '/path/to/icon.icns' badge_icon = icon_from_app(application) # Where to put the icons -icon_locations = { - appname: (140, 120), - 'Applications': (500, 120) - } +icon_locations = {appname: (140, 120), "Applications": (500, 120)} # .. Window configuration ...................................................... @@ -87,7 +94,7 @@ def icon_from_app(app_path): # # Other color components may be expressed either in the range 0 to 1, or # as percentages (e.g. 60% is equivalent to 0.6). -background = 'builtin-arrow' +background = "builtin-arrow" show_status_bar = False show_tab_view = False @@ -106,15 +113,15 @@ def icon_from_app(app_path): # 'column-view' # 'coverflow' # -default_view = 'icon-view' +default_view = "icon-view" # General view configuration show_icon_preview = False # Set these to True to force inclusion of icon/list view settings (otherwise # we only include settings for the default view) -include_icon_view_settings = 'auto' -include_list_view_settings = 'auto' +include_icon_view_settings = "auto" +include_list_view_settings = "auto" # .. Icon view configuration ................................................... @@ -122,7 +129,7 @@ def icon_from_app(app_path): grid_offset = (0, 0) grid_spacing = 100 scroll_position = (0, 0) -label_pos = 'bottom' # or 'right' +label_pos = "bottom" # or 'right' text_size = 16 icon_size = 128 @@ -144,34 +151,34 @@ def icon_from_app(app_path): list_icon_size = 16 list_text_size = 12 list_scroll_position = (0, 0) -list_sort_by = 'name' +list_sort_by = "name" list_use_relative_dates = True -list_calculate_all_sizes = False, -list_columns = ('name', 'date-modified', 'size', 'kind', 'date-added') +list_calculate_all_sizes = (False,) +list_columns = ("name", "date-modified", "size", "kind", "date-added") list_column_widths = { - 'name': 300, - 'date-modified': 181, - 'date-created': 181, - 'date-added': 181, - 'date-last-opened': 181, - 'size': 97, - 'kind': 115, - 'label': 100, - 'version': 75, - 'comments': 300, - } + "name": 300, + "date-modified": 181, + "date-created": 181, + "date-added": 181, + "date-last-opened": 181, + "size": 97, + "kind": 115, + "label": 100, + "version": 75, + "comments": 300, +} list_column_sort_directions = { - 'name': 'ascending', - 'date-modified': 'descending', - 'date-created': 'descending', - 'date-added': 'descending', - 'date-last-opened': 'descending', - 'size': 'descending', - 'kind': 'ascending', - 'label': 'ascending', - 'version': 'ascending', - 'comments': 'ascending', - } + "name": "ascending", + "date-modified": "descending", + "date-created": "descending", + "date-added": "descending", + "date-last-opened": "descending", + "size": "descending", + "kind": "ascending", + "label": "ascending", + "version": "ascending", + "comments": "ascending", +} # .. License configuration ..................................................... @@ -193,54 +200,67 @@ def icon_from_app(app_path): # pt_PT, ro_RO, ru_RU, se, sk_SK, sl_SI, sr_RS, sv_SE, th_TH, to_TO, tr_TR, # uk_UA, ur_IN, ur_PK, uz_UZ, vi_VN, zh_CN, zh_TW -# license = { -# 'default-language': 'en_US', -# 'licenses': { -# # For each language, the text of the license. This can be plain text, -# # RTF (in which case it must start "{\rtf1"), or a path to a file -# # containing the license text. If you're using RTF, -# # watch out for Python escaping (or read it from a file). -# 'English': b'''{\\rtf1\\ansi\\ansicpg1252\\cocoartf1504\\cocoasubrtf820 -# {\\fonttbl\\f0\\fnil\\fcharset0 Helvetica-Bold;\\f1\\fnil\\fcharset0 Helvetica;} -# {\\colortbl;\\red255\\green255\\blue255;\\red0\\green0\\blue0;} -# {\\*\\expandedcolortbl;;\\cssrgb\\c0\\c0\\c0;} -# \\paperw11905\\paperh16837\\margl1133\\margr1133\\margb1133\\margt1133 -# \\deftab720 -# \\pard\\pardeftab720\\sa160\\partightenfactor0 - -# \\f0\\b\\fs60 \\cf2 \\expnd0\\expndtw0\\kerning0 -# \\up0 \\nosupersub \\ulnone \\outl0\\strokewidth0 \\strokec2 Test License\\ -# \\pard\\pardeftab720\\sa160\\partightenfactor0 - -# \\fs36 \\cf2 \\strokec2 What is this?\\ -# \\pard\\pardeftab720\\sa160\\partightenfactor0 - -# \\f1\\b0\\fs22 \\cf2 \\strokec2 This is the English license. It says what you are allowed to do with this software.\\ -# \\ -# }''', -# }, -# 'buttons': { -# # For each language, text for the buttons on the licensing window. -# # -# # Default buttons and text are built-in for the following languages: -# # -# # English (en_US), German (de_DE), Spanish (es_ES), French (fr_FR), -# # Italian (it_IT), Japanese (ja_JP), Dutch (nl_NL), Swedish (sv_SE), -# # Brazilian Portuguese (pt_BR), Simplified Chinese (zh_CN), -# # Traditional Chinese (zh_TW), Danish (da_DK), Finnish (fi_FI), -# # Korean (ko_KR), Norwegian (nb_NO) -# # -# # You don't need to specify them for those languages; if you fail to -# # specify them for some other language, English will be used instead. - -# 'en_US': ( -# b'English', -# b'Agree', -# b'Disagree', -# b'Print', -# b'Save', -# b'If you agree with the terms of this license, press "Agree" to ' -# b'install the software. If you do not agree, press "Disagree".' -# ), -# }, -# } \ No newline at end of file +license = { + "default-language": "en_US", + "licenses": { + # For each language, the text of the license. This can be plain text, + # RTF (in which case it must start "{\rtf1"), or a path to a file + # containing the license text. If you're using RTF, + # watch out for Python escaping (or read it from a file). + "en_GB": b"""{\\rtf1\\ansi\\ansicpg1252\\cocoartf1504\\cocoasubrtf820 + {\\fonttbl\\f0\\fnil\\fcharset0 Helvetica-Bold;\\f1\\fnil\\fcharset0 Helvetica;} + {\\colortbl;\\red255\\green255\\blue255;\\red0\\green0\\blue0;} + {\\*\\expandedcolortbl;;\\cssrgb\\c0\\c0\\c0;} + \\paperw11905\\paperh16837\\margl1133\\margr1133\\margb1133\\margt1133 + \\deftab720 + \\pard\\pardeftab720\\sa160\\partightenfactor0 + + \\f0\\b\\fs60 \\cf2 \\expnd0\\expndtw0\\kerning0 + \\up0 \\nosupersub \\ulnone \\outl0\\strokewidth0 \\strokec2 Test License\\ + \\pard\\pardeftab720\\sa160\\partightenfactor0 + + \\fs36 \\cf2 \\strokec2 What is this?\\ + \\pard\\pardeftab720\\sa160\\partightenfactor0 + + \\f1\\b0\\fs22 \\cf2 \\strokec2 This is the English license. It says what you are allowed to do with this software.\\ + \\ + }""", + "de_DE": "Ich bin ein Berliner. Bielefeld gibt's doch gar nicht.", + }, + "buttons": { + # For each language, text for the buttons on the licensing window. + # + # Default buttons and text are built-in for the following languages: + # + # da_DK: Danish + # de_DE: German + # en_AU: English (Australian) + # en_GB: English (UK) + # en_NZ: English (New Zealand) + # en_US: English (US) + # es_ES: Spanish + # fr_CA: French (Canadian) + # fr_FR: French + # it_IT: Italian + # ja_JP: Japanese + # nb_NO: Norsk + # nl_BE: Flemish + # nl_NL: Dutch + # pt_BR: Brazilian Portuguese + # pt_PT: Portugese + # sv_SE: Swedish + # zh_CN: Simplified Chinese + # zh_TW: Traditional Chinese + # + # You don't need to specify them for those languages; if you fail to + # specify them for some other language, English will be used instead. + "en_US": ( + b"English", + b"Agree!", + b"Disagree!", + b"Print!", + b"Save!", + b'Do you agree or not? Press "Agree" or "Disagree".', + ), + }, +} \ No newline at end of file diff --git a/release_script/mac_only/dmgbuild_settings_old.py b/release_script/mac_only/dmgbuild_settings_old.py new file mode 100644 index 000000000..0702bbeaa --- /dev/null +++ b/release_script/mac_only/dmgbuild_settings_old.py @@ -0,0 +1,266 @@ +import os.path +import plistlib + +# +# Example settings file for dmgbuild +# + +# Use like this: dmgbuild -s settings.py "Test Volume" test.dmg + +# You can actually use this file for your own application (not just TextEdit) +# by doing e.g. +# +# dmgbuild -s settings.py -D app=/path/to/My.app "My Application" MyApp.dmg + +# .. Useful stuff .............................................................. + +application = defines.get("app", "/System/Applications/TextEdit.app") # noqa: F821 +appname = os.path.basename(application) + + +def icon_from_app(app_path): + plist_path = os.path.join(app_path, "Contents", "Info.plist") + with open(plist_path, "rb") as f: + plist = plistlib.load(f) + icon_name = plist["CFBundleIconFile"] + icon_root, icon_ext = os.path.splitext(icon_name) + if not icon_ext: + icon_ext = ".icns" + icon_name = icon_root + icon_ext + return os.path.join(app_path, "Contents", "Resources", icon_name) + + +# .. Basics .................................................................... + +# Uncomment to override the output filename +# filename = 'test.dmg' + +# Uncomment to override the output volume name +# volume_name = 'Test' + +# Volume format (see hdiutil create -help) +format = defines.get("format", "UDBZ") # noqa: F821 + +# Compression level (if relevant) +# compression_level = 9 + +# Volume size +size = defines.get("size", None) # noqa: F821 + +# Files to include +files = [application] + +# Symlinks to create +symlinks = {"Applications": "/Applications"} + +# Files to hide +# hide = [ 'Secret.data' ] + +# Files to hide the extension of +# hide_extension = [ 'README.rst' ] + +# Volume icon +# +# You can either define icon, in which case that icon file will be copied to the +# image, *or* you can define badge_icon, in which case the icon file you specify +# will be used to badge the system's Removable Disk icon. Badge icons require +# pyobjc-framework-Quartz. +# +# icon = '/path/to/icon.icns' +badge_icon = icon_from_app(application) + +# Where to put the icons +icon_locations = {appname: (140, 120), "Applications": (500, 120)} + +# .. Window configuration ...................................................... + +# Background +# +# This is a STRING containing any of the following: +# +# #3344ff - web-style RGB color +# #34f - web-style RGB color, short form (#34f == #3344ff) +# rgb(1,0,0) - RGB color, each value is between 0 and 1 +# hsl(120,1,.5) - HSL (hue saturation lightness) color +# hwb(300,0,0) - HWB (hue whiteness blackness) color +# cmyk(0,1,0,0) - CMYK color +# goldenrod - X11/SVG named color +# builtin-arrow - A simple built-in background with a blue arrow +# /foo/bar/baz.png - The path to an image file +# +# The hue component in hsl() and hwb() may include a unit; it defaults to +# degrees ('deg'), but also supports radians ('rad') and gradians ('grad' +# or 'gon'). +# +# Other color components may be expressed either in the range 0 to 1, or +# as percentages (e.g. 60% is equivalent to 0.6). +background = "builtin-arrow" + +show_status_bar = False +show_tab_view = False +show_toolbar = False +show_pathbar = False +show_sidebar = False +sidebar_width = 180 + +# Window position in ((x, y), (w, h)) format +window_rect = ((100, 100), (640, 280)) + +# Select the default view; must be one of +# +# 'icon-view' +# 'list-view' +# 'column-view' +# 'coverflow' +# +default_view = "icon-view" + +# General view configuration +show_icon_preview = False + +# Set these to True to force inclusion of icon/list view settings (otherwise +# we only include settings for the default view) +include_icon_view_settings = "auto" +include_list_view_settings = "auto" + +# .. Icon view configuration ................................................... + +arrange_by = None +grid_offset = (0, 0) +grid_spacing = 100 +scroll_position = (0, 0) +label_pos = "bottom" # or 'right' +text_size = 16 +icon_size = 128 + +# .. List view configuration ................................................... + +# Column names are as follows: +# +# name +# date-modified +# date-created +# date-added +# date-last-opened +# size +# kind +# label +# version +# comments +# +list_icon_size = 16 +list_text_size = 12 +list_scroll_position = (0, 0) +list_sort_by = "name" +list_use_relative_dates = True +list_calculate_all_sizes = (False,) +list_columns = ("name", "date-modified", "size", "kind", "date-added") +list_column_widths = { + "name": 300, + "date-modified": 181, + "date-created": 181, + "date-added": 181, + "date-last-opened": 181, + "size": 97, + "kind": 115, + "label": 100, + "version": 75, + "comments": 300, +} +list_column_sort_directions = { + "name": "ascending", + "date-modified": "descending", + "date-created": "descending", + "date-added": "descending", + "date-last-opened": "descending", + "size": "descending", + "kind": "ascending", + "label": "ascending", + "version": "ascending", + "comments": "ascending", +} + +# .. License configuration ..................................................... + +# Text in the license configuration is stored in the resources, which means +# it gets stored in a legacy Mac encoding according to the language. dmgbuild +# will *try* to convert Unicode strings to the appropriate encoding, *but* +# you should be aware that Python doesn't support all of the necessary encodings; +# in many cases you will need to encode the text yourself and use byte strings +# instead here. + +# Recognized language names are: +# +# af_ZA, ar, be_BY, bg_BG, bn, bo, br, ca_ES, cs_CZ, cy, da_DK, de_AT, de_CH, +# de_DE, dz_BT, el_CY, el_GR, en_AU, en_CA, en_GB, en_IE, en_SG, en_US, eo, +# es_419, es_ES, et_EE, fa_IR, fi_FI, fo_FO, fr_001, fr_BE, fr_CA, fr_CH, +# fr_FR, ga-Latg_IE, ga_IE, gd, grc, gu_IN, gv, he_IL, hi_IN, hr_HR, hu_HU, +# hy_AM, is_IS, it_CH, it_IT, iu_CA, ja_JP, ka_GE, kl, ko_KR, lt_LT, lv_LV, +# mk_MK, mr_IN, mt_MT, nb_NO, ne_NP, nl_BE, nl_NL, nn_NO, pa, pl_PL, pt_BR, +# pt_PT, ro_RO, ru_RU, se, sk_SK, sl_SI, sr_RS, sv_SE, th_TH, to_TO, tr_TR, +# uk_UA, ur_IN, ur_PK, uz_UZ, vi_VN, zh_CN, zh_TW + +license = { + "default-language": "en_US", + "licenses": { + # For each language, the text of the license. This can be plain text, + # RTF (in which case it must start "{\rtf1"), or a path to a file + # containing the license text. If you're using RTF, + # watch out for Python escaping (or read it from a file). + "en_GB": b"""{\\rtf1\\ansi\\ansicpg1252\\cocoartf1504\\cocoasubrtf820 + {\\fonttbl\\f0\\fnil\\fcharset0 Helvetica-Bold;\\f1\\fnil\\fcharset0 Helvetica;} + {\\colortbl;\\red255\\green255\\blue255;\\red0\\green0\\blue0;} + {\\*\\expandedcolortbl;;\\cssrgb\\c0\\c0\\c0;} + \\paperw11905\\paperh16837\\margl1133\\margr1133\\margb1133\\margt1133 + \\deftab720 + \\pard\\pardeftab720\\sa160\\partightenfactor0 + + \\f0\\b\\fs60 \\cf2 \\expnd0\\expndtw0\\kerning0 + \\up0 \\nosupersub \\ulnone \\outl0\\strokewidth0 \\strokec2 Test License\\ + \\pard\\pardeftab720\\sa160\\partightenfactor0 + + \\fs36 \\cf2 \\strokec2 What is this?\\ + \\pard\\pardeftab720\\sa160\\partightenfactor0 + + \\f1\\b0\\fs22 \\cf2 \\strokec2 This is the English license. It says what you are allowed to do with this software.\\ + \\ + }""", + "de_DE": "Ich bin ein Berliner. Bielefeld gibt's doch gar nicht.", + }, + "buttons": { + # For each language, text for the buttons on the licensing window. + # + # Default buttons and text are built-in for the following languages: + # + # da_DK: Danish + # de_DE: German + # en_AU: English (Australian) + # en_GB: English (UK) + # en_NZ: English (New Zealand) + # en_US: English (US) + # es_ES: Spanish + # fr_CA: French (Canadian) + # fr_FR: French + # it_IT: Italian + # ja_JP: Japanese + # nb_NO: Norsk + # nl_BE: Flemish + # nl_NL: Dutch + # pt_BR: Brazilian Portuguese + # pt_PT: Portugese + # sv_SE: Swedish + # zh_CN: Simplified Chinese + # zh_TW: Traditional Chinese + # + # You don't need to specify them for those languages; if you fail to + # specify them for some other language, English will be used instead. + "en_US": ( + b"English", + b"Agree!", + b"Disagree!", + b"Print!", + b"Save!", + b'Do you agree or not? Press "Agree" or "Disagree".', + ), + }, +} \ No newline at end of file