dfdffdfdfdfd commited on
Commit
cb7d6e8
·
verified ·
1 Parent(s): a181f45

Delete gerar_files.py

Browse files
Files changed (1) hide show
  1. gerar_files.py +0 -36
gerar_files.py DELETED
@@ -1,36 +0,0 @@
1
- import os
2
- import json
3
-
4
- BASE_URL = "https://SUA_URL_AQUI/"
5
-
6
- def get_files(directory):
7
- files_list = []
8
-
9
- for root, dirs, files in os.walk(directory):
10
- for file in files:
11
- if file in ['gerar_files.py', 'client_config.json', 'files.json']:
12
- continue
13
-
14
- filepath = os.path.join(root, file)
15
- rel_path = os.path.relpath(filepath, directory)
16
- rel_path = rel_path.replace("\\", "/")
17
-
18
- size = os.path.getsize(filepath)
19
-
20
- files_list.append({
21
- "name": file,
22
- "size": size,
23
- "path": rel_path,
24
- "url": BASE_URL + rel_path
25
- })
26
- return files_list
27
-
28
- if __name__ == "__main__":
29
- base_dir = "."
30
-
31
- data = {"files": get_files(base_dir)}
32
-
33
- with open("files.json", "w", encoding="utf-8") as f:
34
- json.dump(data, f, indent=4, separators=(',', ': '))
35
-
36
- print(f"Sucesso. {len(data['files'])} arquivos mapeados.")