✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ premium290.web-hosting.com ​🇻​♯➤ 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP 🇾​♯➤ 2025

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 63.250.38.37 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.217.6
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ 𝗔𝗟𝗟 𝗪𝗢𝗥𝗞𝗜𝗡𝗚....

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /opt/cloudlinux/venv/lib/python3.11/site-packages/pyvirtualdisplay//smartdisplay.py
import logging
import time

from PIL import Image, ImageChops
from PIL.ImageGrab import grab

from pyvirtualdisplay import Display

log = logging.getLogger(__name__)


class DisplayTimeoutError(Exception):
    pass


def autocrop(im, bgcolor):
    """Crop borders off an image.

    :param im: Source image.
    :param bgcolor: Background color, using either a color tuple.
    :return: An image without borders, or None if there's no actual content in the image.
    """
    if im.mode != "RGB":
        im = im.convert("RGB")
    bg = Image.new("RGB", im.size, bgcolor)
    diff = ImageChops.difference(im, bg)
    bbox = diff.getbbox()
    if bbox:
        return im.crop(bbox)
    return None  # no contents


class SmartDisplay(Display):
    def autocrop(self, im):
        """Crop borders off an image.

        :param im: Source image.
        :return: An image without borders, or None if there's no actual content in the image.
        """
        return autocrop(im, self._bgcolor)

    def grab(self, autocrop=True):
        # TODO: use Xvfb fbdir option for screenshot
        img = grab(xdisplay=self.new_display_var)

        if autocrop:
            img = self.autocrop(img)
        return img

    def waitgrab(self, timeout=60, autocrop=True, cb_imgcheck=None):
        """start process and create screenshot.
        Repeat screenshot until it is not empty and
        cb_imgcheck callback function returns True
        for current screenshot.

        :param autocrop: True -> crop screenshot
        :param timeout: int
        :param cb_imgcheck: None or callback for testing img,
                            True = accept img,
                            False = reject img
        """
        t = 0
        sleep_time = 0.3  # for fast windows
        repeat_time = 0.5
        while 1:
            log.debug("sleeping %s secs" % str(sleep_time))
            time.sleep(sleep_time)
            t += sleep_time
            img = self.grab(autocrop=False)
            img_crop = self.autocrop(img)
            if autocrop:
                img = img_crop
            if img_crop:
                if not cb_imgcheck:
                    break
                if cb_imgcheck(img):
                    break
            sleep_time = repeat_time
            repeat_time += 0.5  # progressive
            if t > timeout:
                msg = "Timeout! elapsed time:%s timeout:%s " % (t, timeout)
                raise DisplayTimeoutError(msg)
                # break

            log.debug("screenshot is empty, next try..")
        assert img
        #        if not img:
        #            log.debug('screenshot is empty!')
        return img


Current_dir [ 𝗡𝗢𝗧 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
25 Jun 2026 7.01 AM
root / root
0755
__pycache__
--
11 Feb 2026 8.04 AM
root / root
0755
examples
--
11 Feb 2026 8.04 AM
root / root
0755
__init__.py
0.235 KB
20 Jan 2026 1.01 PM
root / root
0644
about.py
0.02 KB
20 Jan 2026 1.01 PM
root / root
0644
abstractdisplay.py
12.288 KB
20 Jan 2026 1.01 PM
root / root
0644
display.py
3.181 KB
20 Jan 2026 1.01 PM
root / root
0644
py.typed
0 KB
20 Jan 2026 1.01 PM
root / root
0644
smartdisplay.py
2.601 KB
20 Jan 2026 1.01 PM
root / root
0644
util.py
0.475 KB
20 Jan 2026 1.01 PM
root / root
0644
xauth.py
1.14 KB
20 Jan 2026 1.01 PM
root / root
0644
xephyr.py
1.597 KB
20 Jan 2026 1.01 PM
root / root
0644
xvfb.py
1.896 KB
20 Jan 2026 1.01 PM
root / root
0644
xvnc.py
1.872 KB
20 Jan 2026 1.01 PM
root / root
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF