Compare commits

..

No commits in common. "9a64523baa73457767c77d60ef2d18ce7e67fcbf" and "969c66e2bfd0336a433d98e9de6b8981b444e242" have entirely different histories.

2 changed files with 3 additions and 9 deletions

View File

@ -32,7 +32,7 @@ max-line-length = 120
# Disable some rules for entire files # Disable some rules for entire files
per-file-ignores = per-file-ignores =
# DALL000: Missing __all__, main isn't supposed to be imported # DALL000: Missing __all__, main isn't supposed to be imported
main.py: DALL000, run_db_scripts.py: DALL000, main.py: DALL000,
# DALL000: Missing __all__, Cogs aren't modules # DALL000: Missing __all__, Cogs aren't modules
./didier/cogs/*: DALL000, ./didier/cogs/*: DALL000,
# DALL000: Missing __all__, tests aren't supposed to be imported # DALL000: Missing __all__, tests aren't supposed to be imported

View File

@ -8,9 +8,7 @@ import importlib
import sys import sys
from typing import Callable from typing import Callable
if __name__ == "__main__":
async def main():
"""Try to parse all command-line arguments into modules and run them sequentially"""
scripts = sys.argv[1:] scripts = sys.argv[1:]
if not scripts: if not scripts:
print("No scripts provided.", file=sys.stderr) print("No scripts provided.", file=sys.stderr)
@ -22,12 +20,8 @@ async def main():
try: try:
script_main: Callable = module.main script_main: Callable = module.main
await script_main() asyncio.run(script_main())
print(f"Successfully ran {script}") print(f"Successfully ran {script}")
except AttributeError: except AttributeError:
print(f'Script "{script}" not found.', file=sys.stderr) print(f'Script "{script}" not found.', file=sys.stderr)
exit(1) exit(1)
if __name__ == "__main__":
asyncio.run(main())