Completed
Pull Request — master (#554)
by
unknown
03:07
created

getapplist()   A

Complexity

Conditions 3

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
c 1
b 0
f 0
dl 0
loc 7
rs 9.4285
1
from lib.wechatutil.appinfo import AppInfo
2
3
apiUrl = 'https://qyapi.weixin.qq.com/cgi-bin/agent/list'
4
5
6
def getapplist(factory):
7
    response = factory.get(apiUrl, None)
8
    if response['errcode'] != 0:
9
        factory.refreshtoken()
10
        response = factory.get(apiUrl, None)
11
    applist = [AppInfo(app) for app in response['agentlist']]
0 ignored issues
show
Bug introduced by
There seem to be too many positional arguments for this constructor call.
Loading history...
12
    return response['errcode'], applist, response['errmsg']
13