Skip to content
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

Add support to configure install/upgrade messages #1675

Merged
merged 1 commit into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Package Control.sublime-settings
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@
// to the Sublime Text console
"debug": false,

// Print package install and upgrade messages.
// Valid values are:
// - "disabled": don't print anything
// - "background": open message view in background
// - "foreground": open message view in foreground
// - "auto": focus messages depending on command mode (unattended)
"print_messages": "auto",

// If package install, upgrade and removal info should be submitted to
// the channel for aggregated statistics
"submit_usage": true,
Expand Down
8 changes: 8 additions & 0 deletions package_control/package_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def __init__(self):
'package_destination',
'package_name_map',
'package_profiles',
'print_messages',
'proxy_password',
'proxy_username',
'remove_orphaned',
Expand Down Expand Up @@ -2141,6 +2142,13 @@ def print_messages(self, package_name, package_dir, is_upgrade, old_version, new
If ``True`` don't focus "Package Control Messages".
"""

if self.settings["print_messages"] == "disabled":
return
elif self.settings["print_messages"] == "background":
unattended = True
elif self.settings["print_messages"] == "foreground":
unattended = False

try:
messages_file = os.path.join(package_dir, 'messages.json')
with open(messages_file, 'r', encoding='utf-8') as fobj:
Expand Down
Loading