Describe the bug
Loading the blueprint string of a book with individual blueprints scattered across multiple slots with gaps between them loses the index of the individual blueprints.
and processing the blueprint string with the following snippet:
import sys
import functools
import draftsman.blueprintable
data = b"".join(iter(functools.partial(sys.stdin.buffer.read, 1024), b""))
bp = draftsman.blueprintable.get_blueprintable_from_string(data)
print(bp.to_string())
will pack the individual blueprints in the book together, making them lose their original positioning in the original blueprint string:
Expected behavior
When loading a blueprint string of a book into a draftsman.blueprintable.BlueprintBook instance and converting the result back to a blueprint string should preserve the position of individual blueprints within the given blueprint book.
Please also include the following:
Draftsman version: factorio-draftsman==1.1.1
Python version: CPython 3.12.2
Describe the bug Loading the blueprint string of a book with individual blueprints scattered across multiple slots with gaps between them loses the index of the individual blueprints.
Current Behavior Given the blueprint string
and processing the blueprint string with the following snippet:
will pack the individual blueprints in the book together, making them lose their original positioning in the original blueprint string:
Expected behavior When loading a blueprint string of a book into a
draftsman.blueprintable.BlueprintBook
instance and converting the result back to a blueprint string should preserve the position of individual blueprints within the given blueprint book.Please also include the following: Draftsman version:
factorio-draftsman==1.1.1
Python version:CPython 3.12.2