From 4d9138e3ef76ce300f054a8cb07b1a2327b35a83 Mon Sep 17 00:00:00 2001 From: Jordan Wiens Date: Sat, 14 Sep 2019 01:06:50 -0400 Subject: lots of small documentation updates, mostly around making sure parameters are consistent and typed properly --- python/interaction.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'python/interaction.py') diff --git a/python/interaction.py b/python/interaction.py index 3a4f7575..d2fc59fc 100644 --- a/python/interaction.py +++ b/python/interaction.py @@ -956,8 +956,8 @@ def markdown_to_html(contents): """ ``markdown_to_html`` converts the provided markdown to HTML - :param string contents: Markdown contents to convert to HTML - :rtype: string + :param str contents: Markdown contents to convert to HTML + :rtype: str :Example: >>> markdown_to_html("##Yay") '

Yay

' @@ -1057,7 +1057,7 @@ def get_text_line_input(prompt, title): :param str prompt: String to prompt with. :param str title: Title of the window when executed in the UI. - :rtype: string containing the input without trailing newline character. + :rtype: str containing the input without trailing newline character. :Example: >>> get_text_line_input("PROMPT>", "getinfo") PROMPT> Input! @@ -1122,7 +1122,8 @@ def get_choice_input(prompt, title, choices): :param str prompt: String to prompt with. :param str title: Title of the window when executed in the UI. - :param list choices: A list of strings for the user to choose from. + :param choices: A list of strings for the user to choose from. + :type choices: list(str) :rtype: integer array index of the selected option :Example: >>> get_choice_input("PROMPT>", "choices", ["Yes", "No", "Maybe"]) @@ -1226,9 +1227,12 @@ def get_form_input(fields, title): - OpenFileNameField - Prompt for file to open - SaveFileNameField - Prompt for file to save to - DirectoryNameField - Prompt for directory name - This API is flexible and works both in the UI via a pop-up dialog and on the command-line. - :params list fields: A list containing of the above specified classes, strings or None - :params str title: The title of the pop-up dialog. + This API is flexible and works both in the UI via a pop-up dialog and on the command-line. Note that more complicated APIs should consider usin the included pyside2 functionality in the `binaryninjaui` module. + + :param fields: A list containing of the above specified classes, strings or None + :type fields: list(str) or list(None) or list(LabelField) or list(SeparatorField) or list(TextLineField) or list(MultilineTextField) or list(IntegerField) or list(AddressField) or list(ChoiceField) or list(OpenFileNameField) or list(SaveFileNameField) or list(DirectoryNameField) + :param str title: The title of the pop-up dialog. + :rtype None :Example: >>> int_f = IntegerField("Specify Integer") @@ -1236,7 +1240,7 @@ def get_form_input(fields, title): >>> choice_f = ChoiceField("Options", ["Yes", "No", "Maybe"]) >>> get_form_input(["Get Data", None, int_f, tex_f, choice_f], "The options") Get Data - + Specify Integer 1337 Specify name Peter The options -- cgit v1.3.1