Sample CLI
gway clock to-download
Docstring
Prompt: Create a python function that takes a file size such as 100 MB or 1.76 GB
(pick a wide array of units) and then calculates the possible time to download
it within 4 ranges. You choose the ranges logarithmically. Then, perform a quick
check against google to let the user know what their current range is.
Sample CLI
gway release build
References
['abort', 'error', 'info', 'readme', 'readme.collect_projects', 'resource', 'test']
Signature
(*, bump: bool = False, dist: bool = False, twine: bool = False, help_db: bool = True, user: str =
'[PYPI_USERNAME]', password: str = '[PYPI_PASSWORD]', token: str = '[PYPI_API_TOKEN]', projects:
bool = False, git: bool = False, all: bool = False) -> None
Docstring
Build the project and optionally upload to PyPI.
Args:
bump (bool): Increment patch version if True.
dist (bool): Build distribution package if True.
twine (bool): Upload to PyPI if True.
user (str): PyPI username (default: [PYPI_USERNAME]).
password (str): PyPI password (default: [PYPI_PASSWORD]).
token (str): PyPI API token (default: [PYPI_API_TOKEN]).
git (bool): Require a clean git repo and commit/push after release if True.
vscode (bool): Build the vscode extension.
Sample CLI
gway release loc
Docstring
Counts Python lines of code in the given directories, ignoring hidden files and directories.
Defaults to everything in the current GWAY release.
Sample CLI
gway tests dummy-function
Signature
(param1: str, param2: str = 'default')
Docstring
Dummy function for testing.
Sample CLI
gway tests variadic-keyword
Sample CLI
gway tests variadic-positional
Sample CLI
gway web.app render-template
Signature
(*, title='GWAY', navbar='', content='', static='static', css_files=None)
Sample CLI
gway web.app urlencode
Signature
(query, doseq=False, safe='', encoding=None, errors=None, quote_via=)
Docstring
Encode a dict or sequence of two-element tuples into a URL query string.
If any values in the query arg are sequences and doseq is true, each
sequence element is converted to a separate parameter.
If the query arg is a sequence of two-element tuples, the order of the
parameters in the output will match the order of parameters in the
input.
The components of a query arg may each be either a string or a bytes type.
The safe, encoding, and errors parameters are passed down to the function
specified by quote_via (encoding and errors only if a component is a str).
Sample CLI
gway web.proxy setup-app
Signature
(*, endpoint: str, app=None, websockets: bool = False, path: str = '/')
Docstring
Create an HTTP (and optional WebSocket) proxy to the given endpoint.
Accepts positional apps, the `app=` kwarg, or both. Flattens any iterables
and selects apps by type using gw.filter_apps.
Returns a single app if one is provided, otherwise a tuple of apps.
TODOs
# TODO: Test if this is properly compatible with web.server.start_app
Sample CLI
gway hello-world
Signature
(name: str = 'World', *, greeting: str = 'Hello')
Docstring
Smoke test function.
Signature
(root: str = 'tests', filter=None)
Docstring
Execute all automatically detected test suites.