<commit_before>import sublime
from sublime_plugin import TextCommand

from .status import *
from .branch import *
from .rebase import *
from .tags import *


class GsTabCycleCommand(TextCommand, GitCommand):
    commands = {
        "status": "gs_show_status",
        "branch": "gs_show_branch",
        "rebase": "gs_show_rebase",
        "tags": "gs_show_tags",
        "graph": "gs_log_graph_current_branch"
    }

    view_signatures = {
        "status": "git_savvy.status_view",
        "branch": "git_savvy.branch_view",
        "rebase": "git_savvy.rebase_view",
        "tags": "git_savvy.tags_view",
        "graph": "git_savvy.log_graph_view"
    }

    def run(self, edit, source=None, target=None, reverse=False):
        sublime.set_timeout_async(lambda: self.run_async(source, target, reverse))

    def run_async(self, source, target, reverse):
        to_load = target or self.get_next(source, reverse)
        view_signature = self.view_signatures[to_load]

        self.view.window().run_command("hide_panel", {"cancel": True})

        self.view.window().run_command(self.commands[to_load])
        if not self.view.settings().get(view_signature):
            sublime.set_timeout_async(self.view.close)

    def get_next(self, source, reverse=False):
        savvy_settings = sublime.load_settings("GitSavvy.sublime-settings")
        tab_order = savvy_settings.get("tab_order")

        if reverse is True:
            tab_order.reverse()

        source_idx = tab_order.index(source)
        next_idx = 0 if source_idx == len(tab_order) - 1 else source_idx + 1<commit_msg>Fix: check if the current dashboard is on the list<commit_after>import sublime
from sublime_plugin import TextCommand

from .status import *
from .branch import *
from .rebase import *
from .tags import *


class GsTabCycleCommand(TextCommand, GitCommand):
    commands = {
        "status": "gs_show_status",
        "branch": "gs_show_branch",
        "rebase": "gs_show_rebase",
        "tags": "gs_show_tags",
        "graph": "gs_log_graph_current_branch"
    }

    view_signatures = {
        "status": "git_savvy.status_view",
        "branch": "git_savvy.branch_view",
        "rebase": "git_savvy.rebase_view",
        "tags": "git_savvy.tags_view",
        "graph": "git_savvy.log_graph_view"
    }

    def run(self, edit, source=None, target=None, reverse=False):
        sublime.set_timeout_async(lambda: self.run_async(source, target, reverse))

    def run_async(self, source, target, reverse):
        to_load = target or self.get_next(source, reverse)
        if not to_load:
            return
        view_signature = self.view_signatures[to_load]

        self.view.window().run_command("hide_panel", {"cancel": True})

        self.view.window().run_command(self.commands[to_load])
        if not self.view.settings().get(view_signature):
            sublime.set_timeout_async(self.view.close)

    def get_next(self, source, reverse=False):
        savvy_settings = sublime.load_settings("GitSavvy.sublime-settings")
        tab_order = savvy_settings.get("tab_order")

        if reverse is True:
            tab_order.reverse()

        if source not in tab_order:
            return None

        source_idx = tab_order.index(source)
        next_idx = 0 if source_idx == len(tab_order) - 1 else source_idx + 1
{'fraction_non_alphanumeric': 0.11558090663464425, 'fraction_numerical': 0.0018012608826178324, 'mean_word_length': 3.0634146341463415, 'pattern_counts': {'":': 22, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6689482', 'n_tokens_mistral': 1100, 'n_tokens_neox': 1053, 'n_words': 213}