wajid commited on
Commit
d20292d
·
1 Parent(s): b138af6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -13
app.py CHANGED
@@ -124,8 +124,13 @@ def extract_result(lst):
124
  year-=10
125
 
126
  if nationality=='IND' or nationality=='CHN' or nationality=='BRA':
127
-
128
- day+=1
 
 
 
 
 
129
  str_day=day
130
  str_month=month
131
  if len(str(day))==1:
@@ -144,9 +149,7 @@ def extract_result(lst):
144
 
145
 
146
  issue_date=expiry_date
147
- print(type(expiry_date))
148
- print("check2")
149
-
150
  document_type=lst[x][1][7]
151
  document_number=lst[x][1][8]
152
  temp_lst.append([surname,name,country,birth_date,expiry_date,document_number,issue_date])
@@ -161,31 +164,30 @@ def extract_result(lst):
161
  country=lst[x][2]
162
  nationality=lst[x][3]
163
  try:
164
- print("3rd in")
165
  birth_date=datetime.strptime(lst[x][4], '%y%m%d').strftime('%d/%m/%Y')
166
  expiry_date=datetime.strptime(lst[x][5], '%y%m%d').strftime('%d/%m/%Y')
167
  year=datetime.strptime(lst[x][5], '%y%m%d').year
168
  month=datetime.strptime(lst[x][5], '%y%m%d').month
169
  day=datetime.strptime(lst[x][5], '%y%m%d').day
170
- print("3rd out")
171
  if nationality=='TWN':
172
  year-=5
173
  else:
174
  year-=10
175
 
176
- print("3rd 2nd")
177
- print(nationality)
178
  if country=='IND' or nationality=='CHN' or nationality=='BRA':
179
 
180
  if str(day)=="31":
181
  day=1
 
182
  else:
183
  day+=1
184
  str_day=day
185
  str_month=month
186
 
187
- print(day)
188
- print(str_day)
189
  if len(str(day))==1:
190
  str_day="0"+str(day)
191
 
@@ -201,8 +203,7 @@ def extract_result(lst):
201
  birth_date=lst[x][4]#datetime.strptime(lst[x][4], '%y%m%d').strftime('%d/%m/%Y')
202
  expiry_date=lst[x][5]#datetime.strptime(lst[x][5], '%y%m%d').strftime('%d/%m/%Y')
203
  issue_date=expiry_date
204
- print(type(expiry_date))
205
- print("check4")
206
 
207
  document_type=lst[x][7]
208
  document_number=lst[x][8]
 
124
  year-=10
125
 
126
  if nationality=='IND' or nationality=='CHN' or nationality=='BRA':
127
+
128
+ if str(day)=="31":
129
+ day=1
130
+ month+=1
131
+ else:
132
+ day+=1
133
+
134
  str_day=day
135
  str_month=month
136
  if len(str(day))==1:
 
149
 
150
 
151
  issue_date=expiry_date
152
+
 
 
153
  document_type=lst[x][1][7]
154
  document_number=lst[x][1][8]
155
  temp_lst.append([surname,name,country,birth_date,expiry_date,document_number,issue_date])
 
164
  country=lst[x][2]
165
  nationality=lst[x][3]
166
  try:
167
+
168
  birth_date=datetime.strptime(lst[x][4], '%y%m%d').strftime('%d/%m/%Y')
169
  expiry_date=datetime.strptime(lst[x][5], '%y%m%d').strftime('%d/%m/%Y')
170
  year=datetime.strptime(lst[x][5], '%y%m%d').year
171
  month=datetime.strptime(lst[x][5], '%y%m%d').month
172
  day=datetime.strptime(lst[x][5], '%y%m%d').day
173
+
174
  if nationality=='TWN':
175
  year-=5
176
  else:
177
  year-=10
178
 
179
+
 
180
  if country=='IND' or nationality=='CHN' or nationality=='BRA':
181
 
182
  if str(day)=="31":
183
  day=1
184
+ month+=1
185
  else:
186
  day+=1
187
  str_day=day
188
  str_month=month
189
 
190
+
 
191
  if len(str(day))==1:
192
  str_day="0"+str(day)
193
 
 
203
  birth_date=lst[x][4]#datetime.strptime(lst[x][4], '%y%m%d').strftime('%d/%m/%Y')
204
  expiry_date=lst[x][5]#datetime.strptime(lst[x][5], '%y%m%d').strftime('%d/%m/%Y')
205
  issue_date=expiry_date
206
+
 
207
 
208
  document_type=lst[x][7]
209
  document_number=lst[x][8]