-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
34 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import luma.core.framebuffer | ||
|
||
|
||
class __framebuffer_mixin(object): | ||
""" | ||
Helper class for initializing the framebuffer. Its only purpose is to | ||
log a deprecation warning if a string framebuffer is specified. | ||
.. note:: | ||
Specifying the framebuffer as a string will be removed at the next | ||
major release, and hence this mixin will become redundant and will | ||
also be removed at that point. | ||
""" | ||
|
||
def init_framebuffer(self, framebuffer): | ||
if isinstance(framebuffer, str): | ||
import warnings | ||
warnings.warn( | ||
"Specifying framebuffer as a string is now deprecated; Supply an instance of class full_frame() or diff_to_previous() instead", | ||
DeprecationWarning | ||
) | ||
self.framebuffer = getattr(luma.core.framebuffer, framebuffer)() | ||
else: | ||
self.framebuffer = framebuffer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters