Parse [TITLE]
This commit is contained in:
@@ -25,3 +25,18 @@ def set_title_cache(name: str, cs: ChangeSet) -> SqlChangeSet:
|
|||||||
|
|
||||||
def set_title(name: str, cs: ChangeSet) -> ChangeSet:
|
def set_title(name: str, cs: ChangeSet) -> ChangeSet:
|
||||||
return execute_command(name, set_title_cache(name ,cs))
|
return execute_command(name, set_title_cache(name ,cs))
|
||||||
|
|
||||||
|
|
||||||
|
class InpTitle:
|
||||||
|
def __init__(self, section) -> None:
|
||||||
|
self.value = '\n'.join(section)
|
||||||
|
|
||||||
|
|
||||||
|
def inp_in_title(section: list[str]) -> ChangeSet:
|
||||||
|
title = InpTitle(section)
|
||||||
|
cs = ChangeSet({'operation' : API_ADD, 'type': 'title', 'value' : title.value})
|
||||||
|
return cs
|
||||||
|
|
||||||
|
def inp_out_title(name: str) -> list[str]:
|
||||||
|
title = str(get_title(name)['value'])
|
||||||
|
return title.split('\n')
|
||||||
|
|||||||
Reference in New Issue
Block a user