Skip to content

Commit 8e25a00

Browse files
committed
chore: Remove commented code and unused imports
1 parent f12aad2 commit 8e25a00

File tree

2 files changed

+32
-29
lines changed

2 files changed

+32
-29
lines changed

main.py

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -42,33 +42,33 @@
4242
# print(headers)
4343

4444
collections = [
45-
{
46-
"function": export_ind,
47-
"method": "ExportInd",
48-
"params": {
49-
**ensa_infos,
50-
"type": "etd",
51-
"id": "*",
52-
},
53-
},
54-
{
55-
"function": export_ind,
56-
"method": "ExportInd",
57-
"params": {
58-
**ensa_infos,
59-
"type": "adm",
60-
"id": "*",
61-
},
62-
},
63-
{
64-
"function": export_ind,
65-
"method": "ExportInd",
66-
"params": {
67-
**ensa_infos,
68-
"type": "esn",
69-
"id": "*",
70-
},
71-
},
45+
# {
46+
# "function": export_ind,
47+
# "method": "ExportInd",
48+
# "params": {
49+
# **ensa_infos,
50+
# "type": "etd",
51+
# "id": "*",
52+
# },
53+
# },
54+
# {
55+
# "function": export_ind,
56+
# "method": "ExportInd",
57+
# "params": {
58+
# **ensa_infos,
59+
# "type": "adm",
60+
# "id": "*",
61+
# },
62+
# },
63+
# {
64+
# "function": export_ind,
65+
# "method": "ExportInd",
66+
# "params": {
67+
# **ensa_infos,
68+
# "type": "esn",
69+
# "id": "*",
70+
# },
71+
# },
7272
{
7373
"function": export_pictures,
7474
"method": "ExportPhotos",
@@ -91,7 +91,7 @@ async def main():
9191
parser.add_argument('--run', help='all | taiga | sesame',default='all')
9292
parser.add_argument('--an', help='Année universitaire à importer ',default="0")
9393
args = parser.parse_args()
94-
if args.an != 0 :
94+
if args.an != 0:
9595
print(f"Import pour l'annee {args.an}")
9696
for col in collections:
9797
col.get('params')['au']=int(args.an)

src/export_pictures.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,18 @@ def copy_file(source, destination):
2323
dest_file.write(data)
2424

2525
async def export_pictures(url, col, headers):
26+
params = {k: v for k, v in col.get("params", {}).items() if k != "au"}
2627
payload = {
2728
"jsonrpc": "2.0",
2829
"method": col.get('method'),
29-
"params": col.get("params"),
30+
"params": params,
3031
"id": str(uuid.uuid4()),
3132
}
3233
try:
3334
response = requests.post(url, json=payload, headers=headers, verify=False, timeout=10000)
3435
response.raise_for_status()
36+
print(payload)
37+
print(response.json())
3538
if response.text == 'ko!':
3639
raise Exception("ko!")
3740
elif not response.json()['result']['output']:

0 commit comments

Comments
 (0)