# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['rdp_manipulations']

package_data = \
{'': ['*']}

install_requires = \
['environs>=9.5.0,<10.0.0',
 'loguru>=0.6.0,<0.7.0',
 'numpy>=1.23.4,<2.0.0',
 'opencv-python-headless>=4.6.0.66,<5.0.0.0',
 'playwright>=1.27.1,<2.0.0']

setup_kwargs = {
    'name': 'rdp-manipulations',
    'version': '0.2.0',
    'description': 'Tool for RDP (Remote Desktop Protocol) manipulations, automations and testing via Python and Apache Guacamole',
    'long_description': '# rdp-manipulations\n\nTool for image-based control RDP (Remote Desktop Protocol). Manipulations, automations and testing via Python and Apache Guacamole\n\n## Prerequisites\n\nInstalled and configured [Apache Guacamole](https://guacamole.apache.org/). I used this guacamole docker project: https://github.com/boschkundendienst/guacamole-docker-compose\n\n## Examples\n\nsee `./examples` folder. To run it, clone this repo, and:\n\n```\npoetry shell\npoetry install\npython examples/copy_and_zip.py\n```\n\n## Supported OS\n\nOnly Windows 7 is currently supported because I only needed to work with Windows 7 PCs. If you need support for other OSes, use your [`ASSERT_DICT`](#main.ASSERT_DICT), make a pull request, or write an issue. We\'ll figure something out.\n\n# Table of Contents\n\n- [main](#main)\n  - [ASSERT_DICT](#main.ASSERT_DICT)\n  - [RDP](#main.RDP)\n    - [\\_\\_init\\_\\_](#main.RDP.__init__)\n    - [login](#main.RDP.login)\n    - [key_press](#main.RDP.key_press)\n    - [key_type](#main.RDP.key_type)\n    - [make_screenshot](#main.RDP.make_screenshot)\n    - [is_on_screen](#main.RDP.is_on_screen)\n    - [wait_until_appear](#main.RDP.wait_until_appear)\n    - [wait_until_desappear](#main.RDP.wait_until_desappear)\n    - [exec_remote](#main.RDP.exec_remote)\n    - [copydir](#main.RDP.copydir)\n    - [copy](#main.RDP.copy)\n    - [mkdir](#main.RDP.mkdir)\n    - [opendir](#main.RDP.opendir)\n    - [closedir](#main.RDP.closedir)\n    - [mouse_click](#main.RDP.mouse_click)\n    - [mouse_move](#main.RDP.mouse_move)\n    - [mouse_move_to](#main.RDP.mouse_move_to)\n    - [mouse_click_to](#main.RDP.mouse_click_to)\n    - [current_lang](#main.RDP.current_lang)\n    - [lang_switch](#main.RDP.lang_switch)\n    - [logout](#main.RDP.logout)\n\n<a id="main"></a>\n\n# main\n\n<a id="main.ASSERT_DICT"></a>\n\n#### ASSERT_DICT\n\nPass it to instance of [`RDP`](#main.RDP) for unsupported OS (see below)\n\n```\n{\n    \'prelogin\': \'./image_asserts/prelogin.png\',\n    \'login\': \'./image_asserts/login.png\',\n    \'post_login\': \'./image_asserts/post_login.png\',\n    \'start_btn\': \'./image_asserts/start_btn.png\',\n    \'start_btn_selected\': \'./image_asserts/start_btn_selected.png\',\n    \'run_window\': \'./image_asserts/run_window.png\',\n    \'lang_ru\': \'./image_asserts/lang_ru.png\',\n    \'lang_en\': \'./image_asserts/lang_en.png\',\n    \'opened_folder\': \'./image_asserts/opened_folder.png\',\n    \'files_copy\': \'./image_asserts/files_copy.png\',\n}\n```\n\n<a id="main.RDP"></a>\n\n## RDP Objects\n\n```python\nclass RDP()\n```\n\nRDP class\n\n<a id="main.RDP.__init__"></a>\n\n#### \\_\\_init\\_\\_\n\n```python\ndef __init__(headless=headless,\n             width=width,\n             height=height,\n             clear_logs=clear_logs,\n             assert_dict=ASSERT_DICT) -> None\n```\n\n**Arguments**:\n\n- `headless` _bool, optional_ - if False rdp window is shown.\n  (default is True)\n- `width` _int, optional_ - witdth of rdp window. Set it same in guacamole\n  (default is 800)\n- `height` _int, optional_ - witdth of rdp window. Set it same in guacamole\n  (default is 600)\n- `clear_logs` _bool, optional_ - if True old image logs will be removed when RDP class inited.\n  (default is True)\n- `assert_dict` _dict, optional_ - dict with assertion images. Pass it for unsupported OS\n  (default is [`ASSERT_DICT`](#main.ASSERT_DICT))\n\n<a id="main.RDP.login"></a>\n\n#### login\n\n```python\ndef login(guacamole_user: str,\n          guacamole_password: str,\n          guacamole_pc_name: str,\n          guacamole_url=guacamole_url) -> None\n```\n\nLogin method. Call this first\n\n<a id="main.RDP.key_press"></a>\n\n#### key_press\n\n```python\ndef key_press(keys: str)\n```\n\nThis is wrapper of playwright keyboard.press method. see: https://playwright.dev/python/docs/api/class-keyboard#keyboard-press\n\n<a id="main.RDP.key_type"></a>\n\n#### key_type\n\n```python\ndef key_type(text: str)\n```\n\nType text on remote pc\n\n<a id="main.RDP.make_screenshot"></a>\n\n#### make_screenshot\n\n```python\ndef make_screenshot(filename: Optional[str] = None,\n                    path: Optional[str] = None) -> str\n```\n\nMake screenshot, and save it to default direcotry (./image_logs), or to given path\n\n<a id="main.RDP.is_on_screen"></a>\n\n#### is_on_screen\n\n```python\ndef is_on_screen(assertion: str, threshold: float = image_threshold) -> bool\n```\n\nChecking assertion image is on screen (assertion is a path to image)\n\n<a id="main.RDP.wait_until_appear"></a>\n\n#### wait_until_appear\n\n```python\ndef wait_until_appear(assertion: str,\n                      attempts: int = screen_state_attempts,\n                      threshold: float = image_threshold) -> None\n```\n\nWaiting until assertion image is appear on screen (assertion is a path to image)\n\n<a id="main.RDP.wait_until_desappear"></a>\n\n#### wait_until_desappear\n\n```python\ndef wait_until_desappear(assertion: str,\n                         attempts: int = screen_state_attempts,\n                         threshold: float = image_threshold) -> None\n```\n\nWaiting until assertion image is desappear on screen (assertion is a path to image)\n\n<a id="main.RDP.exec_remote"></a>\n\n#### exec_remote\n\n```python\ndef exec_remote(cmd_str: str) -> None\n```\n\nExecute remote command via win+r run window\n\n<a id="main.RDP.copydir"></a>\n\n#### copydir\n\n```python\ndef copydir(from_path: str, to_path: str) -> None\n```\n\nCopy folder on remote PC\n\n<a id="main.RDP.copy"></a>\n\n#### copy\n\n```python\ndef copy(from_path: str, to_path: str) -> None\n```\n\nCopy file on remote PC\n\n<a id="main.RDP.mkdir"></a>\n\n#### mkdir\n\n```python\ndef mkdir(dir_path: str) -> None\n```\n\nMaking directory\n\n<a id="main.RDP.opendir"></a>\n\n#### opendir\n\n```python\ndef opendir(dir_path: str, local: bool = False) -> None\n```\n\nOpen explorer.exe of given directory path\n\n<a id="main.RDP.closedir"></a>\n\n#### closedir\n\n```python\ndef closedir(dir_name: str) -> None\n```\n\nClose explorer.exe of given directory name\n\n<a id="main.RDP.mouse_click"></a>\n\n#### mouse_click\n\n```python\ndef mouse_click(x: float, y: float, click_count: int = 1) -> None\n```\n\nMouse left click on remote PC by giving coordinates\n\n<a id="main.RDP.mouse_move"></a>\n\n#### mouse_move\n\n```python\ndef mouse_move(x: float, y: float) -> None\n```\n\nMouse move on remote PC by giving coordinates\n\n<a id="main.RDP.mouse_move_to"></a>\n\n#### mouse_move_to\n\n```python\ndef mouse_move_to(assertion: str) -> Optional[tuple[float, float]]\n```\n\nMouse move on remote PC by giving image assertion path\n\n<a id="main.RDP.mouse_click_to"></a>\n\n#### mouse_click_to\n\n```python\ndef mouse_click_to(\n        assertion: str,\n        button: Literal[\'left\', \'middle\', \'right\'] = \'left\') -> None\n```\n\nMouse click on remote PC by giving image assertion path\n\n<a id="main.RDP.current_lang"></a>\n\n#### current_lang\n\n```python\ndef current_lang() -> Optional[str]\n```\n\nGet a current keuboard language (now support only \'en\' and \'ru\')\n\n<a id="main.RDP.lang_switch"></a>\n\n#### lang_switch\n\n```python\ndef lang_switch(lang: Optional[str] = None) -> Optional[str]\n```\n\nSwitch keuboard language (now support only \'en\' and \'ru\')\n\n<a id="main.RDP.logout"></a>\n\n#### logout\n\n```python\ndef logout() -> None\n```\n\nLogout method\n',
    'author': 'Marat Azizov',
    'author_email': 'etomarat@gmail.com',
    'maintainer': 'None',
    'maintainer_email': 'None',
    'url': 'None',
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'python_requires': '>=3.10,<4.0',
}


setup(**setup_kwargs)
