mirror of
https://codeberg.org/cblanken/boggler.git
synced 2026-07-26 03:29:26 -04:00
Add poetry script to run main boggler script
- Also correct import for boggler_utils to be relative in __main__.py so it can be run as module with `python -m boggler`
This commit is contained in:
+5
-2
@@ -1,9 +1,9 @@
|
||||
"""Boggler Demo"""
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from boggler_utils import BoggleBoard, build_full_boggle_tree, read_boggle_file
|
||||
from .boggler_utils import BoggleBoard, build_full_boggle_tree, read_boggle_file
|
||||
|
||||
if __name__ == '__main__':
|
||||
def main():
|
||||
if len(sys.argv) < 3 or len(sys.argv) > 4:
|
||||
print('Usage: python3 boggler.py <BOARD_FILE> <WORDLISTS_DIR> [MAX_WORD_LENGTH]')
|
||||
sys.exit(1)
|
||||
@@ -32,3 +32,6 @@ if __name__ == '__main__':
|
||||
print("The [MAX_WORD_LENGTH] argument must be an integer.")
|
||||
print("Please try again.")
|
||||
sys.exit(1)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@@ -28,6 +28,9 @@ readme = "README.md"
|
||||
[tool.poetry.dependencies]
|
||||
python = "^3.11"
|
||||
|
||||
[tool.poetry.scripts]
|
||||
boggler = "boggler.__main__:main"
|
||||
|
||||
|
||||
[build-system]
|
||||
requires = ["poetry-core"]
|
||||
|
||||
Reference in New Issue
Block a user