Skip to content

Commit

Permalink
Continue without shapely when missing libgeos
Browse files Browse the repository at this point in the history
  • Loading branch information
Franklyn committed Sep 30, 2021
1 parent f1a9228 commit 5fed728
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions preprocess_cancellation.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import logging
import time
import pathlib
import platform
import re
import shutil
import statistics
Expand All @@ -16,11 +17,13 @@
logging.basicConfig(stream=sys.stderr, level=logging.INFO)
logger = logging.getLogger("prepropress_cancellation")

shapely = None
try:
import shapely.geometry
except ImportError:
logger.info("Shapely not found, complex hulls disabled")
shapely = None
except OSError:
logger.exception("Failed to import shapely. Are you missing libgeos?")


HEADER_MARKER = "; Pre-Processed for Cancel-Object support\n"
Expand Down Expand Up @@ -501,4 +504,4 @@ def _main():
sys.exit(exitcode)

if __name__ == "__main__":
_main()
_main()
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.3"
version = "0.1.4"
description = "GCode processor to add klipper cancel-object markers"
authors = ["Franklyn Tackitt <[email protected]>"]
repository = "https://github.com/kageurufu/cancelobject-preprocessor"
Expand Down

0 comments on commit 5fed728

Please sign in to comment.