예제 #1
0
 def get_children(self,path):
 	results = ""
 	outputList = ListOfProcs.getDependency(path,1)
 	while outputList != None: 
 		for obj in outputList:
 			for obj
 	return results
예제 #2
0
def getFileNames():
  list_of_objects =  ListOfProcs.main('config.txt')
  collection.remove()
  counter = 0
  return_string = "{\"data\":["
  for object in list_of_objects:
  	  insert_string = {'key' :  counter , 'name' :  object.getName() , 'path' : object.getPath()  }
  	  #print insert_string
   	  id = collection.insert(insert_string)
   	  return_string = return_string + " { \"id\" : " + str(counter) + " , \"name\" : \"" + object.getName() + "\" } ," 
   	  counter = counter + 1
  return_string = return_string.rstrip(",") + " ]}"
  return return_string
예제 #3
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)