Skip to content

Commit 1e8bc30

Browse files
committed
issue #115 apres modif pour oasys
1 parent bbc9b8d commit 1e8bc30

File tree

1 file changed

+93
-13
lines changed

1 file changed

+93
-13
lines changed

main.py

Lines changed: 93 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,36 +27,116 @@
2727
joined_auth = ':'.join(map(str, basic_auth)).encode('utf-8')
2828
ensa_infos={}
2929
ensa_pass=""
30+
collections=[]
3031
if( os.getenv('SOURCE','TAIGA') == 'TAIGA'):
3132
url = f"{os.getenv('STC_API_BASEURL', 'https://taiga.archi.fr')}/taiga_libext/JsonRPC/api.php"
3233
ensa_pass = os.getenv('STC_API_PASSENSA') + datetime.now().strftime('%Y%m%d')
3334
ensa_infos = {
3435
"code_ensa": os.getenv('STC_API_CODEENSA', 'lyon'),
3536
"pass_ensa": hashlib.sha1(ensa_pass.encode()).hexdigest(),
3637
}
38+
collections = [
39+
{
40+
"function": export_ind,
41+
"method": "ExportInd",
42+
"params": {
43+
**ensa_infos,
44+
"type": "pri",
45+
"id": "*",
46+
},
47+
},
48+
{
49+
"function": export_ind,
50+
"method": "ExportInd",
51+
"params": {
52+
**ensa_infos,
53+
"type": "etd",
54+
"id": "*",
55+
},
56+
},
57+
{
58+
"function": export_ind,
59+
"method": "ExportInd",
60+
"params": {
61+
**ensa_infos,
62+
"type": "adm",
63+
"id": "*",
64+
},
65+
},
66+
{
67+
"function": export_ind,
68+
"method": "ExportInd",
69+
"params": {
70+
**ensa_infos,
71+
"type": "esn",
72+
"id": "*",
73+
},
74+
},
75+
{
76+
"function": export_pictures,
77+
"method": "ExportPhotos",
78+
"methodBase64": "ExportPhoto",
79+
"params": {
80+
**ensa_infos,
81+
"type": "etd",
82+
"id": "*",
83+
},
84+
"paramsBase64": {
85+
"type": "etd",
86+
**ensa_infos,
87+
},
88+
},
89+
{
90+
"function": export_pictures,
91+
"method": "ExportPhotos",
92+
"methodBase64": "ExportPhoto",
93+
"params": {
94+
**ensa_infos,
95+
"type": "adm",
96+
"id": "*",
97+
},
98+
"paramsBase64": {
99+
"type": "adm",
100+
**ensa_infos,
101+
},
102+
},
103+
{
104+
"function": export_pictures,
105+
"method": "ExportPhotos",
106+
"methodBase64": "ExportPhoto",
107+
"params": {
108+
**ensa_infos,
109+
"type": "esn",
110+
"id": "*",
111+
},
112+
"paramsBase64": {
113+
"type": "esn",
114+
**ensa_infos,
115+
},
116+
},
117+
]
37118
print(ensa_infos)
38119
else:
39120
url=os.getenv('STC_API_BASEURL', '')
121+
collections = [
122+
{
123+
"function": export_oasis,
124+
"method": "student",
125+
"params": {
126+
**ensa_infos,
127+
"type": "etd",
128+
"id": "*",
129+
},
130+
}
131+
]
132+
40133
headers = {
41134
"Authorization": f"Basic {base64.b64encode(joined_auth).decode('utf-8')}",
42135
"Content-Type": "application/json; charset=utf-8",
43136
}
44137

45138
# print(headers)
46139

47-
collections = [
48-
{
49-
"function": export_oasis,
50-
"method": "student",
51-
"params": {
52-
**ensa_infos,
53-
"type": "etd",
54-
"id": "*",
55-
},
56-
},
57-
58-
]
59-
60140

61141
async def main():
62142
parser = argparse.ArgumentParser()

0 commit comments

Comments
 (0)