kliment / Printrun

Pronterface, Pronsole, and Printcore - Pure Python 3d printing host software
GNU General Public License v3.0
2.37k stars 997 forks source link

Refactor printcore.py #1346

Closed rockstorm101 closed 9 months ago

rockstorm101 commented 1 year ago

Split printcore.py into two. All the functionality related to directly communicating with serial ports or TCP sockets is moved into device.py. This way this logic is abstracted from printcore.py, which is now independent of the underlying connection type.

This reduces the complexity of printcore.py and increases code modularity. Plus it has the advantage of making it simple to add more connection types in the future (if any).

Notes:

As always, any comments/suggestions are appreciated and I'll be happy to address them.

volconst commented 1 year ago
  • I could not test the TCP connection.

Try to connect to https://github.com/kliment/Printrun/blob/master/testtools/mock-printer.py

rockstorm101 commented 1 year ago

Try to connect to https://github.com/kliment/Printrun/blob/master/testtools/mock-printer.py

Of course, thanks! I forgot about that. It communicates without issues with that mock-up on my machine, yey! \o/