Skip to content

Commit

Permalink
Prep for 0.1.7 release
Browse files Browse the repository at this point in the history
  • Loading branch information
kageurufu committed Feb 10, 2022
1 parent 7169bd6 commit 04c14ae
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
30 changes: 17 additions & 13 deletions preprocess_cancellation.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
import json
import logging
import pathlib
import platform
import re
import shutil
import statistics
import sys
import tempfile
import time
from typing import Any, Dict, List, NamedTuple, Optional, Set, Tuple, TypeVar
from typing import Dict, List, NamedTuple, Optional, Set, Tuple, TypeVar

__version__ = "0.1.7"


logging.basicConfig(stream=sys.stderr, level=logging.INFO)
logger = logging.getLogger("prepropress_cancellation")
Expand All @@ -25,8 +26,7 @@
except OSError:
logger.exception("Failed to import shapely. Are you missing libgeos?")


HEADER_MARKER = "; Pre-Processed for Cancel-Object support\n"
HEADER_MARKER = f"; Pre-Processed for Cancel-Object support by preprocess_cancellation v{__version__}\n"


PathLike = TypeVar("PathLike", str, pathlib.Path)
Expand Down Expand Up @@ -332,15 +332,19 @@ def preprocess_slicer(infile):
infile.seek(0)
for line in infile:
yield line
if line.strip() and not line.startswith(";"):
break

if line.startswith("; generated by"):
yield from header(len(known_objects))
for object_id, hull in known_objects.values():
yield from define_object(
object_id,
center=hull.center(),
polygon=hull.exterior(),
)
yield from header(len(known_objects))
for object_id, hull in known_objects.values():
yield from define_object(
object_id,
center=hull.center(),
polygon=hull.exterior(),
)

for line in infile:
yield line

if line.startswith("; printing object "):
yield from object_start_marker(known_objects[line.split("printing object")[1].strip()].name)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "preprocess_cancellation"
version = "0.1.6"
version = "0.1.7"
description = "GCode processor to add klipper cancel-object markers"
readme = "README.md"
authors = ["Franklyn Tackitt <[email protected]>"]
Expand Down

0 comments on commit 04c14ae

Please sign in to comment.