{ "info": { "author": "ponty", "author_email": "", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: BSD License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7" ], "description": "``discogui`` discovers GUI elements\n\nLinks:\n * home: https://github.com/ponty/discogui\n * documentation: http://discogui.readthedocs.org\n * PYPI: https://pypi.python.org/pypi/discogui\n\n|Travis| |Coveralls| |Latest Version| |Supported Python versions| |License| |Code Health| |Documentation|\n\nFeatures:\n * python module\n * works on Linux\n * does not depend on Accessibility technologies\n * toolkit independent\n * only basic tests on very simple GUI\n * GUI should be displayed on Xvfb or Xephyr\n \nKnown problems:\n - Python 3 is not supported\n - slow\n\nPossible applications:\n * automatic GUI testing\n * automatic GUI control\n\nBasic usage\n===========\n::\n\n from discogui.buttons import discover_buttons\n from easyprocess import EasyProcess\n from pyvirtualdisplay import Display\n with Display():\n with EasyProcess('zenity --question') as p: \n p.sleep(1) \n buttons = discover_buttons()\n print buttons\n\n\nInstallation\n============\n\nGeneral\n-------\n\n * install Xvfb_ and Xephyr_\n * install Xlib\n * install scrot\n * install PIL_\n * install xdotool\n * install pip_\n * install latest PyMouse and the program::\n\n # as root\n pip install https://github.com/pepijndevos/PyMouse/zipball/master\n pip install discogui\n\nUbuntu 14.04\n------------\n::\n\n sudo apt-get install python-pip xvfb python-xlib scrot python-pil xdotool\n sudo pip install https://github.com/pepijndevos/PyMouse/zipball/master\n sudo pip install discogui\n\nUninstall\n---------\n::\n\n # as root\n pip uninstall discogui\n\nUsage\n=====\n\n.. #-- from docs.screenshot import screenshot--# \n.. #-#\n\n\nbasic\n-----\n\nCode::\n \n #-- include('examples/basic.py')--#\n '''\n 1. start zenity Yes/No dialog on Xvfb\n 2. discover buttons using :mod:`discogui.buttons` module\n 3. print rectangles\n '''\n from discogui.buttons import discover_buttons\n from easyprocess import EasyProcess\n from pyvirtualdisplay import Display\n\n\n def main():\n with Display(visible=0):\n with EasyProcess('zenity --question') as p:\n p.sleep(5)\n buttons = discover_buttons()\n print( buttons )\n\n\n if __name__ == '__main__':\n main()\n #-#\n \n \nOutput::\n\n #-- sh('python -m discogui.examples.basic 2>/dev/null')--#\n [ScreenRect((582,407,667,442)), ScreenRect((491,407,576,442))]\n #-#\n\n\nbutton discovery on zenity\n--------------------------\n\nCode::\n \n #-- include('examples/buttondiscovery.py')--#\n '''\n 1. start zenity Yes/No dialog on Xvfb\n 2. discover buttons using :mod:`discogui.buttons` module\n 3. print rectangles\n 4. draw red rectangles on screenshot\n '''\n from easyprocess import EasyProcess\n from pyscreenshot import grab\n from discogui.buttons import discover_buttons\n from discogui.draw import draw_indexed_rect_list\n from discogui.imgutil import autocrop\n from pyvirtualdisplay import Display\n\n\n def main():\n with Display(visible=0):\n with EasyProcess('zenity --question') as p:\n p.sleep(1)\n\n img = grab()\n rectangles = discover_buttons()\n print( rectangles )\n\n img = draw_indexed_rect_list(img, rectangles)\n img = autocrop(img)\n\n # display results\n img.show()\n\n if __name__ == '__main__':\n main()\n #-#\n \nImage:\n\n.. #-- screenshot('python -m discogui.examples.buttondiscovery','screenshot_buttondiscovery.png') --#\n.. image:: _img/screenshot_buttondiscovery.png\n.. #-#\n\n\nbutton discovery on gnumeric\n----------------------------\n\nCode::\n \n #-- include('examples/hovergnumeric.py')--#\n '''\n 1. start gnumeric on Xvfb with low ersolution\n 2. discover buttons using :mod:`discogui.hover` module\n 3. print rectangles\n 4. draw red rectangles on screenshot\n '''\n from discogui.draw import draw_indexed_rect_list\n from discogui.hover import active_rectangles\n from discogui.imgutil import autocrop\n from easyprocess import EasyProcess\n # from pyscreenshot import grab\n # from pyvirtualdisplay import Display\n from pyvirtualdisplay.smartdisplay import SmartDisplay\n # import time\n\n\n def main():\n with SmartDisplay(size=(640, 480), visible=0) as disp:\n with EasyProcess('gnumeric'):\n # time.sleep(2)\n img = disp.waitgrab(timeout=60)\n rectangles = active_rectangles()\n print( rectangles )\n\n img = draw_indexed_rect_list(img, rectangles)\n img = autocrop(img)\n\n # display results\n img.show()\n\n if __name__ == '__main__':\n main()\n #-#\n \nImage:\n\n.. #-- screenshot('python -m discogui.examples.hovergnumeric','screenshot_hovergnumeric.png') --#\n.. image:: _img/screenshot_hovergnumeric.png\n.. #-#\n\nbutton test\n-----------\n\nCode::\n \n #-- include('examples/clickbutton.py')--#\n '''\n 1. start zenity Yes/No dialog on Xvfb\n 2. discover buttons using :mod:`discogui.buttons` module\n 3. click first button, print return code\n 4. click second button, print return code\n '''\n from discogui.buttons import discover_buttons\n from discogui.mouse import PyMouse\n from easyprocess import EasyProcess\n from pyvirtualdisplay import Display\n import time\n\n\n def click_button_get_return_code(which_button):\n with EasyProcess('zenity --question') as p:\n time.sleep(1)\n rectangles = discover_buttons()\n PyMouse().click(*rectangles[which_button].center)\n return p.wait().return_code\n\n\n def main():\n with Display():\n print( click_button_get_return_code(0) )\n print( click_button_get_return_code(1) )\n\n if __name__ == '__main__':\n main()\n #-#\n\n\nOutput::\n\n #-- sh('python -m discogui.examples.clickbutton 2>/dev/null')--#\n 0\n 1\n #-#\n\n\n.. _setuptools: http://peak.telecommunity.com/DevCenter/EasyInstall\n.. _pip: http://pip.openplans.org/\n.. _Xvfb: http://en.wikipedia.org/wiki/Xvfb\n.. _Xephyr: http://en.wikipedia.org/wiki/Xephyr\n.. _PIL: http://www.pythonware.com/library/pil/\n\n\n.. |Travis| image:: http://img.shields.io/travis/ponty/discogui.svg\n :target: https://travis-ci.org/ponty/discogui/\n.. |Coveralls| image:: http://img.shields.io/coveralls/ponty/discogui/master.svg\n :target: https://coveralls.io/r/ponty/discogui/\n.. |Latest Version| image:: https://img.shields.io/pypi/v/discogui.svg\n :target: https://pypi.python.org/pypi/discogui/\n.. |Supported Python versions| image:: https://img.shields.io/pypi/pyversions/discogui.svg\n :target: https://pypi.python.org/pypi/discogui/\n.. |License| image:: https://img.shields.io/pypi/l/discogui.svg\n :target: https://pypi.python.org/pypi/discogui/\n.. |Code Health| image:: https://landscape.io/github/ponty/discogui/master/landscape.svg?style=flat\n :target: https://landscape.io/github/ponty/discogui/master\n.. |Documentation| image:: https://readthedocs.org/projects/discogui/badge/?version=latest\n :target: https://readthedocs.org/projects/discogui/?badge=latest\n\n\n\n\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ponty/discogui", "keywords": "GUI", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "discogui", "package_url": "https://pypi.org/project/discogui/", "platform": "", "project_url": "https://pypi.org/project/discogui/", "project_urls": { "Homepage": "https://github.com/ponty/discogui" }, "release_url": "https://pypi.org/project/discogui/0.1/", "requires_dist": null, "requires_python": "", "summary": "GUI discovery", "version": "0.1" }, "last_serial": 4361231, "releases": { "0.0.0": [ { "comment_text": "", "digests": { "md5": "b5e9b2c5ba7976614917dc12f83c4bbd", "sha256": "3332c0b8b2f3277c567212564607fb68056367fa453482e870b537b2e9e20256" }, "downloads": -1, "filename": "discogui-0.0.0.tar.gz", "has_sig": false, "md5_digest": "b5e9b2c5ba7976614917dc12f83c4bbd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 37345, "upload_time": "2011-02-23T19:59:56", "url": "https://files.pythonhosted.org/packages/31/aa/53a30bdff4f4dbc196fa96c592b06dbd3ca0f57082f63868e2dc74eb9ee3/discogui-0.0.0.tar.gz" } ], "0.0.1": [ { "comment_text": "", "digests": { "md5": "f9cb13fee1576d9c8d6c5c77a1457fbc", "sha256": "c59780f2a30e7fd90c01fd77bed6418c846192f00d4b622145ff31786569dee8" }, "downloads": -1, "filename": "discogui-0.0.1.tar.gz", "has_sig": false, "md5_digest": "f9cb13fee1576d9c8d6c5c77a1457fbc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 41763, "upload_time": "2011-11-18T18:37:23", "url": "https://files.pythonhosted.org/packages/17/5a/18204eddbdece211461424beef8033f12082ee953b59cf6f3f5cf494af06/discogui-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "5288aa924f35624af69d27b793589cde", "sha256": "9f4d5b13c79cd1979c7480df5e83c61bf81a18bcb889842512e079180835c4ef" }, "downloads": -1, "filename": "discogui-0.0.2.tar.gz", "has_sig": false, "md5_digest": "5288aa924f35624af69d27b793589cde", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12702, "upload_time": "2012-12-04T19:31:28", "url": "https://files.pythonhosted.org/packages/1a/69/00bcebc2ea8507b26946007c8b9702efd7f92bd1c0de69420ef356a2e430/discogui-0.0.2.tar.gz" } ], "0.1": [ { "comment_text": "", "digests": { "md5": "a9bc6c9f7ff85b242b16a752e25de8f1", "sha256": "0831a624ccd276e83b21fd5af076026b37edc3c739bdecb04d8252f81d3f3463" }, "downloads": -1, "filename": "discogui-0.1.tar.gz", "has_sig": false, "md5_digest": "a9bc6c9f7ff85b242b16a752e25de8f1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 47641, "upload_time": "2018-10-10T19:11:59", "url": "https://files.pythonhosted.org/packages/53/c7/4c74232f34c900c658a6e487f5210124001009790925584f33ad49f6e865/discogui-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a9bc6c9f7ff85b242b16a752e25de8f1", "sha256": "0831a624ccd276e83b21fd5af076026b37edc3c739bdecb04d8252f81d3f3463" }, "downloads": -1, "filename": "discogui-0.1.tar.gz", "has_sig": false, "md5_digest": "a9bc6c9f7ff85b242b16a752e25de8f1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 47641, "upload_time": "2018-10-10T19:11:59", "url": "https://files.pythonhosted.org/packages/53/c7/4c74232f34c900c658a6e487f5210124001009790925584f33ad49f6e865/discogui-0.1.tar.gz" } ] }