MCPcopy Index your code
hub / github.com/Tencent/CodeAnalysis / __init__

Method __init__

server/projects/analysis/util/webclients.py:44–93  ·  view source on GitHub ↗

初始化需要授权,访问地址等

(self)

Source from the content-addressed store, hash-verified

42
43class MainClient:
44 def __init__(self):
45 """
46 初始化需要授权,访问地址等
47 """
48 self._server_url = settings.MAIN_SERVER_URL
49 self._headers = {"SERVER-TICKET": MainServerTicket.generate_ticket(), "CONTENT-TYPE": "application/json"}
50 self._session = HttpClient()
51
52 self._apis = {
53 'job_closed': {
54 'path': 'api/projects/%d/jobs/%d/',
55 'method': 'put',
56 },
57 'project_detail': {
58 'path': 'api/projects/%s/',
59 'method': 'get',
60 },
61 'toolname_list': {
62 'path': 'api/conf/toolnames/',
63 'method': 'get',
64 },
65 'get_package_rule_ids': {
66 'path': 'api/conf/checkpackages/%s/checkruleids/',
67 'method': 'get',
68 },
69 'scheme_detail': {
70 'path': 'api/projects/%s/scheme/',
71 'method': 'get',
72 },
73 'scheme_checkprofile': {
74 'path': 'api/projects/%s/scheme/checkprofile/',
75 'method': 'get',
76 },
77 'report_closed': {
78 'path': 'api/personstat/reports/%d/',
79 'method': 'put',
80 },
81 'project_permission': {
82 'path': 'api/projects/%s/permissions/',
83 'method': 'get'
84 },
85 'repo_permission': {
86 'path': 'api/repos/%s/permissions/',
87 'method': 'get'
88 },
89 'repoinfo_summary': {
90 'path': 'api/personstat/repoinfos/summary/',
91 'method': 'post'
92 }
93 }
94
95 def _get_url(self, path):
96 return "%s/%s" % (self._server_url, path)

Callers

nothing calls this directly

Calls 2

HttpClientClass · 0.90
generate_ticketMethod · 0.45

Tested by

no test coverage detected