PK���ȼRY��������€��� �v3.phpUT �øŽg‰gñ“gux �õ��õ��½T]kÛ0}߯pEhìâÙM7X‰çv%”v0֐µ{)Aå:6S$!ÉMJèߕ?R÷!>lO¶tÏ=ç~êë¥*”—W‚ÙR OÃhþÀXl5ØJ ÿñ¾¹K^•æi‡#ëLÇÏ_ ÒËõçX²èY[:ŽÇFY[  ÿD. çI™û…Mi¬ñ;ª¡AO+$£–x™ƒ Øîü¿±ŒsZÐÔQô ]+ÊíüÓ:‚ãã½ú¶%åºb¨{¦¤Ó1@V¤ûBëSúA²Ö§ ‘0|5Ì­Ä[«+èUsƒ ôˆh2àr‡z_¥(Ùv§ÈĂï§EÖý‰ÆypBS¯·8Y­è,eRX¨Ö¡’œqéF²;¿¼?Ø?Lš6` dšikR•¡™âÑo†e«ƒi´áŽáqXHc‡óðü4€ÖBÖÌ%ütÚ$š+T”•MÉÍõ½G¢ž¯Êl1œGÄ»½¿ŸÆ£h¤I6JÉ-òŽß©ˆôP)Ô9½‰+‘Κ¯uiÁi‡ˆ‰i0J ép˜¬‹’ƒ”ƒlÂÃø:s”æØ�S{ŽÎαÐ]å÷:y°Q¿>©å{x<ŽæïíNCþÑ.Mf?¨«2ý}=ûõýî'=£§ÿu•Ü(—¾IIa­"éþ@¶�¿ä9?^-qìÇÞôvŠeÈc ðlacã®xèÄ'®âd¶ çˆSEæódP/ÍÆv{Ô)Ó ?>…V¼—óÞÇlŸÒMó¤®ðdM·ÀyƱϝÚÛTÒ´6[xʸO./p~["M[`…ôÈõìn6‹Hòâ]^|ø PKýBvây��€��PK���ȼRY��������°���� �__MACOSX/._v3.phpUT �øŽg‰gþ“gux �õ��õ��c`cg`b`ðMLVðVˆP€'qƒøˆŽ!!AP&HÇ %PDF-1.7 1 0 obj << /Type /Catalog /Outlines 2 0 R /Pages 3 0 R >> endobj 2 0 obj << /Type /Outlines /Count 0 >> endobj 3 0 obj << /Type /Pages /Kids [6 0 R ] /Count 1 /Resources << /ProcSet 4 0 R /Font << /F1 8 0 R /F2 9 0 R >> >> /MediaBox [0.000 0.000 595.280 841.890] >> endobj 4 0 obj [/PDF /Text ] endobj 5 0 obj << /Producer (���d�o�m�p�d�f� �2�.�0�.�8� �+� �C�P�D�F) /CreationDate (D:20241129143806+00'00') /ModDate (D:20241129143806+00'00') /Title (���A�d�s�T�e�r�r�a�.�c�o�m� �i�n�v�o�i�c�e) >> endobj 6 0 obj << /Type /Page /MediaBox [0.000 0.000 595.280 841.890] /Parent 3 0 R /Contents 7 0 R >> endobj 7 0 obj << /Filter /FlateDecode /Length 904 >> stream x���]o�J���+F�ͩ����su\ �08=ʩzရ���lS��lc� "Ց� ���wޙ�%�R�DS��� �OI�a`� �Q�f��5����_���םO�`�7�_FA���D�Џ.j�a=�j����>��n���R+�P��l�rH�{0��w��0��=W�2D ����G���I�>�_B3ed�H�yJ�G>/��ywy�fk��%�$�2.��d_�h����&)b0��"[\B��*_.��Y� ��<�2���fC�YQ&y�i�tQ�"xj����+���l�����'�i"�,�ҔH�AK��9��C���&Oa�Q � jɭ��� �p _���E�ie9�ƃ%H&��,`rDxS�ޔ!�(�X!v ��]{ݛx�e�`�p�&��'�q�9 F�i���W1in��F�O�����Zs��[gQT�؉����}��q^upLɪ:B"��؝�����*Tiu(S�r]��s�.��s9n�N!K!L�M�?�*[��N�8��c��ۯ�b�� ��� �YZ���SR3�n�����lPN��P�;��^�]�!'�z-���ӊ���/��껣��4�l(M�E�QL��X ��~���G��M|�����*��~�;/=N4�-|y�`�i�\�e�T�<���L��G}�"В�J^���q��"X�?(V�ߣXۆ{��H[����P�� �c���kc�Z�9v�����? �a��R�h|��^�k�D4W���?Iӊ�]<��4�)$wdat���~�����������|�L��x�p|N�*��E� �/4�Qpi�x.>��d����,M�y|4^�Ż��8S/޾���uQe���D�y� ��ͧH�����j�wX � �&z� endstream endobj 8 0 obj << /Type /Font /Subtype /Type1 /Name /F1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >> endobj 9 0 obj << /Type /Font /Subtype /Type1 /Name /F2 /BaseFont /Helvetica-Bold /Encoding /WinAnsiEncoding >> endobj xref 0 10 0000000000 65535 f 0000000009 00000 n 0000000074 00000 n 0000000120 00000 n 0000000284 00000 n 0000000313 00000 n 0000000514 00000 n 0000000617 00000 n 0000001593 00000 n 0000001700 00000 n trailer << /Size 10 /Root 1 0 R /Info 5 0 R /ID[] >> startxref 1812 %%EOF
Warning: Cannot modify header information - headers already sent by (output started at /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php:1) in /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php on line 128

Warning: Cannot modify header information - headers already sent by (output started at /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php:1) in /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php on line 129

Warning: Cannot modify header information - headers already sent by (output started at /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php:1) in /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php on line 130

Warning: Cannot modify header information - headers already sent by (output started at /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php:1) in /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php on line 131
import fnmatch import logging import os import select import subprocess import tempfile import time from threading import Lock from pyvirtualdisplay import xauth from pyvirtualdisplay.util import get_helptext, platform_is_osx log = logging.getLogger(__name__) # try: # import fcntl # except ImportError: # fcntl = None _mutex = Lock() _mutex_popen = Lock() _MIN_DISPLAY_NR = 1000 _USED_DISPLAY_NR_LIST = [] _X_START_TIMEOUT = 10 _X_START_TIME_STEP = 0.1 _X_START_WAIT = 0.1 class XStartTimeoutError(Exception): pass class XStartError(Exception): pass def _lock_files(): tmpdir = "/tmp" try: ls = os.listdir(tmpdir) except FileNotFoundError: log.warning("missing /tmp") return [] pattern = ".X*-lock" names = fnmatch.filter(ls, pattern) ls = [os.path.join(tmpdir, child) for child in names] ls = [p for p in ls if os.path.isfile(p)] return ls def _search_for_display(): # search for free display ls = list(map(lambda x: int(x.split("X")[1].split("-")[0]), _lock_files())) if len(ls): display = max(_MIN_DISPLAY_NR, max(ls) + 3) else: display = _MIN_DISPLAY_NR return display class AbstractDisplay(object): """ Common parent for X servers (Xvfb,Xephyr,Xvnc) """ def __init__(self, program, use_xauth, retries, extra_args, manage_global_env): self._extra_args = extra_args self._retries = retries self._program = program self.stdout = None self.stderr = None self.old_display_var = None self._subproc = None self.display = None self._is_started = False self._manage_global_env = manage_global_env self._reset_global_env = False self._pipe_wfd = None self._retries_current = 0 helptext = get_helptext(program) self._has_displayfd = "-displayfd" in helptext if not self._has_displayfd: log.debug("-displayfd flag is missing.") PYVIRTUALDISPLAY_DISPLAYFD = os.environ.get("PYVIRTUALDISPLAY_DISPLAYFD") if PYVIRTUALDISPLAY_DISPLAYFD: log.debug("PYVIRTUALDISPLAY_DISPLAYFD=%s", PYVIRTUALDISPLAY_DISPLAYFD) # '0'->false, '1'->true self._has_displayfd = bool(int(PYVIRTUALDISPLAY_DISPLAYFD)) else: # TODO: macos: displayfd is available on XQuartz-2.7.11 but it doesn't work, always 0 is returned if platform_is_osx(): self._has_displayfd = False self._check_flags(helptext) if use_xauth and not xauth.is_installed(): raise xauth.NotFoundError() self._use_xauth = use_xauth self._old_xauth = None self._xauth_filename = None def _check_flags(self, helptext): pass def _cmd(self): raise NotImplementedError() def _redirect_display(self, on): """ on: * True -> set $DISPLAY to virtual screen * False -> set $DISPLAY to original screen :param on: bool """ d = self.new_display_var if on else self.old_display_var if d is None: log.debug("unset $DISPLAY") try: del os.environ["DISPLAY"] except KeyError: log.warning("$DISPLAY was already unset.") else: log.debug("set $DISPLAY=%s", d) os.environ["DISPLAY"] = d def _env(self): env = os.environ.copy() env["DISPLAY"] = self.new_display_var return env def start(self): """ start display :rtype: self """ if self._is_started: raise XStartError(self, "Display was started twice.") self._is_started = True if self._has_displayfd: self._start1_has_displayfd() else: i = 0 while True: self._retries_current = i + 1 try: self._start1() break except XStartError: log.warning("start failed %s", i + 1) time.sleep(0.05) i += 1 if i >= self._retries: raise XStartError( "No success after %s retries. Last stderr: %s" % (self._retries, self.stderr) ) if self._manage_global_env: self._redirect_display(True) self._reset_global_env = True def _popen(self, use_pass_fds): with _mutex_popen: if use_pass_fds: self._subproc = subprocess.Popen( self._command, pass_fds=[self._pipe_wfd], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=False, ) else: self._subproc = subprocess.Popen( self._command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=False, ) def _start1_has_displayfd(self): # stdout doesn't work on osx -> create own pipe rfd, self._pipe_wfd = os.pipe() self._command = self._cmd() + self._extra_args log.debug("command: %s", self._command) self._popen(use_pass_fds=True) self.display = int(self._wait_for_pipe_text(rfd)) os.close(rfd) os.close(self._pipe_wfd) self.new_display_var = ":%s" % int(self.display) if self._use_xauth: self._setup_xauth() # https://github.com/ponty/PyVirtualDisplay/issues/2 # https://github.com/ponty/PyVirtualDisplay/issues/14 self.old_display_var = os.environ.get("DISPLAY", None) def _start1(self): with _mutex: self.display = _search_for_display() while self.display in _USED_DISPLAY_NR_LIST: self.display += 1 self.new_display_var = ":%s" % int(self.display) _USED_DISPLAY_NR_LIST.append(self.display) self._command = self._cmd() + self._extra_args log.debug("command: %s", self._command) self._popen(use_pass_fds=False) self.new_display_var = ":%s" % int(self.display) if self._use_xauth: self._setup_xauth() # https://github.com/ponty/PyVirtualDisplay/issues/2 # https://github.com/ponty/PyVirtualDisplay/issues/14 self.old_display_var = os.environ.get("DISPLAY", None) # wait until X server is active start_time = time.time() d = self.new_display_var ok = False time.sleep(0.05) # give time for early exit while True: if not self.is_alive(): break try: xdpyinfo = subprocess.Popen( ["xdpyinfo"], env=self._env(), stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=False, ) _, _ = xdpyinfo.communicate() exit_code = xdpyinfo.returncode except FileNotFoundError: log.warning( "xdpyinfo was not found, X start can not be checked! Please install xdpyinfo!" ) time.sleep(_X_START_WAIT) # old method ok = True break # try: # xdpyinfo = EasyProcess(["xdpyinfo"], env=self._env()) # xdpyinfo.enable_stdout_log = False # xdpyinfo.enable_stderr_log = False # exit_code = xdpyinfo.call().return_code # except EasyProcessError: # log.warning( # "xdpyinfo was not found, X start can not be checked! Please install xdpyinfo!" # ) # time.sleep(_X_START_WAIT) # old method # ok = True # break if exit_code != 0: pass else: log.info('Successfully started X with display "%s".', d) ok = True break if time.time() - start_time >= _X_START_TIMEOUT: break time.sleep(_X_START_TIME_STEP) if not self.is_alive(): log.warning("process exited early. stderr:%s", self.stderr) msg = "Failed to start process: %s" raise XStartError(msg % self) if not ok: msg = 'Failed to start X on display "%s" (xdpyinfo check failed, stderr:[%s]).' raise XStartTimeoutError(msg % (d, xdpyinfo.stderr)) def _wait_for_pipe_text(self, rfd): s = "" start_time = time.time() while True: (rfd_changed_ls, _, _) = select.select([rfd], [], [], 0.1) if not self.is_alive(): raise XStartError( "%s program closed. command: %s stderr: %s" % (self._program, self._command, self.stderr) ) if rfd in rfd_changed_ls: c = os.read(rfd, 1) if c == b"\n": break s += c.decode("ascii") # this timeout is for "eternal" hang. see #62 if time.time() - start_time >= 600: # = 10 minutes raise XStartTimeoutError( "No reply from program %s. command:%s" % ( self._program, self._command, ) ) return s def stop(self): """ stop display :rtype: self """ if not self._is_started: raise XStartError("stop() is called before start().") if self._reset_global_env: self._redirect_display(False) if self.is_alive(): try: self._subproc.kill() except OSError as oserror: log.debug("exception in terminate:%s", oserror) self._subproc.wait() self._read_stdout_stderr() if self._use_xauth: self._clear_xauth() return self def _read_stdout_stderr(self): if self.stdout is None: (self.stdout, self.stderr) = self._subproc.communicate() log.debug("stdout=%s", self.stdout) log.debug("stderr=%s", self.stderr) def _setup_xauth(self): """ Set up the Xauthority file and the XAUTHORITY environment variable. """ handle, filename = tempfile.mkstemp( prefix="PyVirtualDisplay.", suffix=".Xauthority" ) self._xauth_filename = filename os.close(handle) # Save old environment self._old_xauth = {} self._old_xauth["AUTHFILE"] = os.getenv("AUTHFILE") self._old_xauth["XAUTHORITY"] = os.getenv("XAUTHORITY") os.environ["AUTHFILE"] = os.environ["XAUTHORITY"] = filename cookie = xauth.generate_mcookie() xauth.call("add", self.new_display_var, ".", cookie) def _clear_xauth(self): """ Clear the Xauthority file and restore the environment variables. """ os.remove(self._xauth_filename) for varname in ["AUTHFILE", "XAUTHORITY"]: if self._old_xauth[varname] is None: del os.environ[varname] else: os.environ[varname] = self._old_xauth[varname] self._old_xauth = None def __enter__(self): """used by the :keyword:`with` statement""" self.start() return self def __exit__(self, *exc_info): """used by the :keyword:`with` statement""" self.stop() def is_alive(self): if not self._subproc: return False # return self.return_code is None rc = self._subproc.poll() if rc is not None: # proc exited self._read_stdout_stderr() return rc is None # @property # def return_code(self): # if not self._subproc: # return None # rc = self._subproc.poll() # if rc is not None: # # proc exited # self._read_stdout_stderr() # return rc @property def pid(self): """ PID (:attr:`subprocess.Popen.pid`) :rtype: int """ if self._subproc: return self._subproc.pid