Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -481,7 +481,7 @@ def checktables():
|
|
| 481 |
differentSections=[]
|
| 482 |
if projectpart and projectname:
|
| 483 |
print(t3Diff1)
|
| 484 |
-
|
| 485 |
roww=t3Diff1.iloc[np.where((t3Diff1['ProjectId']==str(prjid) ) & (t3Diff1['ProjectPartId']==str(partid)) ) ]
|
| 486 |
# print(prjid,partid,roww.shape[0] )
|
| 487 |
for i in range(len(roww['ProjectId'].values)):
|
|
@@ -493,70 +493,9 @@ def checktables():
|
|
| 493 |
returnString=['Changes have been made in Sections. Would you like to retrieve them in the console?','section',differentSections]
|
| 494 |
print(differentSections)
|
| 495 |
|
| 496 |
-
# if not t2Diff.empty:
|
| 497 |
-
# newvalues= t2Diff['ProjectName'].values
|
| 498 |
-
# else:
|
| 499 |
-
# newvalues= t2Diff1['ProjectName'].values
|
| 500 |
-
# returnString=''
|
| 501 |
-
# returnString=['Changes have been made in Parts. Would you like to retrieve them in the console? By saying yes, you may need to repeat the website related processes(if any).','part']
|
| 502 |
-
# elif (not t3Diff.empty) or (not t3Diff1.empty):
|
| 503 |
-
# returnString=''
|
| 504 |
-
|
| 505 |
-
# returnString=['Changes have been made in Sections. Would you like to retrieve them in the console? By saying yes, you may need to repeat the website related processes(if any).','section']
|
| 506 |
-
# elif ((not t1Diff.empty) or (not t1Diff1.empty)) and ((not t2Diff.empty) or ( not t2Diff1.empty)):
|
| 507 |
-
# returnString=''
|
| 508 |
-
# returnString=['Changes have been made in Projects and Parts. Would you like to retrieve them in the console? By saying yes, you may need to repeat the website related processes(if any).','projectpart']
|
| 509 |
-
# elif ((not t1Diff.empty) or (not t1Diff1.empty)) and ((not t3Diff.empty) or (not t3Diff1.empty) ):
|
| 510 |
-
# returnString=''
|
| 511 |
-
# returnString=['Changes have been made in Projects and Sections. Would you like to retrieve them in the console? By saying yes, you may need to repeat the website related processes(if any).','projectsection']
|
| 512 |
-
# elif ((not t2Diff.empty) or (not t2Diff1.empty)) and ((not t3Diff.empty) or (not t3Diff1.empty)):
|
| 513 |
-
# returnString=''
|
| 514 |
-
# returnString=['Changes have been made in Parts and Sections. Would you like to retrieve them in the console? By saying yes, you may need to repeat the website related processes(if any).','partsection']
|
| 515 |
-
# elif ((not t1Diff.empty) or (not t1Diff1.empty)) and ((not t2Diff.empty) or (not t2Diff1.empty)) and ((not t3Diff.empty) or (not t3Diff1.empty)):
|
| 516 |
-
# returnString=''
|
| 517 |
-
# returnString=['Changes have been made in Projects, Parts and Sections. Would you like to retrieve them in the console? By saying yes, you may need to repeat the website related processes(if any).','project']
|
| 518 |
print(returnString)
|
| 519 |
-
# if sectionData!='noSectionYet':
|
| 520 |
-
# return jsonify([returnString,DictionaryOfTemplates])
|
| 521 |
-
# else:
|
| 522 |
-
# returnString=prjpartsRefreshAPItable2(table2,projectname)
|
| 523 |
-
|
| 524 |
return jsonify(returnString)
|
| 525 |
|
| 526 |
-
# @app.route('/getnewparts',methods=["GET", "POST"])
|
| 527 |
-
|
| 528 |
-
|
| 529 |
-
def prjsectionsRefreshAPItable3(table3,projectname,projectpart):
|
| 530 |
-
# table1,table2,table3=API.GenerateTables()
|
| 531 |
-
# projectname = request.args.get('prjname')
|
| 532 |
-
|
| 533 |
-
url_1 = prjnamesURL.replace('/edit#gid=', '/export?format=csv&gid=')
|
| 534 |
-
table1N = pd.read_csv(url_1)
|
| 535 |
-
|
| 536 |
-
url_2 = prjpartsURL.replace('/edit#gid=', '/export?format=csv&gid=')
|
| 537 |
-
table2N = pd.read_csv(url_2)
|
| 538 |
-
|
| 539 |
-
url_3 = prjsectionsURL.replace('/edit#gid=', '/export?format=csv&gid=')
|
| 540 |
-
table3N = pd.read_csv(url_3)
|
| 541 |
-
|
| 542 |
-
differentSections=[]
|
| 543 |
-
returnString=''
|
| 544 |
-
t3Diff1=table3[~table3.isin(table3N)].dropna()
|
| 545 |
-
t3Diff=table3N[~table3N.isin(table3)].dropna()
|
| 546 |
-
|
| 547 |
-
a1 = table1N.to_numpy()
|
| 548 |
-
row = np.where(a1 == projectname)
|
| 549 |
-
prjid=a1[row[0]][0][0]
|
| 550 |
-
a2 = table2N.to_numpy()
|
| 551 |
-
row2 = np.where(a2 == projectpart)
|
| 552 |
-
partid=a2[row2[0]][0][1]
|
| 553 |
-
|
| 554 |
-
for i in range(len(t3Diff['ProjectId'].values)):
|
| 555 |
-
roww=table3N.iloc[np.where((table3N['ProjectId']==prjid) & (table3N['ProjectPartId']==partid) ) ]
|
| 556 |
-
differentSections.append(roww['ProjectSection'].iloc[i])
|
| 557 |
-
# returnString=['Changes have been made in Parts. Would you like to retrieve them in the console?','part',differentParts]
|
| 558 |
-
print(differentSections)
|
| 559 |
-
return returnString
|
| 560 |
|
| 561 |
@app.route('/refreshDropbox',methods=["GET", "POST"])
|
| 562 |
def checkdropbox():
|
|
|
|
| 481 |
differentSections=[]
|
| 482 |
if projectpart and projectname:
|
| 483 |
print(t3Diff1)
|
| 484 |
+
print(prjid,partid)
|
| 485 |
roww=t3Diff1.iloc[np.where((t3Diff1['ProjectId']==str(prjid) ) & (t3Diff1['ProjectPartId']==str(partid)) ) ]
|
| 486 |
# print(prjid,partid,roww.shape[0] )
|
| 487 |
for i in range(len(roww['ProjectId'].values)):
|
|
|
|
| 493 |
returnString=['Changes have been made in Sections. Would you like to retrieve them in the console?','section',differentSections]
|
| 494 |
print(differentSections)
|
| 495 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 496 |
print(returnString)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 497 |
return jsonify(returnString)
|
| 498 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 499 |
|
| 500 |
@app.route('/refreshDropbox',methods=["GET", "POST"])
|
| 501 |
def checkdropbox():
|