예제 #1
0
 def replace_search_node(self, *, existing_node: pb.SearchNode,
                         replacement_node: pb.SearchNode) -> str:
     input = pb.ReplaceSearchNodeIn(existing_node=existing_node,
                                    replacement_node=replacement_node)
     output = pb.String()
     output.ParseFromString(self._run_command(13, input))
     return output.val
예제 #2
0
 def join_search_nodes(self, *, joiner: pb.SearchNode.Group.Joiner.V,
                       existing_node: pb.SearchNode,
                       additional_node: pb.SearchNode) -> str:
     input = pb.JoinSearchNodesIn(joiner=joiner,
                                  existing_node=existing_node,
                                  additional_node=additional_node)
     output = pb.String()
     output.ParseFromString(self._run_command(12, input))
     return output.val
예제 #3
0
 def build_search_string(self, input: pb.SearchNode) -> str:
     output = pb.String()
     output.ParseFromString(self._run_command(9, input))
     return output.val
예제 #4
0
 def format_timespan(self, *, seconds: float,
                     context: pb.FormatTimespanIn.Context.V) -> str:
     input = pb.FormatTimespanIn(seconds=seconds, context=context)
     output = pb.String()
     output.ParseFromString(self._run_command(101, input))
     return output.val
예제 #5
0
 def remove_config(self, val: str) -> pb.Empty:
     input = pb.String(val=val)
     output = pb.Empty()
     output.ParseFromString(self._run_command(112, input))
     return output
예제 #6
0
 def get_config_string(self, key: pb.Config.String.Key.V) -> str:
     input = pb.Config.String(key=key)
     output = pb.String()
     output.ParseFromString(self._run_command(116, input))
     return output.val
예제 #7
0
 def get_config_json(self, val: str) -> bytes:
     input = pb.String(val=val)
     output = pb.Json()
     output.ParseFromString(self._run_command(110, input))
     return output.json
예제 #8
0
 def strip_av_tags(self, val: str) -> str:
     input = pb.String(val=val)
     output = pb.String()
     output.ParseFromString(self._run_command(8, input))
     return output.val
예제 #9
0
 def render_markdown(self, *, markdown: str, sanitize: bool) -> str:
     input = pb.RenderMarkdownIn(markdown=markdown, sanitize=sanitize)
     output = pb.String()
     output.ParseFromString(self._run_command(103, input))
     return output.val
예제 #10
0
 def clear_tag(self, val: str) -> pb.Empty:
     input = pb.String(val=val)
     output = pb.Empty()
     output.ParseFromString(self._run_command(107, input))
     return output
예제 #11
0
 def translate_string(self, input: pb.TranslateStringIn) -> str:
     output = pb.String()
     output.ParseFromString(self._run_command(100, input))
     return output.val
예제 #12
0
 def studied_today(self) -> str:
     input = pb.Empty()
     output = pb.String()
     output.ParseFromString(self._run_command(16, input))
     return output.val
예제 #13
0
 def get_notetype_id_by_name(self, val: str) -> int:
     input = pb.String(val=val)
     output = pb.NoteTypeID()
     output.ParseFromString(self._run_command(85, input))
     return output.ntid
예제 #14
0
 def get_deck_id_by_name(self, val: str) -> int:
     input = pb.String(val=val)
     output = pb.DeckID()
     output.ParseFromString(self._run_command(52, input))
     return output.did
예제 #15
0
 def add_media_file(self, *, desired_name: str, data: bytes) -> str:
     input = pb.AddMediaFileIn(desired_name=desired_name, data=data)
     output = pb.String()
     output.ParseFromString(self._run_command(45, input))
     return output.val
예제 #16
0
 def card_stats(self, cid: int) -> str:
     input = pb.CardID(cid=cid)
     output = pb.String()
     output.ParseFromString(self._run_command(39, input))
     return output.val
예제 #17
0
 def studied_today_message(self, *, cards: int, seconds: float) -> str:
     input = pb.StudiedTodayMessageIn(cards=cards, seconds=seconds)
     output = pb.String()
     output.ParseFromString(self._run_command(17, input))
     return output.val