pybiolib 0.2.951__py3-none-any.whl → 1.2.1890__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- biolib/__init__.py +357 -11
- biolib/_data_record/data_record.py +380 -0
- biolib/_index/__init__.py +0 -0
- biolib/_index/index.py +55 -0
- biolib/_index/query_result.py +103 -0
- biolib/_internal/__init__.py +0 -0
- biolib/_internal/add_copilot_prompts.py +58 -0
- biolib/_internal/add_gui_files.py +81 -0
- biolib/_internal/data_record/__init__.py +1 -0
- biolib/_internal/data_record/data_record.py +85 -0
- biolib/_internal/data_record/push_data.py +116 -0
- biolib/_internal/data_record/remote_storage_endpoint.py +43 -0
- biolib/_internal/errors.py +5 -0
- biolib/_internal/file_utils.py +125 -0
- biolib/_internal/fuse_mount/__init__.py +1 -0
- biolib/_internal/fuse_mount/experiment_fuse_mount.py +209 -0
- biolib/_internal/http_client.py +159 -0
- biolib/_internal/lfs/__init__.py +1 -0
- biolib/_internal/lfs/cache.py +51 -0
- biolib/_internal/libs/__init__.py +1 -0
- biolib/_internal/libs/fusepy/__init__.py +1257 -0
- biolib/_internal/push_application.py +488 -0
- biolib/_internal/runtime.py +22 -0
- biolib/_internal/string_utils.py +13 -0
- biolib/_internal/templates/__init__.py +1 -0
- biolib/_internal/templates/copilot_template/.github/instructions/general-app-knowledge.instructions.md +10 -0
- biolib/_internal/templates/copilot_template/.github/instructions/style-general.instructions.md +20 -0
- biolib/_internal/templates/copilot_template/.github/instructions/style-python.instructions.md +16 -0
- biolib/_internal/templates/copilot_template/.github/instructions/style-react-ts.instructions.md +47 -0
- biolib/_internal/templates/copilot_template/.github/prompts/biolib_app_inputs.prompt.md +11 -0
- biolib/_internal/templates/copilot_template/.github/prompts/biolib_onboard_repo.prompt.md +19 -0
- biolib/_internal/templates/copilot_template/.github/prompts/biolib_run_apps.prompt.md +12 -0
- biolib/_internal/templates/dashboard_template/.biolib/config.yml +5 -0
- biolib/_internal/templates/github_workflow_template/.github/workflows/biolib.yml +21 -0
- biolib/_internal/templates/gitignore_template/.gitignore +10 -0
- biolib/_internal/templates/gui_template/.yarnrc.yml +1 -0
- biolib/_internal/templates/gui_template/App.tsx +53 -0
- biolib/_internal/templates/gui_template/Dockerfile +27 -0
- biolib/_internal/templates/gui_template/biolib-sdk.ts +82 -0
- biolib/_internal/templates/gui_template/dev-data/output.json +7 -0
- biolib/_internal/templates/gui_template/index.css +5 -0
- biolib/_internal/templates/gui_template/index.html +13 -0
- biolib/_internal/templates/gui_template/index.tsx +10 -0
- biolib/_internal/templates/gui_template/package.json +27 -0
- biolib/_internal/templates/gui_template/tsconfig.json +24 -0
- biolib/_internal/templates/gui_template/vite-plugin-dev-data.ts +50 -0
- biolib/_internal/templates/gui_template/vite.config.mts +10 -0
- biolib/_internal/templates/init_template/.biolib/config.yml +19 -0
- biolib/_internal/templates/init_template/Dockerfile +14 -0
- biolib/_internal/templates/init_template/requirements.txt +1 -0
- biolib/_internal/templates/init_template/run.py +12 -0
- biolib/_internal/templates/init_template/run.sh +4 -0
- biolib/_internal/templates/templates.py +25 -0
- biolib/_internal/tree_utils.py +106 -0
- biolib/_internal/utils/__init__.py +65 -0
- biolib/_internal/utils/auth.py +46 -0
- biolib/_internal/utils/job_url.py +33 -0
- biolib/_internal/utils/multinode.py +263 -0
- biolib/_runtime/runtime.py +157 -0
- biolib/_session/session.py +44 -0
- biolib/_shared/__init__.py +0 -0
- biolib/_shared/types/__init__.py +74 -0
- biolib/_shared/types/account.py +12 -0
- biolib/_shared/types/account_member.py +8 -0
- biolib/_shared/types/app.py +9 -0
- biolib/_shared/types/data_record.py +40 -0
- biolib/_shared/types/experiment.py +32 -0
- biolib/_shared/types/file_node.py +17 -0
- biolib/_shared/types/push.py +6 -0
- biolib/_shared/types/resource.py +37 -0
- biolib/_shared/types/resource_deploy_key.py +11 -0
- biolib/_shared/types/resource_permission.py +14 -0
- biolib/_shared/types/resource_version.py +19 -0
- biolib/_shared/types/result.py +14 -0
- biolib/_shared/types/typing.py +10 -0
- biolib/_shared/types/user.py +19 -0
- biolib/_shared/utils/__init__.py +7 -0
- biolib/_shared/utils/resource_uri.py +75 -0
- biolib/api/__init__.py +6 -0
- biolib/api/client.py +168 -0
- biolib/app/app.py +252 -49
- biolib/app/search_apps.py +45 -0
- biolib/biolib_api_client/api_client.py +126 -31
- biolib/biolib_api_client/app_types.py +24 -4
- biolib/biolib_api_client/auth.py +31 -8
- biolib/biolib_api_client/biolib_app_api.py +147 -52
- biolib/biolib_api_client/biolib_job_api.py +161 -141
- biolib/biolib_api_client/job_types.py +21 -5
- biolib/biolib_api_client/lfs_types.py +7 -23
- biolib/biolib_api_client/user_state.py +56 -0
- biolib/biolib_binary_format/__init__.py +1 -4
- biolib/biolib_binary_format/file_in_container.py +105 -0
- biolib/biolib_binary_format/module_input.py +24 -7
- biolib/biolib_binary_format/module_output_v2.py +149 -0
- biolib/biolib_binary_format/remote_endpoints.py +34 -0
- biolib/biolib_binary_format/remote_stream_seeker.py +59 -0
- biolib/biolib_binary_format/saved_job.py +3 -2
- biolib/biolib_binary_format/{attestation_document.py → stdout_and_stderr.py} +8 -8
- biolib/biolib_binary_format/system_status_update.py +3 -2
- biolib/biolib_binary_format/utils.py +175 -0
- biolib/biolib_docker_client/__init__.py +11 -2
- biolib/biolib_errors.py +36 -0
- biolib/biolib_logging.py +27 -10
- biolib/cli/__init__.py +38 -0
- biolib/cli/auth.py +46 -0
- biolib/cli/data_record.py +164 -0
- biolib/cli/index.py +32 -0
- biolib/cli/init.py +421 -0
- biolib/cli/lfs.py +101 -0
- biolib/cli/push.py +50 -0
- biolib/cli/run.py +63 -0
- biolib/cli/runtime.py +14 -0
- biolib/cli/sdk.py +16 -0
- biolib/cli/start.py +56 -0
- biolib/compute_node/cloud_utils/cloud_utils.py +110 -161
- biolib/compute_node/job_worker/cache_state.py +66 -88
- biolib/compute_node/job_worker/cache_types.py +1 -6
- biolib/compute_node/job_worker/docker_image_cache.py +112 -37
- biolib/compute_node/job_worker/executors/__init__.py +0 -3
- biolib/compute_node/job_worker/executors/docker_executor.py +532 -199
- biolib/compute_node/job_worker/executors/docker_types.py +9 -1
- biolib/compute_node/job_worker/executors/types.py +19 -9
- biolib/compute_node/job_worker/job_legacy_input_wait_timeout_thread.py +30 -0
- biolib/compute_node/job_worker/job_max_runtime_timer_thread.py +3 -5
- biolib/compute_node/job_worker/job_storage.py +108 -0
- biolib/compute_node/job_worker/job_worker.py +397 -212
- biolib/compute_node/job_worker/large_file_system.py +87 -38
- biolib/compute_node/job_worker/network_alloc.py +99 -0
- biolib/compute_node/job_worker/network_buffer.py +240 -0
- biolib/compute_node/job_worker/utilization_reporter_thread.py +197 -0
- biolib/compute_node/job_worker/utils.py +9 -24
- biolib/compute_node/remote_host_proxy.py +400 -98
- biolib/compute_node/utils.py +31 -9
- biolib/compute_node/webserver/compute_node_results_proxy.py +189 -0
- biolib/compute_node/webserver/proxy_utils.py +28 -0
- biolib/compute_node/webserver/webserver.py +130 -44
- biolib/compute_node/webserver/webserver_types.py +2 -6
- biolib/compute_node/webserver/webserver_utils.py +77 -12
- biolib/compute_node/webserver/worker_thread.py +183 -42
- biolib/experiments/__init__.py +0 -0
- biolib/experiments/experiment.py +356 -0
- biolib/jobs/__init__.py +1 -0
- biolib/jobs/job.py +741 -0
- biolib/jobs/job_result.py +185 -0
- biolib/jobs/types.py +50 -0
- biolib/py.typed +0 -0
- biolib/runtime/__init__.py +14 -0
- biolib/sdk/__init__.py +91 -0
- biolib/tables.py +34 -0
- biolib/typing_utils.py +2 -7
- biolib/user/__init__.py +1 -0
- biolib/user/sign_in.py +54 -0
- biolib/utils/__init__.py +162 -0
- biolib/utils/cache_state.py +94 -0
- biolib/utils/multipart_uploader.py +194 -0
- biolib/utils/seq_util.py +150 -0
- biolib/utils/zip/remote_zip.py +640 -0
- pybiolib-1.2.1890.dist-info/METADATA +41 -0
- pybiolib-1.2.1890.dist-info/RECORD +177 -0
- {pybiolib-0.2.951.dist-info → pybiolib-1.2.1890.dist-info}/WHEEL +1 -1
- pybiolib-1.2.1890.dist-info/entry_points.txt +2 -0
- README.md +0 -17
- biolib/app/app_result.py +0 -68
- biolib/app/utils.py +0 -62
- biolib/biolib-js/0-biolib.worker.js +0 -1
- biolib/biolib-js/1-biolib.worker.js +0 -1
- biolib/biolib-js/2-biolib.worker.js +0 -1
- biolib/biolib-js/3-biolib.worker.js +0 -1
- biolib/biolib-js/4-biolib.worker.js +0 -1
- biolib/biolib-js/5-biolib.worker.js +0 -1
- biolib/biolib-js/6-biolib.worker.js +0 -1
- biolib/biolib-js/index.html +0 -10
- biolib/biolib-js/main-biolib.js +0 -1
- biolib/biolib_api_client/biolib_account_api.py +0 -21
- biolib/biolib_api_client/biolib_large_file_system_api.py +0 -108
- biolib/biolib_binary_format/aes_encrypted_package.py +0 -42
- biolib/biolib_binary_format/module_output.py +0 -58
- biolib/biolib_binary_format/rsa_encrypted_aes_package.py +0 -57
- biolib/biolib_push.py +0 -114
- biolib/cli.py +0 -203
- biolib/cli_utils.py +0 -273
- biolib/compute_node/cloud_utils/enclave_parent_types.py +0 -7
- biolib/compute_node/enclave/__init__.py +0 -2
- biolib/compute_node/enclave/enclave_remote_hosts.py +0 -53
- biolib/compute_node/enclave/nitro_secure_module_utils.py +0 -64
- biolib/compute_node/job_worker/executors/base_executor.py +0 -18
- biolib/compute_node/job_worker/executors/pyppeteer_executor.py +0 -173
- biolib/compute_node/job_worker/executors/remote/__init__.py +0 -1
- biolib/compute_node/job_worker/executors/remote/nitro_enclave_utils.py +0 -81
- biolib/compute_node/job_worker/executors/remote/remote_executor.py +0 -51
- biolib/lfs.py +0 -196
- biolib/pyppeteer/.circleci/config.yml +0 -100
- biolib/pyppeteer/.coveragerc +0 -3
- biolib/pyppeteer/.gitignore +0 -89
- biolib/pyppeteer/.pre-commit-config.yaml +0 -28
- biolib/pyppeteer/CHANGES.md +0 -253
- biolib/pyppeteer/CONTRIBUTING.md +0 -26
- biolib/pyppeteer/LICENSE +0 -12
- biolib/pyppeteer/README.md +0 -137
- biolib/pyppeteer/docs/Makefile +0 -177
- biolib/pyppeteer/docs/_static/custom.css +0 -28
- biolib/pyppeteer/docs/_templates/layout.html +0 -10
- biolib/pyppeteer/docs/changes.md +0 -1
- biolib/pyppeteer/docs/conf.py +0 -299
- biolib/pyppeteer/docs/index.md +0 -21
- biolib/pyppeteer/docs/make.bat +0 -242
- biolib/pyppeteer/docs/reference.md +0 -211
- biolib/pyppeteer/docs/server.py +0 -60
- biolib/pyppeteer/poetry.lock +0 -1699
- biolib/pyppeteer/pyppeteer/__init__.py +0 -135
- biolib/pyppeteer/pyppeteer/accessibility.py +0 -286
- biolib/pyppeteer/pyppeteer/browser.py +0 -401
- biolib/pyppeteer/pyppeteer/browser_fetcher.py +0 -194
- biolib/pyppeteer/pyppeteer/command.py +0 -22
- biolib/pyppeteer/pyppeteer/connection/__init__.py +0 -242
- biolib/pyppeteer/pyppeteer/connection/cdpsession.py +0 -101
- biolib/pyppeteer/pyppeteer/coverage.py +0 -346
- biolib/pyppeteer/pyppeteer/device_descriptors.py +0 -787
- biolib/pyppeteer/pyppeteer/dialog.py +0 -79
- biolib/pyppeteer/pyppeteer/domworld.py +0 -597
- biolib/pyppeteer/pyppeteer/emulation_manager.py +0 -53
- biolib/pyppeteer/pyppeteer/errors.py +0 -48
- biolib/pyppeteer/pyppeteer/events.py +0 -63
- biolib/pyppeteer/pyppeteer/execution_context.py +0 -156
- biolib/pyppeteer/pyppeteer/frame/__init__.py +0 -299
- biolib/pyppeteer/pyppeteer/frame/frame_manager.py +0 -306
- biolib/pyppeteer/pyppeteer/helpers.py +0 -245
- biolib/pyppeteer/pyppeteer/input.py +0 -371
- biolib/pyppeteer/pyppeteer/jshandle.py +0 -598
- biolib/pyppeteer/pyppeteer/launcher.py +0 -683
- biolib/pyppeteer/pyppeteer/lifecycle_watcher.py +0 -169
- biolib/pyppeteer/pyppeteer/models/__init__.py +0 -103
- biolib/pyppeteer/pyppeteer/models/_protocol.py +0 -12460
- biolib/pyppeteer/pyppeteer/multimap.py +0 -82
- biolib/pyppeteer/pyppeteer/network_manager.py +0 -678
- biolib/pyppeteer/pyppeteer/options.py +0 -8
- biolib/pyppeteer/pyppeteer/page.py +0 -1728
- biolib/pyppeteer/pyppeteer/pipe_transport.py +0 -59
- biolib/pyppeteer/pyppeteer/target.py +0 -147
- biolib/pyppeteer/pyppeteer/task_queue.py +0 -24
- biolib/pyppeteer/pyppeteer/timeout_settings.py +0 -36
- biolib/pyppeteer/pyppeteer/tracing.py +0 -93
- biolib/pyppeteer/pyppeteer/us_keyboard_layout.py +0 -305
- biolib/pyppeteer/pyppeteer/util.py +0 -18
- biolib/pyppeteer/pyppeteer/websocket_transport.py +0 -47
- biolib/pyppeteer/pyppeteer/worker.py +0 -101
- biolib/pyppeteer/pyproject.toml +0 -97
- biolib/pyppeteer/spell.txt +0 -137
- biolib/pyppeteer/tox.ini +0 -72
- biolib/pyppeteer/utils/generate_protocol_types.py +0 -603
- biolib/start_cli.py +0 -7
- biolib/utils.py +0 -47
- biolib/validators/validate_app_version.py +0 -183
- biolib/validators/validate_argument.py +0 -134
- biolib/validators/validate_module.py +0 -323
- biolib/validators/validate_zip_file.py +0 -40
- biolib/validators/validator_utils.py +0 -103
- pybiolib-0.2.951.dist-info/LICENSE +0 -21
- pybiolib-0.2.951.dist-info/METADATA +0 -61
- pybiolib-0.2.951.dist-info/RECORD +0 -153
- pybiolib-0.2.951.dist-info/entry_points.txt +0 -3
- /LICENSE → /pybiolib-1.2.1890.dist-info/licenses/LICENSE +0 -0
|
@@ -1,305 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
# flake8: noqa
|
|
4
|
-
|
|
5
|
-
"""US Keyboard Definition."""
|
|
6
|
-
|
|
7
|
-
keyDefinitions = {
|
|
8
|
-
'0': {'keyCode': 48, 'key': '0', 'code': 'Digit0'},
|
|
9
|
-
'1': {'keyCode': 49, 'key': '1', 'code': 'Digit1'},
|
|
10
|
-
'2': {'keyCode': 50, 'key': '2', 'code': 'Digit2'},
|
|
11
|
-
'3': {'keyCode': 51, 'key': '3', 'code': 'Digit3'},
|
|
12
|
-
'4': {'keyCode': 52, 'key': '4', 'code': 'Digit4'},
|
|
13
|
-
'5': {'keyCode': 53, 'key': '5', 'code': 'Digit5'},
|
|
14
|
-
'6': {'keyCode': 54, 'key': '6', 'code': 'Digit6'},
|
|
15
|
-
'7': {'keyCode': 55, 'key': '7', 'code': 'Digit7'},
|
|
16
|
-
'8': {'keyCode': 56, 'key': '8', 'code': 'Digit8'},
|
|
17
|
-
'9': {'keyCode': 57, 'key': '9', 'code': 'Digit9'},
|
|
18
|
-
'Power': {'key': 'Power', 'code': 'Power'},
|
|
19
|
-
'Eject': {'key': 'Eject', 'code': 'Eject'},
|
|
20
|
-
'Abort': {'keyCode': 3, 'code': 'Abort', 'key': 'Cancel'},
|
|
21
|
-
'Help': {'keyCode': 6, 'code': 'Help', 'key': 'Help'},
|
|
22
|
-
'Backspace': {'keyCode': 8, 'code': 'Backspace', 'key': 'Backspace'},
|
|
23
|
-
'Tab': {'keyCode': 9, 'code': 'Tab', 'key': 'Tab'},
|
|
24
|
-
'Numpad5': {'keyCode': 12, 'shiftKeyCode': 101, 'key': 'Clear', 'code': 'Numpad5', 'shiftKey': '5', 'location': 3},
|
|
25
|
-
'NumpadEnter': {'keyCode': 13, 'code': 'NumpadEnter', 'key': 'Enter', 'text': '\r', 'location': 3},
|
|
26
|
-
'Enter': {'keyCode': 13, 'code': 'Enter', 'key': 'Enter', 'text': '\r'},
|
|
27
|
-
'\r': {'keyCode': 13, 'code': 'Enter', 'key': 'Enter', 'text': '\r'},
|
|
28
|
-
'\n': {'keyCode': 13, 'code': 'Enter', 'key': 'Enter', 'text': '\r'},
|
|
29
|
-
'ShiftLeft': {'keyCode': 16, 'code': 'ShiftLeft', 'key': 'Shift', 'location': 1},
|
|
30
|
-
'ShiftRight': {'keyCode': 16, 'code': 'ShiftRight', 'key': 'Shift', 'location': 2},
|
|
31
|
-
'ControlLeft': {'keyCode': 17, 'code': 'ControlLeft', 'key': 'Control', 'location': 1},
|
|
32
|
-
'ControlRight': {'keyCode': 17, 'code': 'ControlRight', 'key': 'Control', 'location': 2},
|
|
33
|
-
'AltLeft': {'keyCode': 18, 'code': 'AltLeft', 'key': 'Alt', 'location': 1},
|
|
34
|
-
'AltRight': {'keyCode': 18, 'code': 'AltRight', 'key': 'Alt', 'location': 2},
|
|
35
|
-
'Pause': {'keyCode': 19, 'code': 'Pause', 'key': 'Pause'},
|
|
36
|
-
'CapsLock': {'keyCode': 20, 'code': 'CapsLock', 'key': 'CapsLock'},
|
|
37
|
-
'Escape': {'keyCode': 27, 'code': 'Escape', 'key': 'Escape'},
|
|
38
|
-
'Convert': {'keyCode': 28, 'code': 'Convert', 'key': 'Convert'},
|
|
39
|
-
'NonConvert': {'keyCode': 29, 'code': 'NonConvert', 'key': 'NonConvert'},
|
|
40
|
-
'Space': {'keyCode': 32, 'code': 'Space', 'key': ' '},
|
|
41
|
-
'Numpad9': {'keyCode': 33, 'shiftKeyCode': 105, 'key': 'PageUp', 'code': 'Numpad9', 'shiftKey': '9', 'location': 3},
|
|
42
|
-
'PageUp': {'keyCode': 33, 'code': 'PageUp', 'key': 'PageUp'},
|
|
43
|
-
'Numpad3': {
|
|
44
|
-
'keyCode': 34,
|
|
45
|
-
'shiftKeyCode': 99,
|
|
46
|
-
'key': 'PageDown',
|
|
47
|
-
'code': 'Numpad3',
|
|
48
|
-
'shiftKey': '3',
|
|
49
|
-
'location': 3,
|
|
50
|
-
},
|
|
51
|
-
'PageDown': {'keyCode': 34, 'code': 'PageDown', 'key': 'PageDown'},
|
|
52
|
-
'End': {'keyCode': 35, 'code': 'End', 'key': 'End'},
|
|
53
|
-
'Numpad1': {'keyCode': 35, 'shiftKeyCode': 97, 'key': 'End', 'code': 'Numpad1', 'shiftKey': '1', 'location': 3},
|
|
54
|
-
'Home': {'keyCode': 36, 'code': 'Home', 'key': 'Home'},
|
|
55
|
-
'Numpad7': {'keyCode': 36, 'shiftKeyCode': 103, 'key': 'Home', 'code': 'Numpad7', 'shiftKey': '7', 'location': 3},
|
|
56
|
-
'ArrowLeft': {'keyCode': 37, 'code': 'ArrowLeft', 'key': 'ArrowLeft'},
|
|
57
|
-
'Numpad4': {
|
|
58
|
-
'keyCode': 37,
|
|
59
|
-
'shiftKeyCode': 100,
|
|
60
|
-
'key': 'ArrowLeft',
|
|
61
|
-
'code': 'Numpad4',
|
|
62
|
-
'shiftKey': '4',
|
|
63
|
-
'location': 3,
|
|
64
|
-
},
|
|
65
|
-
'Numpad8': {
|
|
66
|
-
'keyCode': 38,
|
|
67
|
-
'shiftKeyCode': 104,
|
|
68
|
-
'key': 'ArrowUp',
|
|
69
|
-
'code': 'Numpad8',
|
|
70
|
-
'shiftKey': '8',
|
|
71
|
-
'location': 3,
|
|
72
|
-
},
|
|
73
|
-
'ArrowUp': {'keyCode': 38, 'code': 'ArrowUp', 'key': 'ArrowUp'},
|
|
74
|
-
'ArrowRight': {'keyCode': 39, 'code': 'ArrowRight', 'key': 'ArrowRight'},
|
|
75
|
-
'Numpad6': {
|
|
76
|
-
'keyCode': 39,
|
|
77
|
-
'shiftKeyCode': 102,
|
|
78
|
-
'key': 'ArrowRight',
|
|
79
|
-
'code': 'Numpad6',
|
|
80
|
-
'shiftKey': '6',
|
|
81
|
-
'location': 3,
|
|
82
|
-
},
|
|
83
|
-
'Numpad2': {
|
|
84
|
-
'keyCode': 40,
|
|
85
|
-
'shiftKeyCode': 98,
|
|
86
|
-
'key': 'ArrowDown',
|
|
87
|
-
'code': 'Numpad2',
|
|
88
|
-
'shiftKey': '2',
|
|
89
|
-
'location': 3,
|
|
90
|
-
},
|
|
91
|
-
'ArrowDown': {'keyCode': 40, 'code': 'ArrowDown', 'key': 'ArrowDown'},
|
|
92
|
-
'Select': {'keyCode': 41, 'code': 'Select', 'key': 'Select'},
|
|
93
|
-
'Open': {'keyCode': 43, 'code': 'Open', 'key': 'Execute'},
|
|
94
|
-
'PrintScreen': {'keyCode': 44, 'code': 'PrintScreen', 'key': 'PrintScreen'},
|
|
95
|
-
'Insert': {'keyCode': 45, 'code': 'Insert', 'key': 'Insert'},
|
|
96
|
-
'Numpad0': {'keyCode': 45, 'shiftKeyCode': 96, 'key': 'Insert', 'code': 'Numpad0', 'shiftKey': '0', 'location': 3},
|
|
97
|
-
'Delete': {'keyCode': 46, 'code': 'Delete', 'key': 'Delete'},
|
|
98
|
-
'NumpadDecimal': {
|
|
99
|
-
'keyCode': 46,
|
|
100
|
-
'shiftKeyCode': 110,
|
|
101
|
-
'code': 'NumpadDecimal',
|
|
102
|
-
'key': '\u0000',
|
|
103
|
-
'shiftKey': '.',
|
|
104
|
-
'location': 3,
|
|
105
|
-
},
|
|
106
|
-
'Digit0': {'keyCode': 48, 'code': 'Digit0', 'shiftKey': ')', 'key': '0'},
|
|
107
|
-
'Digit1': {'keyCode': 49, 'code': 'Digit1', 'shiftKey': '!', 'key': '1'},
|
|
108
|
-
'Digit2': {'keyCode': 50, 'code': 'Digit2', 'shiftKey': '@', 'key': '2'},
|
|
109
|
-
'Digit3': {'keyCode': 51, 'code': 'Digit3', 'shiftKey': '#', 'key': '3'},
|
|
110
|
-
'Digit4': {'keyCode': 52, 'code': 'Digit4', 'shiftKey': '$', 'key': '4'},
|
|
111
|
-
'Digit5': {'keyCode': 53, 'code': 'Digit5', 'shiftKey': '%', 'key': '5'},
|
|
112
|
-
'Digit6': {'keyCode': 54, 'code': 'Digit6', 'shiftKey': '^', 'key': '6'},
|
|
113
|
-
'Digit7': {'keyCode': 55, 'code': 'Digit7', 'shiftKey': '&', 'key': '7'},
|
|
114
|
-
'Digit8': {'keyCode': 56, 'code': 'Digit8', 'shiftKey': '*', 'key': '8'},
|
|
115
|
-
'Digit9': {'keyCode': 57, 'code': 'Digit9', 'shiftKey': '\(', 'key': '9'},
|
|
116
|
-
'KeyA': {'keyCode': 65, 'code': 'KeyA', 'shiftKey': 'A', 'key': 'a'},
|
|
117
|
-
'KeyB': {'keyCode': 66, 'code': 'KeyB', 'shiftKey': 'B', 'key': 'b'},
|
|
118
|
-
'KeyC': {'keyCode': 67, 'code': 'KeyC', 'shiftKey': 'C', 'key': 'c'},
|
|
119
|
-
'KeyD': {'keyCode': 68, 'code': 'KeyD', 'shiftKey': 'D', 'key': 'd'},
|
|
120
|
-
'KeyE': {'keyCode': 69, 'code': 'KeyE', 'shiftKey': 'E', 'key': 'e'},
|
|
121
|
-
'KeyF': {'keyCode': 70, 'code': 'KeyF', 'shiftKey': 'F', 'key': 'f'},
|
|
122
|
-
'KeyG': {'keyCode': 71, 'code': 'KeyG', 'shiftKey': 'G', 'key': 'g'},
|
|
123
|
-
'KeyH': {'keyCode': 72, 'code': 'KeyH', 'shiftKey': 'H', 'key': 'h'},
|
|
124
|
-
'KeyI': {'keyCode': 73, 'code': 'KeyI', 'shiftKey': 'I', 'key': 'i'},
|
|
125
|
-
'KeyJ': {'keyCode': 74, 'code': 'KeyJ', 'shiftKey': 'J', 'key': 'j'},
|
|
126
|
-
'KeyK': {'keyCode': 75, 'code': 'KeyK', 'shiftKey': 'K', 'key': 'k'},
|
|
127
|
-
'KeyL': {'keyCode': 76, 'code': 'KeyL', 'shiftKey': 'L', 'key': 'l'},
|
|
128
|
-
'KeyM': {'keyCode': 77, 'code': 'KeyM', 'shiftKey': 'M', 'key': 'm'},
|
|
129
|
-
'KeyN': {'keyCode': 78, 'code': 'KeyN', 'shiftKey': 'N', 'key': 'n'},
|
|
130
|
-
'KeyO': {'keyCode': 79, 'code': 'KeyO', 'shiftKey': 'O', 'key': 'o'},
|
|
131
|
-
'KeyP': {'keyCode': 80, 'code': 'KeyP', 'shiftKey': 'P', 'key': 'p'},
|
|
132
|
-
'KeyQ': {'keyCode': 81, 'code': 'KeyQ', 'shiftKey': 'Q', 'key': 'q'},
|
|
133
|
-
'KeyR': {'keyCode': 82, 'code': 'KeyR', 'shiftKey': 'R', 'key': 'r'},
|
|
134
|
-
'KeyS': {'keyCode': 83, 'code': 'KeyS', 'shiftKey': 'S', 'key': 's'},
|
|
135
|
-
'KeyT': {'keyCode': 84, 'code': 'KeyT', 'shiftKey': 'T', 'key': 't'},
|
|
136
|
-
'KeyU': {'keyCode': 85, 'code': 'KeyU', 'shiftKey': 'U', 'key': 'u'},
|
|
137
|
-
'KeyV': {'keyCode': 86, 'code': 'KeyV', 'shiftKey': 'V', 'key': 'v'},
|
|
138
|
-
'KeyW': {'keyCode': 87, 'code': 'KeyW', 'shiftKey': 'W', 'key': 'w'},
|
|
139
|
-
'KeyX': {'keyCode': 88, 'code': 'KeyX', 'shiftKey': 'X', 'key': 'x'},
|
|
140
|
-
'KeyY': {'keyCode': 89, 'code': 'KeyY', 'shiftKey': 'Y', 'key': 'y'},
|
|
141
|
-
'KeyZ': {'keyCode': 90, 'code': 'KeyZ', 'shiftKey': 'Z', 'key': 'z'},
|
|
142
|
-
'MetaLeft': {'keyCode': 91, 'code': 'MetaLeft', 'key': 'Meta', 'location': 1},
|
|
143
|
-
'MetaRight': {'keyCode': 92, 'code': 'MetaRight', 'key': 'Meta', 'location': 2},
|
|
144
|
-
'ContextMenu': {'keyCode': 93, 'code': 'ContextMenu', 'key': 'ContextMenu'},
|
|
145
|
-
'NumpadMultiply': {'keyCode': 106, 'code': 'NumpadMultiply', 'key': '*', 'location': 3},
|
|
146
|
-
'NumpadAdd': {'keyCode': 107, 'code': 'NumpadAdd', 'key': '+', 'location': 3},
|
|
147
|
-
'NumpadSubtract': {'keyCode': 109, 'code': 'NumpadSubtract', 'key': '-', 'location': 3},
|
|
148
|
-
'NumpadDivide': {'keyCode': 111, 'code': 'NumpadDivide', 'key': '/', 'location': 3},
|
|
149
|
-
'F1': {'keyCode': 112, 'code': 'F1', 'key': 'F1'},
|
|
150
|
-
'F2': {'keyCode': 113, 'code': 'F2', 'key': 'F2'},
|
|
151
|
-
'F3': {'keyCode': 114, 'code': 'F3', 'key': 'F3'},
|
|
152
|
-
'F4': {'keyCode': 115, 'code': 'F4', 'key': 'F4'},
|
|
153
|
-
'F5': {'keyCode': 116, 'code': 'F5', 'key': 'F5'},
|
|
154
|
-
'F6': {'keyCode': 117, 'code': 'F6', 'key': 'F6'},
|
|
155
|
-
'F7': {'keyCode': 118, 'code': 'F7', 'key': 'F7'},
|
|
156
|
-
'F8': {'keyCode': 119, 'code': 'F8', 'key': 'F8'},
|
|
157
|
-
'F9': {'keyCode': 120, 'code': 'F9', 'key': 'F9'},
|
|
158
|
-
'F10': {'keyCode': 121, 'code': 'F10', 'key': 'F10'},
|
|
159
|
-
'F11': {'keyCode': 122, 'code': 'F11', 'key': 'F11'},
|
|
160
|
-
'F12': {'keyCode': 123, 'code': 'F12', 'key': 'F12'},
|
|
161
|
-
'F13': {'keyCode': 124, 'code': 'F13', 'key': 'F13'},
|
|
162
|
-
'F14': {'keyCode': 125, 'code': 'F14', 'key': 'F14'},
|
|
163
|
-
'F15': {'keyCode': 126, 'code': 'F15', 'key': 'F15'},
|
|
164
|
-
'F16': {'keyCode': 127, 'code': 'F16', 'key': 'F16'},
|
|
165
|
-
'F17': {'keyCode': 128, 'code': 'F17', 'key': 'F17'},
|
|
166
|
-
'F18': {'keyCode': 129, 'code': 'F18', 'key': 'F18'},
|
|
167
|
-
'F19': {'keyCode': 130, 'code': 'F19', 'key': 'F19'},
|
|
168
|
-
'F20': {'keyCode': 131, 'code': 'F20', 'key': 'F20'},
|
|
169
|
-
'F21': {'keyCode': 132, 'code': 'F21', 'key': 'F21'},
|
|
170
|
-
'F22': {'keyCode': 133, 'code': 'F22', 'key': 'F22'},
|
|
171
|
-
'F23': {'keyCode': 134, 'code': 'F23', 'key': 'F23'},
|
|
172
|
-
'F24': {'keyCode': 135, 'code': 'F24', 'key': 'F24'},
|
|
173
|
-
'NumLock': {'keyCode': 144, 'code': 'NumLock', 'key': 'NumLock'},
|
|
174
|
-
'ScrollLock': {'keyCode': 145, 'code': 'ScrollLock', 'key': 'ScrollLock'},
|
|
175
|
-
'AudioVolumeMute': {'keyCode': 173, 'code': 'AudioVolumeMute', 'key': 'AudioVolumeMute'},
|
|
176
|
-
'AudioVolumeDown': {'keyCode': 174, 'code': 'AudioVolumeDown', 'key': 'AudioVolumeDown'},
|
|
177
|
-
'AudioVolumeUp': {'keyCode': 175, 'code': 'AudioVolumeUp', 'key': 'AudioVolumeUp'},
|
|
178
|
-
'MediaTrackNext': {'keyCode': 176, 'code': 'MediaTrackNext', 'key': 'MediaTrackNext'},
|
|
179
|
-
'MediaTrackPrevious': {'keyCode': 177, 'code': 'MediaTrackPrevious', 'key': 'MediaTrackPrevious'},
|
|
180
|
-
'MediaStop': {'keyCode': 178, 'code': 'MediaStop', 'key': 'MediaStop'},
|
|
181
|
-
'MediaPlayPause': {'keyCode': 179, 'code': 'MediaPlayPause', 'key': 'MediaPlayPause'},
|
|
182
|
-
'Semicolon': {'keyCode': 186, 'code': 'Semicolon', 'shiftKey': ':', 'key': ';'},
|
|
183
|
-
'Equal': {'keyCode': 187, 'code': 'Equal', 'shiftKey': '+', 'key': '='},
|
|
184
|
-
'NumpadEqual': {'keyCode': 187, 'code': 'NumpadEqual', 'key': '=', 'location': 3},
|
|
185
|
-
'Comma': {'keyCode': 188, 'code': 'Comma', 'shiftKey': '\<', 'key': ','},
|
|
186
|
-
'Minus': {'keyCode': 189, 'code': 'Minus', 'shiftKey': '_', 'key': '-'},
|
|
187
|
-
'Period': {'keyCode': 190, 'code': 'Period', 'shiftKey': '>', 'key': '.'},
|
|
188
|
-
'Slash': {'keyCode': 191, 'code': 'Slash', 'shiftKey': '?', 'key': '/'},
|
|
189
|
-
'Backquote': {'keyCode': 192, 'code': 'Backquote', 'shiftKey': '~', 'key': '`'},
|
|
190
|
-
'BracketLeft': {'keyCode': 219, 'code': 'BracketLeft', 'shiftKey': '{', 'key': '['},
|
|
191
|
-
'Backslash': {'keyCode': 220, 'code': 'Backslash', 'shiftKey': '|', 'key': '\\'},
|
|
192
|
-
'BracketRight': {'keyCode': 221, 'code': 'BracketRight', 'shiftKey': '}', 'key': ']'},
|
|
193
|
-
'Quote': {'keyCode': 222, 'code': 'Quote', 'shiftKey': '"', 'key': '\''},
|
|
194
|
-
'AltGraph': {'keyCode': 225, 'code': 'AltGraph', 'key': 'AltGraph'},
|
|
195
|
-
'Props': {'keyCode': 247, 'code': 'Props', 'key': 'CrSel'},
|
|
196
|
-
'Cancel': {'keyCode': 3, 'key': 'Cancel', 'code': 'Abort'},
|
|
197
|
-
'Clear': {'keyCode': 12, 'key': 'Clear', 'code': 'Numpad5', 'location': 3},
|
|
198
|
-
'Shift': {'keyCode': 16, 'key': 'Shift', 'code': 'ShiftLeft', 'location': 1},
|
|
199
|
-
'Control': {'keyCode': 17, 'key': 'Control', 'code': 'ControlLeft', 'location': 1},
|
|
200
|
-
'Alt': {'keyCode': 18, 'key': 'Alt', 'code': 'AltLeft', 'location': 1},
|
|
201
|
-
'Accept': {'keyCode': 30, 'key': 'Accept'},
|
|
202
|
-
'ModeChange': {'keyCode': 31, 'key': 'ModeChange'},
|
|
203
|
-
' ': {'keyCode': 32, 'key': ' ', 'code': 'Space'},
|
|
204
|
-
'Print': {'keyCode': 42, 'key': 'Print'},
|
|
205
|
-
'Execute': {'keyCode': 43, 'key': 'Execute', 'code': 'Open'},
|
|
206
|
-
'\u0000': {'keyCode': 46, 'key': '\u0000', 'code': 'NumpadDecimal', 'location': 3},
|
|
207
|
-
'a': {'keyCode': 65, 'key': 'a', 'code': 'KeyA'},
|
|
208
|
-
'b': {'keyCode': 66, 'key': 'b', 'code': 'KeyB'},
|
|
209
|
-
'c': {'keyCode': 67, 'key': 'c', 'code': 'KeyC'},
|
|
210
|
-
'd': {'keyCode': 68, 'key': 'd', 'code': 'KeyD'},
|
|
211
|
-
'e': {'keyCode': 69, 'key': 'e', 'code': 'KeyE'},
|
|
212
|
-
'f': {'keyCode': 70, 'key': 'f', 'code': 'KeyF'},
|
|
213
|
-
'g': {'keyCode': 71, 'key': 'g', 'code': 'KeyG'},
|
|
214
|
-
'h': {'keyCode': 72, 'key': 'h', 'code': 'KeyH'},
|
|
215
|
-
'i': {'keyCode': 73, 'key': 'i', 'code': 'KeyI'},
|
|
216
|
-
'j': {'keyCode': 74, 'key': 'j', 'code': 'KeyJ'},
|
|
217
|
-
'k': {'keyCode': 75, 'key': 'k', 'code': 'KeyK'},
|
|
218
|
-
'l': {'keyCode': 76, 'key': 'l', 'code': 'KeyL'},
|
|
219
|
-
'm': {'keyCode': 77, 'key': 'm', 'code': 'KeyM'},
|
|
220
|
-
'n': {'keyCode': 78, 'key': 'n', 'code': 'KeyN'},
|
|
221
|
-
'o': {'keyCode': 79, 'key': 'o', 'code': 'KeyO'},
|
|
222
|
-
'p': {'keyCode': 80, 'key': 'p', 'code': 'KeyP'},
|
|
223
|
-
'q': {'keyCode': 81, 'key': 'q', 'code': 'KeyQ'},
|
|
224
|
-
'r': {'keyCode': 82, 'key': 'r', 'code': 'KeyR'},
|
|
225
|
-
's': {'keyCode': 83, 'key': 's', 'code': 'KeyS'},
|
|
226
|
-
't': {'keyCode': 84, 'key': 't', 'code': 'KeyT'},
|
|
227
|
-
'u': {'keyCode': 85, 'key': 'u', 'code': 'KeyU'},
|
|
228
|
-
'v': {'keyCode': 86, 'key': 'v', 'code': 'KeyV'},
|
|
229
|
-
'w': {'keyCode': 87, 'key': 'w', 'code': 'KeyW'},
|
|
230
|
-
'x': {'keyCode': 88, 'key': 'x', 'code': 'KeyX'},
|
|
231
|
-
'y': {'keyCode': 89, 'key': 'y', 'code': 'KeyY'},
|
|
232
|
-
'z': {'keyCode': 90, 'key': 'z', 'code': 'KeyZ'},
|
|
233
|
-
'Meta': {'keyCode': 91, 'key': 'Meta', 'code': 'MetaLeft', 'location': 1},
|
|
234
|
-
'*': {'keyCode': 106, 'key': '*', 'code': 'NumpadMultiply', 'location': 3},
|
|
235
|
-
'+': {'keyCode': 107, 'key': '+', 'code': 'NumpadAdd', 'location': 3},
|
|
236
|
-
'-': {'keyCode': 109, 'key': '-', 'code': 'NumpadSubtract', 'location': 3},
|
|
237
|
-
'/': {'keyCode': 111, 'key': '/', 'code': 'NumpadDivide', 'location': 3},
|
|
238
|
-
';': {'keyCode': 186, 'key': ';', 'code': 'Semicolon'},
|
|
239
|
-
'=': {'keyCode': 187, 'key': '=', 'code': 'Equal'},
|
|
240
|
-
',': {'keyCode': 188, 'key': ',', 'code': 'Comma'},
|
|
241
|
-
'.': {'keyCode': 190, 'key': '.', 'code': 'Period'},
|
|
242
|
-
'`': {'keyCode': 192, 'key': '`', 'code': 'Backquote'},
|
|
243
|
-
'[': {'keyCode': 219, 'key': '[', 'code': 'BracketLeft'},
|
|
244
|
-
'\\': {'keyCode': 220, 'key': '\\', 'code': 'Backslash'},
|
|
245
|
-
']': {'keyCode': 221, 'key': ']', 'code': 'BracketRight'},
|
|
246
|
-
'\'': {'keyCode': 222, 'key': '\'', 'code': 'Quote'},
|
|
247
|
-
'Attn': {'keyCode': 246, 'key': 'Attn'},
|
|
248
|
-
'CrSel': {'keyCode': 247, 'key': 'CrSel', 'code': 'Props'},
|
|
249
|
-
'ExSel': {'keyCode': 248, 'key': 'ExSel'},
|
|
250
|
-
'EraseEof': {'keyCode': 249, 'key': 'EraseEof'},
|
|
251
|
-
'Play': {'keyCode': 250, 'key': 'Play'},
|
|
252
|
-
'ZoomOut': {'keyCode': 251, 'key': 'ZoomOut'},
|
|
253
|
-
')': {'keyCode': 48, 'key': ')', 'code': 'Digit0'},
|
|
254
|
-
'!': {'keyCode': 49, 'key': '!', 'code': 'Digit1'},
|
|
255
|
-
'@': {'keyCode': 50, 'key': '@', 'code': 'Digit2'},
|
|
256
|
-
'#': {'keyCode': 51, 'key': '#', 'code': 'Digit3'},
|
|
257
|
-
'$': {'keyCode': 52, 'key': '$', 'code': 'Digit4'},
|
|
258
|
-
'%': {'keyCode': 53, 'key': '%', 'code': 'Digit5'},
|
|
259
|
-
'^': {'keyCode': 54, 'key': '^', 'code': 'Digit6'},
|
|
260
|
-
'&': {'keyCode': 55, 'key': '&', 'code': 'Digit7'},
|
|
261
|
-
'(': {'keyCode': 57, 'key': '\(', 'code': 'Digit9'},
|
|
262
|
-
'A': {'keyCode': 65, 'key': 'A', 'code': 'KeyA'},
|
|
263
|
-
'B': {'keyCode': 66, 'key': 'B', 'code': 'KeyB'},
|
|
264
|
-
'C': {'keyCode': 67, 'key': 'C', 'code': 'KeyC'},
|
|
265
|
-
'D': {'keyCode': 68, 'key': 'D', 'code': 'KeyD'},
|
|
266
|
-
'E': {'keyCode': 69, 'key': 'E', 'code': 'KeyE'},
|
|
267
|
-
'F': {'keyCode': 70, 'key': 'F', 'code': 'KeyF'},
|
|
268
|
-
'G': {'keyCode': 71, 'key': 'G', 'code': 'KeyG'},
|
|
269
|
-
'H': {'keyCode': 72, 'key': 'H', 'code': 'KeyH'},
|
|
270
|
-
'I': {'keyCode': 73, 'key': 'I', 'code': 'KeyI'},
|
|
271
|
-
'J': {'keyCode': 74, 'key': 'J', 'code': 'KeyJ'},
|
|
272
|
-
'K': {'keyCode': 75, 'key': 'K', 'code': 'KeyK'},
|
|
273
|
-
'L': {'keyCode': 76, 'key': 'L', 'code': 'KeyL'},
|
|
274
|
-
'M': {'keyCode': 77, 'key': 'M', 'code': 'KeyM'},
|
|
275
|
-
'N': {'keyCode': 78, 'key': 'N', 'code': 'KeyN'},
|
|
276
|
-
'O': {'keyCode': 79, 'key': 'O', 'code': 'KeyO'},
|
|
277
|
-
'P': {'keyCode': 80, 'key': 'P', 'code': 'KeyP'},
|
|
278
|
-
'Q': {'keyCode': 81, 'key': 'Q', 'code': 'KeyQ'},
|
|
279
|
-
'R': {'keyCode': 82, 'key': 'R', 'code': 'KeyR'},
|
|
280
|
-
'S': {'keyCode': 83, 'key': 'S', 'code': 'KeyS'},
|
|
281
|
-
'T': {'keyCode': 84, 'key': 'T', 'code': 'KeyT'},
|
|
282
|
-
'U': {'keyCode': 85, 'key': 'U', 'code': 'KeyU'},
|
|
283
|
-
'V': {'keyCode': 86, 'key': 'V', 'code': 'KeyV'},
|
|
284
|
-
'W': {'keyCode': 87, 'key': 'W', 'code': 'KeyW'},
|
|
285
|
-
'X': {'keyCode': 88, 'key': 'X', 'code': 'KeyX'},
|
|
286
|
-
'Y': {'keyCode': 89, 'key': 'Y', 'code': 'KeyY'},
|
|
287
|
-
'Z': {'keyCode': 90, 'key': 'Z', 'code': 'KeyZ'},
|
|
288
|
-
':': {'keyCode': 186, 'key': ':', 'code': 'Semicolon'},
|
|
289
|
-
'<': {'keyCode': 188, 'key': '\<', 'code': 'Comma'},
|
|
290
|
-
'_': {'keyCode': 189, 'key': '_', 'code': 'Minus'},
|
|
291
|
-
'>': {'keyCode': 190, 'key': '>', 'code': 'Period'},
|
|
292
|
-
'?': {'keyCode': 191, 'key': '?', 'code': 'Slash'},
|
|
293
|
-
'~': {'keyCode': 192, 'key': '~', 'code': 'Backquote'},
|
|
294
|
-
'{': {'keyCode': 219, 'key': '{', 'code': 'BracketLeft'},
|
|
295
|
-
'|': {'keyCode': 220, 'key': '|', 'code': 'Backslash'},
|
|
296
|
-
'}': {'keyCode': 221, 'key': '}', 'code': 'BracketRight'},
|
|
297
|
-
'"': {'keyCode': 222, 'key': '"', 'code': 'Quote'},
|
|
298
|
-
'SoftLeft': {'key': 'SoftLeft', 'code': 'SoftLeft', 'location': 4},
|
|
299
|
-
'SoftRight': {'key': 'SoftRight', 'code': 'SoftRight', 'location': 4},
|
|
300
|
-
'Camera': {'keyCode': 44, 'key': 'Camera', 'code': 'Camera', 'location': 4},
|
|
301
|
-
'Call': {'key': 'Call', 'code': 'Call', 'location': 4},
|
|
302
|
-
'EndCall': {'keyCode': 95, 'key': 'EndCall', 'code': 'EndCall', 'location': 4},
|
|
303
|
-
'VolumeDown': {'keyCode': 182, 'key': 'VolumeDown', 'code': 'VolumeDown', 'location': 4},
|
|
304
|
-
'VolumeUp': {'keyCode': 183, 'key': 'VolumeUp', 'code': 'VolumeUp', 'location': 4},
|
|
305
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
|
|
4
|
-
"""Utility functions."""
|
|
5
|
-
|
|
6
|
-
import gc
|
|
7
|
-
import socket
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
def get_free_port() -> int:
|
|
11
|
-
"""Get free port."""
|
|
12
|
-
sock = socket.socket()
|
|
13
|
-
sock.bind(('localhost', 0))
|
|
14
|
-
port = sock.getsockname()[1]
|
|
15
|
-
sock.close()
|
|
16
|
-
del sock
|
|
17
|
-
gc.collect()
|
|
18
|
-
return port
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import asyncio
|
|
2
|
-
import logging
|
|
3
|
-
from typing import Any, AsyncIterable, Callable, Iterable, Optional, Union
|
|
4
|
-
|
|
5
|
-
from websockets import Data, WebSocketClientProtocol, connect
|
|
6
|
-
|
|
7
|
-
logger = logging.getLogger(__name__)
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class WebsocketTransport:
|
|
11
|
-
def __init__(self, ws: WebSocketClientProtocol):
|
|
12
|
-
self.onmessage: Optional[Callable[[str], Any]] = None
|
|
13
|
-
self.onclose: Optional[Callable[[], Any]] = None
|
|
14
|
-
self.ws = ws
|
|
15
|
-
|
|
16
|
-
@classmethod
|
|
17
|
-
async def create(cls, uri: str, loop: asyncio.AbstractEventLoop = None) -> 'WebsocketTransport':
|
|
18
|
-
return cls(
|
|
19
|
-
await connect(
|
|
20
|
-
uri=uri,
|
|
21
|
-
# chrome doesn't respond to pings
|
|
22
|
-
# todo: remove note after websockets release
|
|
23
|
-
# waiting on websockets to release new version where ping_interval is typed correctly
|
|
24
|
-
ping_interval=None, # type: ignore
|
|
25
|
-
max_size=256 * 1024 * 1024, # 256Mb
|
|
26
|
-
loop=loop,
|
|
27
|
-
close_timeout=5,
|
|
28
|
-
# todo check if speed is affected
|
|
29
|
-
# note: seems to work w/ compression
|
|
30
|
-
compression=None,
|
|
31
|
-
)
|
|
32
|
-
)
|
|
33
|
-
|
|
34
|
-
async def send(self, message: Union[Data, Iterable[Data], AsyncIterable[Data]]) -> None:
|
|
35
|
-
await self.ws.send(message)
|
|
36
|
-
|
|
37
|
-
async def close(self, code: int = 1000, reason: str = '') -> None:
|
|
38
|
-
logger.debug(f'Disposing connection: code={code} reason={reason}')
|
|
39
|
-
await self.ws.close(code=code, reason=reason)
|
|
40
|
-
if self.onclose:
|
|
41
|
-
await self.onclose()
|
|
42
|
-
|
|
43
|
-
async def recv(self) -> Data:
|
|
44
|
-
data = await self.ws.recv()
|
|
45
|
-
if self.onmessage and data:
|
|
46
|
-
await self.onmessage(data)
|
|
47
|
-
return data
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
|
|
4
|
-
"""Worker module."""
|
|
5
|
-
|
|
6
|
-
import logging
|
|
7
|
-
from typing import TYPE_CHECKING, Any, Callable, Dict, List
|
|
8
|
-
|
|
9
|
-
from pyee import AsyncIOEventEmitter
|
|
10
|
-
from biolib.pyppeteer.pyppeteer.execution_context import ExecutionContext
|
|
11
|
-
from biolib.pyppeteer.pyppeteer.jshandle import JSHandle
|
|
12
|
-
from biolib.pyppeteer.pyppeteer.models import JSFunctionArg
|
|
13
|
-
|
|
14
|
-
if TYPE_CHECKING:
|
|
15
|
-
from pyppeteer.connection import CDPSession
|
|
16
|
-
|
|
17
|
-
logger = logging.getLogger(__name__)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
class Worker(AsyncIOEventEmitter):
|
|
21
|
-
"""The Worker class represents a WebWorker.
|
|
22
|
-
|
|
23
|
-
The events `workercreated` and `workerdestroyed` are emitted on the page
|
|
24
|
-
object to signal the worker lifecycle.
|
|
25
|
-
|
|
26
|
-
.. code::
|
|
27
|
-
|
|
28
|
-
page.on('workercreated', lambda worker: print('Worker created:', worker.url))
|
|
29
|
-
"""
|
|
30
|
-
|
|
31
|
-
def __init__(
|
|
32
|
-
self,
|
|
33
|
-
client: 'CDPSession',
|
|
34
|
-
url: str,
|
|
35
|
-
consoleAPICalled: Callable[[str, List[JSHandle], Any], None],
|
|
36
|
-
exceptionThrown: Callable[[Dict], None],
|
|
37
|
-
) -> None:
|
|
38
|
-
super().__init__()
|
|
39
|
-
self._client = client
|
|
40
|
-
self._url = url
|
|
41
|
-
self.loop = client.loop
|
|
42
|
-
self._executionContextPromise = self.loop.create_future()
|
|
43
|
-
|
|
44
|
-
def jsHandleFactory(remoteObject: Dict) -> JSHandle:
|
|
45
|
-
return None # type: ignore
|
|
46
|
-
|
|
47
|
-
def onExecutionContentCreated(event: Dict) -> None:
|
|
48
|
-
nonlocal jsHandleFactory
|
|
49
|
-
|
|
50
|
-
# noinspection PyRedeclaration
|
|
51
|
-
def jsHandleFactory(remoteObject: Dict) -> JSHandle:
|
|
52
|
-
return JSHandle(executionContext, client, remoteObject)
|
|
53
|
-
|
|
54
|
-
executionContext = ExecutionContext(client, event['context'], None)
|
|
55
|
-
self._executionContextCallback(executionContext)
|
|
56
|
-
|
|
57
|
-
self._client.once('Runtime.executionContextCreated', onExecutionContentCreated)
|
|
58
|
-
try:
|
|
59
|
-
# This might fail if the target is closed before we receive all
|
|
60
|
-
# execution contexts.
|
|
61
|
-
self._client.send('Runtime.enable', {})
|
|
62
|
-
except Exception as e:
|
|
63
|
-
logger.error(f'An exception occurred: {e}')
|
|
64
|
-
|
|
65
|
-
def onConsoleAPICalled(event: Dict[str, Any]) -> None:
|
|
66
|
-
args: List[JSHandle] = []
|
|
67
|
-
for arg in event.get('args', []):
|
|
68
|
-
args.append(jsHandleFactory(arg))
|
|
69
|
-
consoleAPICalled(event['type'], args, event['stackTrace'])
|
|
70
|
-
|
|
71
|
-
self._client.on('Runtime.consoleAPICalled', onConsoleAPICalled)
|
|
72
|
-
self._client.on(
|
|
73
|
-
'Runtime.exceptionThrown', lambda exception: exceptionThrown(exception['exceptionDetails']),
|
|
74
|
-
)
|
|
75
|
-
|
|
76
|
-
def _executionContextCallback(self, value: ExecutionContext) -> None:
|
|
77
|
-
self._executionContextPromise.set_result(value)
|
|
78
|
-
|
|
79
|
-
@property
|
|
80
|
-
def url(self) -> str:
|
|
81
|
-
"""Return URL."""
|
|
82
|
-
return self._url
|
|
83
|
-
|
|
84
|
-
@property
|
|
85
|
-
async def executionContext(self) -> ExecutionContext:
|
|
86
|
-
"""Return ExecutionContext."""
|
|
87
|
-
return await self._executionContextPromise
|
|
88
|
-
|
|
89
|
-
async def evaluate(self, pageFunction: str, *args: JSFunctionArg) -> Any:
|
|
90
|
-
"""Evaluate ``pageFunction`` with ``args``.
|
|
91
|
-
|
|
92
|
-
Shortcut for ``(await worker.executionContext).evaluate(pageFunction, *args)``.
|
|
93
|
-
"""
|
|
94
|
-
return await (await self._executionContextPromise).evaluate(pageFunction, *args)
|
|
95
|
-
|
|
96
|
-
async def evaluateHandle(self, pageFunction: str, *args: JSFunctionArg) -> JSHandle:
|
|
97
|
-
"""Evaluate ``pageFunction`` with ``args`` and return :class:`~pyppeteer.execution_context.JSHandle`.
|
|
98
|
-
|
|
99
|
-
Shortcut for ``(await worker.executionContext).evaluateHandle(pageFunction, *args)``.
|
|
100
|
-
"""
|
|
101
|
-
return await (await self._executionContextPromise).evaluateHandle(pageFunction, *args)
|
biolib/pyppeteer/pyproject.toml
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
[tool.poetry]
|
|
2
|
-
name = "pyppeteer"
|
|
3
|
-
version = "0.2.3"
|
|
4
|
-
description = "Headless chrome/chromium automation library (unofficial port of puppeteer)"
|
|
5
|
-
readme = 'README.md'
|
|
6
|
-
license = "MIT"
|
|
7
|
-
homepage = "https://github.com/pyppeteer/pyppeteer"
|
|
8
|
-
repository = "https://github.com/pyppeteer/pyppeteer"
|
|
9
|
-
keywords=['pyppeteer', 'puppeteer', 'chrome', 'chromium']
|
|
10
|
-
authors = [
|
|
11
|
-
"pyppeteer <pyppeteer@protonmail.com>",
|
|
12
|
-
"granitosaurus <bernardas.alisauskas@pm.me>",
|
|
13
|
-
"Hiroyuki Takagi <miyako.dev@gmail.com>",
|
|
14
|
-
]
|
|
15
|
-
classifiers = [
|
|
16
|
-
'Development Status :: 3 - Alpha',
|
|
17
|
-
'Intended Audience :: Developers',
|
|
18
|
-
'License :: OSI Approved :: MIT License',
|
|
19
|
-
'Natural Language :: English',
|
|
20
|
-
'Programming Language :: Python :: 3',
|
|
21
|
-
'Programming Language :: Python :: 3.6',
|
|
22
|
-
'Programming Language :: Python :: 3.7',
|
|
23
|
-
'Programming Language :: Python :: 3.8',
|
|
24
|
-
]
|
|
25
|
-
packages = [
|
|
26
|
-
{ include = "pyppeteer" },
|
|
27
|
-
]
|
|
28
|
-
include = [
|
|
29
|
-
"README.md",
|
|
30
|
-
"LICENSE",
|
|
31
|
-
"CHANGES.md",
|
|
32
|
-
"tests/*",
|
|
33
|
-
"docs/*",
|
|
34
|
-
]
|
|
35
|
-
exclude = [
|
|
36
|
-
'*/__pycache__',
|
|
37
|
-
'*/*.py[co]',
|
|
38
|
-
]
|
|
39
|
-
|
|
40
|
-
[tool.poetry.urls]
|
|
41
|
-
"Bug Tracker" = "https://github.com/pyppeteer/pyppeteer/issues"
|
|
42
|
-
|
|
43
|
-
[tool.poetry.scripts]
|
|
44
|
-
pyppeteer-install = 'pyppeteer.command:install'
|
|
45
|
-
|
|
46
|
-
[tool.poetry.dependencies]
|
|
47
|
-
python = "^3.6.1"
|
|
48
|
-
aenum = "^2.2.3"
|
|
49
|
-
appdirs = "^1.4.3"
|
|
50
|
-
certifi = ">=2019.11.28"
|
|
51
|
-
ordered_set = "^4.0.1"
|
|
52
|
-
pillow = "^7.1.2"
|
|
53
|
-
pyee = "^7.0.1"
|
|
54
|
-
tqdm = "^4.42.1"
|
|
55
|
-
typing_extensions = { version ="^3.7.4", python = '<3.8'}
|
|
56
|
-
typing_inspect = { version ="^0.5.0", python = '<3.8'}
|
|
57
|
-
urllib3 = "^1.25.8"
|
|
58
|
-
websockets = "^8.1"
|
|
59
|
-
|
|
60
|
-
[tool.poetry.dev-dependencies]
|
|
61
|
-
aiohttp = "^3.6.2"
|
|
62
|
-
diff_match_patch = "^20181111"
|
|
63
|
-
doit = "^0.32.0"
|
|
64
|
-
flake8 = "^3.7.9"
|
|
65
|
-
livereload = "^2.6.1"
|
|
66
|
-
m2r = "^0.2.1"
|
|
67
|
-
mypy = "^0.770"
|
|
68
|
-
networkx = "^2.4"
|
|
69
|
-
pixelmatch = "^0.2.1"
|
|
70
|
-
pre-commit = "^2.2.0"
|
|
71
|
-
pydocstyle = "^5.0.2"
|
|
72
|
-
pylint = "^2.4.4"
|
|
73
|
-
pytest = "^5.3.5"
|
|
74
|
-
pytest-cov = "^2.8.1"
|
|
75
|
-
pytest-timeout = "^1.3.4"
|
|
76
|
-
pytest-xdist = "^1.31.0"
|
|
77
|
-
readme_renderer = "^24.0"
|
|
78
|
-
sphinx = "^2.4.0"
|
|
79
|
-
sphinxcontrib-asyncio = "^0.2.0"
|
|
80
|
-
syncer = "^1.3.0"
|
|
81
|
-
tox = "^3.14.3"
|
|
82
|
-
|
|
83
|
-
[tool.black]
|
|
84
|
-
line-length = 120
|
|
85
|
-
target-version = ['py36', 'py37', 'py38']
|
|
86
|
-
skip-string-normalization = true
|
|
87
|
-
|
|
88
|
-
[tool.isort]
|
|
89
|
-
line_length = 120
|
|
90
|
-
multi_line_output = 3
|
|
91
|
-
include_trailing_comma = true
|
|
92
|
-
force_grid_wrap = 0
|
|
93
|
-
use_parentheses = true
|
|
94
|
-
known_third_party = ["PIL", "aiohttp", "appdirs", "certifi", "diff_match_patch", "livereload", "networkx", "ordered_set", "pixelmatch", "pyee", "pyppeteer", "pytest", "syncer", "tests", "tqdm", "urllib3", "websockets"]
|
|
95
|
-
[build-system]
|
|
96
|
-
requires = ["poetry>=0.12"]
|
|
97
|
-
build-backend = "poetry.masonry.api"
|