TurtleExtension 1.0.0__tar.gz → 2.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {turtleextension-1.0.0 → turtleextension-2.0.0}/PKG-INFO +4 -4
- {turtleextension-1.0.0 → turtleextension-2.0.0}/README.md +3 -3
- {turtleextension-1.0.0 → turtleextension-2.0.0}/TurtleExtension.egg-info/PKG-INFO +4 -4
- turtleextension-2.0.0/TurtleExtension.egg-info/SOURCES.txt +21 -0
- turtleextension-2.0.0/TurtleExtension.egg-info/top_level.txt +1 -0
- {turtleextension-1.0.0 → turtleextension-2.0.0}/pyproject.toml +7 -2
- {turtleextension-1.0.0/TurtleExtension → turtleextension-2.0.0/turtle_extension}/__init__.py +12 -16
- {turtleextension-1.0.0/TurtleExtension/Foundations → turtleextension-2.0.0/turtle_extension/foundations}/__init__.py +13 -16
- turtleextension-1.0.0/TurtleExtension/Foundations/CustomTurtleShapes.py → turtleextension-2.0.0/turtle_extension/foundations/custom_turtle_shapes.py +3 -2
- turtleextension-1.0.0/TurtleExtension/Foundations/CustomTurtleShapes.pyi → turtleextension-2.0.0/turtle_extension/foundations/custom_turtle_shapes.pyi +15 -18
- turtleextension-1.0.0/TurtleExtension/Foundations/GlobalFunctions.py → turtleextension-2.0.0/turtle_extension/foundations/global_functions.py +12 -11
- turtleextension-1.0.0/TurtleExtension/Foundations/GlobalFunctions.pyi → turtleextension-2.0.0/turtle_extension/foundations/global_functions.pyi +4 -9
- turtleextension-1.0.0/TurtleExtension/Foundations/GlobalVariables.pyi → turtleextension-2.0.0/turtle_extension/foundations/global_variables.pyi +1 -3
- turtleextension-1.0.0/TurtleExtension/Foundations/TurtleFunctions.py → turtleextension-2.0.0/turtle_extension/foundations/turtle_functions.py +5 -4
- turtleextension-1.0.0/TurtleExtension/Foundations/TurtleFunctions.pyi → turtleextension-2.0.0/turtle_extension/foundations/turtle_functions.pyi +1 -4
- turtleextension-2.0.0/turtle_extension/turtle_heart/__init__.py +6 -0
- turtleextension-1.0.0/TurtleExtension/TurtleHeart/TurtleSkeleton.py → turtleextension-2.0.0/turtle_extension/turtle_heart/turtle_skeleton.py +2 -1
- turtleextension-1.0.0/TurtleExtension/TurtleHeart/TurtleSkeleton.pyi → turtleextension-2.0.0/turtle_extension/turtle_heart/turtle_skeleton.pyi +3 -30
- turtleextension-1.0.0/TurtleExtension/TurtleHeart/__init__.py +0 -6
- turtleextension-1.0.0/TurtleExtension.egg-info/SOURCES.txt +0 -21
- turtleextension-1.0.0/TurtleExtension.egg-info/top_level.txt +0 -1
- {turtleextension-1.0.0 → turtleextension-2.0.0}/LICENSE +0 -0
- {turtleextension-1.0.0 → turtleextension-2.0.0}/TurtleExtension.egg-info/dependency_links.txt +0 -0
- {turtleextension-1.0.0 → turtleextension-2.0.0}/TurtleExtension.egg-info/requires.txt +0 -0
- {turtleextension-1.0.0 → turtleextension-2.0.0}/setup.cfg +0 -0
- /turtleextension-1.0.0/TurtleExtension/Foundations/GlobalVariables.py → /turtleextension-2.0.0/turtle_extension/foundations/global_variables.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: TurtleExtension
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.0.0
|
|
4
4
|
Summary: A Python utility library providing turtle extensions on top of Python's original turtle feature.
|
|
5
5
|
Author-email: "Miah M. Sabiq" <miah.sabiq@gibs.at>
|
|
6
6
|
Requires-Python: >=3.14
|
|
@@ -30,7 +30,7 @@ TurtleExtension is a Python project dedicated to extending and experimenting wit
|
|
|
30
30
|
Once published to PyPI, install with:
|
|
31
31
|
|
|
32
32
|
```bash
|
|
33
|
-
python -m pip install
|
|
33
|
+
python -m pip install turtle_extension
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
## Usage
|
|
@@ -38,7 +38,7 @@ python -m pip install TurtleExtension
|
|
|
38
38
|
```python
|
|
39
39
|
import turtle
|
|
40
40
|
|
|
41
|
-
# Your
|
|
41
|
+
# Your turtle_extension functionality goes here.
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
The public API and usage examples will be documented as the project develops.
|
|
@@ -49,7 +49,7 @@ Clone the repository:
|
|
|
49
49
|
|
|
50
50
|
```bash
|
|
51
51
|
git clone https://github.com/YOUR-USERNAME/TurtleExtension.git
|
|
52
|
-
cd
|
|
52
|
+
cd turtle_extension
|
|
53
53
|
```
|
|
54
54
|
|
|
55
55
|
Install the package locally if your project contains a `pyproject.toml`:
|
|
@@ -19,7 +19,7 @@ TurtleExtension is a Python project dedicated to extending and experimenting wit
|
|
|
19
19
|
Once published to PyPI, install with:
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
python -m pip install
|
|
22
|
+
python -m pip install turtle_extension
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
## Usage
|
|
@@ -27,7 +27,7 @@ python -m pip install TurtleExtension
|
|
|
27
27
|
```python
|
|
28
28
|
import turtle
|
|
29
29
|
|
|
30
|
-
# Your
|
|
30
|
+
# Your turtle_extension functionality goes here.
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
The public API and usage examples will be documented as the project develops.
|
|
@@ -38,7 +38,7 @@ Clone the repository:
|
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
40
|
git clone https://github.com/YOUR-USERNAME/TurtleExtension.git
|
|
41
|
-
cd
|
|
41
|
+
cd turtle_extension
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
Install the package locally if your project contains a `pyproject.toml`:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: TurtleExtension
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.0.0
|
|
4
4
|
Summary: A Python utility library providing turtle extensions on top of Python's original turtle feature.
|
|
5
5
|
Author-email: "Miah M. Sabiq" <miah.sabiq@gibs.at>
|
|
6
6
|
Requires-Python: >=3.14
|
|
@@ -30,7 +30,7 @@ TurtleExtension is a Python project dedicated to extending and experimenting wit
|
|
|
30
30
|
Once published to PyPI, install with:
|
|
31
31
|
|
|
32
32
|
```bash
|
|
33
|
-
python -m pip install
|
|
33
|
+
python -m pip install turtle_extension
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
## Usage
|
|
@@ -38,7 +38,7 @@ python -m pip install TurtleExtension
|
|
|
38
38
|
```python
|
|
39
39
|
import turtle
|
|
40
40
|
|
|
41
|
-
# Your
|
|
41
|
+
# Your turtle_extension functionality goes here.
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
The public API and usage examples will be documented as the project develops.
|
|
@@ -49,7 +49,7 @@ Clone the repository:
|
|
|
49
49
|
|
|
50
50
|
```bash
|
|
51
51
|
git clone https://github.com/YOUR-USERNAME/TurtleExtension.git
|
|
52
|
-
cd
|
|
52
|
+
cd turtle_extension
|
|
53
53
|
```
|
|
54
54
|
|
|
55
55
|
Install the package locally if your project contains a `pyproject.toml`:
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
TurtleExtension.egg-info/PKG-INFO
|
|
5
|
+
TurtleExtension.egg-info/SOURCES.txt
|
|
6
|
+
TurtleExtension.egg-info/dependency_links.txt
|
|
7
|
+
TurtleExtension.egg-info/requires.txt
|
|
8
|
+
TurtleExtension.egg-info/top_level.txt
|
|
9
|
+
turtle_extension/__init__.py
|
|
10
|
+
turtle_extension/foundations/__init__.py
|
|
11
|
+
turtle_extension/foundations/custom_turtle_shapes.py
|
|
12
|
+
turtle_extension/foundations/custom_turtle_shapes.pyi
|
|
13
|
+
turtle_extension/foundations/global_functions.py
|
|
14
|
+
turtle_extension/foundations/global_functions.pyi
|
|
15
|
+
turtle_extension/foundations/global_variables.py
|
|
16
|
+
turtle_extension/foundations/global_variables.pyi
|
|
17
|
+
turtle_extension/foundations/turtle_functions.py
|
|
18
|
+
turtle_extension/foundations/turtle_functions.pyi
|
|
19
|
+
turtle_extension/turtle_heart/__init__.py
|
|
20
|
+
turtle_extension/turtle_heart/turtle_skeleton.py
|
|
21
|
+
turtle_extension/turtle_heart/turtle_skeleton.pyi
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
turtle_extension
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "TurtleExtension"
|
|
7
|
-
version = "
|
|
7
|
+
version = "2.0.0"
|
|
8
8
|
description = "A Python utility library providing turtle extensions on top of Python's original turtle feature."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">= 3.14"
|
|
@@ -19,5 +19,10 @@ authors = [
|
|
|
19
19
|
|
|
20
20
|
[tool.setuptools.packages.find]
|
|
21
21
|
include = [
|
|
22
|
-
"
|
|
22
|
+
"turtle_extension*",
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
[tool.ruff.lint]
|
|
26
|
+
ignore = [
|
|
27
|
+
"RUF022",
|
|
23
28
|
]
|
{turtleextension-1.0.0/TurtleExtension → turtleextension-2.0.0/turtle_extension}/__init__.py
RENAMED
|
@@ -12,27 +12,23 @@ And a lot more.
|
|
|
12
12
|
Author: Miah M. Sabiq
|
|
13
13
|
"""
|
|
14
14
|
|
|
15
|
-
from .
|
|
15
|
+
from .foundations import (
|
|
16
|
+
CUSTOM_SHAPES,
|
|
17
|
+
SU,
|
|
16
18
|
UV,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
TurtleFct,
|
|
20
|
+
UserShape,
|
|
20
21
|
get_screen,
|
|
21
|
-
|
|
22
|
+
get_UserShape_dict,
|
|
22
23
|
mainloop,
|
|
23
|
-
tls_color,
|
|
24
24
|
reset_tls,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
CUSTOM_SHAPES,
|
|
29
|
-
|
|
30
|
-
TurtleFct,
|
|
25
|
+
t_now,
|
|
26
|
+
t_shape,
|
|
27
|
+
tls_color,
|
|
31
28
|
)
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
tl,
|
|
29
|
+
from .turtle_heart import (
|
|
30
|
+
ChainTurtle,
|
|
31
|
+
tl,
|
|
36
32
|
)
|
|
37
33
|
|
|
38
34
|
__all__ = [
|
|
@@ -1,25 +1,22 @@
|
|
|
1
|
-
from .
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
from .custom_turtle_shapes import (
|
|
2
|
+
CUSTOM_SHAPES,
|
|
3
|
+
UserShape,
|
|
4
|
+
get_UserShape_dict,
|
|
5
5
|
)
|
|
6
|
-
|
|
7
|
-
from .GlobalFunctions import (
|
|
8
|
-
get_screen,
|
|
6
|
+
from .global_functions import (
|
|
9
7
|
SU,
|
|
8
|
+
get_screen,
|
|
10
9
|
mainloop,
|
|
11
|
-
tls_color,
|
|
12
10
|
reset_tls,
|
|
11
|
+
tls_color,
|
|
13
12
|
)
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
CUSTOM_SHAPES,
|
|
13
|
+
from .global_variables import (
|
|
14
|
+
UV,
|
|
15
|
+
t_now,
|
|
16
|
+
t_shape,
|
|
19
17
|
)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
TurtleFct,
|
|
18
|
+
from .turtle_functions import (
|
|
19
|
+
TurtleFct,
|
|
23
20
|
)
|
|
24
21
|
|
|
25
22
|
__all__ = [
|
|
@@ -2,70 +2,67 @@
|
|
|
2
2
|
This module contains the class Usershape which contains functions to make a customized turtle shape.
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
-
from numbers import Real
|
|
6
5
|
from collections.abc import Callable, Sequence
|
|
6
|
+
from numbers import Real
|
|
7
|
+
|
|
8
|
+
type ReturnShapeType = Sequence[tuple[Real,Real]] | None
|
|
7
9
|
|
|
10
|
+
type UserShapeDictType = dict[
|
|
11
|
+
str,
|
|
12
|
+
Callable[[], ReturnShapeType]
|
|
13
|
+
]
|
|
8
14
|
|
|
9
|
-
type return_shape = Sequence[tuple[Real,Real]] | None
|
|
10
|
-
type user_shape_dict = dict[str, Callable[[], return_shape]]
|
|
11
15
|
|
|
12
16
|
class UserShape:
|
|
13
17
|
"""
|
|
14
18
|
This class contains different custom turtle shape maker functions
|
|
15
19
|
"""
|
|
16
20
|
@staticmethod
|
|
17
|
-
def custom_circle() ->
|
|
21
|
+
def custom_circle() -> ReturnShapeType:
|
|
18
22
|
"""
|
|
19
23
|
Creates a custom circle turtle shape.
|
|
20
24
|
:return: the custom shape
|
|
21
25
|
"""
|
|
22
|
-
...
|
|
23
26
|
|
|
24
27
|
@staticmethod
|
|
25
|
-
def custom_square() ->
|
|
28
|
+
def custom_square() -> ReturnShapeType:
|
|
26
29
|
"""
|
|
27
30
|
Creates a custom square turtle shape.
|
|
28
31
|
:return: the custom shape
|
|
29
32
|
"""
|
|
30
|
-
...
|
|
31
33
|
|
|
32
34
|
@staticmethod
|
|
33
|
-
def custom_triangle() ->
|
|
35
|
+
def custom_triangle() -> ReturnShapeType:
|
|
34
36
|
"""
|
|
35
37
|
Creates a custom equilateral triangle turtle shape.
|
|
36
38
|
:return: the custom shape
|
|
37
39
|
"""
|
|
38
|
-
...
|
|
39
40
|
|
|
40
41
|
@staticmethod
|
|
41
|
-
def custom_poly() ->
|
|
42
|
+
def custom_poly() -> ReturnShapeType:
|
|
42
43
|
"""
|
|
43
44
|
Creates a custom regular polygon turtle shape.
|
|
44
45
|
:return: the custom shape
|
|
45
46
|
"""
|
|
46
|
-
...
|
|
47
47
|
|
|
48
48
|
@staticmethod
|
|
49
|
-
def custom_SOD() ->
|
|
49
|
+
def custom_SOD() -> ReturnShapeType:
|
|
50
50
|
"""
|
|
51
51
|
Creates a custom star of David turtle shape.
|
|
52
52
|
:return: the custom shape
|
|
53
53
|
"""
|
|
54
|
-
...
|
|
55
54
|
|
|
56
55
|
@classmethod
|
|
57
|
-
def _list_shapes(cls) ->
|
|
56
|
+
def _list_shapes(cls) -> UserShapeDictType:
|
|
58
57
|
"""
|
|
59
58
|
Creates a dictionary with the functions in UserShape and returns it
|
|
60
59
|
:return: dictionary containing function names -> function
|
|
61
60
|
"""
|
|
62
|
-
...
|
|
63
61
|
|
|
64
|
-
def get_UserShape_dict() ->
|
|
62
|
+
def get_UserShape_dict() -> UserShapeDictType:
|
|
65
63
|
"""
|
|
66
64
|
Takes all custom turtle functions in UserShape and returns a dictionary with them
|
|
67
65
|
:return: dictionary mapping function names to functions
|
|
68
66
|
"""
|
|
69
|
-
...
|
|
70
67
|
|
|
71
|
-
CUSTOM_SHAPES:
|
|
68
|
+
CUSTOM_SHAPES: UserShapeDictType
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
from ..TurtleHeart import tl, ChainTurtle
|
|
2
|
-
from .GlobalVariables import t_shape, UV
|
|
3
|
-
from turtle import TurtleGraphicsError
|
|
4
1
|
from time import sleep as rest
|
|
5
|
-
|
|
6
|
-
from typing import Final
|
|
2
|
+
from turtle import TurtleGraphicsError
|
|
3
|
+
from typing import Final
|
|
7
4
|
|
|
5
|
+
import uf
|
|
6
|
+
|
|
7
|
+
from ..turtle_heart import ChainTurtle, tl
|
|
8
|
+
from .global_variables import UV, t_shape
|
|
8
9
|
|
|
9
10
|
_screen = None
|
|
10
11
|
|
|
@@ -24,13 +25,12 @@ def SU():
|
|
|
24
25
|
def mainloop():
|
|
25
26
|
get_screen().mainloop()
|
|
26
27
|
|
|
27
|
-
type turtle_list = list[ChainTurtle]
|
|
28
28
|
|
|
29
29
|
def tls_color(**options):
|
|
30
30
|
|
|
31
|
-
tl_num_name: Final
|
|
32
|
-
entry_name: Final
|
|
33
|
-
index_name: Final
|
|
31
|
+
tl_num_name: Final = "tl_num"
|
|
32
|
+
entry_name: Final = "entry"
|
|
33
|
+
index_name: Final = "index"
|
|
34
34
|
|
|
35
35
|
if tl_num_name in options:
|
|
36
36
|
tl_num = options[tl_num_name]
|
|
@@ -51,7 +51,8 @@ def tls_color(**options):
|
|
|
51
51
|
else:
|
|
52
52
|
print("NONE of the entered options exist!")
|
|
53
53
|
return None
|
|
54
|
-
|
|
54
|
+
|
|
55
|
+
tls: list[ChainTurtle] = []
|
|
55
56
|
|
|
56
57
|
for color_num in range(turtles_num_count):
|
|
57
58
|
while True:
|
|
@@ -80,7 +81,7 @@ def tls_color(**options):
|
|
|
80
81
|
|
|
81
82
|
def reset_tls(tls_list):
|
|
82
83
|
|
|
83
|
-
tls_list_name: Final
|
|
84
|
+
tls_list_name: Final = "tls_list"
|
|
84
85
|
uf.TypeValidate(list)(tls_list, name=tls_list_name)
|
|
85
86
|
uf.SequenceValidate(ChainTurtle, ...)(tls_list, name=tls_list_name)
|
|
86
87
|
|
|
@@ -3,33 +3,29 @@ This module contains a very useful function: tls_color, which lets the user crea
|
|
|
3
3
|
colors and get a list with them.
|
|
4
4
|
"""
|
|
5
5
|
|
|
6
|
-
from ..
|
|
7
|
-
|
|
6
|
+
from ..turtle_heart import ChainTurtle, tl
|
|
8
7
|
|
|
9
8
|
def get_screen() -> tl.Screen:
|
|
10
9
|
"""
|
|
11
10
|
Initiates the turtle screen when the function is called.
|
|
12
11
|
:return: turtle screen object
|
|
13
12
|
"""
|
|
14
|
-
...
|
|
15
13
|
|
|
16
14
|
def SU() -> None:
|
|
17
15
|
"""
|
|
18
16
|
This function updates the turtle screen.
|
|
19
17
|
:return: None
|
|
20
18
|
"""
|
|
21
|
-
...
|
|
22
19
|
|
|
23
20
|
def mainloop() -> None:
|
|
24
21
|
"""
|
|
25
22
|
This function keeps the turtle screen open.
|
|
26
23
|
:return: None
|
|
27
24
|
"""
|
|
28
|
-
...
|
|
29
25
|
|
|
30
|
-
type
|
|
26
|
+
type TurtleListType = list[ChainTurtle]
|
|
31
27
|
|
|
32
|
-
def tls_color(**options) -> int | tuple[
|
|
28
|
+
def tls_color(**options) -> int | tuple[TurtleListType, int] | TurtleListType | None:
|
|
33
29
|
"""This function creates a turtle list with their colors or adds newly creates turtles to the UV["tls"] list
|
|
34
30
|
to be used for the user_drawing_ft()
|
|
35
31
|
|
|
@@ -39,9 +35,8 @@ def tls_color(**options) -> int | tuple[turtle_list, int] | turtle_list | None:
|
|
|
39
35
|
& it returns the index of the last turtle
|
|
40
36
|
:return: tls_num: turtle list with colored turtles, entry: list with colored turtles + number of turtles ,otherwise: index of last turtle
|
|
41
37
|
"""
|
|
42
|
-
...
|
|
43
38
|
|
|
44
|
-
def reset_tls(tls_list:
|
|
39
|
+
def reset_tls(tls_list: TurtleListType) -> list:
|
|
45
40
|
"""
|
|
46
41
|
This function deletes the drawings of given turtle list + turtles
|
|
47
42
|
|
|
@@ -9,8 +9,8 @@ t_shape() -> lets users take the current turtle shape
|
|
|
9
9
|
"""
|
|
10
10
|
|
|
11
11
|
from typing import Any
|
|
12
|
-
from ..TurtleHeart import ChainTurtle
|
|
13
12
|
|
|
13
|
+
from ..turtle_heart import ChainTurtle
|
|
14
14
|
|
|
15
15
|
UV: dict[str, Any]
|
|
16
16
|
|
|
@@ -25,7 +25,6 @@ def t_now() -> ChainTurtle:
|
|
|
25
25
|
|
|
26
26
|
:return: ChainTurtle
|
|
27
27
|
"""
|
|
28
|
-
...
|
|
29
28
|
|
|
30
29
|
def t_shape() -> str:
|
|
31
30
|
"""
|
|
@@ -37,4 +36,3 @@ def t_shape() -> str:
|
|
|
37
36
|
|
|
38
37
|
:return: string
|
|
39
38
|
"""
|
|
40
|
-
...
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
from
|
|
4
|
-
|
|
1
|
+
import uf
|
|
2
|
+
|
|
3
|
+
from ..turtle_heart import ChainTurtle, tl
|
|
4
|
+
from .custom_turtle_shapes import CUSTOM_SHAPES
|
|
5
|
+
from .global_variables import UV
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
class TurtleFct:
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
This module contains the class TurtleFct which lets the user change the turtle shape to a customized one.
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
-
from ..
|
|
6
|
-
|
|
5
|
+
from ..turtle_heart import ChainTurtle
|
|
7
6
|
|
|
8
7
|
class TurtleFct:
|
|
9
8
|
"""
|
|
@@ -16,7 +15,6 @@ class TurtleFct:
|
|
|
16
15
|
:param tls_num: ChainTurtle() or None
|
|
17
16
|
:return: ChainTurtle() if tls_num is a ChainTurtle(), otherwise None
|
|
18
17
|
"""
|
|
19
|
-
...
|
|
20
18
|
|
|
21
19
|
@staticmethod
|
|
22
20
|
def user_tls_shape_ft(tls_num: ChainTurtle | None = None) -> ChainTurtle | str:
|
|
@@ -25,4 +23,3 @@ class TurtleFct:
|
|
|
25
23
|
:param tls_num: ChainTurtle() or None
|
|
26
24
|
:return: ChainTurtle() if tls_num is a ChainTurtle(), otherwise None
|
|
27
25
|
"""
|
|
28
|
-
...
|
|
@@ -2,11 +2,8 @@
|
|
|
2
2
|
This module contains the class ChainTurtle() which is the foundational object around which this entire software has been made.
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
-
from numbers import Real
|
|
6
5
|
from collections.abc import Callable
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
tl = tl
|
|
6
|
+
from numbers import Real
|
|
10
7
|
|
|
11
8
|
class ChainTurtle:
|
|
12
9
|
"""This class adds chaining functionality to turtle.Turtle"""
|
|
@@ -16,7 +13,6 @@ class ChainTurtle:
|
|
|
16
13
|
:param distance: distance in pixels
|
|
17
14
|
:return: ChainTurtle()
|
|
18
15
|
"""
|
|
19
|
-
...
|
|
20
16
|
|
|
21
17
|
def fd_inv(self, distance: Real) -> ChainTurtle:
|
|
22
18
|
"""
|
|
@@ -24,7 +20,6 @@ class ChainTurtle:
|
|
|
24
20
|
:param distance: distance in pixels
|
|
25
21
|
:return: ChainTurtle()
|
|
26
22
|
"""
|
|
27
|
-
...
|
|
28
23
|
|
|
29
24
|
def bk(self, distance: Real) -> ChainTurtle:
|
|
30
25
|
"""
|
|
@@ -32,7 +27,6 @@ class ChainTurtle:
|
|
|
32
27
|
:param distance: distance in pixels
|
|
33
28
|
:return: ChainTurtle()
|
|
34
29
|
"""
|
|
35
|
-
...
|
|
36
30
|
|
|
37
31
|
def bk_inv(self, distance: Real) -> ChainTurtle:
|
|
38
32
|
"""
|
|
@@ -40,7 +34,6 @@ class ChainTurtle:
|
|
|
40
34
|
:param distance: distance in pixels
|
|
41
35
|
:return: ChainTurtle()
|
|
42
36
|
"""
|
|
43
|
-
...
|
|
44
37
|
|
|
45
38
|
def rt(self, angle: Real) -> ChainTurtle:
|
|
46
39
|
"""
|
|
@@ -48,7 +41,6 @@ class ChainTurtle:
|
|
|
48
41
|
:param angle: angle in degrees
|
|
49
42
|
:return: ChainTurtle()
|
|
50
43
|
"""
|
|
51
|
-
...
|
|
52
44
|
|
|
53
45
|
def lt(self, angle: Real) -> ChainTurtle:
|
|
54
46
|
"""
|
|
@@ -56,7 +48,6 @@ class ChainTurtle:
|
|
|
56
48
|
:param angle: angle in degrees
|
|
57
49
|
:return: ChainTurtle()
|
|
58
50
|
"""
|
|
59
|
-
...
|
|
60
51
|
|
|
61
52
|
def setpos(self, x_val: Real, y_val: Real) -> ChainTurtle:
|
|
62
53
|
"""
|
|
@@ -65,61 +56,53 @@ class ChainTurtle:
|
|
|
65
56
|
:param y_val: y position in pixels
|
|
66
57
|
:return: ChainTurtle()
|
|
67
58
|
"""
|
|
68
|
-
...
|
|
69
59
|
|
|
70
60
|
def pu(self) -> ChainTurtle:
|
|
71
61
|
"""
|
|
72
62
|
Puts the pen down to leave a trace.
|
|
73
63
|
:return: ChainTurtle()
|
|
74
64
|
"""
|
|
75
|
-
...
|
|
76
65
|
|
|
77
66
|
def pd(self) -> ChainTurtle:
|
|
78
67
|
"""
|
|
79
68
|
Puts the pen up to not leave a trace.
|
|
80
69
|
:return: ChainTurtle()
|
|
81
70
|
"""
|
|
82
|
-
...
|
|
83
71
|
|
|
84
72
|
def seth(self, direction: Real) -> ChainTurtle:
|
|
85
73
|
"""
|
|
86
74
|
Sets the direction of the turtle starting East, going counterclockwise.
|
|
87
75
|
:param direction: direction in degrees
|
|
88
76
|
"""
|
|
89
|
-
...
|
|
90
77
|
|
|
91
78
|
def home(self) -> ChainTurtle:
|
|
92
79
|
"""
|
|
93
80
|
Sets the position of the turtle to home (0, 0) with trace, heading = 0 .
|
|
94
81
|
:return: ChainTurtle()
|
|
95
82
|
"""
|
|
96
|
-
...
|
|
97
83
|
|
|
98
84
|
def home_inv(self) -> ChainTurtle:
|
|
99
85
|
"""
|
|
100
86
|
Sets the position of the turtle to home (0, 0) without trace, heading = 0 .
|
|
101
87
|
:return: ChainTurtle()
|
|
102
88
|
"""
|
|
103
|
-
...
|
|
104
89
|
|
|
105
90
|
def begin_fill(self) -> ChainTurtle:
|
|
106
91
|
"""
|
|
107
92
|
Makes the turtle begin fill for a closed shape.
|
|
108
93
|
:return: ChainTurtle()
|
|
109
94
|
"""
|
|
110
|
-
...
|
|
111
95
|
|
|
112
96
|
def end_fill(self) -> ChainTurtle:
|
|
113
97
|
"""
|
|
114
98
|
Ends the turtle fill for a closed shape, therefore fills the shapes.
|
|
115
99
|
:return: ChainTurtle()
|
|
116
100
|
"""
|
|
117
|
-
...
|
|
118
101
|
|
|
119
102
|
def circle(self,
|
|
120
103
|
radius: Real,
|
|
121
104
|
extent: Real | None = None,
|
|
122
|
-
steps: int = None) -> ChainTurtle:
|
|
105
|
+
steps: int | None = None) -> ChainTurtle:
|
|
123
106
|
"""
|
|
124
107
|
Makes the turtle draw a circle
|
|
125
108
|
:param radius: radius in pixels
|
|
@@ -127,33 +110,29 @@ class ChainTurtle:
|
|
|
127
110
|
:param steps: number of sides
|
|
128
111
|
:return: ChainTurtle()
|
|
129
112
|
"""
|
|
130
|
-
...
|
|
131
113
|
|
|
132
114
|
def circle_fill(self,
|
|
133
115
|
radius: Real,
|
|
134
116
|
angle: Real | None = None,
|
|
135
|
-
sides: int = None) -> ChainTurtle:
|
|
117
|
+
sides: int | None = None) -> ChainTurtle:
|
|
136
118
|
"""
|
|
137
119
|
Makes the turtle draw a circle and fills it
|
|
138
120
|
:param radius: radius in degrees
|
|
139
121
|
:param angle: angle in degrees
|
|
140
122
|
:param sides: number of sides
|
|
141
123
|
"""
|
|
142
|
-
...
|
|
143
124
|
|
|
144
125
|
def dot(self, radius: Real) -> ChainTurtle:
|
|
145
126
|
"""
|
|
146
127
|
Makes the turtle draw a colored dot
|
|
147
128
|
:param radius: radius in pixels
|
|
148
129
|
"""
|
|
149
|
-
...
|
|
150
130
|
|
|
151
131
|
def color(self, turtle_color: str) -> ChainTurtle:
|
|
152
132
|
"""
|
|
153
133
|
Lets the user change the color of the turtle trace and turtle color itself
|
|
154
134
|
:param turtle_color: valid turtle color
|
|
155
135
|
"""
|
|
156
|
-
...
|
|
157
136
|
|
|
158
137
|
def teleport(self, x: Real, y: Real, *, fill_gap: bool = False) -> ChainTurtle:
|
|
159
138
|
"""
|
|
@@ -161,35 +140,30 @@ class ChainTurtle:
|
|
|
161
140
|
:param x: x position in pixels
|
|
162
141
|
:param y: y position in pixels
|
|
163
142
|
"""
|
|
164
|
-
...
|
|
165
143
|
|
|
166
144
|
def shape(self, shape_name: str) -> ChainTurtle:
|
|
167
145
|
"""
|
|
168
146
|
Changes the shape of the turtle shape
|
|
169
147
|
:param shape_name: name of the shape
|
|
170
148
|
"""
|
|
171
|
-
...
|
|
172
149
|
|
|
173
150
|
def undo(self) -> ChainTurtle:
|
|
174
151
|
"""
|
|
175
152
|
Undoes the last turtle command.
|
|
176
153
|
:return: ChainTurtle()
|
|
177
154
|
"""
|
|
178
|
-
...
|
|
179
155
|
|
|
180
156
|
def clear(self) -> ChainTurtle:
|
|
181
157
|
"""
|
|
182
158
|
Deletes the turtles drawings.
|
|
183
159
|
:return: ChainTurtle()
|
|
184
160
|
"""
|
|
185
|
-
...
|
|
186
161
|
|
|
187
162
|
def ht(self) -> ChainTurtle:
|
|
188
163
|
"""
|
|
189
164
|
Hides the turtle.
|
|
190
165
|
:return: ChainTurtle()
|
|
191
166
|
"""
|
|
192
|
-
...
|
|
193
167
|
|
|
194
168
|
@classmethod
|
|
195
169
|
def list_methods(cls) -> dict[str, Callable]:
|
|
@@ -197,4 +171,3 @@ class ChainTurtle:
|
|
|
197
171
|
Creates a dictionary with all ChainTurtle methods and returns it
|
|
198
172
|
:return: dictionary
|
|
199
173
|
"""
|
|
200
|
-
...
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
LICENSE
|
|
2
|
-
README.md
|
|
3
|
-
pyproject.toml
|
|
4
|
-
TurtleExtension/__init__.py
|
|
5
|
-
TurtleExtension.egg-info/PKG-INFO
|
|
6
|
-
TurtleExtension.egg-info/SOURCES.txt
|
|
7
|
-
TurtleExtension.egg-info/dependency_links.txt
|
|
8
|
-
TurtleExtension.egg-info/requires.txt
|
|
9
|
-
TurtleExtension.egg-info/top_level.txt
|
|
10
|
-
TurtleExtension/Foundations/CustomTurtleShapes.py
|
|
11
|
-
TurtleExtension/Foundations/CustomTurtleShapes.pyi
|
|
12
|
-
TurtleExtension/Foundations/GlobalFunctions.py
|
|
13
|
-
TurtleExtension/Foundations/GlobalFunctions.pyi
|
|
14
|
-
TurtleExtension/Foundations/GlobalVariables.py
|
|
15
|
-
TurtleExtension/Foundations/GlobalVariables.pyi
|
|
16
|
-
TurtleExtension/Foundations/TurtleFunctions.py
|
|
17
|
-
TurtleExtension/Foundations/TurtleFunctions.pyi
|
|
18
|
-
TurtleExtension/Foundations/__init__.py
|
|
19
|
-
TurtleExtension/TurtleHeart/TurtleSkeleton.py
|
|
20
|
-
TurtleExtension/TurtleHeart/TurtleSkeleton.pyi
|
|
21
|
-
TurtleExtension/TurtleHeart/__init__.py
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
TurtleExtension
|
|
File without changes
|
{turtleextension-1.0.0 → turtleextension-2.0.0}/TurtleExtension.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|