-
Notifications
You must be signed in to change notification settings - Fork 1
/
check_folder_missing.py
36 lines (31 loc) · 1016 Bytes
/
check_folder_missing.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/python
import sys
import os
import subprocess
import os, shutil, fnmatch
import subprocess
import time
import pathlib
country_list=[]
#File country
file_in = open("country.txt", "rt")
lines = file_in.readlines()
for line in lines:
result = line.split(";")
country_list.append([result[0],result[1],result[2],result[3]])
file_in.close()
for idx, country in enumerate(country_list):
hasFilesDem=False
hasFilesDemWithId=False
country_name=country[0].replace("#",'')
id=country[1]
style=country[2]
url=country[3]
country_dir = "carte_"+country_name.replace(' ','_').lower()
isDir = os.path.isdir(country_dir)
if(isDir==False):
print("Dir "+country_name+" missing")
country_name_lower_case = country_name.lower().replace(" ", "_").replace(" ", "_")
print("Creating "+country_name_lower_case+" ...")
os.makedirs("dem/"+country_name_lower_case, exist_ok=True)
os.makedirs("carte_"+country_name_lower_case, exist_ok=True)