import asyncio
+import logging
+import timeit
from mpdaio.client import MPDClient
+logging.basicConfig(level=logging.DEBUG,
+ format='%(levelname)-8s %(module)-10s %(message)s')
+
async def run_cli():
cli = MPDClient()
- await cli.connect()
+ cli.mpd_timeout = 0.1
current = await cli.currentsong()
print(current)
- print(await cli.playlistinfo())
+
+ await cli.currentsong()
+ await cli.playlistinfo()
+ await cli.list('artist')
+ #print(await cli.playlistinfo())
await cli.close()
-asyncio.run(run_cli())
+if __name__ == '__main__':
+ asyncio.run(run_cli())
+ asyncio.run(run_cli())
+ #t = timeit.Timer('asyncio.run(run_cli())', globals=globals())
+ #print(t.autorange())
+ with asyncio.Runner() as runner:
+ runner.run(run_cli())
+ runner.run(run_cli())