Beispiel #1
0
def getTomDoc(id):
 return_string = ""
 for document in collection.find({'key':int(id)}):
		return_string =  GetProcedure.show_tomdoc(document['path'])
 

 return return_string.replace("\n","<br/>")
Beispiel #2
0
def getDependencyTemp(fileId):
  output_path = ""
  output_name = ""
  dependency_objects = []
  output_json = ""
  for document in collection.find({'key':int(fileId)}):
    return_string =  GetProcedure.show_tomdoc(document['path'])
    output_path = document['path']
    output_name = document['name']
 
  dependency_objects = ListOfProcs.getDependency(output_path,1)
 
  output_json = "{ \"name\":\""+output_name+"\",\"children\":[ "
  
  for obj in dependency_objects:
    if len(dependency_objects) > 0 :
      for obj_inner in obj:
        output_json = output_json + "{ \"name\" : \""+obj_inner+"\"},"
    else :  
      output_json = output_json + "}"

  output_json = output_json.replace('SENTINEL.','')
  output_json = output_json.rstrip(',') + "] }"
  return str(output_json)