Blighty

Latest version: v3.0.0

Safety actively analyzes 613631 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

2.1.2

What's New

This version fixes a problem with the artefact deployed to PyPI.

2.1.1

What's New

This release fixes a memory leak introduced by the new performance upgrade in version 2.

2.1.0

What's New

With version 2.1.0, blighty source code is made available from PyPI.

2.0.0

What's New

Version 2 brings considerable performance upgrades and comes with an official
documentation hosted on ReadTheDocs.io.

Brushes have been extended to GTK canvases, thus extending compatibility and
portability even further.

1.1.0

What's New

This release introduces _brushes_. Import the `brush` decorator from blighty and use it to decorate methods that you want to rebind to the context object. This feature is similar to the draw methods of release 1.0.0, except they can have any name, as long as it doesn't clash with any methods or attributes from `cairo.Context`.

1.0.0

What's New
Methods of subclasses of the X11 `Canvas` class that start with the `draw_` prefix will be re-bound to the cairo context passed to the `on_draw` callback method. For example,

~~~ python
class DrawMethodsCanvas(x11.Canvas):
def on_button_pressed(self, button, state, x, y):
if button == 1:
self.destroy()

def draw_rect(ctx, width, height):
ctx.set_source_rgb(*[r() for _ in range(3)])
ctx.rectangle(0, 0, width, height)
ctx.fill()

def on_draw(self, ctx):
for i in range(4):
ctx.draw_rect(self.width >> i, self.height >> i)
~~~

Whilst the method `draw_rect` is defined inside the `DrawMethodsCanvas` class, inside the `on_draw` method it can be accessible as a method of `ctx` (which is now an instance of `ExtendedContext`, a wrapper around `cairo.Context`).

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.