Skip to content

Commit e101a27

Browse files
committed
Fix startup using asyncio
1 parent 77a1fda commit e101a27

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
setup(
1313
name=name,
14-
version='1.17',
14+
version='1.18',
1515
description='Program to run plugins to inhibit system '
1616
'sleep/suspend/hibernate',
1717
long_description=here.joinpath('README.md').read_text(),

sleep_inhibitor.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,12 +201,15 @@ def init():
201201
plugin_dir, inhibitor_prog)
202202
for index, plugin in enumerate(plugins, 1)]
203203

204-
async def main():
204+
async def run():
205205
'Main entry'
206206
tasks = init()
207207

208208
# Wait for each plugin task to finish (i.e. wait forever)
209209
await asyncio.gather(*(t.run() for t in tasks))
210210

211+
def main():
212+
asyncio.run(run())
213+
211214
if __name__ == '__main__':
212-
asyncio.run(main(), debug=True)
215+
main()

0 commit comments

Comments
 (0)