Add getProfiles action

This commit is contained in:
Scott Noyes 2020-05-01 09:24:51 -05:00
parent e01544a538
commit fdae44f1d3
2 changed files with 23 additions and 0 deletions

View File

@ -222,6 +222,26 @@ guarantee that your application continues to function properly in the future.
}
```
* **getProfiles**
Retrieve the list of profiles.
*Sample request*:
```json
{
"action": "getProfiles",
"version": 6
}
```
*Sample result*:
```json
{
"result": ["User 1"],
"error": null
}
```
* **loadProfile**
Selects the profile specified in request.

View File

@ -261,6 +261,9 @@ class AnkiConnect:
def version(self):
return util.setting('apiVersion')
@util.api()
def getProfiles(self):
return self.window().pm.profiles()
@util.api()
def loadProfile(self, name):