dialogs.*¶
Modal dialogs
-
class
dialogs.ApproveWarningDialog(parent)[source]¶ Bases:
objectModal warning dialog for approving files to be evaled
The modal dialog is shown on accessing the property choice.
- Parameters
parent (
QWidget) – Parent widget, e.g. main window
-
property
choice¶ User choice
Returns True iif the user approves leaving safe_mode. Returns False iif the user chooses to stay in safe_mode Returns None if the user chooses to abort the operation
- Return type
-
choices= <PyQt5.QtWidgets.QMessageBox.StandardButtons object>¶
-
default_choice= 65536¶
-
text= 'You are going to approve and trust a file that you have not created yourself. After proceeding, the file is executed.\n \nIt may harm your system as any program can. Please check all cells thoroughly before proceeding.\n \nProceed and sign this file as trusted?'¶
-
title= 'Security warning'¶
-
class
dialogs.CellKeyDialog(parent, shape)[source]¶ Bases:
dialogs.DataEntryDialogModal dialog for entering a cell key, i.e. row, column, table
- Parameters
-
class
dialogs.ChartDialog(parent, key, size=(800, 600))[source]¶ Bases:
PyQt5.QtWidgets.QDialogThe chart dialog
- Parameters
Returns a QDialogButtonBox with Ok and Cancel
-
class
dialogs.CsvExportAreaDialog(parent, grid, title)[source]¶ Bases:
dialogs.DataEntryDialogModal dialog for entering csv export area
Initially, this dialog is filled with the selection bounding box if present or with the visible area of <= 1 cell is selected.
- Parameters
parent (
QWidget) – Parent widget, e.g. main windowgrid (
QTableView) – The main grid widgettitle (
str) – Dialog title
-
property
_column_validator¶ Returns column validator
- Return type
QIntValidator
-
property
_row_validator¶ Returns row validator
- Return type
QIntValidator
-
property
_validator¶ Returns int validator for positive numbers
-
property
area¶ Executes the dialog and returns top, left, bottom, right
Returns None if the dialog is canceled.
- Return type
-
area_cls¶ alias of
dialogs.SinglePageArea
-
groupbox_title= 'Page area'¶
-
labels= ['Top', 'Left', 'Bottom', 'Right']¶
-
class
dialogs.CsvExportDialog(parent, csv_area)[source]¶ Bases:
PyQt5.QtWidgets.QDialogModal dialog for exporting csv files
- Parameters
parent (
QWidget) – Parent windowcsv_area (
SinglePageArea) – Grid area to be exported
Returns button box with Reset, Apply, Ok, Cancel
- Return type
QDialogButtonBox
-
maxrows= 10¶
-
title= 'CSV export'¶
-
class
dialogs.CsvFileImportDialog(main_window)[source]¶ Bases:
dialogs.FileDialogBaseModal dialog for importing csv files
- Parameters
main_window (
QMainWindow) – Application main window
-
filters_list= ['CSV file (*.*)']¶
-
property
suffix¶ Do not offer suffix for filepath
-
title= 'Import data'¶
-
class
dialogs.CsvImportDialog(parent, filepath, digest_types=None)[source]¶ Bases:
PyQt5.QtWidgets.QDialogModal dialog for importing csv files
- Parameters
Returns a QDialogButtonBox
-
title= 'CSV import'¶
-
class
dialogs.CsvParameterGroupBox(parent)[source]¶ Bases:
PyQt5.QtWidgets.QGroupBoxQGroupBox that holds parameter widgets for the csv import dialog
- Parameters
parent (
QWidget) – Parent window
-
adjust_csvdialect(dialect)[source]¶ Adjusts csv dialect from widget settings
Note that the dialect has two extra attributes encoding and hasheader
-
default_delimiter= ','¶
-
default_encoding= 'utf-8'¶
-
default_quotechar= '"'¶
-
default_quoting= 'QUOTE_MINIMAL'¶
-
delimiter_tooltip= 'A one-character string used to separate fields.'¶
-
doublequote_tooltip= 'Controls how instances of quotechar appearing inside a field should be themselves be quoted. When True, the character is doubled. When False, the escapechar is used as a prefix to the quotechar.'¶
-
encoding_widget_tooltip= 'CSV file encoding'¶
-
encodings= ('ascii', 'big5', 'big5hkscs', 'cp037', 'cp424', 'cp437', 'cp500', 'cp720', 'cp737', 'cp775', 'cp850', 'cp852', 'cp855', 'cp856', 'cp857', 'cp858', 'cp860', 'cp861', 'cp862', 'cp863', 'cp864', 'cp865', 'cp866', 'cp869', 'cp874', 'cp875', 'cp932', 'cp949', 'cp950', 'cp1006', 'cp1026', 'cp1140', 'cp1250', 'cp1251', 'cp1252', 'cp1253', 'cp1254', 'cp1255', 'cp1256', 'cp1257', 'cp1258', 'euc-jp', 'euc-jis-2004', 'euc-jisx0213', 'euc-kr', 'gb2312', 'gbk', 'gb18030', 'hz', 'iso2022-jp', 'iso2022-jp-1', 'iso2022-jp-2', 'iso2022-jp-2004', 'iso2022-jp-3', 'iso2022-jp-ext', 'iso2022-kr', 'latin-1', 'iso8859-2', 'iso8859-3', 'iso8859-4', 'iso8859-5', 'iso8859-6', 'iso8859-7', 'iso8859-8', 'iso8859-9', 'iso8859-10', 'iso8859-13', 'iso8859-14', 'iso8859-15', 'iso8859-16', 'johab', 'koi8-r', 'koi8-u', 'mac-cyrillic', 'mac-greek', 'mac-iceland', 'mac-latin2', 'mac-roman', 'mac-turkish', 'ptcp154', 'shift-jis', 'shift-jis-2004', 'shift-jisx0213', 'utf-32', 'utf-32-be', 'utf-32-le', 'utf-16', 'utf-16-be', 'utf-16-le', 'utf-7', 'utf-8', 'utf-8-sig')¶
-
escapechar_tooltip= 'A one-character string used by the writer to escape the delimiter if quoting is set to QUOTE_NONE and the quotechar if doublequote is False. On reading, the escapechar removes any special meaning from the following character.'¶
-
hasheader_tooltip= 'Analyze the CSV file and treat the first row as strings if it appears to be a series of column headers.'¶
-
keepheader_tooltip= 'Import header labels as str in the first row'¶
-
quotechar_tooltip= 'A one-character string used to quote fields containing special characters, such as the delimiter or quotechar, or which contain new-line characters.'¶
-
quoting_widget_tooltip= 'Controls when quotes should be generated by the writer and recognised by the reader.'¶
-
quotings= ('QUOTE_ALL', 'QUOTE_MINIMAL', 'QUOTE_NONNUMERIC', 'QUOTE_NONE')¶
-
set_csvdialect(dialect)[source]¶ Update widgets from given csv dialect
- Parameters
dialect (
Dialect) – Attributes class for csv reading and writing
-
skipinitialspace_tooltip= 'When True, whitespace immediately following the delimiter is ignored.'¶
-
title= 'Parameters'¶
-
class
dialogs.CsvTable(parent)[source]¶ Bases:
PyQt5.QtWidgets.QTableViewTable for previewing csv file content
- Parameters
parent (
QWidget) – Parent window
-
add_choice_row(length)[source]¶ Adds row with comboboxes for digest choice
- Parameters
length (
int) – Number of columns in row
-
fill(filepath, dialect, digest_types=None)[source]¶ Fills the csv table with values from the csv file
-
no_rows= 9¶
-
class
dialogs.DataEntryDialog(parent, title, labels, initial_data=None, groupbox_title=None, validators=None)[source]¶ Bases:
PyQt5.QtWidgets.QDialogModal dialog for entering multiple values
- Parameters
parent (
QWidget) – Parent widget, e.g. main windowtitle (
str) – Dialog titlelabels (
Sequence[str]) – Labels for the values in the dialoginitial_data (
Optional[Sequence[str]]) – Initial values to be displayed in the dialogvalidators (
Optional[Sequence[Union[QValidator,bool,None]]]) – Validators for the editors of the dialog
len(initial_data), len(validators) and len(labels) must be equal
Returns a QDialogButtonBox with Ok and Cancel
- Return type
QDialogButtonBox
-
class
dialogs.DiscardChangesDialog(main_window)[source]¶ Bases:
objectModal dialog that asks if the user wants to discard or save unsaved data
The modal dialog is shown on accessing the property choice.
- Parameters
main_window (
QMainWindow) – Application main window
-
property
choice¶ User choice
Returns True if the user confirms in a user dialog that unsaved changes will be discarded if conformed. Returns False if the user chooses to save the unsaved data Returns None if the user chooses to abort the operation
- Return type
-
choices= <PyQt5.QtWidgets.QMessageBox.StandardButtons object>¶
-
default_choice= 2048¶
-
text= 'There are unsaved changes.\nDo you want to save?'¶
-
title= 'Unsaved changes'¶
-
class
dialogs.DiscardDataDialog(main_window, text)[source]¶ Bases:
dialogs.DiscardChangesDialogModal dialog that asks if the user wants to discard data
- Parameters
main_window (
QMainWindow) – Application main windowtext (
str) – Message text
-
choices= <PyQt5.QtWidgets.QMessageBox.StandardButtons object>¶
-
default_choice= 4194304¶
-
title= 'Data to be discarded'¶
-
class
dialogs.FileDialogBase(main_window)[source]¶ Bases:
objectBase class for modal file dialogs
The chosen filename is stored in the file_path attribute The chosen name filter is stored in the chosen_filter attribute If the dialog is aborted then both filepath and chosen_filter are None
_get_filepath must be overloaded
- Parameters
main_window (
QMainWindow) – Application main window
-
file_path= None¶
-
filters_list= ['Pyspread un-compressed (*.pysu)', 'Pyspread compressed (*.pys)']¶
-
selected_filter= None¶
-
title= 'Choose file'¶
-
class
dialogs.FileExportDialog(main_window, filters_list)[source]¶ Bases:
dialogs.FileDialogBaseModal dialog for exporting csv files
- Parameters
-
title= 'Export data'¶
-
class
dialogs.FileOpenDialog(main_window)[source]¶ Bases:
dialogs.FileDialogBaseModal dialog for opening a pyspread file
- Parameters
main_window (
QMainWindow) – Application main window
-
title= 'Open'¶
-
class
dialogs.FileSaveDialog(main_window)[source]¶ Bases:
dialogs.FileDialogBaseModal dialog for saving a pyspread file
- Parameters
main_window (
QMainWindow) – Application main window
-
title= 'Save'¶
-
class
dialogs.FindDialog(main_window)[source]¶ Bases:
PyQt5.QtWidgets.QDialogFind dialog that is launched from the main menu
- Parameters
main_window (
QMainWindow) – Application main window
-
class
dialogs.FindDialogState(pos, case, results, more, backward, word, regex, start)[source]¶ Bases:
objectDataclass for FindDialog state storage
-
pos: PyQt5.QtCore.QPoint¶
-
-
class
dialogs.GridShapeDialog(parent, shape, title='Create a new Grid')[source]¶ Bases:
dialogs.DataEntryDialogModal dialog for entering the number of rows, columns and tables
- Parameters
-
class
dialogs.ImageFileOpenDialog(main_window)[source]¶ Bases:
dialogs.FileDialogBaseModal dialog for inserting an image
- Parameters
main_window (
QMainWindow) – Application main window
-
img_format_string= '*.bmp *.cur *.ico *.jpeg *.jpg *.pbm *.pgm *.png *.ppm *.xbm *.xpm'¶
-
img_format_strings= <generator object ImageFileOpenDialog.<genexpr>>¶
-
img_formats= [PyQt5.QtCore.QByteArray(b'bmp'), PyQt5.QtCore.QByteArray(b'cur'), PyQt5.QtCore.QByteArray(b'ico'), PyQt5.QtCore.QByteArray(b'jpeg'), PyQt5.QtCore.QByteArray(b'jpg'), PyQt5.QtCore.QByteArray(b'pbm'), PyQt5.QtCore.QByteArray(b'pgm'), PyQt5.QtCore.QByteArray(b'png'), PyQt5.QtCore.QByteArray(b'ppm'), PyQt5.QtCore.QByteArray(b'xbm'), PyQt5.QtCore.QByteArray(b'xpm')]¶
-
name_filter= 'Images (*.bmp *.cur *.ico *.jpeg *.jpg *.pbm *.pgm *.png *.ppm *.xbm *.xpm);;Scalable Vector Graphics (*.svg *.svgz)'¶
-
title= 'Insert image'¶
-
class
dialogs.ManualDialog(parent)[source]¶ Bases:
dialogs.TutorialDialogDialog for browsing the pyspread manual
- Parameters
parent (
QWidget) – Parent window
-
size_hint= (1000, 800)¶
-
title2path= {'Advanced topics': PosixPath('/builds/pyspread/pyspread-v1-archive/pyspread/share/doc/manual/advanced_topics.md'), 'Concepts': PosixPath('/builds/pyspread/pyspread-v1-archive/pyspread/share/doc/manual/basic_concepts.md'), 'Edit': PosixPath('/builds/pyspread/pyspread-v1-archive/pyspread/share/doc/manual/edit_menu.md'), 'File': PosixPath('/builds/pyspread/pyspread-v1-archive/pyspread/share/doc/manual/file_menu.md'), 'Format': PosixPath('/builds/pyspread/pyspread-v1-archive/pyspread/share/doc/manual/format_menu.md'), 'Macro': PosixPath('/builds/pyspread/pyspread-v1-archive/pyspread/share/doc/manual/macro_menu.md'), 'Overview': PosixPath('/builds/pyspread/pyspread-v1-archive/pyspread/share/doc/manual/overview.md'), 'View': PosixPath('/builds/pyspread/pyspread-v1-archive/pyspread/share/doc/manual/view_menu.md'), 'Workspace': PosixPath('/builds/pyspread/pyspread-v1-archive/pyspread/share/doc/manual/workspace.md')}¶
-
window_title= 'pyspread manual'¶
-
class
dialogs.MultiPageArea(top, left, bottom, right, first, last)[source]¶ Bases:
dialogs.SinglePageAreaHolds multi page area boundaries e.g. for printing
-
class
dialogs.PreferencesDialog(parent)[source]¶ Bases:
dialogs.DataEntryDialogModal dialog for entering pyspread preferences
- Parameters
parent (
QWidget) – Parent widget, e.g. main window
-
class
dialogs.PrintAreaDialog(parent, grid, title)[source]¶ Bases:
dialogs.CsvExportAreaDialogModal dialog for entering print area
Initially, this dialog is filled with the selection bounding box if present or with the visible area of <= 1 cell is selected. Initially, the current table is selected.
- Parameters
parent (
QWidget) – Parent widget, e.g. main windowgrid (
QTableView) – The main grid widgettitle (
str) – Dialog title
-
property
_initial_values¶ Returns tuple of initial values
-
property
_table_validator¶ Returns column validator
- Return type
QIntValidator
-
area_cls¶ alias of
dialogs.MultiPageArea
-
labels= ['Top', 'Left', 'Bottom', 'Right', 'First table', 'Last table']¶
-
class
dialogs.PrintPreviewDialog(printer)[source]¶ Bases:
PyQt5.QtPrintSupport.QPrintPreviewDialogAdds Mouse wheel functionality
- Parameters
printer (
QPrinter) – Target printer
-
class
dialogs.ReplaceDialog(main_window)[source]¶ Bases:
dialogs.FindDialogReplace dialog that is launched from the main menu
- Parameters
main_window (
QMainWindow) – Application main window
-
class
dialogs.SinglePageArea(top, left, bottom, right)[source]¶ Bases:
objectHolds single page area boundaries e.g. for export
-
class
dialogs.TutorialDialog(parent)[source]¶ Bases:
PyQt5.QtWidgets.QDialogDialog for browsing the pyspread tutorial
- Parameters
parent (
QWidget) – Parent window
-
path: pathlib.Path = PosixPath('/builds/pyspread/pyspread-v1-archive/pyspread/share/doc/tutorial/tutorial.md')¶
-
size_hint= (1000, 800)¶
-
window_title= 'pyspread tutorial'¶
pyspread