Skip to content

Commit 8a0c2d8

Browse files
committed
v1.1.318a25 MacOS test
* Fixed bug with the `Rectangle` class's `copy()` function not creating a copy of the position lists and just creating a new reference * Fixed bug with the `Colour` class's `__eq__()` and `__nq__()` functions raising an `AttributeError` when comparing against a non-`Colour` object * Fixed the `hex_to_rgb()` and `_hex_to_rgb()` functions to return a tuple, not generator * Fixed bug with the `hex_to_hsl()` and `hex_to_hsv()` functions both returning CMYK values * Created new colour converter testing functions * Changed `Window` `__repr__()` function to use `"Window"` and not `"GraphWin"` * Renamed the `Window` `is_resizable()`, `is_width_resizable()`, and `is_height_resizable()` to use `get` instead * The `Window` `get_resizable()` function now returns a `tuple` not a `list` * Removed the `Window` `__str__()` function since `__repr__()` defined the same thing * Added `Window` getter function testing functions * Fixed bugs with all the CMYK colour conversion functions * Changed the `GraphicsError` in the `Window`'s `__check_open()` function to include the string `"GraphicsError"` at the start and return `True` if the window is open * Added `_check__check_open()` and `_check__autoflush()` methods to the `Window` class to check the functionality of private methods * Removed the `Window` `start_move()` and `stop_move()` methods until I can figure out what they do * Removed the `Window` `draw_bounds()` function because it wasn't required. * Fixed the `Window` `get_pos()`, `get_x_pos()`, and `get_y_pos()` functions to return the value relative to 0, 0 * Replaced all instances of the deprecated `Point` class usages with lists in `Window.py` * The `Window` `set_background()` method no longer uses styles * Changed `Window` `get_bk_colour()` method to `get_background()` to be consistent with the setter * `Window` background colours can not be inputted as hex strings * Removed all auto-flush checks in the `Window` methods because its private method `__autoflush()` also does that * Renamed the variable `RELIEF` to `BORDER_RELIEFS` * The `Window` `set_icon()` method now accepts icons in the local folder too * Added 3 getter methods to the `Window` class: `get_draggable()`, `get_x_draggable_x()`, `get_y_draggable()` * Added 5 getter methods to the `Window` class: `get_top_right()`, `get_top_left()`, `get_bottom_right()`, `get_bottom_left()`, and `get_center()` * Fixed bug with the `GraphicsObject` get animation time left functions raising a `TypeError` * Fixed error with the `Text` `clone()` method trying to clone a `None` type bounds object * Added 5 getter methods to the `_BBox` classes: `get_top_right()`, `get_top_left()`, `get_bottom_right()`, `get_bottom_left()`, `get_left()`, `get_right()`, `get_bottom()`, `get_top()` * Fixed the colour definition of `DARKISH_TURQUOISE` from a purple colour to a turquoise colour * Internally changed how the button `Button` class keeps a track of its current state (normal, hover, or clicked) * Redefined the `_update_lasttime` variable which was removed for an unknown reason * Renamed the base colour conversion functions, like `_rgb_to_hex()` to `rgb_to_hex_nocheck()` * Added a `__version__` variable that keeps track of the goopyplib version, and an `__all__` variable * Added American (spelled with color) colour conversion tests to `goopylib_tests.py` * Renamed the goopylib `math` subpackage to `maths` to avoid conflicts with Python's standard library * Removed `'x_cursor'` from `CURSORS` and moved it to `CURSORS_WINDOWS` since it isn't available on MacOS
1 parent 64ba9f2 commit 8a0c2d8

29 files changed

+66
-62
lines changed

Examples/SnakeGame/SnakeGame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
# [x, y]
6767
apple_position = [random.randint(0, 19) * 30 + 15, random.randint(0, 19) * 30 + 15]
6868
# between [0, 0] and [19, 19]
69-
apple = Circle(apple_position, 10, fill=LIGHTISH_RED).draw(window)
69+
apple = Circle(apple_position, 10, fill=LIGHTISH_RED, outline_width=0).draw(window)
7070
apple.animate_blinking(0.2) # blinks the apple at a rate of 0.2 seconds
7171

7272
apple_eaten = False

Examples/triangulation_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
if False:
1111
while True:
1212
print(timeit.timeit(
13-
setup="from __main__ import vertices; from goopylib.math.Triangulation import triangulate_earclip",
13+
setup="from __main__ import vertices; from goopylib.maths.Triangulation import triangulate_earclip",
1414
stmt="triangulate_earclip(vertices)", number=1000))
1515
print(timeit.timeit(
16-
setup="from __main__ import vertices; from goopylib.math.Triangulation import triangulate_modified_earclip",
16+
setup="from __main__ import vertices; from goopylib.maths.Triangulation import triangulate_modified_earclip",
1717
stmt="triangulate_modified_earclip(vertices)", number=1000))
1818

1919
print()

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ There are 5 subpackages in goopylib: objects, math, sound, physics, & applicatio
6666
To import these, type:
6767

6868
```python
69-
from goopylib.math.py_bezier_curve import py_bezier_curve # The other modules are 'Interpolation', & 'BSpline'
69+
from goopylib.maths.py_bezier_curve import py_bezier_curve # The other modules are 'Interpolation', & 'BSpline'
7070
# or
7171
from goopylib.objects.Rectangle import Rectangle # For a list of graphics objects, look at the documentation
7272
```
@@ -177,7 +177,7 @@ https://stackoverflow.com/questions/63978464/error-when-compiling-cpython-cannot
177177
There are probably still a lot of bugs in the release version, but I moved onto Version 1.1 because I started working
178178
on converting goopylib code to Cython & C and also building a Sound Engine for goopylib 1.2
179179

180-
#### 1.1.316-alpha25 5th May - 25th May 2021 - 25,061 lines of code
180+
#### 1.1.318-alpha25 5th May - 25th May 2021 - 25,061 lines of code
181181

182182
* Fixed bug with the `Rectangle` class's `copy()` function not creating a copy of the position lists and just creating a
183183
new reference
@@ -224,8 +224,10 @@ against a non-`Colour` object
224224
* Redefined the `_update_lasttime` variable which was removed for an unknown reason
225225

226226
* Renamed the base colour conversion functions, like `_rgb_to_hex()` to `rgb_to_hex_nocheck()`
227-
* Added a `__version__` variable that keeps track of the goopyplib version
227+
* Added a `__version__` variable that keeps track of the goopyplib version, and an `__all__` variable
228228
* Added American (spelled with color) colour conversion tests to `goopylib_tests.py`
229+
* Renamed the goopylib `math` subpackage to `maths` to avoid conflicts with Python's standard library
230+
* Removed `'x_cursor'` from `CURSORS` and moved it to `CURSORS_WINDOWS` since it isn't available on MacOS
229231

230232
#### 1.1.282-alpha24 29th March - 7th April 2021
231233

goopylib/Window.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from goopylib.styles import *
1111
from goopylib.util import GraphicsError, GraphicsWarning, resource_path
1212
from goopylib.constants import _root, BORDER_RELIEFS, CURSORS
13-
from goopylib.math.easing import *
13+
from goopylib.maths.easing import *
1414

1515
from goopylib._internal_classes import Transform
1616

@@ -857,7 +857,10 @@ def set_cursor(self, cursor, _internal_call=False):
857857
else:
858858
self.cursor = cursor.lower()
859859

860-
self.config(cursor=CURSORS[cursor])
860+
try:
861+
self.config(cursor=CURSORS[cursor])
862+
except:
863+
print(cursor, CURSORS[cursor])
861864
self.__autoflush()
862865
return self
863866

goopylib/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from goopylib.Window import Window
99

1010
__all__ = ['Window', 'util', 'styles', 'constants', 'colours']
11-
__version__ = "1.1.316a25"
11+
__version__ = "1.1.318a25"
1212

1313
from platform import system as platform_system
1414
if platform_system() == "Windows":

goopylib/c_colours.so

97.4 KB
Binary file not shown.

goopylib/colours.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from random import randint as randomrandint
22

3-
from goopylib.math.interpolations import *
3+
from goopylib.maths.interpolations import *
44

55

66
# -------------------------------------------------------------------------

goopylib/constants.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"resizeupdown", "none", "notallowed", "poof", "countinguphand", "countingdownhand",
2828
"countingupanddownhand", "spinning"}
2929

30-
CURSORS = {"x": "x_cursor", "arrow": "arrow", "based-down-arrow": "based_arrow_down",
30+
CURSORS = {"arrow": "arrow", "based-down-arrow": "based_arrow_down",
3131
"based-up-arrow": "based_arrow_up", "boat": "boat", "maze_symbol": "bogosity",
3232
"bottom-left-corner-arrow": "bottom_left_corner", "bottom-right-corner-arrow": "bottom_right_corner",
3333
"download": "bottom_side", "bottom-t": "bottom_tee", "spiral": "box_spiral", "up-arrow-thin": "center_ptr",
@@ -48,10 +48,9 @@
4848
"spraycan": "spraycan", "star": "star", "target": "target", "t-cross": "tcross",
4949
"flipped-pointer": "top_left_arrow", "top-left-corner-arrow": "top_left_corner",
5050
"top-right-corner-arrow": "top_right_corner", "top-download": "top_side", "top-t": "top_tee",
51-
"virus": "trek",
52-
"top-left-corner": "ul_angle", "umbrella": "umbrella", "top-right-corner": "ur_angle", "loading": "watch",
53-
"text-cursor": "xterm"}
54-
CURSORS_WINDOWS = {"cancel": "no"}
51+
"virus": "trek", "top-left-corner": "ul_angle", "umbrella": "umbrella", "top-right-corner": "ur_angle",
52+
"loading": "watch", "text-cursor": "xterm"}
53+
CURSORS_WINDOWS = {"cancel": "no", "x": "x_cursor"}
5554
CURSORS_MACOSX = {}
5655

5756
BORDER_RELIEFS = {"flat", "sunken", "raised", "groove", "ridge"}

goopylib/imports.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
from goopylib.Window import Window
77

88
from goopylib.objects.imports import *
9-
from goopylib.math.imports import *
9+
from goopylib.maths.imports import *
1010
from goopylib.sound.imports import *

goopylib/math/bezier_curve.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)