-
-
Notifications
You must be signed in to change notification settings - Fork 281
Show detected platform on startup and in About popup #1221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ | |
parse_args, | ||
) | ||
from zulipterminal.model import ServerConnectionFailure | ||
from zulipterminal.platform_code import PLATFORM | ||
from zulipterminal.version import ZT_VERSION | ||
|
||
|
||
|
@@ -132,6 +133,7 @@ def test_valid_zuliprc_but_no_connection( | |
|
||
lines = captured.out.strip().split("\n") | ||
expected_lines = [ | ||
"Detected Platform: " + PLATFORM, | ||
"Loading with:", | ||
" theme 'zt_dark' specified with no config.", | ||
" autohide setting 'no_autohide' specified with no config.", | ||
|
@@ -182,6 +184,7 @@ def test_warning_regarding_incomplete_theme( | |
|
||
lines = captured.out.strip().split("\n") | ||
expected_lines = [ | ||
"Detected Platform: " + PLATFORM, | ||
"Loading with:", | ||
f" theme '{bad_theme}' specified on command line.", | ||
"\x1b[93m WARNING: Incomplete theme; results may vary!", | ||
|
@@ -395,6 +398,7 @@ def test_successful_main_function_with_config( | |
captured = capsys.readouterr() | ||
lines = captured.out.strip().split("\n") | ||
expected_lines = [ | ||
f"Detected Platform: {PLATFORM}", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a reason you used different code here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. None, I'll change it to the same code as the others. |
||
"Loading with:", | ||
" theme 'zt_dark' specified in zuliprc file (by alias 'default').", | ||
" autohide setting 'autohide' specified in zuliprc file.", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ | |
) | ||
from zulipterminal.core import Controller | ||
from zulipterminal.model import ServerConnectionFailure | ||
from zulipterminal.platform_code import PLATFORM | ||
from zulipterminal.version import ZT_VERSION | ||
|
||
|
||
|
@@ -439,6 +440,10 @@ def main(options: Optional[List[str]] = None) -> None: | |
if args.notify: | ||
zterm["notify"] = (args.notify, "on command line") | ||
|
||
if PLATFORM: | ||
print("Detected Platform: " + PLATFORM) | ||
else: | ||
print("Running on undetected platform.") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this intended to be for unsupported platforms, or something else? Please make sure you're aware what values this can take :) You're not testing this result, in any case. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I'll look into that; I'm still not exactly sure how to check for unsupported platforms, though. |
||
print("Loading with:") | ||
print(" theme '{}' specified {}.".format(*theme_to_use)) | ||
complete, incomplete = complete_and_incomplete_themes() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,7 @@ | |
match_stream, | ||
match_user, | ||
) | ||
from zulipterminal.platform_code import PLATFORM | ||
from zulipterminal.server_url import near_message_url | ||
from zulipterminal.ui_tools.boxes import MessageBox, PanelSearchBox | ||
from zulipterminal.ui_tools.buttons import ( | ||
|
@@ -1113,7 +1114,13 @@ def __init__( | |
else [] | ||
) | ||
contents = [ | ||
("Application", [("Zulip Terminal", zt_version)]), | ||
( | ||
"Application", | ||
[ | ||
("Zulip Terminal", zt_version), | ||
("Platform detected", PLATFORM if PLATFORM else "Invalid platform"), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This condition shouldn't arise - again, check the values of PLATFORM. |
||
], | ||
), | ||
("Server", [("Version", server_version)] + self.feature_level_content), | ||
( | ||
"Application Configuration", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this will be the platform that the tests are running on. We may want to mock this instead to ensure we get some known output (and avoid the running vs testing confusion for readers).
It's good to keep tests in the same commit as the code that changes, as it's a unit of change, so here combined with one of the other commits.
We may want a specific test to handle how this output should vary on different platforms, including unsupported.