Skip to content

Commit

Permalink
Update misc.py
Browse files Browse the repository at this point in the history
  • Loading branch information
bimac committed Nov 13, 2023
1 parent 1ebf846 commit c04749e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ibllib/pipes/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import sys
import time
import logging
from functools import wraps
from pathlib import Path
from typing import Union, List, Callable, Any
from inspect import signature
Expand Down Expand Up @@ -1164,7 +1165,7 @@ def inhibit(quiet: bool = False):
@staticmethod
def uninhibit(quiet: bool = False):
if quiet:
log.debug("Allowing Windows from going to sleep")
log.debug("Allowing Windows to go to sleep")
else:
print("Allowing Windows to go to sleep")
WindowsInhibitor._set_thread_execution_state(WindowsInhibitor.ES_CONTINUOUS)
Expand All @@ -1188,6 +1189,8 @@ def sleepless(func: Callable[..., Any]) -> Callable[..., Any]:
callable
The decorated function.
"""

@wraps(func)
def inner(*args, **kwargs) -> Any:
if os.name == 'nt':
WindowsInhibitor().inhibit(quiet=True)
Expand Down

0 comments on commit c04749e

Please sign in to comment.