# Path: plugin.py
# class Plugin:
#     def __init__(self):
#         self.documents = Documents(self)
#         try: self.name
#         except: self.name = self.__class__.__name__.lower()
#         try: self.description
#         except: self.description = 'This plugin has no description.'
#         if self.__class__ is Plugin:
#             raise NotImplementedError
# 
#     @property
#     def user(self):
#         return app.current_user
# 
#     def process(self, request):
#         pass
# 
#     def unload(self):
#         pass


from queue import PriorityQueue, Queue
from datetime import *
from plugin import Plugin
import json

    SPFA_time = datetime.now()
    time_point["SPFA"] = SPFA_time - convert_time

    path_list = []
    for j in Astar(s, t, k):
        # not founded
        if j == -1:
            break

        # overtime
        if j == 0:
            break

        path = []
        for node in j:
            result = {"id": search_pool[node]}
            object_node = data['node'][result["id"]]
            result["NAME"] = object_node["NAME"]
            result["TYPE"] = object_node["TYPE"]
            path.append(result)
            del result
        # path.append(db.node.find_one({"_id": search_dict[node]})["NAME"])
        path_list.append(path)

    Astar_time = datetime.now()
    time_point["Astar"] = Astar_time - SPFA_time
    return {'paths': path_list}



# Path: plugin.py
# class Plugin:
#     def __init__(self):
#         self.documents = Documents(self)
#         try: self.name
#         except: self.name = self.__class__.__name__.lower()
#         try: self.description
#         except: self.description = 'This plugin has no description.'
#         if self.__class__ is Plugin:
#             raise NotImplementedError
# 
#     @property
#     def user(self):
#         return app.current_user
# 
#     def process(self, request):
#         pass
# 
#     def unload(self):
#         pass


# Path: plugins/path_finder_new.py
from queue import PriorityQueue, Queue
from datetime import *
from plugin import Plugin
import json


    SPFA_time = datetime.now()
    time_point["SPFA"] = SPFA_time - convert_time

    path_list = []
    for j in Astar(s, t, k):
        # not founded
        if j == -1:
            break

        # overtime
        if j == 0:
            break

        path = []
        for node in j:
            result = {"id": search_pool[node]}
            object_node = data['node'][result["id"]]
            result["NAME"] = object_node["NAME"]
            result["TYPE"] = object_node["TYPE"]
            path.append(result)
            del result
        # path.append(db.node.find_one({"_id": search_dict[node]})["NAME"])
        path_list.append(path)

    Astar_time = datetime.now()
    time_point["Astar"] = Astar_time - SPFA_time
    return {'paths': path_list}



class Path_Finder_New(Plugin):