Skip to content

Commit

Permalink
skrypt na pobieranie info z komend
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrucznik committed Sep 15, 2024
1 parent 2d0e589 commit 07d3dcb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pobierz_komendy_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@ def get_params(params):
except:
with open(json_file, 'r', encoding='windows-1250') as file:
data = json.load(file)
data['module'] = json_file.split('/')[8]
print(data['module'])
all_data.append(data)
all_keys.update(data.keys())

output_csv = "out.csv"
headers = ['Nazwa','Aliasy','Parametry','Opis','Dodatkowe porady','Uprawnienia','Autor','Data stworzenia']
headers = ['Nazwa','Aliasy','Parametry','Opis','Dodatkowe porady','Uprawnienia','Grupa','Moduł','Autor','Data stworzenia']
with open(output_csv, mode='w', newline='', encoding='utf-8') as csvfile:
writer = csv.DictWriter(csvfile, fieldnames=headers, delimiter=',')
writer.writeheader()
Expand All @@ -50,6 +52,8 @@ def get_params(params):
'Opis': data["description"],
'Dodatkowe porady': ','.join(data.get("command_tips", [])),
'Uprawnienia': ','.join(data.get("permissions", [])),
'Grupa': '',
'Moduł': data["module"],
'Autor': data["author"],
'Data stworzenia': data["date"],
})

0 comments on commit 07d3dcb

Please sign in to comment.