Skip to content

Commit

Permalink
v0.96: release
Browse files Browse the repository at this point in the history
  • Loading branch information
ussserrr committed Dec 17, 2019
1 parent 5c74456 commit 4452185
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ stm32pio changelog:
- Changed: actualized .ioc file for the latest STM32CubeMX version (5.4.0 at the moment)
- Changed: improved help, docs, comments

ver. 0.95 (12.19):
ver. 0.95 (15.12.19):
- New: re-made patch() method: it can intelligently parses platformio.ini and substitute necessary options. Patch can now be a general .INI-format config
- New: test_get_state()
- New: upload to PyPI
Expand All @@ -143,3 +143,14 @@ stm32pio changelog:
- Changed: check whether there is already a platformio.ini file and warn in this case on PlatformIO init stage
- Changed: sort imports in the alphabetic order
- Changed: use configparser to test project patching

ver. 0.96 (17.12.19):
- Fix: generate_code() doesn't destroy the temp folder after execution
- Fix: improved and actualized docs, comments, annotations
- Changed: print Python interpreter information on testing
- Changed: move some asserts inside subTest context managers
- Changed: rename pio_build() => build()
- Changed: take out to the settings.py the width of field in a log format string
- Changed: use file statistic to check its size instead of reading the whole content
- Changed: more logging output
- Changed: change some methods signatures to return result value
2 changes: 1 addition & 1 deletion stm32pio/app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

__version__ = '0.95'
__version__ = '0.96'

import argparse
import logging
Expand Down
5 changes: 4 additions & 1 deletion stm32pio/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,9 @@ def generate_code(self) -> int:
# Use mkstemp() instead of higher-level API for compatibility with Windows (see tempfile docs for more details)
cubemx_script_file, cubemx_script_name = tempfile.mkstemp()

# buffering=0 leads to the immediate flushing on writing
# We should necessarily remove the temp directory, so do not let any exception break our plans
try:
# buffering=0 leads to the immediate flushing on writing
with open(cubemx_script_file, mode='w+b', buffering=0) as cubemx_script:
# encode since mode='w+b'
cubemx_script.write(self.config.get('project', 'cubemx_script_content').encode())
Expand All @@ -328,6 +329,8 @@ def generate_code(self) -> int:
result = subprocess.run(command_arr, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
# Or, for Python 3.7 and above:
# result = subprocess.run(command_arr, capture_output=True)
except Exception as e:
raise e # re-raise an exception after the final block
finally:
pathlib.Path(cubemx_script_name).unlink()

Expand Down

0 comments on commit 4452185

Please sign in to comment.