forked from wikimedia/pywikibot
-
Notifications
You must be signed in to change notification settings - Fork 1
/
pwb.py
executable file
·39 lines (28 loc) · 876 Bytes
/
pwb.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/python3
"""pwb caller script to invoke the :mod:`pywikibot.scripts.wrapper` script.
.. versionadded:: 8.0
"""
#
# (C) Pywikibot team, 2022
#
# Distributed under the terms of the MIT license.
#
import runpy
import sys
VERSIONS_REQUIRED_MESSAGE = """
Pywikibot is not available on:
{version}
This version of Pywikibot only supports Python 3.6.1+.
"""
def python_is_supported():
"""Check that Python is supported."""
return sys.version_info[:3] >= (3, 6, 1)
if not python_is_supported(): # pragma: no cover
sys.exit(VERSIONS_REQUIRED_MESSAGE.format(version=sys.version))
def main():
"""Entry point for :func:`tests.utils.execute_pwb`."""
from pathlib import Path
path = Path(__file__).parent / 'pywikibot' / 'scripts' / 'wrapper.py'
runpy.run_path(str(path), run_name='__main__')
if __name__ == '__main__':
sys.exit(main())