![]() Native Python types (parsed XML) instead of pure XML string. ![]() Has native support of JSON content, usually it’s much more convenient to use run ( main ()) Content typeīy default QuickBuild returns XML content, but starting from 10 version it also get_status ( 12345 )) # now, after some time, password of user somehow changed, so our callback # will be called, new credentials will be using for retry and future here # we get also correct build info instead of QBUnauthorizedError exception print ( await client. json () return response, response async def main (): client = AsyncQBClient ( ', 'user', 'password', auth_update_callback = get_credentials ) # let's suppose credentials are valid now print ( await client. get ( '.' ) as resp : response = await resp. ClientSession () as session : async with session. Update credentials handler: import asyncio import aiohttp from quickbuild import AsyncQBClient async def get_credentials (): async with aiohttp. ![]() Stop build: from quickbuild import QBClient client = QBClient ( ', 'user', 'password' ) client. get_version () print ( version ) await client. Get server version in async way (be careful AsyncQBClient must be called inside async function): import asyncio from quickbuild import AsyncQBClient async def main (): client = AsyncQBClient ( ', 'user', 'password' ) version = await client. Get server version: from quickbuild import QBClient client = QBClient ( ', 'user', 'password' ) version = client. from quickbuild import AsyncQBClient, QBClient DocumentationĪvailable REST API Clients Installation pip3 install quickbuild Examples Package supports sync and async syntax with same code base.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |