~foosoft/anki-connect

0fe61050c92d1869b74d7b7a21c351a6d22dcf5d — Robert Sanek 6 years ago 8c33901
Update AnkiConnect.py
1 files changed, 3 insertions(+), 4 deletions(-)

M AnkiConnect.py
M AnkiConnect.py => AnkiConnect.py +3 -4
@@ 509,19 509,18 @@ class AnkiConnect:

    @api()
    def loadProfile(self, name):
        if name not in self.window().pm.profiles():
            return False
        if not self.window().isVisible():
            self.window().pm.load(name)
            self.window().loadProfile()
            self.window().profileDiag.closeWithoutQuitting()
            return "Loaded profile {}.".format(name)
        else:
            cur_profile = self.window().pm.name
            if cur_profile != name:
                self.window().unloadProfileAndShowProfileManager()
                self.loadProfile(name)
                return "Switched from profile {} to profile {}.".format(cur_profile, name)
            else:
                return "Profile {} already loaded.".format(name)
        return True
    

    @api()

Do not follow this link