Skip to content

Commit

Permalink
order sublime menu alphabetically
Browse files Browse the repository at this point in the history
  • Loading branch information
xavluiz committed Jan 22, 2021
1 parent 8c98984 commit 9518ec4
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 66 deletions.
48 changes: 24 additions & 24 deletions Default.sublime-commands
Original file line number Diff line number Diff line change
@@ -1,47 +1,43 @@
[
{
"command": "show_tree_view",
"caption": "Code Time: Show Tree View"
},
{
"command": "switch_account",
"caption": "Code Time: Switch account"
"command": "connect_slack",
"caption": "Code Time: Connect Slack"
},
{
"command": "launch_code_time_metrics",
"caption": "Code Time: View Dashboard"
"caption": "Code Time: Dashboard"
},
{
"command": "go_to_software",
"caption": "Code Time: View Web Dashboard"
"command": "disconnect_slack",
"caption": "Code Time: Disconnect Slack"
},
{
"command": "toggle_status_bar_metrics",
"caption": "Code Time: Show/Hide Status Bar Metrics"
"command": "enable_slack_notifications",
"caption": "Code Time: Enable Slack notifications"
},
{
"command": "pause_kpm_updates",
"caption": "Code Time: Pause"
"command": "go_to_software",
"caption": "Code Time: More data at Software.com"
},
{
"command": "enable_kpm_updates",
"caption": "Code Time: Enable"
"command": "pause_slack_notifications",
"caption": "Code Time: Pause Slack notifications"
},
{
"command": "disconnect_slack",
"caption": "Code Time: Disconnect Slack"
"command": "show_tree_view",
"caption": "Code Time: Show Tree View"
},
{
"command": "connect_slack",
"caption": "Code Time: Connect Slack"
"command": "switch_account",
"caption": "Code Time: Switch Account"
},
{
"command": "pause_slack_notifications",
"caption": "Code Time: Pause Slack notifications"
"command": "enable_kpm_updates",
"caption": "Code Time: Telemetry Enable"
},
{
"command": "enable_slack_notifications",
"caption": "Code Time: Enable Slack notifications"
"command": "pause_kpm_updates",
"caption": "Code Time: Telemetry Pause"
},
{
"command": "toggle_dark_mode",
Expand All @@ -51,8 +47,12 @@
"command": "toggle_dock",
"caption": "Code Time: Toggle dock"
},
{
"command": "toggle_status_bar_metrics",
"caption": "Code Time: Toggle Status Bar Metrics"
},
{
"command": "update_slack_status_msg",
"caption": "Code Time: Update Slack status msg"
"caption": "Code Time: Update Slack status message"
}
]
58 changes: 19 additions & 39 deletions Main.sublime-menu
Original file line number Diff line number Diff line change
Expand Up @@ -10,60 +10,36 @@
"caption": "Code Time",
"children": [
{
"command": "launch_code_time_metrics",
"caption": "Code Time Dashboard"
},
{
"command": "launch_custom_dashboard",
"caption": "Open a Custom Dashboard"
},
{
"command": "switch_account",
"caption": "Switch Account"
},
{
"command": "go_to_software",
"caption": "Web Dashboard"
"command": "connect_slack",
"caption": "Connect Slack"
},
{
"command": "pause_kpm_updates",
"caption": "Pause Code Time"
"command": "launch_code_time_metrics",
"caption": "Dashboard"
},
{
"command": "enable_kpm_updates",
"caption": "Enable Code Time"
"command": "disconnect_slack",
"caption": "Disconnect Slack"
},
{
"command": "toggle_status_bar_metrics",
"caption": "Show/Hide Status Bar Metrics"
"command": "enable_slack_notifications",
"caption": "Enable Slack notifications"
},
{
"command": "hide_console_message",
"caption": "Hide Console Message"
"command": "go_to_software",
"caption": "More data at Software.com"
},
{
"command": "show_console_message",
"caption": "Show Console Message"
"command": "pause_slack_notifications",
"caption": "Pause Slack notifications"
},
{
"command": "show_tree_view",
"caption": "Show Tree View"
},
{
"command": "disconnect_slack",
"caption": "Disconnect Slack"
},
{
"command": "connect_slack",
"caption": "Connect Slack"
},
{
"command": "pause_slack_notifications",
"caption": "Pause Slack notifications"
},
{
"command": "enable_slack_notifications",
"caption": "Enable Slack notifications"
"command": "switch_account",
"caption": "Switch Account"
},
{
"command": "toggle_dark_mode",
Expand All @@ -73,9 +49,13 @@
"command": "toggle_dock",
"caption": "Toggle dock"
},
{
"command": "toggle_status_bar_metrics",
"caption": "Toggle Status Bar Metrics"
},
{
"command": "update_slack_status_msg",
"caption": "Update Slack status msg"
"caption": "Update Slack status message"
}
]
}
Expand Down
6 changes: 3 additions & 3 deletions lib/SoftwareUserStatus.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,12 @@ def updateSlackIntegrationsFromUser(user):
existingIntegrations = getIntegrations()
for i in range(len(integrations)):
integration = integrations[i]

if (integration["name"].lower() == 'slack'
and integration["status"].lower() == 'active'
and integration["access_token"] is not None
and integration["authId"] is not None):
and integration["access_token"] is not None):

first = next(filter(lambda x: x.authId == integration["authId"], existingIntegrations), None)
first = next(filter(lambda x: x["authId"] == integration["authId"], existingIntegrations), None)

if (first is None):
resp = api_call('users.identity', {'token': integration["access_token"]})
Expand Down

0 comments on commit 9518ec4

Please sign in to comment.