-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfile_created_check.py
140 lines (113 loc) · 3.82 KB
/
file_created_check.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
import json
import os
from datetime import date
today = date.today()
today = today.strftime('%B %d')
os.system('python operations/is_lib_installed.py')
try:
with open("details_service.txt",'r+') as file:
if ("USERNAME" or "PASSWORD" or "from_addr" or "to_addr") not in json.loads(file.read()):
file1 = open("details_service.txt",'w')
file1.write("""{
"USERNAME" : "",
"PASSWORD" : "",
"from_addr" : "",
"to_addr" : ""
}
""")
file1.close()
except FileNotFoundError:
file1 = open("details_service.txt",'w')
file1.write("""{
"USERNAME" : "",
"PASSWORD" : "",
"from_addr" : "",
"to_addr" : ""
}
""")
file1.close()
try:
with open("program_list.txt",'r+') as file2:
if file2.read() == "":
file2.write("""THIS IS AN EXAMPLE OF ADDING YOUR SELECTED PROGRAMS
###Please add in the following format###
{
"file_name1" : "File_address(absolute)",
"file_name2" : "File_address(absolute)",
"file_name3" : "File_address(absolute)",
.........so on
}
and so on as many programs you want to add do make sure have the name in small.
""")
except FileNotFoundError:
file3 = open("program_list.txt",'w')
file3.write("""THIS IS AN EXAMPLE OF ADDING YOUR SELECTED PROGRAMS
###Please add in the following format###
{}
"File_name1" : "File_address(absolute)",
"File_name2" : "File_address(absolute)",
"File_name3" : "File_address(absolute)",
.........so on
}
and so on as many programs you want to add do make sure to remove the comma after the last program in the list.
""")
file3.close()
try:
with open("log_last_created.txt",'r+') as file:
pass
except FileNotFoundError:
file3 = open("log_last_created.txt",'w')
file3.write(today)
file3.close()
try:
with open("operations_list.txt",'r+') as file:
if file.read() == "":
file.write("""THIS IS AN EXAMPLE OF ADDING YOUR SELECTED OPERATIONS
###Please add in the following format###
{
"operation1" : "<name_of_the_file>.py",
"operation2" : "<name_of_the_file>.py",
"operation3" : "<name_of_the_file>.py",
.........so on
}
and so on as many operations you want to add.
""")
except FileNotFoundError:
file4 = open("operations_list.txt",'w')
file4.write("""THIS IS AN EXAMPLE OF ADDING YOUR SELECTED OPERATIONS
###Please add in the following format###
{
"operation1" : "<name_of_the_file>.py",
"operation2" : "<name_of_the_file>.py",
"operation3" : "<name_of_the_file>.py",
.........so on
}
and so on as many operations you want to add.
""")
file4.close()
try:
with open("operations_list_help.txt",'r+') as file:
if file.read() == "":
file.write("""THIS IS AN EXAMPLE OF ADDING YOUR SELECTED OPERATIONS
###Please add in the following format###
{
"operation1" : "File_address(Relative)",
"operation2" : "File_address(Relative)",
"operation3" : "File_address(Relative)",
.........so on
}
and so on as many operations you want to add.
""")
except FileNotFoundError:
file5 = open("operations_list_help.txt",'w')
file5.write("""THIS IS AN EXAMPLE OF ADDING YOUR SELECTED OPERATIONS
###Please add in the following format###
{
"operation1" : "File_address(Relative)",
"operation2" : "File_address(Relative)",
"operation3" : "File_address(Relative)",
.........so on
}
and so on as many operations you want to add.
""")
file5.close()