1.1.4.1. extras¶
This module contains miscellaneous extra GTK widgets.
1.1.4.1.1. Classes¶
1.1.4.1.1.1. Cell Renderers¶
-
class
CellRendererPythonText(*args, **kwargs)[source]¶ Bases:
Gtk.CellRendererTextA base
Gtk.CellRendererTextclass to facilitate rendering native Python values into strings of various formats.
-
class
CellRendererBytes(*args, **kwargs)[source]¶ Bases:
king_phisher.client.widget.extras.CellRendererPythonTextA custom
CellRendererPythonTextto render numeric values representing bytes.
-
class
CellRendererDatetime(*args, **kwargs)[source]¶ Bases:
king_phisher.client.widget.extras.CellRendererPythonTextA custom
CellRendererPythonTextto render numeric values representing bytes.
-
class
CellRendererInteger(*args, **kwargs)[source]¶ Bases:
king_phisher.client.widget.extras.CellRendererPythonTextA custom
CellRendererPythonTextto render numeric values with comma separators.
1.1.4.1.1.2. Column Definitions¶
-
class
ColumnDefinitionBase(title, width)[source]¶ Bases:
objectA base class for defining attributes of columns to be displayed within
TreeViewinstances.-
cell_renderer= None[source]¶ The
CellRendererto use for rendering the content.
-
sort_function= None[source]¶ An optional custom sort function to use for comparing values. This is necessary when
g_typeis not something that can be automatically sorted. If specified, this function will be passed toGtk.TreeSortable.set_sort_func().
-
-
class
ColumnDefinitionBytes(title, width=25)[source]¶ Bases:
king_phisher.client.widget.extras.ColumnDefinitionBase
-
class
ColumnDefinitionDatetime(title, width=25)[source]¶ Bases:
king_phisher.client.widget.extras.ColumnDefinitionBase
-
class
ColumnDefinitionInteger(title, width=15)[source]¶ Bases:
king_phisher.client.widget.extras.ColumnDefinitionBase
-
class
ColumnDefinitionString(title, width=30)[source]¶ Bases:
king_phisher.client.widget.extras.ColumnDefinitionBase
1.1.4.1.1.3. Miscellaneous¶
-
class
FileChooserDialog(title, parent, **kwargs)[source]¶ Bases:
Gtk.FileChooserDialogDisplay a file chooser dialog with additional convenience methods.
-
__init__(title, parent, **kwargs)[source]¶ Parameters: - title (str) – The title for the file chooser dialog.
- parent (
Gtk.Window) – The parent window for the dialog.
-
quick_add_filter(name, patterns)[source]¶ Add a filter for displaying files, this is useful in conjunction with
run_quick_open().Parameters:
-
run_quick_open()[source]¶ Display a dialog asking a user which file should be opened. The value of target_path in the returned dictionary is an absolute path.
Returns: A dictionary with target_uri and target_path keys representing the path chosen. Return type: dict
-
run_quick_save(current_name=None)[source]¶ Display a dialog which asks the user where a file should be saved. The value of target_path in the returned dictionary is an absolute path.
Parameters: current_name (set) – The name of the file to save. Returns: A dictionary with target_uri and target_path keys representing the path chosen. Return type: dict
-
-
class
MultilineEntry(*args, **kwargs)[source]¶ Bases:
Gtk.FrameA custom entry widget which can be styled to look like
Gtk.Entrybut accepts multiple lines of input.
-
class
WebKitHTMLView[source]¶ Bases:
WebKitX.WebViewA WebView widget with additional convenience methods for rendering simple HTML content from either files or strings. If a link is opened within the document, the webview will emit the ‘open-uri’ signal instead of navigating to it.
-
load_html_data(html_data, html_file_uri=None)[source]¶ Load arbitrary HTML data into the WebKit engine to be rendered.
Parameters:
-
load_html_file(html_file)[source]¶ Load arbitrary HTML data from a file into the WebKit engine to be rendered.
Parameters: html_file (str) – The path to the file to load HTML data from.
-
load_markdown_data(md_data, html_file_uri=None, gh_flavor=True, template=None, template_vars=None)[source]¶ Load markdown data, render it into HTML and then load it in to the WebKit engine. When gh_flavor is enabled, the markdown data is rendered using partial GitHub flavor support as provided by
PartialGithubFlavoredMarkdownExtension. If template is specified, it is used to load a Jinja2 template usingtemplate_envinto which the markdown data is passed in the variablemarkdownalong with any others specified in the template_vars dictionary.Parameters: - md_data (str) – The markdown data to render into HTML for displaying.
- html_file_uri (str) – The URI of the file where the HTML data came from.
- gh_flavor (bool) – Whether or not to enable partial GitHub markdown syntax support.
- template (str) – The name of a Jinja2 HTML template to load for hosting the rendered markdown.
- template_vars – Additional variables to pass to the Jinja2
Templatewhen rendering it.
Returns:
-
load_markdown_file(md_file, **kwargs)[source]¶ Load markdown data from a file and render it using
load_markdown_data().Parameters: - md_file (str) – The path to the file to load markdown data from.
- kwargs – Additional keyword arguments to pass to
load_markdown_data().
-
template_env= <king_phisher.templates.TemplateEnvironmentBase object>[source]¶ The
TemplateEnvironmentBaseinstance to use when rendering template content. The environment uses theFindFileSystemLoaderloader.
-