Sfoglia il codice sorgente

amend seo info parse function

wangweimin 4 anni fa
parent
commit
36f2145783
2 ha cambiato i file con 5 aggiunte e 5 eliminazioni
  1. 4 4
      pywebio/platform/utils.py
  2. 1 1
      pywebio/utils.py

+ 4 - 4
pywebio/platform/utils.py

@@ -60,9 +60,9 @@ def cdn_validation(cdn, level='warn'):
 
 def parse_app_metadata(func):
     """解析pywebio app元数据"""
-    title, description = get_function_seo_info(func)
-    if title:
-        return AppMeta(title, description)
+    seo_info = get_function_seo_info(func)
+    if seo_info:
+        return AppMeta(*seo_info)
 
     doc = get_function_doc(func)
     parts = doc.strip().split('\n\n', 1)
@@ -181,7 +181,7 @@ def seo(title, description=None, app=None):
         def hello():
             """应用标题
 
-            应用简介... (应用简介和标题之间需要使用一个空行分隔)
+            应用简介... (应用简介和标题之间使用一个空行分隔)
             """
 
         start_server([

+ 1 - 1
pywebio/utils.py

@@ -176,7 +176,7 @@ def get_function_seo_info(func):
         if hasattr(func, '_pywebio_title'):
             return func._pywebio_title, func._pywebio_description
 
-    return '', ''
+    return None
 
 
 class LimitedSizeQueue(queue.Queue):