Marthee commited on
Commit
34d0189
·
verified ·
1 Parent(s): 8604dea

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -6
app.py CHANGED
@@ -7,10 +7,10 @@ from PIL import Image
7
  import cv2
8
  import numpy as np
9
  import pilecaps_adr
10
- import base64
11
  from db import dropbox_connect
12
  import db
13
- import cv2
14
  import pandas as pd
15
  import time
16
  from io import BytesIO, StringIO
@@ -223,11 +223,11 @@ def measureproject(result,dataDoc=0,img=0,dxffile=0):
223
  pdflink= tsadropboxretrieval.uploadanyFile(doc=doc,path=dbPath,pdfname=result[0]) #doc=doc,pdfname=path,pdfpath=pdfpath+'Measured Plan/'
224
 
225
  _, buffer = cv2.imencode('.png', outputimg)
226
- arr=[ base64.b64encode(buffer).decode('utf-8'),SimilarAreaDictionary.to_dict(), spreadsheet_url,spreadsheetId,[],list1.to_dict(),pdflink]#,hatched_areas,namepathArr]# , spreadsheetId, spreadsheet_url , list1.to_dict()]
227
  ################################# -2.8- #################################
228
  elif result[5][2].startswith('2.8'): #section value - 2.8 floor finishes
229
  #vv[0] array of pdf names
230
- imgss=[]
231
  dpxlinks=[]
232
  legendLinks=[]
233
  listofmarkups=[]
@@ -485,7 +485,7 @@ def dltmarkupslegend():
485
  # myDict=eval(deletedrows)
486
  deletedrows=pd.DataFrame(deletedrows)
487
  print('deletedrows',deletedrows)
488
- if section.startswith('1.0') or section.startswith('3.2'):
489
  newlgnd=google_sheet_Legend.deletefromlegend(deletedrows=deletedrows,SimilarAreaDictionarycopy=SimilarAreaDictionary, section=section,areaPermArr=areaPermArr)
490
  elif section.startswith('2.8'):
491
  newlgnd=google_sheet_Legend.delete3_2(deletedrows,SimilarAreaDictionary)
@@ -521,10 +521,15 @@ def getlinkscreated(jsdata):
521
  ids=gc.spreadsheet_ids()
522
  titles=gc.spreadsheet_titles()
523
  allpaths=[]
 
524
  # for title in titles:
525
  for i in range(0,len(titles)):
 
526
  if not (titles[i].startswith('API') or (titles[i].startswith('Dropbox')) ) :
 
527
  ws=gc.open(titles[i])
 
 
528
  allpaths.append([titles[i], ws.get_developer_metadata('path')[0].value , drive_service.files().get(fileId=ids[i],fields="createdTime, modifiedTime").execute() ,ids[i] ])
529
 
530
  return jsonify(allpaths)
@@ -691,7 +696,7 @@ def cvtSummarytoXML(jsdata):
691
  # print(result[1])
692
  xmllink=google_sheet_to_xml.create_xml(documentname=result[1],dbPath=path)
693
  return jsonify(xmllink)
694
-
695
  #_________________________________________________________________________________________________________________________
696
  #_________________________________________________________________________________________________________________________
697
 
 
7
  import cv2
8
  import numpy as np
9
  import pilecaps_adr
10
+ import base64
11
  from db import dropbox_connect
12
  import db
13
+ import cv2
14
  import pandas as pd
15
  import time
16
  from io import BytesIO, StringIO
 
223
  pdflink= tsadropboxretrieval.uploadanyFile(doc=doc,path=dbPath,pdfname=result[0]) #doc=doc,pdfname=path,pdfpath=pdfpath+'Measured Plan/'
224
 
225
  _, buffer = cv2.imencode('.png', outputimg)
226
+ arr=[ base64.b64encode(buffer).decode('utf-8'),SimilarAreaDictionary.to_dict(), spreadsheet_url,spreadsheetId,[],list1.to_dict(),pdflink,hatched_areas,namepathArr]#,hatched_areas,namepathArr]# , spreadsheetId, spreadsheet_url , list1.to_dict()]
227
  ################################# -2.8- #################################
228
  elif result[5][2].startswith('2.8'): #section value - 2.8 floor finishes
229
  #vv[0] array of pdf names
230
+ imgss=[]
231
  dpxlinks=[]
232
  legendLinks=[]
233
  listofmarkups=[]
 
485
  # myDict=eval(deletedrows)
486
  deletedrows=pd.DataFrame(deletedrows)
487
  print('deletedrows',deletedrows)
488
+ if section.startswith('1.0') or section.startswith('3.2') or section.startswith('3.3'):
489
  newlgnd=google_sheet_Legend.deletefromlegend(deletedrows=deletedrows,SimilarAreaDictionarycopy=SimilarAreaDictionary, section=section,areaPermArr=areaPermArr)
490
  elif section.startswith('2.8'):
491
  newlgnd=google_sheet_Legend.delete3_2(deletedrows,SimilarAreaDictionary)
 
521
  ids=gc.spreadsheet_ids()
522
  titles=gc.spreadsheet_titles()
523
  allpaths=[]
524
+ print('HEREEEEEEEEEE')
525
  # for title in titles:
526
  for i in range(0,len(titles)):
527
+ print('titles',titles[i])
528
  if not (titles[i].startswith('API') or (titles[i].startswith('Dropbox')) ) :
529
+
530
  ws=gc.open(titles[i])
531
+ path_metadata = ws.get_developer_metadata('path')
532
+ print(path_metadata)
533
  allpaths.append([titles[i], ws.get_developer_metadata('path')[0].value , drive_service.files().get(fileId=ids[i],fields="createdTime, modifiedTime").execute() ,ids[i] ])
534
 
535
  return jsonify(allpaths)
 
696
  # print(result[1])
697
  xmllink=google_sheet_to_xml.create_xml(documentname=result[1],dbPath=path)
698
  return jsonify(xmllink)
699
+
700
  #_________________________________________________________________________________________________________________________
701
  #_________________________________________________________________________________________________________________________
702