logaccessparse


Namelogaccessparse JSON
Version 0.10 PyPI version JSON
download
home_pagehttps://github.com/hansalemaos/logaccessparse
SummaryAccessibility parser for Android
upload_time2024-08-02 01:27:08
maintainerNone
docs_urlNone
authorJohannes Fischer
requires_pythonNone
licenseMIT
keywords uiautomator events
VCS
bugtrack_url
requirements mymulti_key_dict
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# Accessibility parser for Android

### Tested against Windows 10 / Python 3.11 / Anaconda 

### pip install logaccessparse

```PY

Args:
    adb_path (str, optional): Path to adb. Defaults to None (when running directly on the emulator).
    device_serial (str, optional): Device serial. Defaults to None (when running directly on the emulator).
    path_logcat (str, optional): Path to logcat. Defaults to "logcat".
    path_top (str, optional): Path to top. Defaults to "top".
    path_grep (str, optional): Path to grep. Defaults to "grep".
    path_awk (str, optional): Path to awk. Defaults to "awk".
    path_kill (str, optional): Path to kill. Defaults to "kill".
    path_sh (str, optional): Path to sh. Defaults to "sh".
    path_printf (str, optional): Path to printf. Defaults to "printf".
    path_wm (str, optional): Path to wm. Defaults to "wm".
    path_tail (str, optional): Path to tail. Defaults to "tail".
    path_sed (str, optional): Path to sed. Defaults to "sed".
    path_su (str, optional): Path to su. Defaults to "su".
    path_pm (str, optional): Path to pm. Defaults to "pm".
    path_tmp_folder (str, optional): Path to temporary folder. Defaults to "/sdcard/_lgcattmp".
    screen_width (int, optional): Screen width. Defaults to 0.
    screen_height (int, optional): Screen height. Defaults to 0.
    sleep_logcat (int, optional): Sleep time for logcat. Defaults to 1.
    kwargs_subprocess (dict, optional): Subprocess kwargs. Defaults to None.
    thread_daemon (bool, optional): Whether the thread is a daemon. Defaults to True.
    buffer_stdout (int, optional): Buffer size for stdout. Defaults to 10000.
    buffer_stderr (int, optional): Buffer size for stderr. Defaults to 10000.
    search_string (bytes, optional): Search string for logcat. Defaults to b"add(".
    refresh_screen_add_width (int, optional): Additional width for screen refresh. Defaults to 0.
    refresh_screen_add_height (int, optional): Additional height for screen refresh. Defaults to 1.
Example:
    from logaccessparse import LogCatParser
    import time
    import shutil
    logadb = LogCatParser(
        #adb_path=shutil.which("adb.exe"),
        adb_path=None,
        device_serial="127.0.0.1:5625",
        path_logcat="logcat",
        path_top="top",
        path_grep="grep",
        path_awk="awk",
        path_kill="kill",
        path_sh="sh",
        path_printf="printf",
        path_wm="wm",
        path_tail="tail",
        path_sed="sed",
        path_su="su",
        path_pm="pm",
        path_tmp_folder="/sdcard/_lgcattmp",
        screen_width=0,
        screen_height=0,
        sleep_logcat=1,
        kwargs_subprocess=None,
        thread_daemon=True,
        buffer_stdout=10000,
        buffer_stderr=10000,
        search_string=b"add(",
        refresh_screen_add_width=0,
        refresh_screen_add_height=1,
    )
    #logadb.install_apk()
    #input("Press Enter to continue...")
    logadb.save_sh_command_to_disk().run_pause_logcat_script().start_logcat_subprocess().run_logcat_script().clear_stderr_stdout().clear_cache()

    try:
        while True:
            counter = 0
            while logadb.stdout_buffer:
                element = logadb.stdout_buffer.pop()
                if "null" not in element["text"] and element["visible"]:
                    print(element["text"])
                    print(element["boundsInScreen"])
                    print(element)
                counter += 1
            if counter == 0:
                logadb.run_update_screen_script()
                time.sleep(1)
            else:
                time.sleep(0.1)
            print(counter)
    except KeyboardInterrupt:
        try:
            time.sleep(1)
        except Exception:
            pass
    logadb.kill_all_subprocesses()
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/hansalemaos/logaccessparse",
    "name": "logaccessparse",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "uiautomator, events",
    "author": "Johannes Fischer",
    "author_email": "aulasparticularesdealemaosp@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/e0/d6/7248eacae13628c1ccbe9edd5e5b40486e77e73e4e5077397803a81045ae/logaccessparse-0.10.tar.gz",
    "platform": null,
    "description": "\r\n# Accessibility parser for Android\r\n\r\n### Tested against Windows 10 / Python 3.11 / Anaconda \r\n\r\n### pip install logaccessparse\r\n\r\n```PY\r\n\r\nArgs:\r\n    adb_path (str, optional): Path to adb. Defaults to None (when running directly on the emulator).\r\n    device_serial (str, optional): Device serial. Defaults to None (when running directly on the emulator).\r\n    path_logcat (str, optional): Path to logcat. Defaults to \"logcat\".\r\n    path_top (str, optional): Path to top. Defaults to \"top\".\r\n    path_grep (str, optional): Path to grep. Defaults to \"grep\".\r\n    path_awk (str, optional): Path to awk. Defaults to \"awk\".\r\n    path_kill (str, optional): Path to kill. Defaults to \"kill\".\r\n    path_sh (str, optional): Path to sh. Defaults to \"sh\".\r\n    path_printf (str, optional): Path to printf. Defaults to \"printf\".\r\n    path_wm (str, optional): Path to wm. Defaults to \"wm\".\r\n    path_tail (str, optional): Path to tail. Defaults to \"tail\".\r\n    path_sed (str, optional): Path to sed. Defaults to \"sed\".\r\n    path_su (str, optional): Path to su. Defaults to \"su\".\r\n    path_pm (str, optional): Path to pm. Defaults to \"pm\".\r\n    path_tmp_folder (str, optional): Path to temporary folder. Defaults to \"/sdcard/_lgcattmp\".\r\n    screen_width (int, optional): Screen width. Defaults to 0.\r\n    screen_height (int, optional): Screen height. Defaults to 0.\r\n    sleep_logcat (int, optional): Sleep time for logcat. Defaults to 1.\r\n    kwargs_subprocess (dict, optional): Subprocess kwargs. Defaults to None.\r\n    thread_daemon (bool, optional): Whether the thread is a daemon. Defaults to True.\r\n    buffer_stdout (int, optional): Buffer size for stdout. Defaults to 10000.\r\n    buffer_stderr (int, optional): Buffer size for stderr. Defaults to 10000.\r\n    search_string (bytes, optional): Search string for logcat. Defaults to b\"add(\".\r\n    refresh_screen_add_width (int, optional): Additional width for screen refresh. Defaults to 0.\r\n    refresh_screen_add_height (int, optional): Additional height for screen refresh. Defaults to 1.\r\nExample:\r\n    from logaccessparse import LogCatParser\r\n    import time\r\n    import shutil\r\n    logadb = LogCatParser(\r\n        #adb_path=shutil.which(\"adb.exe\"),\r\n        adb_path=None,\r\n        device_serial=\"127.0.0.1:5625\",\r\n        path_logcat=\"logcat\",\r\n        path_top=\"top\",\r\n        path_grep=\"grep\",\r\n        path_awk=\"awk\",\r\n        path_kill=\"kill\",\r\n        path_sh=\"sh\",\r\n        path_printf=\"printf\",\r\n        path_wm=\"wm\",\r\n        path_tail=\"tail\",\r\n        path_sed=\"sed\",\r\n        path_su=\"su\",\r\n        path_pm=\"pm\",\r\n        path_tmp_folder=\"/sdcard/_lgcattmp\",\r\n        screen_width=0,\r\n        screen_height=0,\r\n        sleep_logcat=1,\r\n        kwargs_subprocess=None,\r\n        thread_daemon=True,\r\n        buffer_stdout=10000,\r\n        buffer_stderr=10000,\r\n        search_string=b\"add(\",\r\n        refresh_screen_add_width=0,\r\n        refresh_screen_add_height=1,\r\n    )\r\n    #logadb.install_apk()\r\n    #input(\"Press Enter to continue...\")\r\n    logadb.save_sh_command_to_disk().run_pause_logcat_script().start_logcat_subprocess().run_logcat_script().clear_stderr_stdout().clear_cache()\r\n\r\n    try:\r\n        while True:\r\n            counter = 0\r\n            while logadb.stdout_buffer:\r\n                element = logadb.stdout_buffer.pop()\r\n                if \"null\" not in element[\"text\"] and element[\"visible\"]:\r\n                    print(element[\"text\"])\r\n                    print(element[\"boundsInScreen\"])\r\n                    print(element)\r\n                counter += 1\r\n            if counter == 0:\r\n                logadb.run_update_screen_script()\r\n                time.sleep(1)\r\n            else:\r\n                time.sleep(0.1)\r\n            print(counter)\r\n    except KeyboardInterrupt:\r\n        try:\r\n            time.sleep(1)\r\n        except Exception:\r\n            pass\r\n    logadb.kill_all_subprocesses()\r\n```\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Accessibility parser for Android",
    "version": "0.10",
    "project_urls": {
        "Homepage": "https://github.com/hansalemaos/logaccessparse"
    },
    "split_keywords": [
        "uiautomator",
        " events"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dbf86fd132233243ac1ba2472c831a106c667ee5a3565d63cd64b1788763b4d2",
                "md5": "409924c762b8269aece90a804c07a948",
                "sha256": "613f30c753ba829e95323be8aeeb51539aca92cc7e5fa2212906c40ab1a422d3"
            },
            "downloads": -1,
            "filename": "logaccessparse-0.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "409924c762b8269aece90a804c07a948",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 3424407,
            "upload_time": "2024-08-02T01:27:02",
            "upload_time_iso_8601": "2024-08-02T01:27:02.562944Z",
            "url": "https://files.pythonhosted.org/packages/db/f8/6fd132233243ac1ba2472c831a106c667ee5a3565d63cd64b1788763b4d2/logaccessparse-0.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e0d67248eacae13628c1ccbe9edd5e5b40486e77e73e4e5077397803a81045ae",
                "md5": "478eecbad4f12f1536af834a402cbed0",
                "sha256": "0b174d9c7a1cad6371940f432063bc445470ae5f48b4d7cf95db676ddfd7e1fa"
            },
            "downloads": -1,
            "filename": "logaccessparse-0.10.tar.gz",
            "has_sig": false,
            "md5_digest": "478eecbad4f12f1536af834a402cbed0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 3421956,
            "upload_time": "2024-08-02T01:27:08",
            "upload_time_iso_8601": "2024-08-02T01:27:08.541915Z",
            "url": "https://files.pythonhosted.org/packages/e0/d6/7248eacae13628c1ccbe9edd5e5b40486e77e73e4e5077397803a81045ae/logaccessparse-0.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-02 01:27:08",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "hansalemaos",
    "github_project": "logaccessparse",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "mymulti_key_dict",
            "specs": []
        }
    ],
    "lcname": "logaccessparse"
}
        
Elapsed time: 0.32879s