Skip to content

Commit

Permalink
Build scripts/specs ported to Python 3.
Browse files Browse the repository at this point in the history
  • Loading branch information
imiolek-ireneusz committed Aug 22, 2022
1 parent 3bf8303 commit 70bc20b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 18 deletions.
2 changes: 1 addition & 1 deletion classes/cversion.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ver = "4.21.07"
ver = "4.22.08"
13 changes: 8 additions & 5 deletions eduactiv8.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env python2
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# eduActiv8 - Educational Activities for Kids
# Copyright (C) 2012-2019 Ireneusz Imiolek
# Copyright (C) 2012-2022 Ireneusz Imiolek

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -31,6 +31,7 @@

# Import the android module. If we can't import it, set it to None - this
# lets us test it, and check to see if we want android-specific behavior.
__version__ = "4.22.08"
try:
import android
except ImportError:
Expand Down Expand Up @@ -60,7 +61,7 @@
import classes.updater
import classes.sizer

import stresstest
# import stresstest

# setting the working directory to the directory of this file
path = os.path.abspath(os.path.dirname(sys.argv[0]))
Expand Down Expand Up @@ -378,8 +379,10 @@ def run(self):
self.config.settings["screenh"] <= self.config.size_limits[3]:
self.wn_size = [self.config.settings["screenw"], self.config.settings["screenh"]]
else:
self.wn_size = [min(self.config.fs_width - self.config.os_panels_w, self.config.size_limits[2]),
min(self.config.fs_height - self.config.os_panels_h, self.config.size_limits[3])]
# set default screen size - as small as possible
#self.wn_size = [min(self.config.fs_width - self.config.os_panels_w, self.config.size_limits[2]),
# min(self.config.fs_height - self.config.os_panels_h, self.config.size_limits[3])]
self.wn_size = [800, 600]
self.config.settings["screenw"] = self.wn_size[0]
self.config.settings["screenh"] = self.wn_size[1]

Expand Down
13 changes: 3 additions & 10 deletions eduactiv8.spec
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,16 @@ import sys
p = sys.platform
block_cipher = None

# command: $ pyinstaller eduactiv8.spec

# hiddenimports=["_io", "pyimod03_importers", "colorsys", "_struct", "struct"],
if p == "linux" or p == "linux2":
hidden_imports = ["_io", "pyimod03_importers", "colorsys", "_struct", "struct", "sqlite3", "ast", "xml.etree.ElementTree", "json"]
else:
hidden_imports = ["_io", "pyimod03_importers", "colorsys", "_struct", "struct", "json", "sqlite3", "ast", "xml.etree.ElementTree"]

a = Analysis(['eduactiv8.py'],
pathex=['/Users/cextested/Documents/eduActiv8/eduActiv8-3.70.823/dist/eduActiv8'],
binaries=[],
datas = [("CHANGES.txt", "."), ("CREDITS.txt", "."), ("LICENSE", "."), ("README.txt", "."), ("xml", "xml"),
("locale", "locale"), ("res", "res"), ("classes", "classes"), ("game_boards", "game_boards"), ("i18n","i18n")],
hiddenimports=hidden_imports,
hiddenimports=["_io", "pyimod03_importers", "colorsys", "_struct", "struct", "sqlite3", "json", "ast", "xml.etree.ElementTree"],
hookspath=[],
runtime_hooks=[],
excludes=["numpy", "scipy", 'matplotlib', 'PIL', 'cython', 'zmq'],
excludes=["numpy", "scipy", 'matplotlib','PIL','cython','zmq'],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher)
Expand Down Expand Up @@ -62,7 +55,7 @@ elif p == "darwin":
strip=False,
upx=True,
console=False,
icon='res/icon/eduactiv8.ico')
icon='res/icon/eduactiv8.icns')

app = BUNDLE(exe,
name='eduActiv8.app',
Expand Down
4 changes: 2 additions & 2 deletions linux_extras/eduactiv8
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ if [ -d "/usr/share/games/eduactiv8" ]
then
echo "Working directory: /usr/share/games/eduactiv8"
cd "/usr/share/games/eduactiv8"
python2 /usr/share/games/eduactiv8/eduactiv8.py "$@"
python3 /usr/share/games/eduactiv8/eduactiv8.py "$@"
else
if [ -d "/usr/share/eduactiv8" ]
then
echo "Working directory: /usr/share/eduactiv8"
cd "/usr/share/eduactiv8"
python2 /usr/share/eduactiv8/eduactiv8.py "$@"
python3 /usr/share/eduactiv8/eduactiv8.py "$@"
else
echo "eduActiv8 is not installed"
fi
Expand Down

0 comments on commit 70bc20b

Please sign in to comment.