Skip to content

Commit 58eb2fc

Browse files
committed
Fixed mistake in PropellerLoad that left loading flag true. Bumped version to v0.6.2
1 parent f7682cf commit 58eb2fc

File tree

4 files changed

+52
-46
lines changed

4 files changed

+52
-46
lines changed

BlocklyPropClient.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
# Please verify that the version number in the local about.txt and the
3737
# ./package/win-resources/blocklypropclient-installer.iss matches this.
3838
# -----------------------------------------------------------------------
39-
VERSION = "0.6.1"
39+
VERSION = "0.6.2"
4040

4141

4242
# Enable logging for functions outside of the class definition

PropellerLoad.py

Lines changed: 49 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -88,51 +88,57 @@ def get_ports(self):
8888

8989
def download(self, action, file_to_load, com_port):
9090
# Download application to Propeller
91+
# Set loading flag to prevent interruption
9192
self.loading = True
9293

93-
# Patch - see if __init__ is back in full operation
94-
if not self.appdir or self.appdir == "" or self.appdir == "/":
95-
self.logger.info('ERROR: LOADER FOLDER NOT FOUND!')
96-
return False, ' ', ' '
97-
# Patch below removed temporarily during platform testing
98-
# # Patch until we figure out why the __init__ is not getting called
99-
# if not self.appdir or self.appdir == "" or self.appdir == "/":
100-
# # realpath expands to full path if __file__ or sys.argv[0] contains just a filename
101-
# self.appdir = os.path.dirname(os.path.realpath(__file__))
102-
# if self.appdir == "" or self.appdir == "/":
103-
# # launch path is blank; try extracting from argv
104-
# self.appdir = os.path.dirname(os.path.realpath(sys.argv[0]))
105-
106-
# Set command download to RAM or EEPROM and to run afterward download
107-
command = []
108-
if self.loaderAction[action]["compile-options"] != "":
109-
# if RAM/EEPROM compile-option not empty, add it to the list
110-
command.extend([self.loaderAction[action]["compile-options"]])
111-
command.extend(["-r"])
112-
113-
# Add requested port
114-
if com_port is not None:
115-
# Find port(s) named com_port
116-
targetWiFi = [l for l in self.wports if isWiFiName(l, com_port)]
117-
if len(targetWiFi) > 0:
118-
# Found Wi-Fi match
119-
self.logger.debug('Requested port %s is at %s', com_port, getWiFiIP(targetWiFi[0]))
120-
command.extend(["-i"])
121-
command.extend([getWiFiIP(targetWiFi[0]).encode('ascii', 'ignore')])
122-
else:
123-
# Not Wi-Fi match, should be COM port
124-
self.logger.debug('Requested port is %s', com_port)
125-
command.extend(["-p"])
126-
command.extend([com_port.encode('ascii', 'ignore')])
127-
128-
# Add target file
129-
command.extend([file_to_load.name.encode('ascii', 'ignore').replace('\\', '/')])
130-
131-
# Download
132-
(success, out, err) = loader(self, command)
133-
134-
# Return results
135-
return success, out or '', err or ''
94+
try:
95+
# Patch - see if __init__ is back in full operation
96+
if not self.appdir or self.appdir == "" or self.appdir == "/":
97+
self.logger.info('ERROR: LOADER FOLDER NOT FOUND!')
98+
return False, ' ', ' '
99+
# Patch below removed temporarily during platform testing
100+
# # Patch until we figure out why the __init__ is not getting called
101+
# if not self.appdir or self.appdir == "" or self.appdir == "/":
102+
# # realpath expands to full path if __file__ or sys.argv[0] contains just a filename
103+
# self.appdir = os.path.dirname(os.path.realpath(__file__))
104+
# if self.appdir == "" or self.appdir == "/":
105+
# # launch path is blank; try extracting from argv
106+
# self.appdir = os.path.dirname(os.path.realpath(sys.argv[0]))
107+
108+
# Set command download to RAM or EEPROM and to run afterward download
109+
command = []
110+
if self.loaderAction[action]["compile-options"] != "":
111+
# if RAM/EEPROM compile-option not empty, add it to the list
112+
command.extend([self.loaderAction[action]["compile-options"]])
113+
command.extend(["-r"])
114+
115+
# Add requested port
116+
if com_port is not None:
117+
# Find port(s) named com_port
118+
targetWiFi = [l for l in self.wports if isWiFiName(l, com_port)]
119+
if len(targetWiFi) > 0:
120+
# Found Wi-Fi match
121+
self.logger.debug('Requested port %s is at %s', com_port, getWiFiIP(targetWiFi[0]))
122+
command.extend(["-i"])
123+
command.extend([getWiFiIP(targetWiFi[0]).encode('ascii', 'ignore')])
124+
else:
125+
# Not Wi-Fi match, should be COM port
126+
self.logger.debug('Requested port is %s', com_port)
127+
command.extend(["-p"])
128+
command.extend([com_port.encode('ascii', 'ignore')])
129+
130+
# Add target file
131+
command.extend([file_to_load.name.encode('ascii', 'ignore').replace('\\', '/')])
132+
133+
# Download
134+
(success, out, err) = loader(self, command)
135+
136+
# Return results
137+
return success, out or '', err or ''
138+
139+
finally:
140+
# Done, clear loading flag to process other events
141+
self.loading = False
136142

137143

138144
def loader(self, cmdOptions):

about.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Version: v0.6.1
1+
Version: v0.6.2
22

33
Contributors:
44
- Michel Lampo

package/blocklypropclient-installer.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
33

44
#define MyAppName "BlocklyPropClient"
5-
#define MyAppVersion "0.6.1"
5+
#define MyAppVersion "0.6.2"
66
#define MyAppPublisher "Parallax Inc."
77
#define MyAppURL "http://blockly.parallax.com/"
88
#define MyAppExeName "BlocklyPropClient.exe"

0 commit comments

Comments
 (0)