示例#1
0
文件: routes.py 项目: jordancode/phil
 def __init__(self,
              *args,
              comment=None,
              parameters=None,
              returns=None,
              optional_keys=None,
              **kargs):
     super().__init__(*args, **kargs)
     self.parameters = parameters or {}
     self.comment = comment
     self.return_data = Type.serialize(returns, optional_keys)
示例#2
0
文件: routes.py 项目: jordancode/phil
 def update_rule_with_meta(self, request = None, session_store=None):
     m = self.get_method(request, session_store)
     
     if hasattr(m, "meta"):
         if "comment" in m.meta:
             self.set_comment(m.meta["comment"])
         if "return" in m.meta:
             optional_keys = []
             if "optional_keys" in m.meta:
                 optional_keys = m.meta["optional_keys"]
             self.return_data = Type.serialize(m.meta["return"], optional_keys)
         if "parameters" in m.meta:
             self.set_parameters(m.meta["parameters"])
         if "not_implemented" in m.meta:
             self.not_implemented = True 
         
     return m
示例#3
0
文件: routes.py 项目: jordancode/phil
    def update_rule_with_meta(self, request=None, session_store=None):
        m = self.get_method(request, session_store)

        if hasattr(m, "meta"):
            if "comment" in m.meta:
                self.set_comment(m.meta["comment"])
            if "return" in m.meta:
                optional_keys = []
                if "optional_keys" in m.meta:
                    optional_keys = m.meta["optional_keys"]
                self.return_data = Type.serialize(m.meta["return"],
                                                  optional_keys)
            if "parameters" in m.meta:
                self.set_parameters(m.meta["parameters"])
            if "not_implemented" in m.meta:
                self.not_implemented = True

        return m
示例#4
0
文件: routes.py 项目: jordancode/phil
 def __init__(self, *args, comment = None, parameters = None, returns = None, optional_keys=None, **kargs):
     super().__init__(*args, **kargs)
     self.parameters = parameters or {}
     self.comment = comment
     self.return_data =  Type.serialize(returns, optional_keys)