From 76e309ef0843145eb82c746a6afb274d49f6da28 Mon Sep 17 00:00:00 2001 From: Matias Fernandez Date: Thu, 19 May 2022 11:15:38 -0400 Subject: [PATCH] Added LICENSE.md --- LICENSE.md | 9 +++++++++ lib/imagegrab.py | 2 ++ pyvncs/server.py | 4 ++-- requeriments.txt | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 LICENSE.md diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..390a589 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,9 @@ +/* + * ------------------------------------------------------------ + * "THE BEERWARE LICENSE" (Revision 42): + * wrote this code. + * As long as you retain this notice, you can do whatever you + * want with this stuff. If we meet someday, and you think this + * stuff is worth it, you can buy me a beer in return. + * ------------------------------------------------------------ + */ \ No newline at end of file diff --git a/lib/imagegrab.py b/lib/imagegrab.py index 6ff18de..7da093e 100644 --- a/lib/imagegrab.py +++ b/lib/imagegrab.py @@ -8,6 +8,7 @@ if sys.platform == "linux" or sys.platform == "linux2": # take screen images, that's not the best way, so here # we use directly use xlib to take the screenshot. class ImageGrab(): + @staticmethod def grab(): dsp = display.Display() root = dsp.screen().root @@ -22,6 +23,7 @@ elif sys.platform == "darwin": log.debug("ImageGrab: running on darwin") import Quartz.CoreGraphics as CG class ImageGrab(): + @staticmethod def grab(): screenshot = CG.CGWindowListCreateImage(CG.CGRectInfinite, CG.kCGWindowListOptionOnScreenOnly, CG.kCGNullWindowID, CG.kCGWindowImageDefault) width = CG.CGImageGetWidth(screenshot) diff --git a/pyvncs/server.py b/pyvncs/server.py index 61ae83a..2588cd3 100644 --- a/pyvncs/server.py +++ b/pyvncs/server.py @@ -217,7 +217,7 @@ class VncServer(): self.depth = depth self.bpp = bpp bigendian = 0 - truecolor = 1 + self.truecolor = 1 red_maximum = 255 self.red_maximum = red_maximum green_maximum = 255 @@ -233,7 +233,7 @@ class VncServer(): self.rfb_bitmap = RfbBitmap() sendbuff = pack("!HH", width, height) - sendbuff += pack("!BBBB", bpp, depth, bigendian, truecolor) + sendbuff += pack("!BBBB", bpp, depth, bigendian, self.truecolor) sendbuff += pack("!HHHBBB", red_maximum, green_maximum, blue_maximum, red_shift, green_shift, blue_shift) sendbuff += pack("!xxx") # padding diff --git a/requeriments.txt b/requeriments.txt index 38bbd7e..8d781eb 100644 --- a/requeriments.txt +++ b/requeriments.txt @@ -1,5 +1,5 @@ pydes pynput -numpy +numpy==1.17 Pillow-PIL elevate