Skip to content

Commit

Permalink
📝 Start marking methods with @available decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
alicerunsonfedora committed Aug 10, 2021
1 parent 603262a commit 9c91a77
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
11 changes: 11 additions & 0 deletions game/System/Library/CADeprecated.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,17 @@ init python in CADeprecated:
if deprecated and __version_meets_minimum_requirements(current, deprecated):
warnings.warn(deprecated_msg)
clog.warn(deprecated_msg)

if method.__doc__ is None:
method.__doc__ = method.__name__ + " Documentation\n"

if introduced:
method.__doc__ += "\nCandella Verison Introduced: %s" % (introduced)
if deprecated:
method.__doc__ += "\nCandella Version Deprecated: %s" % (deprecated)
if message:
method.__doc__ += " (%s)" % (message)

return method(*args, **kwargs)
return __wrapped_call
return __available
Expand Down
6 changes: 5 additions & 1 deletion game/System/Library/CADesign.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@
init offset = -50
init python in CADesign:
from store import Frame, AlphaMask
from store.CADeprecated import available

@available("*", introduced="apple-cinnamon")
def get_app_mask_frame():
"""Returns a frame with a mask of an application's borders."""
return Frame("System/Library/Design/app_mask.png")


@available("*", introduced="apple-cinnamon")
def get_app_mask(image, size):
"""Returns an AlphaMask of an application's borders."""
return AlphaMask(image, get_app_mask_frame(), xysize=(size, size))
3 changes: 3 additions & 0 deletions game/System/Library/Effects/ASDynamicBlur/ASDyanmicBlur.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#
# MARK: Dynamic Blur Effects
init -1 python:
from store.CADeprecated import available

def SetThumbnailFull():
config.thumbnail_width = config.screen_width
config.thumbnail_height = config.screen_height
Expand All @@ -15,6 +17,7 @@ init -1 python:
config.thumbnail_width = 256
config.thumbnail_height = 144

@available('*', introduced="apple-cinnamon")
def ca_supports_blur():
return renpy.version(tuple=True) > (7, 4, 0) and config.gl2

Expand Down

0 comments on commit 9c91a77

Please sign in to comment.