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:
CellRendererText
A base
Gtk.CellRendererText
class to facilitate rendering native Python values into strings of various formats.
- class CellRendererBytes(*args, **kwargs)[source]
Bases:
CellRendererPythonText
A custom
CellRendererPythonText
to render numeric values representing bytes.
- class CellRendererDatetime(*args, **kwargs)[source]
Bases:
CellRendererPythonText
A custom
CellRendererPythonText
to render numeric values representing bytes.
- class CellRendererInteger(*args, **kwargs)[source]
Bases:
CellRendererPythonText
A custom
CellRendererPythonText
to render numeric values with comma separators.
1.1.4.1.1.2. Column Definitions
- class ColumnDefinitionBase(title, width)[source]
Bases:
object
A base class for defining attributes of columns to be displayed within
TreeView
instances.
- class ColumnDefinitionBytes(title, width=25)[source]
Bases:
ColumnDefinitionBase
- class ColumnDefinitionDatetime(title, width=25)[source]
Bases:
ColumnDefinitionBase
- class ColumnDefinitionInteger(title, width=15)[source]
Bases:
ColumnDefinitionBase
- class ColumnDefinitionString(title, width=30)[source]
Bases:
ColumnDefinitionBase
1.1.4.1.1.3. Miscellaneous
- class FileChooserDialog(title, parent, **kwargs)[source]
Bases:
FileChooserDialog
Display 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()
.
- 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
- class MultilineEntry(*args, **kwargs)[source]
Bases:
Frame
A custom entry widget which can be styled to look like
Gtk.Entry
but accepts multiple lines of input.
- class WebKitHTMLView[source]
Bases:
WebView
A 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.
- 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_env
into which the markdown data is passed in the variablemarkdown
along 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
Template
when 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
TemplateEnvironmentBase
instance to use when rendering template content. The environment uses theFindFileSystemLoader
loader.