|
8 | 8 |
|
9 | 9 | import terminado |
10 | 10 | from tornado import web |
11 | | -from tornado.ioloop import IOLoop |
12 | | -from tornado.ioloop import PeriodicCallback |
| 11 | +from tornado.ioloop import IOLoop, PeriodicCallback |
13 | 12 | from traitlets import Integer |
14 | 13 | from traitlets.config import LoggingConfigurable |
15 | 14 |
|
16 | 15 | try: |
17 | | - from jupyter_server._tz import isoformat |
18 | | - from jupyter_server._tz import utcnow |
| 16 | + from jupyter_server._tz import isoformat, utcnow |
19 | 17 | from jupyter_server.prometheus.metrics import TERMINAL_CURRENTLY_RUNNING_TOTAL |
20 | 18 | except ModuleNotFoundError: |
21 | 19 | raise ModuleNotFoundError("Jupyter Server must be installed to use this extension.") |
@@ -46,7 +44,7 @@ class TerminalManager(LoggingConfigurable, terminado.NamedTermManager): |
46 | 44 | # Methods for managing terminals |
47 | 45 | # ------------------------------------------------------------------------- |
48 | 46 | def __init__(self, *args, **kwargs): |
49 | | - super(TerminalManager, self).__init__(*args, **kwargs) |
| 47 | + super().__init__(*args, **kwargs) |
50 | 48 |
|
51 | 49 | def create(self, **kwargs): |
52 | 50 | """Create a new terminal.""" |
@@ -78,7 +76,7 @@ def list(self): |
78 | 76 | async def terminate(self, name, force=False): |
79 | 77 | """Terminate terminal 'name'.""" |
80 | 78 | self._check_terminal(name) |
81 | | - await super(TerminalManager, self).terminate(name, force=force) |
| 79 | + await super().terminate(name, force=force) |
82 | 80 |
|
83 | 81 | # Decrease the metric below by one |
84 | 82 | # because a terminal has been shutdown |
@@ -113,7 +111,7 @@ def _initialize_culler(self): |
113 | 111 | """ |
114 | 112 | if not self._initialized_culler and self.cull_inactive_timeout > 0: |
115 | 113 | if self._culler_callback is None: |
116 | | - loop = IOLoop.current() |
| 114 | + _ = IOLoop.current() |
117 | 115 | if self.cull_interval <= 0: # handle case where user set invalid value |
118 | 116 | self.log.warning( |
119 | 117 | "Invalid value for 'cull_interval' detected (%s) - using default value (%s).", |
|
0 commit comments