Skip to content

Commit 45ac7bd

Browse files
author
Developer
committed
Replaced .linux.spec to fix build problem and add about.txt to the distribution. Replaced self.appdir code so application retrieves proper leading path when run from both source and executable distribution.
1 parent eec3a9e commit 45ac7bd

File tree

4 files changed

+39
-18
lines changed

4 files changed

+39
-18
lines changed

BlocklyPropClient.linux.spec

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,43 @@
11
# -*- mode: python -*-
2-
a = Analysis(['BlocklyPropClient.py'],
32

3+
block_cipher = None
4+
5+
6+
a = Analysis(['BlocklyPropClient.py'],
7+
binaries=None,
8+
datas=None,
49
hiddenimports=[],
5-
hookspath=None,
6-
runtime_hooks=None)
7-
pyz = PYZ(a.pure)
10+
hookspath=[],
11+
runtime_hooks=[],
12+
excludes=[],
13+
win_no_prefer_redirects=False,
14+
win_private_assemblies=False,
15+
cipher=block_cipher)
16+
pyz = PYZ(a.pure, a.zipped_data,
17+
cipher=block_cipher)
818
exe = EXE(pyz,
919
a.scripts,
1020
exclude_binaries=True,
1121
name='BlocklyPropClient',
1222
debug=False,
13-
strip=None,
14-
upx=false,
15-
console=True,
16-
icon='blocklyprop.ico' )
23+
strip=False,
24+
upx=False,
25+
console=False , icon='BlocklyPropClient.ico')
26+
27+
#Propeller Tools
1728
propeller_libs_and_tools = Tree('propeller-tools', prefix='propeller-tools', excludes=['*.pdf', 'windows', 'mac'])
29+
propeller_libs_and_tools += [('about.txt', 'about.txt', 'About file')]
30+
31+
#Collection (edited to include Propeller Tools)
1832
coll = COLLECT(exe,
1933
a.binaries,
2034
a.zipfiles,
2135
a.datas,
2236
propeller_libs_and_tools,
23-
strip=None,
37+
strip=False,
2438
upx=False,
25-
name='BlocklyPropClient.linux')
39+
name='BlocklyPropClient')
2640

2741
# Analysis
28-
# pathex=['D:\\Development\\python\\BlocklyPropClient'],
42+
# pathex=['/home/developer/Projects/BlocklyPropClient'],
43+

BlocklyPropClient.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
# NOTE:
3535
#
3636
# Please verify that the version number in the local about.txt and the
37-
# ./package/win0resources/blocklypropclient-installer.iss
37+
# ./package/win-resources/blocklypropclient-installer.iss matches this.
3838
# -----------------------------------------------------------------------
3939
VERSION = "0.5.4"
4040

@@ -65,9 +65,11 @@ def __init__(self, *args, **kwargs):
6565
self.connected = False
6666

6767
# Path to where application was launched
68-
self.appdir = os.path.dirname(sys.argv[0])
69-
self.logger.info('Logging is enabled')
70-
self.logger.info('Application launched from %s', self.appdir)
68+
# self.appdir = os.path.dirname(sys.argv[0])
69+
# self.appdir = os.getcwd() #works
70+
self.appdir = os.path.dirname(os.path.realpath(__file__))
71+
self.logger.info('Logging is enabled')
72+
self.logger.info('Application launched from %s', self.appdir)
7173

7274
# initialize config variables
7375
self.ip_address = tk.StringVar()

BlocklyServer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ def __init__(self, version, queue):
2727

2828
self.version = version
2929
self.queue = queue
30-
self.appdir = os.path.dirname(sys.argv[0])
30+
# self.appdir = os.path.dirname(sys.argv[0])
31+
self.appdir = os.path.dirname(os.path.realpath(__file__))
3132
self.logger.debug("Application started from: %s", self.appdir)
3233

3334
queue.put((10, 'INFO', 'Server started'))

PropellerLoad.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ def __init__(self):
1919
self.logger.info('Creating loader logger.')
2020

2121
# Find the path to the application launch directory
22-
self.appdir = os.path.dirname(sys.argv[0])
22+
# self.appdir = os.path.dirname(sys.argv[0])
23+
# self.appdir = os.getcwd() # works
24+
self.appdir = os.path.dirname(os.path.realpath(__file__))
2325
self.logger.debug("Application running from: %s", self.appdir)
2426

2527
# if not self.appdir:
@@ -72,7 +74,8 @@ def load(self, action, file_to_load, com_port):
7274

7375
# Patch until we figure out why the __init__ is not getting called
7476
if not self.appdir or self.appdir == '':
75-
self.appdir = os.path.dirname(sys.argv[0])
77+
# self.appdir = os.path.dirname(sys.argv[0])
78+
self.appdir = os.path.dirname(os.path.realpath(__file__))
7679

7780
executable = self.appdir + self.propeller_load_executables[platform.system()]
7881
self.logger.debug('Loader executable path is: %s)', executable)

0 commit comments

Comments
 (0)