blext.ui
blext.ui.download_wheels
Implements a UI that reports the download progress of Python wheels.
CallbacksDownloadWheel
pydantic-model
Bases: BaseModel
Callbacks to trigger in the process of downloading wheels.
Notes
- All that a download agent has to ensure, is to allow the user to specify equivalent callbacks to these.
- The callback return values are never used for any purpose.
ATTRIBUTE | DESCRIPTION |
---|---|
cb_start_wheel_download |
Called as a wheel is starting to be downloaded.
Called with the wheel, and with its download path.
Always called before
TYPE:
|
cb_update_wheel_download |
Called when an actively downloading wheel
Called with the wheel, and its download path, and newly downloaded bytes.
Always called after
TYPE:
|
cb_finish_wheel_download |
Called when an actively downloading wheel No other callbacks are called for a wheel after this.
TYPE:
|
See Also
blext.pydeps.network.download_wheels
: Download agent that uses equivalent callbacks.blext.ui.ui_download_wheels
: Context manager that provides this object.
Fields:
-
cb_start_wheel_download
(Callable[[PyDepWheel, Path], Any]
) -
cb_update_wheel_download
(Callable[[PyDepWheel, Path, int], Any]
) -
cb_finish_wheel_download
(Callable[[PyDepWheel, Path], Any]
)
ui_download_wheels
ui_download_wheels(
wheels_to_download: frozenset[PyDepWheel],
*,
console: Console,
fps: int = 24,
) -> Generator[CallbacksDownloadWheel, None, None]
Context manager creating a terminal UI to communicate wheel downloading.
Notes
Yields callbacks to call during the download progress, in order for the UI to update correctly.
PARAMETER | DESCRIPTION |
---|---|
wheels_to_download
|
Set of wheels to download.
TYPE:
|
console
|
TYPE:
|
fps
|
Number of updates to the terminal, per second.
TYPE:
|
See Also
blext.ui.download_wheels.CallbacksDownloadWheel
: For more on when to call each callback.
Source code in blext/ui/download_wheels.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 |
|
blext.ui.prepack_extension
Implements a UI that reports the progress of extension pre-packing.
CallbacksPrepackExtension
pydantic-model
Bases: BaseModel
Callbacks to trigger in the process of pre-packing an extension.
Notes
- All callbacks additionally take a
live=
keyword argument - All that a pre-pack agent has to ensure, is to allow the user to specify equivalent callbacks to these.
- The callback return values are never used for any purpose.
ATTRIBUTE | DESCRIPTION |
---|---|
cb_pre_file_write |
Called as a file is about to be pre-packed.
Called with the host path, and the zipfile path.
Always called before
TYPE:
|
cb_post_file_write |
Called after a file has been pre-packed.
Called with the host path, and the zipfile path.
Always called before
TYPE:
|
See Also
blext.pack.prepack_extension
: Prepack agent that uses equivalent callbacks.blext.ui.ui_prepack_extension
: Context manager that provides this object.
Fields:
-
cb_pre_file_write
(PrepackCallback
) -
cb_post_file_write
(PrepackCallback
)
PrepackCallback
Bases: Protocol
Callback for use in CallbacksPrepackExtension
.
__call__
__call__(
path: Path, zipfile_path: Path, *, live: Live
) -> Any
Signature of the callback.
Source code in blext/ui/prepack_extension.py
40 41 42 43 44 45 46 47 |
|
ui_prepack_extension
ui_prepack_extension(
files_to_prepack: frozendict[Path, Path]
| dict[Path, Path],
*,
console: Console,
) -> Generator[CallbacksPrepackExtension, None, None]
Context manager creating a terminal UI to communicate extension prepacking progress.
Notes
Yields callbacks to call during the download progress, in order for the UI to update correctly.
PARAMETER | DESCRIPTION |
---|---|
files_to_prepack
|
Files to be prepack. Maps an absolute host filesystem path, to a relative zipfile path.
TYPE:
|
console
|
TYPE:
|
See Also
blext.ui.download_wheels.CallbacksDownloadWheel
: For more on when to call each callback.
Source code in blext/ui/prepack_extension.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
|