pyspread package¶
Subpackages¶
- pyspread.interfaces package
- pyspread.lib package
- Subpackages
- Submodules
- pyspread.lib.attrdict module
- pyspread.lib.charts module
- pyspread.lib.csv module
- pyspread.lib.dataclasses module
- pyspread.lib.exception_handling module
- pyspread.lib.file_helpers module
- pyspread.lib.hashing module
- pyspread.lib.parsers module
- pyspread.lib.pattern module
- pyspread.lib.qimage2ndarray module
- pyspread.lib.qimage_svg module
- pyspread.lib.selection module
SelectionSelection.cell_generator()Selection.clipped()Selection.get_absolute_access_string()Selection.get_bbox()Selection.get_bottom_borders_selection()Selection.get_grid_bbox()Selection.get_relative_access_string()Selection.get_right_borders_selection()Selection.grown()Selection.insert()Selection.parametersSelection.shifted()Selection.single_cell_selected()
- pyspread.lib.spelltextedit module
LineNumberAreaPythonEnchantHighlighterPythonEnchantHighlighter.bracesPythonEnchantHighlighter.chunkers()PythonEnchantHighlighter.dict()PythonEnchantHighlighter.enable_enchantPythonEnchantHighlighter.err_formatPythonEnchantHighlighter.highlightBlock()PythonEnchantHighlighter.highlightBlock_enchant()PythonEnchantHighlighter.highlightBlock_python()PythonEnchantHighlighter.highlightBlock_spreadsheet()PythonEnchantHighlighter.keywordsPythonEnchantHighlighter.match_multiline()PythonEnchantHighlighter.operatorsPythonEnchantHighlighter.setChunkers()PythonEnchantHighlighter.setDict()
SpellTextEditSpellTextEdit.cb_correct_word()SpellTextEdit.cb_set_format()SpellTextEdit.cb_set_language()SpellTextEdit.contextMenuEvent()SpellTextEdit.createCorrectionsMenu()SpellTextEdit.createFormatsMenu()SpellTextEdit.createLanguagesMenu()SpellTextEdit.createSpellcheckContextMenu()SpellTextEdit.cursorForMisspelling()SpellTextEdit.get_line_number_area_width()SpellTextEdit.keyPressEvent()SpellTextEdit.max_suggestionsSpellTextEdit.resizeEvent()SpellTextEdit.show_line_numbers()SpellTextEdit.spaces_per_tabSpellTextEdit.update_line_number_area()SpellTextEdit.update_line_number_area_width()
format()trim_suggestions()
- pyspread.lib.string_helpers module
- pyspread.lib.typechecks module
- pyspread.lib.xls_column module
- Module contents
- pyspread.model package
- Submodules
- pyspread.model.model module
CellAttributeCellAttributesCodeArrayDataArrayDataArray.cell_array_generator()DataArray.cell_attributesDataArray.col_widthsDataArray.dataDataArray.delete()DataArray.get_col_width()DataArray.get_last_filled_cell()DataArray.get_row_height()DataArray.insert()DataArray.keys()DataArray.macrosDataArray.pop()DataArray.row_heightsDataArray.set_col_width()DataArray.set_row_height()DataArray.shape
DefaultCellAttributeDictDictGridKeyValueStoreupdate_xl_list()
- Module contents
Submodules¶
pyspread.actions module¶
Provides
Actionis a quick one liner way to create QAction
- class pyspread.actions.Action(parent, label, *callbacks, icon=None, shortcut=None, statustip=None, checkable=False, role=None)[source]¶
Bases:
QActionA convenience class for creating a QAction
- Parameters:
- class pyspread.actions.ChartDialogActions(parent)[source]¶
Bases:
AttrDictQActions for chart dialog
Reads out template files in share/templates/matplotlib and adds a QAction for each template.
- Parameters:
parent (
QWidget) – The parent object
- class pyspread.actions.MainWindowActions(parent, shortcuts=True)[source]¶
Bases:
AttrDictHolds all QActions for the main window
- Parameters:
parent (
QWidget) – The parent object, normallypyspread.MainWindowshortcuts (
bool) – Enable shortcuts for actions
Disables unavailable menu items e.g. due to missing dependencies
pyspread.cli module¶
Provides
PathAction:CommandLineParser:
- class pyspread.cli.PyspreadArgumentParser[source]¶
Bases:
ArgumentParserParser for the command line
pyspread.commands module¶
Pyspread undoable commands
Provides
SetColumnWidthSetRowHeight
- class pyspread.commands.DeleteColumns(grid, model, index, column, count, description)[source]¶
Bases:
QUndoCommandDeletes grid columns
- Parameters:
grid (
QTableView) – The main grid objectmodel (
QAbstractTableModel) – Model of the grid objectindex (
QModelIndex) – Parent from which the new columns are deletedcolumn (
int) – Column number of the first column to be deletedcount (
int) – Number of columns to be deleteddescription (
str) – Command description
- class pyspread.commands.DeleteRows(grid, model, index, row, count, description)[source]¶
Bases:
QUndoCommandDeletes grid rows
- Parameters:
- class pyspread.commands.DeleteSelectedCellData(grid, model, selection, description)[source]¶
Bases:
QUndoCommandDelete selected cells
- Parameters:
- class pyspread.commands.DeleteTable(grid, model, table, description)[source]¶
Bases:
QUndoCommandDeletes table
- Parameters:
- class pyspread.commands.FreezeCell(model, cells, description)[source]¶
Bases:
QUndoCommandFreezes cell in grid
- Parameters:
- class pyspread.commands.InsertColumns(grid, model, index, column, count, description)[source]¶
Bases:
QUndoCommandInserts grid columns
- Parameters:
grid (
QTableView) – The main grid objectmodel (
QAbstractTableModel) – Model of the grid objectindex (
QModelIndex) – Parent into which the new columns are insertedcolumn (
int) – Column number of the first column after insertioncount (
int) – Number of columns to be inserteddescription (
str) – Command description
- class pyspread.commands.InsertRows(grid, model, index, row, count, description)[source]¶
Bases:
QUndoCommandInserts grid rows
- Parameters:
grid (
QTableView) – The main grid objectmodel (
QAbstractTableModel) – Model of the grid objectindex (
QModelIndex) – Parent into which the new rows are insertedrow (
int) – Row number that first row will have after insertioncount (
int) – Number of rows to be inserteddescription (
str) – Command description
- class pyspread.commands.InsertTable(grid, model, table, description)[source]¶
Bases:
QUndoCommandInserts table
- Parameters:
- class pyspread.commands.MakeButtonCell(grid, text, index, description)[source]¶
Bases:
QUndoCommandMakes a button cell
- Parameters:
- class pyspread.commands.PasteSelectedCellData(grid, model, selection, data, description)[source]¶
Bases:
QUndoCommandPaste selected cells
- Parameters:
- class pyspread.commands.RemoveButtonCell(grid, index, description)[source]¶
Bases:
QUndoCommandRemoves a button cell
- Parameters:
grid (
QTableView) – Main grid objectindex (
QModelIndex) – Index of the cell where a button cell is removeddescription (
str) – Command description
- class pyspread.commands.SetCellCode(code, model, index, description)[source]¶
Bases:
QUndoCommandSets cell code in grid
- Parameters:
- class pyspread.commands.SetCellFormat(attr, model, index, selected_idx, description)[source]¶
Bases:
QUndoCommandSets cell format in grid
Format is set for one given cell and a selection.
- Parameters:
attr (
CellAttribute) – Cell format to be setmodel (
QAbstractTableModel) – Model of the grid objectindex (
QModelIndex) – Index of the cell for which the format is setselected_idx (
Iterable[QModelIndex]) – Indexes of cells for which the format is setdescription (
str) – Command description
- class pyspread.commands.SetCellMerge(attr, model, index, selected_idx, description)[source]¶
Bases:
SetCellFormatSets cell merges in grid
- Parameters:
attr (
CellAttribute) – Cell format to be setmodel (
QAbstractTableModel) – Model of the grid objectindex (
QModelIndex) – Index of the cell for which the format is setselected_idx (
Iterable[QModelIndex]) – Indexes of cells for which the format is setdescription (
str) – Command description
- class pyspread.commands.SetCellRenderer(attr, model, entry_line, highlighter_document, index, selected_idx, description)[source]¶
Bases:
QUndoCommandSets cell renderer in grid
Adjusts syntax highlighting in entry line.
- Parameters:
attr (
CellAttribute) – Cell format that cointains target renderer informationmodel (
QAbstractTableModel) – Model of the grid objectentry_line (
QPlainTextEdit) – Entry line in main windowhighlighter_document (
QTextDocument) – Document for entry lineindex (
QModelIndex) – Index of the cell for which the renderer is setselected_idx (
Iterable[QModelIndex]) – Indexes of cells for which the renderer is setdescription (
str) – Command description
- class pyspread.commands.SetCellTextAlignment(attr, model, index, selected_idx, description)[source]¶
Bases:
SetCellFormatSets cell text alignment in grid
- Parameters:
attr (
CellAttribute) – Cell format to be setmodel (
QAbstractTableModel) – Model of the grid objectindex (
QModelIndex) – Index of the cell for which the format is setselected_idx (
Iterable[QModelIndex]) – Indexes of cells for which the format is setdescription (
str) – Command description
- class pyspread.commands.SetColumnsWidth(grid, columns, table, old_width, new_width, description)[source]¶
Bases:
QUndoCommandSets column width in grid
- Parameters:
- class pyspread.commands.SetGridSize(grid, old_shape, new_shape, description)[source]¶
Bases:
QUndoCommandSets size of grid
- Parameters:
- class pyspread.commands.SetRowsHeight(grid, rows, table, old_height, new_height, description)[source]¶
Bases:
QUndoCommandSets rows height in grid
- Parameters:
- class pyspread.commands.ThawCell(model, cells, description)[source]¶
Bases:
FreezeCellThaw (unfreezes) cell in grid
- Parameters:
pyspread.dialogs module¶
Modal dialogs
- class pyspread.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
- buttons¶
alias of
StandardButton
- property choice: bool¶
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
- choices = 81920¶
- 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 pyspread.dialogs.CellKeyDialog(parent, shape)[source]¶
Bases:
DataEntryDialogModal dialog for entering a cell key, i.e. row, column, table
- Parameters:
- class pyspread.dialogs.ChartDialog(parent, key, size=(1000, 700))[source]¶
Bases:
QDialogThe chart dialog
- Parameters:
- class pyspread.dialogs.CsvExportAreaDialog(parent, grid, title)[source]¶
Bases:
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 area: SinglePageArea | MultiPageArea¶
Executes the dialog and returns top, left, bottom, right
Returns None if the dialog is canceled.
- area_cls¶
alias of
SinglePageArea
- groupbox_title = 'Page area'¶
- labels = ['Top', 'Left', 'Bottom', 'Right']¶
- class pyspread.dialogs.CsvExportDialog(parent, csv_area)[source]¶
Bases:
QDialogModal dialog for exporting csv files
- Parameters:
parent (
QWidget) – Parent windowcsv_area (
SinglePageArea) – Grid area to be exported
- create_buttonbox()[source]¶
Returns button box with Reset, Apply, Ok, Cancel
- Return type:
QDialogButtonBox
- maxrows = 10¶
- title = 'CSV export'¶
- class pyspread.dialogs.CsvFileImportDialog(main_window)[source]¶
Bases:
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 pyspread.dialogs.CsvImportDialog(parent, filepath, digest_types=None)[source]¶
Bases:
QDialogModal dialog for importing csv files
- Parameters:
- title = 'CSV import'¶
- class pyspread.dialogs.CsvParameterGroupBox(parent)[source]¶
Bases:
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_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'¶
- 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 pyspread.dialogs.CsvTable(parent)[source]¶
Bases:
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 pyspread.dialogs.DataEntryDialog(parent, title, labels, initial_data=None, groupbox_title=None, validators=None)[source]¶
Bases:
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 (
Sequence[str]) – Initial values to be displayed in the dialogvalidators (
Sequence[Union[QValidator,bool,None]]) – Validators for the editors of the dialog
len(initial_data), len(validators) and len(labels) must be equal
- class pyspread.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
- buttons¶
alias of
StandardButton
- property choice: bool¶
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
- choices = 12584960¶
- default_choice = 2048¶
- text = 'There are unsaved changes.\nDo you want to save?'¶
- title = 'Unsaved changes'¶
- class pyspread.dialogs.DiscardDataDialog(main_window, text)[source]¶
Bases:
DiscardChangesDialogModal dialog that asks if the user wants to discard data
- Parameters:
main_window (
QMainWindow) – Application main windowtext (
str) – Message text
- buttons¶
alias of
StandardButton
- choices = 12582912¶
- default_choice = 4194304¶
- title = 'Data to be discarded'¶
- class pyspread.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)', 'Office Open XML - Tabellendokument (*.xlsx)']¶
- selected_filter = None¶
- title = 'Choose file'¶
- class pyspread.dialogs.FileExportDialog(main_window, filters_list)[source]¶
Bases:
FileDialogBaseModal dialog for exporting csv files
- Parameters:
- title = 'Export data'¶
- class pyspread.dialogs.FileOpenDialog(main_window)[source]¶
Bases:
FileDialogBaseModal dialog for opening a pyspread file
- Parameters:
main_window (
QMainWindow) – Application main window
- title = 'Open'¶
- class pyspread.dialogs.FileSaveDialog(main_window)[source]¶
Bases:
FileDialogBaseModal dialog for saving a pyspread file
- Parameters:
main_window (
QMainWindow) – Application main window
- title = 'Save'¶
- class pyspread.dialogs.FindDialog(main_window)[source]¶
Bases:
QDialogFind dialog that is launched from the main menu
- Parameters:
main_window (
QMainWindow) – Application main window
- class pyspread.dialogs.FindDialogState(pos, case, results, more, backward, word, regex, start)[source]¶
Bases:
objectDataclass for FindDialog state storage
- pos: QPoint¶
- class pyspread.dialogs.GridShapeDialog(parent, shape, title='Create a new Grid')[source]¶
Bases:
DataEntryDialogModal dialog for entering the number of rows, columns and tables
- Parameters:
- class pyspread.dialogs.ImageFileOpenDialog(main_window)[source]¶
Bases:
FileDialogBaseModal dialog for inserting an image
- Parameters:
main_window (
QMainWindow) – Application main window
- img_format_string = '*.bmp *.cur *.ico *.jfif *.jpeg *.jpg *.pbm *.pgm *.png *.ppm *.xbm *.xpm'¶
- img_format_strings = <generator object ImageFileOpenDialog.<genexpr>>¶
- img_formats = [PyQt6.QtCore.QByteArray(b'bmp'), PyQt6.QtCore.QByteArray(b'cur'), PyQt6.QtCore.QByteArray(b'ico'), PyQt6.QtCore.QByteArray(b'jfif'), PyQt6.QtCore.QByteArray(b'jpeg'), PyQt6.QtCore.QByteArray(b'jpg'), PyQt6.QtCore.QByteArray(b'pbm'), PyQt6.QtCore.QByteArray(b'pgm'), PyQt6.QtCore.QByteArray(b'png'), PyQt6.QtCore.QByteArray(b'ppm'), PyQt6.QtCore.QByteArray(b'xbm'), PyQt6.QtCore.QByteArray(b'xpm')]¶
- name_filter = 'Images (*.bmp *.cur *.ico *.jfif *.jpeg *.jpg *.pbm *.pgm *.png *.ppm *.xbm *.xpm);;Scalable Vector Graphics (*.svg *.svgz)'¶
- title = 'Insert image'¶
- class pyspread.dialogs.ManualDialog(parent)[source]¶
Bases:
TutorialDialogDialog for browsing the pyspread manual
- Parameters:
parent (
QWidget) – Parent window
- size_hint = (1000, 800)¶
- title2path = {'Advanced topics': PosixPath('/builds/pyspread/pyspread/pyspread/share/doc/manual/advanced_topics.md'), 'Concepts': PosixPath('/builds/pyspread/pyspread/pyspread/share/doc/manual/basic_concepts.md'), 'Edit': PosixPath('/builds/pyspread/pyspread/pyspread/share/doc/manual/edit_menu.md'), 'File': PosixPath('/builds/pyspread/pyspread/pyspread/share/doc/manual/file_menu.md'), 'Format': PosixPath('/builds/pyspread/pyspread/pyspread/share/doc/manual/format_menu.md'), 'Macro': PosixPath('/builds/pyspread/pyspread/pyspread/share/doc/manual/macro_menu.md'), 'Overview': PosixPath('/builds/pyspread/pyspread/pyspread/share/doc/manual/overview.md'), 'View': PosixPath('/builds/pyspread/pyspread/pyspread/share/doc/manual/view_menu.md'), 'Workspace': PosixPath('/builds/pyspread/pyspread/pyspread/share/doc/manual/workspace.md')}¶
- window_title = 'pyspread manual'¶
- class pyspread.dialogs.MultiPageArea(top, left, bottom, right, first, last)[source]¶
Bases:
SinglePageAreaHolds multi page area boundaries e.g. for printing
- class pyspread.dialogs.PreferencesDialog(parent)[source]¶
Bases:
DataEntryDialogModal dialog for entering pyspread preferences
- Parameters:
parent (
QWidget) – Parent widget, e.g. main window
- class pyspread.dialogs.PrintAreaDialog(parent, grid, title)[source]¶
Bases:
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
- area_cls¶
alias of
MultiPageArea
- labels = ['Top', 'Left', 'Bottom', 'Right', 'First table', 'Last table']¶
- class pyspread.dialogs.PrintPreviewDialog(printer)[source]¶
Bases:
QPrintPreviewDialogAdds Mouse wheel functionality
- Parameters:
printer (
QPrinter) – Target printer
- class pyspread.dialogs.ReplaceDialog(main_window)[source]¶
Bases:
FindDialogReplace dialog that is launched from the main menu
- Parameters:
main_window (
QMainWindow) – Application main window
- class pyspread.dialogs.SinglePageArea(top, left, bottom, right)[source]¶
Bases:
objectHolds single page area boundaries e.g. for export
- class pyspread.dialogs.SvgExportAreaDialog(parent, grid, title)[source]¶
Bases:
CsvExportAreaDialogModal dialog for entering svg 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
- groupbox_title = 'SVG export area'¶
- class pyspread.dialogs.TupleValidator(*acceptable_values)[source]¶
Bases:
QValidatorValidator for a tuple of values, normally strings
pyspread.entryline module¶
Provides
- class pyspread.entryline.Entryline(main_window)[source]¶
Bases:
SpellTextEditThe entry line for pyspread
- Parameters:
main_window (
QMainWindow) – Application main window
- eventFilter(source, event)[source]¶
Quotes editor content for <Ctrl>+<Enter> and <Ctrl>+<Return>
Overrides SpellTextEdit default shortcut. Counts as undoable action.
- Parameters:
source (
QWidget) – Source widget of eventevent (
QEvent) – Event to be filtered
- on_toggle_spell_check(signal)[source]¶
Spell check toggle event handler
- Parameters:
signal (
bool) – Spell check is enabled if True
pyspread.grid module¶
Pyspread’s main grid
Provides
Grid: QTableView of the main gridGridHeaderView: QHeaderView for the main grids headersGridTableModel: QAbstractTableModel linking the view to code_array backendGridCellDelegate: QStyledItemDelegate handling custom painting and editorsTableChoice: The TabBar below the main grid
- class pyspread.grid.Grid(main_window, model=None)[source]¶
Bases:
QTableViewThe main grid of pyspread
- Parameters:
main_window (
QMainWindow) – Application main windowmodel – GridTableModel for grid
- closeEditor(editor, hint)[source]¶
Overrides QTableView.closeEditor
- Changes to overridden behavior:
Data is submitted when a cell is changed without pressing <Enter> e.g. by mouse click or arrow keys.
- Parameters:
editor (
QWidget) – Editor to be closedhint (
EndEditHint) – Hint to be overridden if == QAbstractItemDelegate.NoHint
- property column_widths: List[Tuple[int, float]]¶
Returns list of tuples (col_index, col_width) for current table
- contextMenuEvent(event)[source]¶
Overrides contextMenuEvent to install GridContextMenu
- Parameters:
event (
QContextMenuEvent) – Context menu event
- has_selection()[source]¶
Returns True if more than one cell is selected, else False
This method handles spanned/merged cells. One single cell that is selected is considered as no cell being selected.
- Return type:
- keyPressEvent(event)[source]¶
Overrides QTableView.keyPressEvent
- Changes to overridden behavior:
If Shift is pressed, the cell in the next column is selected.
If Shift is not pressed, the cell in the next row is selected.
- Parameters:
event (
QKeyEvent) – Key event
- on_bold_pressed(toggled)[source]¶
Bold button pressed event handler
- Parameters:
toggled (
bool) – Toggle state
- on_button_cell_pressed(toggled)[source]¶
Button cell event handler
- Parameters:
toggled (
bool) – Toggle state
- on_delete_shift_cells_left(*, description_tpl='Delete selection {} and shift cells left')[source]¶
Delete cells and shift right cells left event handler
- Parameters:
description_tpl (
str) – Description template for QUndoCommand
- on_delete_shift_cells_up(*, description_tpl='Delete selection {} and shift cells up')[source]¶
Delete cells and shift below cells up event handler
- Parameters:
description_tpl (
str) – Description template for QUndoCommand
- on_format_default()[source]¶
Reset cell format to system theme by setting values to None
The merge status of cells is unaffected
- on_freeze_pressed(toggled)[source]¶
Freeze cell event handler
- Parameters:
toggled (
bool) – Toggle state
- on_italics_pressed(toggled)[source]¶
Italics button pressed event handler
- Parameters:
toggled (
bool) – Toggle state
- on_lock_pressed(toggled)[source]¶
Lock button pressed event handler
- Parameters:
toggled (
bool) – Toggle state
- on_shift_cells_down(*, description_tpl='Shift selection {} down')[source]¶
Insert shift cells down event handler
- Parameters:
description_tpl (
str) – Description template for QUndoCommand
- on_shift_cells_right(*, description_tpl='Shift selection {} right')[source]¶
Insert shift cells right event handler
- Parameters:
description_tpl (
str) – Description template for QUndoCommand
- on_show_frozen_pressed(toggled)[source]¶
Show frozen cells event handler
- Parameters:
toggled (
bool) – Toggle state
- on_strikethrough_pressed(toggled)[source]¶
Strikethrough button pressed event handler
- Parameters:
toggled (
bool) – Toggle state
- on_underline_pressed(toggled)[source]¶
Underline button pressed event handler
- Parameters:
toggled (
bool) – Toggle state
- property row_heights: List[Tuple[int, float]]¶
Returns list of tuples (row_index, row height) for current table
- set_selection_mode(value=True)[source]¶
Setter for selection mode for all grids
- Parameters:
value – If True, selection mode is set, if False unset
- toggle_selection_mode()[source]¶
Toggle selection mode for all grids
This method is required for accessing selection mode from QActions.
- class pyspread.grid.GridCellDelegate(main_window, grid, code_array)[source]¶
Bases:
QStyledItemDelegateQStyledItemDelegate for main grid QTableView
- Parameters:
- createEditor(parent, option, index)[source]¶
Overloads QStyledItemDelegate
Disables editor in locked cells Switches to chart dialog in chart cells
- Parameters:
parent (
QWidget) – Parent widget for the cell editor to be returnedoption (
QStyleOptionViewItem) – Style option for the cell editorindex (
QModelIndex) – Index of cell for which a cell editor is created
- Return type:
QWidget
- eventFilter(source, event)[source]¶
Overloads eventFilter. Overrides QLineEdit default shortcut.
Quotes cell editor content for <Ctrl>+<Enter> and <Ctrl>+<Return>. Counts as undoable action.
- Parameters:
source (
QObject) – Source widget of eventevent (
QEvent) – Any QEvent
- Return type:
- paint(painter, option, index)[source]¶
Overloads QStyledItemDelegate to add cell border painting
- Parameters:
painter (
QPainter) – Painter with which borders are drawnoption (
QStyleOptionViewItem) – Style option for renderingindex (
QModelIndex) – Index of cell to be rendered
- paint_(painter, rect, option, index)[source]¶
Calls the overloaded paint function or creates html delegate
- Parameters:
painter (
QPainter) – Painter with which borders are drawnrect (
QRectF) – Cell rect of the cell to be paintedoption (
QStyleOptionViewItem) – Style option for renderingindex (
QModelIndex) – Index of cell for which borders are drawn
- setEditorData(editor, index)[source]¶
Overloads setEditorData to use code_array data
- Parameters:
editor (
QWidget) – Cell editor, in which data is setindex (
QModelIndex) – Index of cell from which the cell editor data is set
- setModelData(editor, model, index)[source]¶
Overloads setModelData to use code_array data
- Parameters:
editor (
QWidget) – Cell editor, from which data is retrievedmodel (
QAbstractItemModel) – GridTableModelindex (
QModelIndex) – Index of cell for which data is set
- class pyspread.grid.GridHeaderView(orientation, grid)[source]¶
Bases:
QHeaderViewQHeaderView with zoom support
- Parameters:
orientation (
Orientation) – Orientation of the QHeaderViewgrid (
Grid) – The main grid widget
- contextMenuEvent(event)[source]¶
Overrides contextMenuEvent
Installs HorizontalHeaderContextMenu or VerticalHeaderContextMenu depending on self.orientation().
- Parameters:
event (
QContextMenuEvent) – The triggering event
- paintSection(painter, rect, logicalIndex)[source]¶
Overrides paintSection, which supports zoom
- Parameters:
painter (
QPainter) – Painter with which the section is drawnrect (
QRect) – Outer rectangle of the section to be drawnlogicalIndex (
int) – Index of the section to be drawn
- class pyspread.grid.GridTableModel(main_window, shape)[source]¶
Bases:
QAbstractTableModelQAbstractTableModel for Grid
- Parameters:
- code(index)[source]¶
Code in cell index
- Parameters:
index (
QModelIndex) – Index of the cell for which the code is returned- Return type:
- columnCount(_=<PyQt6.QtCore.QModelIndex object>)[source]¶
Overloaded QAbstractItemModel.columnCount for code_array backend
- Return type:
- data(index, role=ItemDataRole.DisplayRole)[source]¶
Overloaded data for code_array backend
- Parameters:
index (
QModelIndex) – Index of the cell, for which data is returnedrole (
ItemDataRole) – Role of data to be returned
- Return type:
- flags(index)[source]¶
Overloaded, makes items editable
- Parameters:
index (
QModelIndex) – Index of cell for which flags are returned- Return type:
ItemFlag
- insertColumns(column, count)[source]¶
Overloaded QAbstractItemModel.insertColumns for code_array backend
- inserting_columns(index, first, last)[source]¶
Context manager for inserting columns
see QAbstractItemModel.beginInsertColumns
- inserting_rows(index, first, last)[source]¶
Context manager for inserting rows
see QAbstractItemModel.beginInsertRows
- removeColumns(column, count)[source]¶
Overloaded QAbstractItemModel.removeColumns for code_array backend
- removing_columns(index, first, last)[source]¶
Context manager for removing columns
see QAbstractItemModel.beginRemoveColumns
- removing_rows(index, first, last)[source]¶
Context manager for removing rows
see QAbstractItemModel.beginRemoveRows
- rowCount(_=<PyQt6.QtCore.QModelIndex object>)[source]¶
Overloaded QAbstractItemModel.rowCount for code_array backend
- Return type:
- class pyspread.grid.TableChoice(main_window, no_tables)[source]¶
Bases:
QTabBarThe TabBar below the main grid
- Parameters:
main_window (
QMainWindow) – Application main windowno_tables (
int) – Number of tables to be initially created
- contextMenuEvent(event)[source]¶
Overrides contextMenuEvent to install GridContextMenu
- Parameters:
event (
QContextMenuEvent) – Triggering event
pyspread.grid_renderer module¶
Provides
- func:
painter_save: Context manager saving and restoring painter state
- func:
painter_zoom: Context manager scaling and restoring the painter
- func:
painter_rotate: Context manager rotating and restoring the painter
GridCellNavigator: Find neighbors of a cell
EdgeBorders: Dataclass for edge properties
CellEdgeRenderer: Paints cell edges
QColorCache: QColor cache
CellRenderer: Paints cells
- class pyspread.grid_renderer.BorderColorBottomCache(grid, *args, **kwargs)[source]¶
Bases:
BorderWidthBottomCacheBorderColorBottomCache cache
- class pyspread.grid_renderer.BorderColorRightCache(grid, *args, **kwargs)[source]¶
Bases:
BorderWidthBottomCacheBorderColorBottomCache cache
- class pyspread.grid_renderer.BorderWidthBottomCache(grid, *args, **kwargs)[source]¶
Bases:
dictBorderWidthBottom cache
- class pyspread.grid_renderer.BorderWidthRightCache(grid, *args, **kwargs)[source]¶
Bases:
BorderWidthBottomCacheBorderWidthRight cache
- class pyspread.grid_renderer.CellEdgeRenderer(painter, center, borders, rect, clip_path, zoom)[source]¶
Bases:
objectPaints cell edges
Borders are provided by EdgeBorders in order: left, right, top, bottom
- Parameters:
painter (
QPainter) – Painter with which edge is drawncenter (
QPointF) – Edge centerborders (
EdgeBorders) – Border widths and colorsrect (
QRectF) – Rect of the clip_pathclip_path (
QPainterPath) – Clip rectangle that is required for QtSVG clippingzoom (
float) – Current zoom level
- intersection_cache = {}¶
- class pyspread.grid_renderer.CellRenderer(grid, painter, option, index)[source]¶
Bases:
objectPaints cells
Cell rendering governs the area of a cell inside its borders. It is done in a vector oriented way.
Therefore, the following conventions shall apply:
Cell borders of width 1 shall be painted so that they appear only in the bottom and right edge of the cell.
Cell borders of all widths have the same center line.
Cell borders that are thicker than 1 are painted on all borders.
At the edges, borders are painted in the following order: 1. Thin borders are painted first 2. If border width is equal, lighter colors are painted first
- Parameters:
grid (
QTableView) – The main grid widgetpainter (
QPainter) – Painter with which borders are drawnoption (
QStyleOptionViewItem) – Style option for renderingindex (
QModelIndex) – Index of cell to be rendered
- inner_rect(rect)[source]¶
Returns inner rect that is shrunk by border widths
For merged cells, minimum top/left border widths are taken into account
- Parameters:
rect (
QRectF) – Cell rect to be shrunk- Return type:
QRectF
- paint_above_borders(rect, clip_path)[source]¶
Paint lower borders of all above cells
- Parameters:
rect (
QRectF) – Cell rect of below cell, in which the borders are paintedclip_path (
QPainterPath) – Clip rectangle that is requuired for QtSVG clipping
- paint_bottom_border(rect, clip_path)[source]¶
Paint bottom border of cell
- Parameters:
rect (
QRectF) – Cell rect of the cell to be paintedclip_path (
QPainterPath) – Clip rectangle that is required for QtSVG clipping
- paint_bottom_left_edge(rect, clip_path)[source]¶
Paints bottom left edge of the cell
- Parameters:
rect (
QRectF) – Cell rect of cell, for which the edge is paintedclip_path (
QPainterPath) – Clip rectangle that is requuired for QtSVG clipping
Cell layout:
top L | C left ------------ right BL | B bottom
- paint_bottom_right_edge(rect, clip_path)[source]¶
Paints bottom right edge of the cell
- Parameters:
rect (
QRectF) – Cell rect of cell, for which the edge is paintedclip_path (
QPainterPath) – Clip rectangle that is requuired for QtSVG clipping
Cell layout:
top C | R left ----------- right B | BR bottom
- paint_left_borders(rect, clip_path)[source]¶
Paint right borders of all left cells
- Parameters:
rect (
QRectF) – Cell rect of right cell, in which the borders are paintedclip_path (
QPainterPath) – Clip rectangle that is requuired for QtSVG clipping
- paint_right_border(rect, clip_path)[source]¶
Paint right border of cell
- Parameters:
rect (
QRectF) – Cell rect of the cell to be paintedclip_path (
QPainterPath) – Clip rectangle that is requuired for QtSVG clipping
- class pyspread.grid_renderer.EdgeBorders(left_width, right_width, top_width, bottom_width, left_color, right_color, top_color, bottom_color, left_x, right_x, top_y, bottom_y)[source]¶
Bases:
objectHolds border data for an edge and provides effective edge properties
Bases:
objectFind neighbors of a cell
- Parameters:
Color of bottom border line
Color of right border line
Width of bottom border line
Width of right border line
Merge area of the key cell
Merging cell if cell is merged else cell key
- class pyspread.grid_renderer.QColorCache(grid, *args, **kwargs)[source]¶
Bases:
dictQColor cache that returns placeholder text color for None
- pyspread.grid_renderer.painter_rotate(painter, rect, angle=0)[source]¶
Context manager rotating and restoring the painter
- Parameters:
painter (
QPainter) – Painter, which is rotatedrect (
QRectF) – Rect to be painted inangle (
int) – Rotataion angle must be in (0, 90, 180, 270)
- Return type:
QRectF
- pyspread.grid_renderer.painter_save(painter)[source]¶
Context manager saving and restoring painter state
- Parameters:
painter (
QPainter) – Painter, for which the state is preserved
- pyspread.grid_renderer.painter_zoom(painter, zoom, rect)[source]¶
Context manager scaling and restoring the painter
(rect.x(), rect.y()) is invariant
- Parameters:
painter (
QPainter) – Painter, for which the state is preservedzoom (
float) – Zoom factorrect (
QRectF) – Rect for setting zoom invariant point (rect.x(), rect.y())
- Return type:
QRectF
pyspread.icons module¶
Provides
- class pyspread.icons.Icon[source]¶
Bases:
objectProvides QIcons as attributes for all attributes of IconPaths
- class pyspread.icons.IconConverter[source]¶
Bases:
typeMeta class that provides QIcons for IconPaths icons
- class pyspread.icons.IconPath[source]¶
Bases:
objectHolds icon paths as attributes
- align_bottom = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-text-align-bottom.svg')¶
- align_center = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-text-align-center.svg')¶
- align_top = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-text-align-top.svg')¶
- approve = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/document-approve.svg')¶
- background_color = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-background-color.svg')¶
- bold = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-text-bold.svg')¶
- button = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-button.svg')¶
- chart_area_1_1 = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/charts/chart_area_1_1.svg')¶
- chart_bar_1_3 = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/charts/chart_bar_1_3.svg')¶
- chart_boxplot_2_2 = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/charts/chart_boxplot_2_2.svg')¶
- chart_bubble_1_1 = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/charts/chart_bubble_1_1.svg')¶
- chart_column_1_1 = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/charts/chart_column_1_1.svg')¶
- chart_column_1_2 = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/charts/chart_column_1_2.svg')¶
- chart_contour_1_2 = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/charts/chart_contour_1_2.svg')¶
- chart_histogram_1_1 = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/charts/chart_histogram_1_1.svg')¶
- chart_histogram_1_4 = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/charts/chart_histogram_1_4.svg')¶
- chart_line_1_1 = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/charts/chart_line_1_1.svg')¶
- chart_matrix_1_1 = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/charts/chart_matrix_1_1.svg')¶
- chart_pie_1_1 = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/charts/chart_pie_1_1.svg')¶
- chart_plotnine_geom_bar_1_1 = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/charts/chart_plotnine_geom_bar_1_1.svg')¶
- chart_polar_1_1 = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/charts/chart_polar_1_1.svg')¶
- chart_r_ggplot2_geom_boxplot_1_2 = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/charts/chart_r_ggplot2_geom_boxplot_1_2.svg')¶
- chart_r_ggplot2_geom_density2d_1_2 = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/charts/chart_r_ggplot2_geom_density2d_1_2.svg')¶
- chart_r_ggplot2_geom_point_1_1 = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/charts/chart_r_ggplot2_geom_point_1_1.svg')¶
- chart_r_graphics_barplot_1_1 = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/charts/chart_r_graphics_barplot_1_1.svg')¶
- chart_r_lattice_wireframe_2_1 = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/charts/chart_r_lattice_wireframe_2_1.svg')¶
- chart_r_lattice_xyplot_1_1 = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/charts/chart_r_lattice_xyplot_1_1.svg')¶
- chart_ring_1_1 = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/charts/chart_ring_1_1.svg')¶
- chart_scatter_1_1 = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/charts/chart_scatter_1_1.svg')¶
- chart_scatterhist_1_1 = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/charts/chart_scatterhist_1_1.svg')¶
- chart_surface_2_1 = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/charts/chart_surface_2_1.svg')¶
- check_spelling = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/view-check-spelling.svg')¶
- clear_globals = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/edit-clear.svg')¶
- clone_formatting = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/edit-clone-formatting.svg')¶
- copy = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/edit-copy.svg')¶
- copy_format = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-copy.svg')¶
- copy_results = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/edit-copy-results.svg')¶
- cut = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/edit-cut.svg')¶
- date = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/macro-date.svg')¶
- datetime = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/macro-datetime.svg')¶
- default_format = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-default.svg')¶
- delete_column = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/edit-delete-column.svg')¶
- delete_row = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/edit-delete-row.svg')¶
- delete_table = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/edit-delete-table.svg')¶
- dependencies = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/help-dependencies.svg')¶
- export = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/document-export.svg')¶
- faq = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/help-faq.svg')¶
- find = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/edit-find.svg')¶
- find_next = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/edit-find-next.svg')¶
- font_dialog = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-font.svg')¶
- format_borders = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-borders-4.svg')¶
- format_borders_0 = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-borders-0.svg')¶
- format_borders_1 = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-borders-1.svg')¶
- format_borders_16 = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-borders-16.svg')¶
- format_borders_2 = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-borders-2.svg')¶
- format_borders_32 = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-borders-32.svg')¶
- format_borders_4 = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-borders-4.svg')¶
- format_borders_64 = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-borders-64.svg')¶
- format_borders_8 = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-borders-8.svg')¶
- format_borders_all = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-borders-all.svg')¶
- format_borders_bottom = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-borders-bottom.svg')¶
- format_borders_inner = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-borders-inner.svg')¶
- format_borders_left = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-borders-left.svg')¶
- format_borders_outer = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-borders-outer.svg')¶
- format_borders_right = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-borders-right.svg')¶
- format_borders_top = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-borders-top.svg')¶
- format_borders_top_bottom = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-borders-top-bottom.svg')¶
- freeze = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-freeze.svg')¶
- fullscreen = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/view-fullscreen.svg')¶
- goto_cell = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/view-goto-cell.svg')¶
- help = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/help-browser.svg')¶
- image = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-cell-image.svg')¶
- imprt = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/document-import.svg')¶
- insert_chart = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/macro-insert-chart.svg')¶
- insert_column = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/edit-insert-column.svg')¶
- insert_image = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/macro-insert-image.svg')¶
- insert_row = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/edit-insert-row.svg')¶
- insert_sum = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/macro-insert-sum.svg')¶
- insert_table = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/edit-insert-table.svg')¶
- italics = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-text-italic.svg')¶
- justify_center = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-justify-center.svg')¶
- justify_fill = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-justify-fill.svg')¶
- justify_left = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-justify-left.svg')¶
- justify_right = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-justify-right.svg')¶
- line_color = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-line-color.svg')¶
- link_image = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/macro-link-image.svg')¶
- lock = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-lock.svg')¶
- markup = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-cell-markup.svg')¶
- matplotlib = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-cell-chart.svg')¶
- merge_cells = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-merge-cells.svg')¶
- money = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/macro-money.svg')¶
- new = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/document-new.svg')¶
- new_gpg_key = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/document-new-gpg-key.svg')¶
- open = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/document-open.svg')¶
- page_setup = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/document-page-setup.svg')¶
- paste = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/edit-paste.svg')¶
- paste_as = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/edit-paste-as.svg')¶
- paste_format = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-paste.svg')¶
- preferences = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/document-properties.svg')¶
- print = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/document-print.svg')¶
- print_preview = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/document-print-preview.svg')¶
- pyspread = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/hicolor/svg/pyspread.svg')¶
- quit = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/document-log-out.svg')¶
- quote = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/macro-quote.svg')¶
- redo = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/edit-redo.svg')¶
- refresh = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/view-refresh.svg')¶
- replace = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/edit-find-replace.svg')¶
- resize_grid = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/edit-resize-grid.svg')¶
- rotate_0 = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-cell-rotate-0.svg')¶
- rotate_180 = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-cell-rotate-180.svg')¶
- rotate_270 = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-cell-rotate-270.svg')¶
- rotate_90 = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-cell-rotate-90.svg')¶
- safe_mode = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/status/status-safe-mode.svg')¶
- save = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/document-save.svg')¶
- save_as = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/document-save-as.svg')¶
- select_all = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/edit-select-all.svg')¶
- selection_mode = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/status/status-selection-mode.svg')¶
- shift_down = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/edit-shift-down.svg')¶
- shift_left = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/edit-shift-left.svg')¶
- shift_right = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/edit-shift-right.svg')¶
- shift_up = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/edit-shift-up.svg')¶
- show_frozen = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/view-show-frozen.svg')¶
- sort_ascending = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/edit-sort-ascending.svg')¶
- sort_descending = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/edit-sort-descending.svg')¶
- strikethrough = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-text-strikethrough.svg')¶
- text = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-cell-text.svg')¶
- text_color = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-text-color.svg')¶
- time = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/macro-time.svg')¶
- toggle_periodic_updates = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/view-timer.svg')¶
- tutorial = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/help-tutorial.svg')¶
- underline = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/format-text-underline.svg')¶
- undo = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/edit-undo.svg')¶
- zoom_1 = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/view-zoom-original.svg')¶
- zoom_in = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/view-zoom-in.svg')¶
- zoom_out = PosixPath('/builds/pyspread/pyspread/pyspread/share/icons/actions/view-zoom-out.svg')¶
pyspread.installer module¶
Provides
- class pyspread.installer.DependenciesDialog(parent=None)[source]¶
Bases:
QDialogDependencies dialog for python dependencies
- Parameters:
parent (
QWidget) – Parent widget
- column = {'button': 0, 'description': 5, 'name': 2, 'required_version': 4, 'status': 1, 'version': 3}¶
- column_headers = ('', 'Status', 'Package', 'Version', 'Required', 'Description')¶
- class pyspread.installer.InstallPackageDialog(parent=None, module=None)[source]¶
Bases:
QDialogShows a dialog to execute command
- Parameters:
parent – Parent widget
module – Module to be installed
- line_str = '--------------------------------------------------------'¶
pyspread.main_window module¶
pyspread¶
Main Python spreadsheet application
Run this script to start the application.
Provides
MainApplication: Initial command line operations and application launch
MainWindow: Main windows class
- class pyspread.main_window.MainWindow(filepath=PosixPath('.'), default_settings=False)[source]¶
Bases:
QMainWindowPyspread main window
- Parameters:
- closeEvent(event=None)[source]¶
Overloaded, allows saving changes or canceling close
- Parameters:
event (
QEvent) – Any QEvent
- dragEnterEvent(event=None)[source]¶
Overloaded, accept the dragging of files into pyspread
- Parameters:
event (
QEvent) – Any QEvent
- dragMoveEvent(event=None)[source]¶
Overloaded, accept the moving of files over pyspread
- Parameters:
event (
QEvent) – Any QEvent
- dropEvent(event=None)[source]¶
Overloaded, catch the dropping of files into pyspread
- Parameters:
event (
QEvent) – Any QEvent
- eventFilter(source, event)[source]¶
Overloaded event filter for handling QDockWidget close events
Updates the menu if the macro panel is closed.
- Parameters:
source (
QWidget) – Source widget of eventevent (
QEvent) – Any QEvent
- Return type:
- property focused_grid¶
Returns grid with focus or self if none has focus
- on_gui_update(attributes)[source]¶
GUI update that shall be called on each cell change
- Parameters:
attributes (
CellAttributes) – Attributes of current cell
- on_paint_request(printer)[source]¶
Paints to printer
- Parameters:
printer (
QPrinter) – Target printer
- on_refresh_timer()[source]¶
Event handler for self.refresh_timer.timeout
Called for periodic updates of frozen cells. Does nothing if either the entry_line or a cell editor is active.
- on_toggle_entry_line_dock(toggled)[source]¶
Entryline toggle event handler
- Parameters:
toggled (
bool) – Toggle state
- on_toggle_find_toolbar(toggled)[source]¶
Find toolbar toggle event handler
- Parameters:
toggled (
bool) – Toggle state
- on_toggle_format_toolbar(toggled)[source]¶
Format toolbar toggle event handler
- Parameters:
toggled (
bool) – Toggle state
- on_toggle_gridheader_in_spreadsheet(toggled)[source]¶
Grid header format toggle event handler
- Parameters:
toggled (
bool) – Toggle state
- on_toggle_macro_dock(toggled)[source]¶
Macro panel toggle event handler
- Parameters:
toggled (
bool) – Toggle state
- on_toggle_macro_toolbar(toggled)[source]¶
Macro toolbar toggle event handler
- Parameters:
toggled (
bool) – Toggle state
- on_toggle_main_toolbar(toggled)[source]¶
Main toolbar toggle event handler
- Parameters:
toggled (
bool) – Toggle state
- on_toggle_refresh_timer(toggled)[source]¶
Toggles periodic timer for frozen cells
- Parameters:
toggled (
bool) – Toggle state
pyspread.panels module¶
Provides
pyspread.pyspread module¶
pyspread¶
Main Python spreadsheet application
Run this script to start the application.
Provides
MainApplication: Initial command line operations and application launch
MainWindow: Main windows class
pyspread.settings module¶
Provides
- class pyspread.settings.Settings(parent, reset_settings=False)[source]¶
Bases:
objectContains all global application states.
- Parameters:
parent (
QWidget) – Parent widget, normally main windowreset_settings (
bool) – Do not restore saved settings
- add_to_file_history(filename)[source]¶
Adds new file to history
- Parameters:
value – File name to be added to history
- border_choice = 'All borders'¶
The state of the border choice button
- changed_since_save = False¶
If True then File actions trigger a dialog
- currency_iso_code = ''¶
Default currency for Money shortcut
- default_column_width = 100¶
- default_encoding = 'utf-8'¶
Default encoding for exporting files (e.g. CSV)
- default_row_height = 30¶
- digest_types = None¶
List of default digest types for preprocessing values from CSV import
- 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')¶
Encodings for importing and exporting files (e.g. CSV or SVG)
- entry_line_font_family = 'Monospace'¶
Font family for entry line widget
- file_history = []¶
Files in file history
- find_dialog_state = None¶
Find dialog state - needs to be stored when dialog is closed
- font_sizes = (6, 8, 10, 12, 14, 16, 18, 20, 24, 28, 32)¶
Sizes
- highlighter_limit = 1000000¶
Maximum length of code, for which the netry line enables highlighting
- macro_editor_font_family = 'Monospace'¶
Font family for macro editor widget
- max_file_history = 5¶
Maximum number of files in file history
- maxshape = (1000000, 100000, 100)¶
Maximum shape of the grid
- print_zoom = None¶
- refresh_timeout = 1000¶
Timeout for frozen cell updates in milliseconds
- shape = (1000, 100, 3)¶
Default shape of initial grid (rows, columns, tables)
- show_frozen = False¶
If True then frozen cell background is striped
- show_statusbar_sum = True¶
- signature_key = None¶
Key for signing save files
- sniff_size = 65536¶
Number of bytes for csv sniffer sniff_size should be larger than 1st+2nd line
- timeout = 1000¶
Timeout for cell calculations in milliseconds
- toolbar_icon_size = 28¶
Size of toolbar icons
- widget_names = ['main_window', 'main_toolbar', 'find_toolbar', 'format_toolbar', 'macro_toolbar', 'entry_line', 'entry_line_dock']¶
Names of widgets with persistant states
- zoom_levels = (0.4, 0.5, 0.6, 0.7, 0.8, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.5, 3.0, 3.5, 4.0, 5.0, 6.0, 8.0)¶
pyspread.themes module¶
Themes for pyspread
Provides
ColorRoles: Maps attribute names to theme color roles
pyspread.toolbar module¶
Provides
- class pyspread.toolbar.ChartTemplatesToolBar(parent)[source]¶
Bases:
ToolBarBaseToolbar for chart dialog for inserting template chart code
- Parameters:
parent (
QWidget) – Parent widget, e.g. chart dialog window
- tooltip_tpl = 'Package {} required but not installed'¶
- class pyspread.toolbar.FindToolbar(main_window)[source]¶
Bases:
ToolBarBaseThe find toolbar for pyspread
- Parameters:
main_window (
QMainWindow) – Application main window
- class pyspread.toolbar.FormatToolbar(main_window)[source]¶
Bases:
ToolBarBaseThe format toolbar for pyspread
- Parameters:
main_window (
QMainWindow) – Application main window
- class pyspread.toolbar.MacroToolbar(main_window)[source]¶
Bases:
ToolBarBaseThe macro toolbar for pyspread
- Parameters:
main_window (
QMainWindow) – Application main window
- class pyspread.toolbar.MainToolBar(main_window)[source]¶
Bases:
ToolBarBaseThe main toolbar
- Parameters:
main_window (
QMainWindow) – Application main window
- class pyspread.toolbar.RChartTemplatesToolBar(parent)[source]¶
Bases:
ToolBarBaseToolbar for chart dialog for inserting R template chart code
Requires rpy2 with ggplot, lattice and graphics packages
- Parameters:
parent (
QWidget) – Parent widget, e.g. chart dialog window
- static is_r_package_installed(package_name)[source]¶
True if the R package is installed
- Parameters:
package_name – Name of R package to checked
- tooltip_tpl = 'R Package {} required but not installed'¶
- class pyspread.toolbar.ToolBarBase(title, parent, *args, **kwargs)[source]¶
Bases:
QToolBarBase toolbar class that provides toolbar manager button method
pyspread.widgets module¶
Provides
- class pyspread.widgets.AlignmentButton(main_window)[source]¶
Bases:
MultiStateBitmapButtonAlignment button for the format toolbar
- Parameters:
main_window (
QMainWindow) – Application main window
- action_names = ('align_top', 'align_center', 'align_bottom')¶
- label = 'Alignment'¶
- class pyspread.widgets.BackgroundColorButton(color)[source]¶
Bases:
ColorButtonColor button with text icon
- Parameters:
color (
QColor) – Color that is initially set
- label = 'Background Color'¶
- class pyspread.widgets.CellButton(text, grid, key)[source]¶
Bases:
QPushButtonButton that is used for button cells in the grid
- Parameters:
- class pyspread.widgets.ColorButton(color, icon=None, max_size=PyQt6.QtCore.QSize(28, 28))[source]¶
Bases:
QToolButtonColor button widget
- Parameters:
color (
QColor) – Color that is initially seticon (
QIcon) – Button foreground imagemax_size (
QSize) – Maximum Size of the button
- property color: QColor¶
Chosen color
- default_color = None¶
- set_max_size(size)[source]¶
Set the maximum size of the widget
- Parameters:
color – Maximum button size
- title = 'Select Color'¶
- class pyspread.widgets.FindEditor(parent)[source]¶
Bases:
QLineEditThe Find editor widget for the find toolbar
- Parameters:
parent (
QWidget) – Parent widget
- case = False¶
Context menu event handler
- Parameters:
point (
QPoint) – Context menu coordinates on screen
- on_toggle_case(toggled)[source]¶
Find case sensitively toggle event handler
- Parameters:
toggled (
bool) – case sensitivity option toggle state
- on_toggle_regexp(toggled)[source]¶
Find with regular expression toggle event handler
- Parameters:
toggled (
bool) – regular expression option toggle state
- on_toggle_results(toggled)[source]¶
Find in results toggle event handler
- Parameters:
toggled (
bool) – results option toggle state
- on_toggle_up(toggled)[source]¶
Find upwards toggle event handler
- Parameters:
toggled (
bool) – up option toggle state
- on_toggle_word(toggled)[source]¶
Find whole word toggle event handler
- Parameters:
toggled (
bool) – whole word option toggle state
- prepend_actions(menu)[source]¶
Prepends find specific actions to menu
- Parameters:
menu (
QMenu) – Find editor context menu
- regexp = False¶
- results = False¶
- up = False¶
- word = False¶
- class pyspread.widgets.FontChoiceCombo(main_window)[source]¶
Bases:
QFontComboBoxFont choice combo box
- Parameters:
main_window (
QMainWindow) – Application main window
- label = 'Font Family'¶
- class pyspread.widgets.FontSizeCombo(main_window)[source]¶
Bases:
QComboBoxFont choice combo box
- Parameters:
main_window (
QMainWindow) – Application main window
- label = 'Font Size'¶
- class pyspread.widgets.HelpBrowser(parent, path)[source]¶
Bases:
QTextBrowserHelp browser widget
- Parameters:
parent (
QWidget) – Parent windowpath (
Path) – Path to markdown file that is displayed
- class pyspread.widgets.JustificationButton(main_window)[source]¶
Bases:
MultiStateBitmapButtonJustification button for the format toolbar
- Parameters:
main_window (
QMainWindow) – Application main window
- action_names = ('justify_left', 'justify_center', 'justify_right', 'justify_fill')¶
- label = 'Justification'¶
- class pyspread.widgets.LineColorButton(color)[source]¶
Bases:
ColorButtonColor button with text icon
- Parameters:
color (
QColor) – Color that is initially set
- label = 'Line Color'¶
- class pyspread.widgets.MenuComboBox(items)[source]¶
Bases:
QComboBoxComboBox that uses a menu instead of a list
- Parameters:
items (
dict) – Menu items
The dict items needs to be given in the following format:
{"<label_1>": None, # For leaf item "<label_2>": {"<label_2.1>": None}, } # For submenu
Event handler for menu
- text_tpl = '{} ({})'¶
- class pyspread.widgets.MultiStateBitmapButton(main_window)[source]¶
Bases:
QToolButtonQToolButton that cycles through arbitrary states
The states are defined by an iterable of QIcons
- Parameters:
main_window (
QMainWindow) – Application main window
- get_action(index)[source]¶
Returns action from index in action_names
- Parameters:
index (
int) – Index of action to be returned- Return type:
QAction
- set_current_action(action_name)[source]¶
Sets current action
- Parameters:
action_name (
str) – Name of action as in MainWindowActions
Sets checked status of menu
- Parameters:
action_name (
str) – Name of action as in MainWindowActions
- class pyspread.widgets.RendererButton(main_window)[source]¶
Bases:
MultiStateBitmapButtonCell render button for the format toolbar
- Parameters:
main_window (
QMainWindow) – Application main window
- action_names = ('text', 'markup', 'image', 'matplotlib')¶
- label = 'Renderer'¶
- class pyspread.widgets.RotationButton(main_window)[source]¶
Bases:
MultiStateBitmapButtonRotation button for the format toolbar
- Parameters:
main_window (
QMainWindow) – Application main window
- action_names = ('rotate_0', 'rotate_90', 'rotate_180', 'rotate_270')¶
- label = 'Rotate'¶
- class pyspread.widgets.TextColorButton(color)[source]¶
Bases:
ColorButtonColor button with text icon
- Parameters:
color (
QColor) – Color that is initially set
- label = 'Text Color'¶
- class pyspread.widgets.TypeMenuComboBox[source]¶
Bases:
MenuComboBoxMenuComboBox that comprises types and currencies for CSV import
- Parameters:
items – Menu items
The dict items needs to be given in the following format:
{"<label_1>": None, # For leaf item "<label_2>": {"<label_2.1>": None}, } # For submenu
pyspread.workflows module¶
Workflows for pyspread
- class pyspread.workflows.Workflows(main_window)[source]¶
Bases:
objectWorkflow container class
- apply_attributes()[source]¶
Applies given cell attributes
Pasting starts at cursor or at top left bbox corner
- cell2dialog = {}¶
- cloned_cell_attributes = {}¶
- cloned_selection = Selection([], [], [], [], [])¶
- count_file_lines(filepath)[source]¶
Returns line count of file in filepath
- Parameters:
filepath (
Path) – Path of file to be analyzed
- edit_copy(*, selection=None)[source]¶
Edit -> Copy workflow
Copies selected grid code to clipboard
- Parameters:
selection (
Selection) – Selection to copy, copies grid selection if None
- edit_copy_results()[source]¶
Edit -> Copy results workflow
If a selection is present then repr of selected grid cells result objects are copied to the clipboard.
If no selection is present, the current cell results are copied to the clipboard. This can be plain text, html, a png image or an svg image.
- edit_paste()[source]¶
Edit -> Paste workflow
Pastes text clipboard data
If no selection is present, data is pasted starting with the current cell. If a selection is present, data is pasted fully if the selection is smaller. If the selection is larger then data is duplicated.
- filepath_open(filepath)[source]¶
Workflow for opening a file if a filepath is known
- Parameters:
filepath (
Path) – Path of file to be opened
- find_dialog_on_find(find_dialog)[source]¶
Edit -> Find workflow, after pressing find button in FindDialog
- Parameters:
find_dialog (
FindDialog) – Find dialog of origin
- format_copy_format()[source]¶
Copies the format of the selected cells to the Clipboard
Cells are shifted so that the top left bbox corner is at 0,0
- format_paste_format()[source]¶
Pastes cell formats
Pasting starts at cursor or at top left bbox corner
- get_selection_attributes()[source]¶
Returns cell attributes of selection
Cells are shifted so that the top left bbox corner is at 0,0. Merged cells abd cell renderert settinbgs are excluded.
- Return type:
- handle_changed_since_save(*args, **kwargs)[source]¶
Decorator to handle changes since last saving the document
If changes are present then a dialog is displayed that asks if the changes shall be discarded.
If the user selects Cancel then func is not executed.
If the user selects Save then the file is saved and func is executed.
If the user selects Discard then the file is not saved and func is executed.
If no changes are present then func is directly executed. After executing func,
reset_changed_since_save()and update_main_window_title are called.
- macro_insert_sum()[source]¶
Sum up selection area
The sum is inserted into the cell below the bottom right cell of the selection.
- paint(painter, option, paint_rect, rows, columns)[source]¶
Grid paint workflow for printing and svg export
- prevent_updates()[source]¶
contextmanagersets the prevent_updates stateThe prevent_updates state prevents updates in main_window.grid.setData
- print_zoom(zoom=1.0)[source]¶
Decorator for tasks that have to take place in standard zoom
- Parameters:
zoom (
float) – Print zoom factor
- replace_dialog_on_replace(replace_dialog, toggled=False, max_=1)[source]¶
Edit -> Replace workflow when pushing Replace in ReplaceDialog
Returns True if there is a match otherwise False
- Parameters:
replace_dialog (
ReplaceDialog) – Replace dialog of origintoggled (
bool) – Replace dialog toggle statemax – Maximum number of replace actions, -1 is unlimited
- Return type:
- replace_dialog_on_replace_all(replace_dialog)[source]¶
Edit -> Replace workflow when pushing ReplaceAll in ReplaceDialog
- Parameters:
replace_dialog (
ReplaceDialog) – Replace dialog of origin
- sign_file(filepath)[source]¶
Signs filepath if not in
model.model.DataArray.safe_mode- Parameters:
filepath (
Path) – Path of file to be signed
- svg_export(filepath, svg_area=None)[source]¶
Export to svg file filepath
- Parameters:
filepath (
Path) – Path of file to be exportedsvg_area (
SinglePageArea) – Area of the grid to be exported