Skip to content

Commit 61725c6

Browse files
committed
chore(linting): lint the newly added wtfpm.py file
1 parent 1386ed8 commit 61725c6

File tree

1 file changed

+32
-28
lines changed

1 file changed

+32
-28
lines changed

python/pythonmonkey/lib/wtfpm.py

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,38 @@
55

66
import pythonmonkey as pm
77

8+
89
def printTimersDebugInfo():
9-
pm.eval("""(require) => {
10-
const internalBinding = require('internal-binding');
11-
const { getAllRefedTimersDebugInfo: getDebugInfo } = internalBinding('timers');
12-
console.log(getDebugInfo())
13-
console.log(new Date())
14-
}""")(pm.createRequire(__file__))
10+
pm.eval("""(require) => {
11+
const internalBinding = require('internal-binding');
12+
const { getAllRefedTimersDebugInfo: getDebugInfo } = internalBinding('timers');
13+
console.log(getDebugInfo())
14+
console.log(new Date())
15+
}""")(pm.createRequire(__file__))
16+
1517

1618
class WTF:
17-
"""
18-
WTFPythonMonkey to use as a Python context manager (`with`-statement)
19-
20-
Usage:
21-
```py
22-
from pythonmonkey.lib.wtfpm import WTF
23-
24-
with WTF():
25-
# the main entry point for the program utilizes PythonMonkey event-loop
26-
asyncio.run(pythonmonkey_main())
27-
```
28-
"""
29-
def __enter__(self):
30-
pass
31-
def __exit__(self, errType, errValue, traceback):
32-
if errType is None: # no exception
33-
return
34-
elif issubclass(errType, KeyboardInterrupt): # except KeyboardInterrupt:
35-
printTimersDebugInfo()
36-
return True # exception suppressed
37-
else: # other exceptions
38-
return False
19+
"""
20+
WTFPythonMonkey to use as a Python context manager (`with`-statement)
21+
22+
Usage:
23+
```py
24+
from pythonmonkey.lib.wtfpm import WTF
25+
26+
with WTF():
27+
# the main entry point for the program utilizes PythonMonkey event-loop
28+
asyncio.run(pythonmonkey_main())
29+
```
30+
"""
31+
32+
def __enter__(self):
33+
pass
34+
35+
def __exit__(self, errType, errValue, traceback):
36+
if errType is None: # no exception
37+
return
38+
elif issubclass(errType, KeyboardInterrupt): # except KeyboardInterrupt:
39+
printTimersDebugInfo()
40+
return True # exception suppressed
41+
else: # other exceptions
42+
return False

0 commit comments

Comments
 (0)