Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- async def process_function(argument, row, file_stats, db_session):
- switcher = {
- 0: process_log_in,
- 1: process_launch_application,
- 2: process_enter_application,
- 3: process_exit_application,
- 4: process_access_screen,
- 5: process_log_out,
- 6: process_time_out
- }
- # Get the function from switcher dictionary
- func = switcher.get(argument, lambda: "nothing")
- # Execute the function
- ret = func(row, file_stats, db_session)
- if asyncio.iscoroutine(ret):
- # func returned a coroutine, await it
- ret = await ret
- return ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement