Rename version.version() to version_info()
To get a less generic name.
This commit is contained in:
parent
4787b30f96
commit
fb6594be27
|
|
@ -96,7 +96,7 @@ def run(args):
|
|||
q_app.setApplicationVersion(qutebrowser.__version__)
|
||||
|
||||
if args.version:
|
||||
print(version.version())
|
||||
print(version.version_info())
|
||||
sys.exit(usertypes.Exit.ok)
|
||||
|
||||
quitter.init(args)
|
||||
|
|
|
|||
|
|
@ -302,7 +302,7 @@ def qute_spawn_output(_url: QUrl) -> _HandlerRet:
|
|||
def qute_version(_url):
|
||||
"""Handler for qute://version."""
|
||||
src = jinja.render('version.html', title='Version info',
|
||||
version=version.version(),
|
||||
version=version.version_info(),
|
||||
copyright=qutebrowser.__copyright__)
|
||||
return 'text/html', src
|
||||
|
||||
|
|
|
|||
|
|
@ -246,7 +246,7 @@ class _CrashDialog(QDialog):
|
|||
except Exception:
|
||||
self._crash_info.append(("Launch time", traceback.format_exc()))
|
||||
try:
|
||||
self._crash_info.append(("Version info", version.version()))
|
||||
self._crash_info.append(("Version info", version.version_info()))
|
||||
except Exception:
|
||||
self._crash_info.append(("Version info", traceback.format_exc()))
|
||||
try:
|
||||
|
|
@ -650,7 +650,7 @@ def dump_exception_info(exc, pages, cmdhist, qobjects):
|
|||
print(''.join(traceback.format_exception(*exc)), file=sys.stderr)
|
||||
print("\n---- Version info ----", file=sys.stderr)
|
||||
try:
|
||||
print(version.version(), file=sys.stderr)
|
||||
print(version.version_info(), file=sys.stderr)
|
||||
except Exception:
|
||||
traceback.print_exc()
|
||||
print("\n---- Config ----", file=sys.stderr)
|
||||
|
|
|
|||
|
|
@ -412,7 +412,7 @@ def _config_py_loaded() -> str:
|
|||
return "no config.py was loaded"
|
||||
|
||||
|
||||
def version() -> str:
|
||||
def version_info() -> str:
|
||||
"""Return a string with various version information."""
|
||||
lines = ["qutebrowser v{}".format(qutebrowser.__version__)]
|
||||
gitver = _git_str()
|
||||
|
|
@ -646,5 +646,5 @@ def pastebin_version(pbclient: pastebin.PastebinClient = None) -> None:
|
|||
|
||||
pbclient.paste(getpass.getuser(),
|
||||
"qute version info {}".format(qutebrowser.__version__),
|
||||
version(),
|
||||
version_info(),
|
||||
private=True)
|
||||
|
|
|
|||
|
|
@ -927,8 +927,8 @@ class VersionParams:
|
|||
VersionParams('no-autoconfig-loaded', autoconfig_loaded=False),
|
||||
VersionParams('no-config-py-loaded', config_py_loaded=False),
|
||||
], ids=lambda param: param.name)
|
||||
def test_version_output(params, stubs, monkeypatch, config_stub):
|
||||
"""Test version.version()."""
|
||||
def test_version_info(params, stubs, monkeypatch, config_stub):
|
||||
"""Test version.version_info()."""
|
||||
config.instance.config_py_loaded = params.config_py_loaded
|
||||
import_path = os.path.abspath('/IMPORTPATH')
|
||||
|
||||
|
|
@ -1048,7 +1048,7 @@ def test_version_output(params, stubs, monkeypatch, config_stub):
|
|||
""".lstrip('\n'))
|
||||
|
||||
expected = template.rstrip('\n').format(**substitutions)
|
||||
assert version.version() == expected
|
||||
assert version.version_info() == expected
|
||||
|
||||
|
||||
class TestOpenGLInfo:
|
||||
|
|
@ -1133,7 +1133,7 @@ def pbclient(stubs):
|
|||
|
||||
def test_pastebin_version(pbclient, message_mock, monkeypatch, qtbot):
|
||||
"""Test version.pastebin_version() sets the url."""
|
||||
monkeypatch.setattr('qutebrowser.utils.version.version',
|
||||
monkeypatch.setattr('qutebrowser.utils.version.version_info',
|
||||
lambda: "dummy")
|
||||
monkeypatch.setattr('qutebrowser.utils.utils.log_clipboard', True)
|
||||
|
||||
|
|
@ -1148,7 +1148,7 @@ def test_pastebin_version(pbclient, message_mock, monkeypatch, qtbot):
|
|||
|
||||
def test_pastebin_version_twice(pbclient, monkeypatch):
|
||||
"""Test whether calling pastebin_version twice sends no data."""
|
||||
monkeypatch.setattr('qutebrowser.utils.version.version',
|
||||
monkeypatch.setattr('qutebrowser.utils.version.version_info',
|
||||
lambda: "dummy")
|
||||
|
||||
version.pastebin_version(pbclient)
|
||||
|
|
@ -1166,7 +1166,7 @@ def test_pastebin_version_twice(pbclient, monkeypatch):
|
|||
|
||||
def test_pastebin_version_error(pbclient, caplog, message_mock, monkeypatch):
|
||||
"""Test version.pastebin_version() with errors."""
|
||||
monkeypatch.setattr('qutebrowser.utils.version.version',
|
||||
monkeypatch.setattr('qutebrowser.utils.version.version_info',
|
||||
lambda: "dummy")
|
||||
|
||||
version.pastebin_url = None
|
||||
|
|
|
|||
Loading…
Reference in New Issue