Add hack-fix to avoid leaking cmdline flags to kivy

kivy_mainline_and_py3.8
Tyler Goodlet 2019-02-25 20:14:36 -05:00
parent 77548d2ee6
commit 747d703d92
3 changed files with 9 additions and 5 deletions

View File

@ -1,7 +1,13 @@
"""
Stuff for you eyes.
Stuff for your eyes.
"""
import os
import sys
# XXX clear all flags at import to avoid upsetting
# ol' kivy see: https://github.com/kivy/kivy/issues/4225
# though this is likely a ``click`` problem
sys.argv[1:] = []
# use the trio async loop
os.environ['KIVY_EVENTLOOP'] = 'trio'

View File

@ -252,8 +252,7 @@ async def _async_main(
quotes
)
try:
# Trio-kivy entry point.
await async_runTouchApp(widgets['root']) # run kivy
await async_runTouchApp(widgets['root'])
finally:
# cancel remote data feed task
await quote_gen.aclose()

View File

@ -498,8 +498,7 @@ async def _async_main(
)
async with chain.open_rt_display(nursery, symbol):
try:
# trio-kivy entry point.
await async_runTouchApp(chain.widgets['root']) # run kivy
await async_runTouchApp(chain.widgets['root'])
finally:
if chain._quote_gen:
await chain._quote_gen.aclose()