[mypy] type AppObject.category
authorLaurent Peuch <cortex@worlddomination.be>
Thu, 19 Dec 2019 06:35:54 +0100
changeset 12833 c69421aece24
parent 12832 7d3299d6e655
child 12834 492e1e0bbc6c
[mypy] type AppObject.category
cubicweb/server/hook.py
cubicweb/web/action.py
--- a/cubicweb/server/hook.py	Thu Dec 19 06:35:19 2019 +0100
+++ b/cubicweb/server/hook.py	Thu Dec 19 06:35:54 2019 +0100
@@ -522,8 +522,8 @@
     """
     __select__ = enabled_category()
     # set this in derivated classes
-    category = None
     events: Union[None, Tuple[str], Tuple[str, str]] = None
+    category: Union[None, str] = None
     order = 0
     # stop pylint from complaining about missing attributes in Hooks classes
     eidfrom = eidto = entity = rtype = repo = None
--- a/cubicweb/web/action.py	Thu Dec 19 06:35:19 2019 +0100
+++ b/cubicweb/web/action.py	Thu Dec 19 06:35:54 2019 +0100
@@ -32,6 +32,7 @@
 Many examples are available in :mod:`cubicweb.web.views.actions`.
 """
 
+from typing import Optional
 
 from cubicweb import _
 
@@ -48,7 +49,7 @@
     __registry__ = 'actions'
     __select__ = match_search_state('normal')
     order = 99
-    category = 'moreactions'
+    category: Optional[str] = 'moreactions'
     # actions in category 'moreactions' can specify a sub-menu in which they should be filed
     submenu = None