@@ -48,14 +48,12 @@ class Method(object):
48
48
"""
49
49
def __init__ (self , name : str , func : Callable [..., JSONType ],
50
50
mtype : MethodType = MethodType .RPCMETHOD ,
51
- deprecated : Union [bool , List [str ]] = None ,
52
- description : str = None ):
51
+ deprecated : Union [bool , List [str ]] = None ):
53
52
self .name = name
54
53
self .func = func
55
54
self .mtype = mtype
56
55
self .background = False
57
56
self .deprecated = deprecated
58
- self .description = description
59
57
self .before : List [str ] = []
60
58
self .after : List [str ] = []
61
59
@@ -83,9 +81,6 @@ def get_usage(self):
83
81
else :
84
82
args .append ("[%s]" % arg )
85
83
86
- if self .description is not None :
87
- args .append ("\n %s" % self .description )
88
-
89
84
return " " .join (args )
90
85
91
86
@@ -354,8 +349,7 @@ def convert_featurebits(
354
349
355
350
def add_method (self , name : str , func : Callable [..., Any ],
356
351
background : bool = False ,
357
- deprecated : Optional [Union [bool , List [str ]]] = None ,
358
- description : str = None ) -> None :
352
+ deprecated : Optional [Union [bool , List [str ]]] = None ) -> None :
359
353
"""Add a plugin method to the dispatch table.
360
354
361
355
The function will be expected at call time (see `_dispatch`)
@@ -392,7 +386,7 @@ def add_method(self, name: str, func: Callable[..., Any],
392
386
)
393
387
394
388
# Register the function with the name
395
- method = Method (name , func , MethodType .RPCMETHOD , deprecated , description )
389
+ method = Method (name , func , MethodType .RPCMETHOD , deprecated )
396
390
method .background = background
397
391
self .methods [name ] = method
398
392
@@ -506,36 +500,25 @@ def get_option(self, name: str) -> Optional[Any]:
506
500
else :
507
501
return self .options [name ].default
508
502
509
- def async_method (self , method_name : str , category : Optional [str ] = None ,
510
- desc : Optional [str ] = None ,
511
- long_desc : Optional [str ] = None ,
503
+ def async_method (self , method_name : str ,
512
504
deprecated : Optional [Union [bool , List [str ]]] = None ) -> NoneDecoratorType :
513
505
"""Decorator to add an async plugin method to the dispatch table.
514
506
515
507
Internally uses add_method.
516
508
"""
517
509
def decorator (f : Callable [..., None ]) -> Callable [..., None ]:
518
- for attr , attr_name in [(category , "Category" ), (desc , "Description" ), (long_desc , "Long description" )]:
519
- if attr is not None :
520
- self .log ("{} is deprecated but defined in method {}; it will be ignored by Core Lightning" .format (attr_name , method_name ), level = "warn" )
521
510
self .add_method (method_name , f , background = True , deprecated = deprecated )
522
511
return f
523
512
return decorator
524
513
525
- def method (self , method_name : str , category : Optional [str ] = None ,
526
- desc : Optional [str ] = None ,
527
- long_desc : Optional [str ] = None ,
528
- deprecated : Union [bool , List [str ]] = None ,
529
- description : str = None ) -> JsonDecoratorType :
514
+ def method (self , method_name : str ,
515
+ deprecated : Union [bool , List [str ]] = None ) -> JsonDecoratorType :
530
516
"""Decorator to add a plugin method to the dispatch table.
531
517
532
518
Internally uses add_method.
533
519
"""
534
520
def decorator (f : Callable [..., JSONType ]) -> Callable [..., JSONType ]:
535
- for attr , attr_name in [(category , "Category" ), (desc , "Description" ), (long_desc , "Long description" )]:
536
- if attr is not None :
537
- self .log ("{} is deprecated but defined in method {}; it will be ignored by Core Lightning" .format (attr_name , method_name ), level = "warn" )
538
- self .add_method (method_name , f , background = False , deprecated = deprecated , description = f .__doc__ )
521
+ self .add_method (method_name , f , background = False , deprecated = deprecated )
539
522
return f
540
523
return decorator
541
524
@@ -948,16 +931,9 @@ def _getmanifest(self, **kwargs) -> JSONType:
948
931
doc = "Undocumented RPC method from a plugin."
949
932
doc = re .sub ('\n +' , ' ' , doc )
950
933
951
- # For compatibility with lightningd prior to 24.08, we must
952
- # provide a description. Ignored by 24.08 onwards,
953
- description = method .description
954
- if description is None :
955
- description = ""
956
-
957
934
methods .append ({
958
935
'name' : method .name ,
959
- 'usage' : method .get_usage (),
960
- 'description' : description ,
936
+ 'usage' : method .get_usage ()
961
937
})
962
938
963
939
manifest = {
0 commit comments