{"id":15105123,"url":"https://github.com/tito/automate","last_synced_at":"2025-04-05T12:41:40.621Z","repository":{"id":62574327,"uuid":"41636576","full_name":"tito/automate","owner":"tito","description":"Kivy automation for screenshot (unittest later)","archived":false,"fork":false,"pushed_at":"2022-06-06T15:37:19.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-12T12:46:24.592Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tito.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-30T17:16:17.000Z","updated_at":"2022-06-06T15:37:22.000Z","dependencies_parsed_at":"2022-11-03T18:33:53.360Z","dependency_job_id":null,"html_url":"https://github.com/tito/automate","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tito%2Fautomate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tito%2Fautomate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tito%2Fautomate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tito%2Fautomate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tito","download_url":"https://codeload.github.com/tito/automate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247339136,"owners_count":20923009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-25T20:21:15.518Z","updated_at":"2025-04-05T12:41:40.595Z","avatar_url":"https://github.com/tito.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Automate\n\nKivy automation, currently used to automate screenshots on various devices at\nspecific places.\n\n# Installation\n\n    pip install kivy-automate\n\n# Usage\n\nThere is 2 part of the software: a server and a client. The server must be\ninstalled into your application, and then you can use the client to communicate\nwith it.\n\n## Install the server into your application\n\nJust run this command to create an `automateserver.py` file that you can import:\n\n    python -m automate.install\n\nThen, in your main.py, just import `automateserver` when you want to start the\nserver automation asynchronously:\n\n    import automateserver\n\n## Use the client\n\nIt is as simple as:\n\n    from automate.client import *\n\n    connect()\n    wait(\"app.screen_manager.current == 'welcome'\")\n    wait(\"app.screen_manager.current_screen.progression == 1\")\n    screenshot()\n    quit()\n\nThis example will:\n\n1. connect to the first started application, or wait the application to start\n2. wait for our screen manager to show the \"welcome\" screen\n3. wait the transition to be finished\n4. at this point, a screenshot will be done\n5. and the application will quit.\n\n# Commands\n\n#### connect(host=\"localhost\", port=7777, timeout=10)\n\nConnect to the specified host / port. It will wait at maximum 10 seconds before\ngoing to timeout.\n\n    connect(\"192.168.1.6\", timeout=60)\n\n### wait(cond, timeout=-1)\n\nWait for a condition to be True, or break when the timeout happen. The only\navailable symbol in the condition globals() is the current running application\ninstance, accessible from `app` keyword. If the condition have an exception\nwhile running, it will  wait 100ms before retrying.\n\nSo no error will be throw if you don't write a valid condition, the only way to\nget out is either the condition happen, either the timeout happen.\n\n    wait(\"app.screen_manager.current == 'welcome'\")\n\n### execute(cmd)\n\nExecute a python statement in the application context. The only available symbol\nin the cmd globals() is the current running application instance, accessible\nfrom `app` keyword.\n\n    execute(\"app.screen_manager.current = 'credits'\")\n\n### screenshot(name=\"screenshot\", suffix=None, outdir=None)\n\nTake a screenshot of the current displayed window. The screenshot will be saved into `outdir` (current directory if None), with the name of `{name}{suffix}.png`.\nCare, it will replace any existing filename.\n\n    screenshot(\"welcome\")\n\n### quit()\n\nQuit the application. This is a shortcut to calling\n`App.get_running_app().stop()`.\n\n### spawn(...)\n\nContext manager that can be used to run your application multiple times, like:\n\n    for screen in (\"onex\", \"droid2\", \"ipad\"):\n        with spawn(\"python\", \"main.py\", \"-m\", \"screen:{}\".format(screen)):\n            connect()\n            wait()\n            screenshot(\"startup\", screen)\n            wait(\"app.screen_manager.current == 'welcome'\")\n            screenshot(\"welcome\", screen)\n            quit()\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftito%2Fautomate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftito%2Fautomate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftito%2Fautomate/lists"}