Code Cleanup#136
Conversation
- fixed mixed indentation of classifiers - specified minimum setuptools version
|
Fixed the issues and separated the commits. Passes all tests locally. |
- Simplified read + write + convert functions - Handle PathLike and named streams
- replaced randint with getrandbits - fixed issue where EmbThread.color could be None color_hex returns None when the string length isn't as expected. This can end up with color being set to None color attribute + set_color was replaced with color property (other getters / setters were replaced with properties where it made sense). color.setter now throws a ValueError on types that aren't convertable to an int (such as None)
- replaced os.path with pathlib - fixed minor bug in add_stitch_absolute - use type narrowing for stream argument - fixed bug where __iadd__ would sometimes return None
- removed __future__.print_function - replace randint with getrandbits - use tempfile with context manager instead of os.remove - avoid wildcard imports where possible - use unittest.skip for TestReadHus - use unittest.skip for test_generic_write_gcode
- fix typing for EmbThread.__init__ - handle invalid color strings in EmbThread.__eq__ - EmbThread.parse_string_color() no longer has a default value
|
Also, |
|
Thank you so much for all the work you've put into this. This package really needs someone to take the time and do this kind of work on it. It's all looking good to me. |
Made a lot of changes while looking through the source code
random.randintwithrandom.getrandbitswhere appropriatecatch AttributeErrorwithgetattrwhere appropriatepyproject.toml: fixed mixed indentation of classifierspyproject.toml: specified minimum setuptools versionEmbThread: created properties to replace getter + setter functionsEmbThread: fixed issue wherecolorcould be set toNoneEmbPattern: replacedos.pathwithpathlib.PurePathEmbPattern: fixed minor bug inadd_stitch_absoluteEmbPattern: use type narrowing forstreamargument (read_embroideryandwrite_embroidery)EmbPattern: fixed bug where__iadd__would sometimes returnNonefrom __future__ import print_functiontempfilewith context manager instead ofos.removeunittest.skipforTestReadHus+test_generic_write_gcode