check_engine
Engine
Source code in src/cookiecutter_python/backend/hosting_services/check_engine.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | |
check(servers)
Request Future per supported server, for web hosting service checks
For each server the dedicated 'checker' is called, which tries to return a Future.
Returns None checker's 'activation' boolean flag was off at runtime. Returns None if internal mechanism for determining server URL fails to derive the URL (atm URL is only trie d to be read from User Config yaml)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
servers |
List[str]
|
[description] |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Iterator |
Iterator
|
of custom objects with 'future' evaluatable attribute |
Source code in src/cookiecutter_python/backend/hosting_services/check_engine.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | |
create(config_file, default_config)
staticmethod
Initialize objects, for Asynchronous http with 3rd-party Services
Objects are designed to Ask PyPI and Read The Docs, if the soon to be generated package name, and readthedocs project slug are available.
These 'Checker' objects make asynchronous http requests to PyPI and RTD web servers, for non-blocking IO, and to avoid blocking the main thread.
Checkers are initialized as 'Activated' if User Config is given and Default Config is False.
Then each Checker (pypi, rtd) requires: - PyPI requires the 'pkg_name' in User's yaml Config - RTD requires the 'readthedocs_project_slug' in User's yaml Config
to derive the URLs for Future Requests
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config_file |
str
|
user's yaml config file |
required |
default_config |
bool
|
default config flag |
required |
Source code in src/cookiecutter_python/backend/hosting_services/check_engine.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | |