id int32 0 252k | repo stringlengths 7 55 | path stringlengths 4 127 | func_name stringlengths 1 88 | original_string stringlengths 75 19.8k | language stringclasses 1
value | code stringlengths 51 19.8k | code_tokens list | docstring stringlengths 3 17.3k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 87 242 |
|---|---|---|---|---|---|---|---|---|---|---|---|
250,300 | manns/pyspread | pyspread/src/interfaces/xls.py | Xls._get_pattern | def _get_pattern(self, pys_style):
"""Returns xlwt.pattern for pyspread style"""
# Return None if there is no bgcolor
if "bgcolor" not in pys_style:
return
pattern = xlwt.Pattern()
pattern.pattern = xlwt.Pattern.SOLID_PATTERN
bgcolor = wx.Colour()
b... | python | def _get_pattern(self, pys_style):
# Return None if there is no bgcolor
if "bgcolor" not in pys_style:
return
pattern = xlwt.Pattern()
pattern.pattern = xlwt.Pattern.SOLID_PATTERN
bgcolor = wx.Colour()
bgcolor.SetRGB(pys_style["bgcolor"])
pattern.pat... | [
"def",
"_get_pattern",
"(",
"self",
",",
"pys_style",
")",
":",
"# Return None if there is no bgcolor",
"if",
"\"bgcolor\"",
"not",
"in",
"pys_style",
":",
"return",
"pattern",
"=",
"xlwt",
".",
"Pattern",
"(",
")",
"pattern",
".",
"pattern",
"=",
"xlwt",
".",... | Returns xlwt.pattern for pyspread style | [
"Returns",
"xlwt",
".",
"pattern",
"for",
"pyspread",
"style"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/interfaces/xls.py#L326-L340 |
250,301 | manns/pyspread | pyspread/src/interfaces/xls.py | Xls._get_borders | def _get_borders(self, pys_style, pys_style_above, pys_style_left):
"""Returns xlwt.Borders for pyspread style"""
# Return None if there is no border key
border_keys = [
"borderwidth_right",
"borderwidth_bottom",
"bordercolor_right",
"bordercolor_... | python | def _get_borders(self, pys_style, pys_style_above, pys_style_left):
# Return None if there is no border key
border_keys = [
"borderwidth_right",
"borderwidth_bottom",
"bordercolor_right",
"bordercolor_bottom",
]
if not any(border_key in py... | [
"def",
"_get_borders",
"(",
"self",
",",
"pys_style",
",",
"pys_style_above",
",",
"pys_style_left",
")",
":",
"# Return None if there is no border key",
"border_keys",
"=",
"[",
"\"borderwidth_right\"",
",",
"\"borderwidth_bottom\"",
",",
"\"bordercolor_right\"",
",",
"\... | Returns xlwt.Borders for pyspread style | [
"Returns",
"xlwt",
".",
"Borders",
"for",
"pyspread",
"style"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/interfaces/xls.py#L342-L512 |
250,302 | manns/pyspread | pyspread/src/interfaces/xls.py | Xls._get_xfstyle | def _get_xfstyle(self, worksheets, key):
"""Gets XFStyle for cell key"""
row, col, tab = key
dict_grid = self.code_array.dict_grid
dict_grid.cell_attributes._update_table_cache()
pys_style = dict_grid.cell_attributes[key]
pys_style_above = dict_grid.cell_attributes[row ... | python | def _get_xfstyle(self, worksheets, key):
row, col, tab = key
dict_grid = self.code_array.dict_grid
dict_grid.cell_attributes._update_table_cache()
pys_style = dict_grid.cell_attributes[key]
pys_style_above = dict_grid.cell_attributes[row - 1, col, tab]
pys_style_left = d... | [
"def",
"_get_xfstyle",
"(",
"self",
",",
"worksheets",
",",
"key",
")",
":",
"row",
",",
"col",
",",
"tab",
"=",
"key",
"dict_grid",
"=",
"self",
".",
"code_array",
".",
"dict_grid",
"dict_grid",
".",
"cell_attributes",
".",
"_update_table_cache",
"(",
")"... | Gets XFStyle for cell key | [
"Gets",
"XFStyle",
"for",
"cell",
"key"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/interfaces/xls.py#L514-L555 |
250,303 | manns/pyspread | pyspread/src/interfaces/xls.py | Xls._cell_attribute_append | def _cell_attribute_append(self, selection, tab, attributes):
"""Appends to cell_attributes with checks"""
cell_attributes = self.code_array.cell_attributes
thick_bottom_cells = []
thick_right_cells = []
# Does any cell in selection.cells have a larger bottom border?
... | python | def _cell_attribute_append(self, selection, tab, attributes):
cell_attributes = self.code_array.cell_attributes
thick_bottom_cells = []
thick_right_cells = []
# Does any cell in selection.cells have a larger bottom border?
if "borderwidth_bottom" in attributes:
bwi... | [
"def",
"_cell_attribute_append",
"(",
"self",
",",
"selection",
",",
"tab",
",",
"attributes",
")",
":",
"cell_attributes",
"=",
"self",
".",
"code_array",
".",
"cell_attributes",
"thick_bottom_cells",
"=",
"[",
"]",
"thick_right_cells",
"=",
"[",
"]",
"# Does a... | Appends to cell_attributes with checks | [
"Appends",
"to",
"cell_attributes",
"with",
"checks"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/interfaces/xls.py#L557-L602 |
250,304 | manns/pyspread | pyspread/src/interfaces/xls.py | Xls._row_heights2xls | def _row_heights2xls(self, worksheets):
"""Writes row_heights to xls file
Format: <row>\t<tab>\t<value>\n
"""
xls_max_rows, xls_max_tabs = self.xls_max_rows, self.xls_max_tabs
dict_grid = self.code_array.dict_grid
for row, tab in dict_grid.row_heights:
if... | python | def _row_heights2xls(self, worksheets):
xls_max_rows, xls_max_tabs = self.xls_max_rows, self.xls_max_tabs
dict_grid = self.code_array.dict_grid
for row, tab in dict_grid.row_heights:
if row < xls_max_rows and tab < xls_max_tabs:
height_pixels = dict_grid.row_heights... | [
"def",
"_row_heights2xls",
"(",
"self",
",",
"worksheets",
")",
":",
"xls_max_rows",
",",
"xls_max_tabs",
"=",
"self",
".",
"xls_max_rows",
",",
"self",
".",
"xls_max_tabs",
"dict_grid",
"=",
"self",
".",
"code_array",
".",
"dict_grid",
"for",
"row",
",",
"t... | Writes row_heights to xls file
Format: <row>\t<tab>\t<value>\n | [
"Writes",
"row_heights",
"to",
"xls",
"file"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/interfaces/xls.py#L770-L788 |
250,305 | manns/pyspread | pyspread/src/interfaces/xls.py | Xls.pys_width2xls_width | def pys_width2xls_width(self, pys_width):
"""Returns xls width from given pyspread width"""
width_0 = get_default_text_extent("0")[0]
# Scale relative to 12 point font instead of 10 point
width_0_char = pys_width * 1.2 / width_0
return int(width_0_char * 256.0) | python | def pys_width2xls_width(self, pys_width):
width_0 = get_default_text_extent("0")[0]
# Scale relative to 12 point font instead of 10 point
width_0_char = pys_width * 1.2 / width_0
return int(width_0_char * 256.0) | [
"def",
"pys_width2xls_width",
"(",
"self",
",",
"pys_width",
")",
":",
"width_0",
"=",
"get_default_text_extent",
"(",
"\"0\"",
")",
"[",
"0",
"]",
"# Scale relative to 12 point font instead of 10 point",
"width_0_char",
"=",
"pys_width",
"*",
"1.2",
"/",
"width_0",
... | Returns xls width from given pyspread width | [
"Returns",
"xls",
"width",
"from",
"given",
"pyspread",
"width"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/interfaces/xls.py#L804-L810 |
250,306 | manns/pyspread | pyspread/src/interfaces/xls.py | Xls._col_widths2xls | def _col_widths2xls(self, worksheets):
"""Writes col_widths to xls file
Format: <col>\t<tab>\t<value>\n
"""
xls_max_cols, xls_max_tabs = self.xls_max_cols, self.xls_max_tabs
dict_grid = self.code_array.dict_grid
for col, tab in dict_grid.col_widths:
if co... | python | def _col_widths2xls(self, worksheets):
xls_max_cols, xls_max_tabs = self.xls_max_cols, self.xls_max_tabs
dict_grid = self.code_array.dict_grid
for col, tab in dict_grid.col_widths:
if col < xls_max_cols and tab < xls_max_tabs:
pys_width = dict_grid.col_widths[(col, ... | [
"def",
"_col_widths2xls",
"(",
"self",
",",
"worksheets",
")",
":",
"xls_max_cols",
",",
"xls_max_tabs",
"=",
"self",
".",
"xls_max_cols",
",",
"self",
".",
"xls_max_tabs",
"dict_grid",
"=",
"self",
".",
"code_array",
".",
"dict_grid",
"for",
"col",
",",
"ta... | Writes col_widths to xls file
Format: <col>\t<tab>\t<value>\n | [
"Writes",
"col_widths",
"to",
"xls",
"file"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/interfaces/xls.py#L820-L835 |
250,307 | manns/pyspread | pyspread/src/interfaces/xls.py | Xls.from_code_array | def from_code_array(self):
"""Returns xls workbook object with everything from code_array"""
worksheets = []
self._shape2xls(worksheets)
self._code2xls(worksheets)
self._row_heights2xls(worksheets)
self._col_widths2xls(worksheets)
return self.workbook | python | def from_code_array(self):
worksheets = []
self._shape2xls(worksheets)
self._code2xls(worksheets)
self._row_heights2xls(worksheets)
self._col_widths2xls(worksheets)
return self.workbook | [
"def",
"from_code_array",
"(",
"self",
")",
":",
"worksheets",
"=",
"[",
"]",
"self",
".",
"_shape2xls",
"(",
"worksheets",
")",
"self",
".",
"_code2xls",
"(",
"worksheets",
")",
"self",
".",
"_row_heights2xls",
"(",
"worksheets",
")",
"self",
".",
"_col_w... | Returns xls workbook object with everything from code_array | [
"Returns",
"xls",
"workbook",
"object",
"with",
"everything",
"from",
"code_array"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/interfaces/xls.py#L852-L863 |
250,308 | manns/pyspread | pyspread/src/interfaces/xls.py | Xls.to_code_array | def to_code_array(self):
"""Replaces everything in code_array from xls_file"""
self._xls2shape()
worksheets = self.workbook.sheet_names()
for tab, worksheet_name in enumerate(worksheets):
worksheet = self.workbook.sheet_by_name(worksheet_name)
self._xls2code(wo... | python | def to_code_array(self):
self._xls2shape()
worksheets = self.workbook.sheet_names()
for tab, worksheet_name in enumerate(worksheets):
worksheet = self.workbook.sheet_by_name(worksheet_name)
self._xls2code(worksheet, tab)
self._xls2attributes(worksheet, tab)
... | [
"def",
"to_code_array",
"(",
"self",
")",
":",
"self",
".",
"_xls2shape",
"(",
")",
"worksheets",
"=",
"self",
".",
"workbook",
".",
"sheet_names",
"(",
")",
"for",
"tab",
",",
"worksheet_name",
"in",
"enumerate",
"(",
"worksheets",
")",
":",
"worksheet",
... | Replaces everything in code_array from xls_file | [
"Replaces",
"everything",
"in",
"code_array",
"from",
"xls_file"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/interfaces/xls.py#L865-L877 |
250,309 | manns/pyspread | pyspread/src/interfaces/pys.py | Pys._split_tidy | def _split_tidy(self, string, maxsplit=None):
"""Rstrips string for \n and splits string for \t"""
if maxsplit is None:
return string.rstrip("\n").split("\t")
else:
return string.rstrip("\n").split("\t", maxsplit) | python | def _split_tidy(self, string, maxsplit=None):
if maxsplit is None:
return string.rstrip("\n").split("\t")
else:
return string.rstrip("\n").split("\t", maxsplit) | [
"def",
"_split_tidy",
"(",
"self",
",",
"string",
",",
"maxsplit",
"=",
"None",
")",
":",
"if",
"maxsplit",
"is",
"None",
":",
"return",
"string",
".",
"rstrip",
"(",
"\"\\n\"",
")",
".",
"split",
"(",
"\"\\t\"",
")",
"else",
":",
"return",
"string",
... | Rstrips string for \n and splits string for \t | [
"Rstrips",
"string",
"for",
"\\",
"n",
"and",
"splits",
"string",
"for",
"\\",
"t"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/interfaces/pys.py#L107-L113 |
250,310 | manns/pyspread | pyspread/src/interfaces/pys.py | Pys._pys_assert_version | def _pys_assert_version(self, line):
"""Asserts pys file version"""
if float(line.strip()) > 1.0:
# Abort if file version not supported
msg = _("File version {version} unsupported (>1.0).").format(
version=line.strip())
raise ValueError(msg) | python | def _pys_assert_version(self, line):
if float(line.strip()) > 1.0:
# Abort if file version not supported
msg = _("File version {version} unsupported (>1.0).").format(
version=line.strip())
raise ValueError(msg) | [
"def",
"_pys_assert_version",
"(",
"self",
",",
"line",
")",
":",
"if",
"float",
"(",
"line",
".",
"strip",
"(",
")",
")",
">",
"1.0",
":",
"# Abort if file version not supported",
"msg",
"=",
"_",
"(",
"\"File version {version} unsupported (>1.0).\"",
")",
".",... | Asserts pys file version | [
"Asserts",
"pys",
"file",
"version"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/interfaces/pys.py#L120-L127 |
250,311 | manns/pyspread | pyspread/src/interfaces/pys.py | Pys._shape2pys | def _shape2pys(self):
"""Writes shape to pys file
Format: <rows>\t<cols>\t<tabs>\n
"""
shape_line = u"\t".join(map(unicode, self.code_array.shape)) + u"\n"
self.pys_file.write(shape_line) | python | def _shape2pys(self):
shape_line = u"\t".join(map(unicode, self.code_array.shape)) + u"\n"
self.pys_file.write(shape_line) | [
"def",
"_shape2pys",
"(",
"self",
")",
":",
"shape_line",
"=",
"u\"\\t\"",
".",
"join",
"(",
"map",
"(",
"unicode",
",",
"self",
".",
"code_array",
".",
"shape",
")",
")",
"+",
"u\"\\n\"",
"self",
".",
"pys_file",
".",
"write",
"(",
"shape_line",
")"
] | Writes shape to pys file
Format: <rows>\t<cols>\t<tabs>\n | [
"Writes",
"shape",
"to",
"pys",
"file"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/interfaces/pys.py#L138-L146 |
250,312 | manns/pyspread | pyspread/src/interfaces/pys.py | Pys._code2pys | def _code2pys(self):
"""Writes code to pys file
Format: <row>\t<col>\t<tab>\t<code>\n
"""
for key in self.code_array:
key_str = u"\t".join(repr(ele) for ele in key)
code_str = self.code_array(key)
if code_str is not None:
out_str = k... | python | def _code2pys(self):
for key in self.code_array:
key_str = u"\t".join(repr(ele) for ele in key)
code_str = self.code_array(key)
if code_str is not None:
out_str = key_str + u"\t" + code_str + u"\n"
self.pys_file.write(out_str.encode("utf-8")) | [
"def",
"_code2pys",
"(",
"self",
")",
":",
"for",
"key",
"in",
"self",
".",
"code_array",
":",
"key_str",
"=",
"u\"\\t\"",
".",
"join",
"(",
"repr",
"(",
"ele",
")",
"for",
"ele",
"in",
"key",
")",
"code_str",
"=",
"self",
".",
"code_array",
"(",
"... | Writes code to pys file
Format: <row>\t<col>\t<tab>\t<code>\n | [
"Writes",
"code",
"to",
"pys",
"file"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/interfaces/pys.py#L153-L166 |
250,313 | manns/pyspread | pyspread/src/interfaces/pys.py | Pys._pys2code | def _pys2code(self, line):
"""Updates code in pys code_array"""
row, col, tab, code = self._split_tidy(line, maxsplit=3)
key = self._get_key(row, col, tab)
self.code_array.dict_grid[key] = unicode(code, encoding='utf-8') | python | def _pys2code(self, line):
row, col, tab, code = self._split_tidy(line, maxsplit=3)
key = self._get_key(row, col, tab)
self.code_array.dict_grid[key] = unicode(code, encoding='utf-8') | [
"def",
"_pys2code",
"(",
"self",
",",
"line",
")",
":",
"row",
",",
"col",
",",
"tab",
",",
"code",
"=",
"self",
".",
"_split_tidy",
"(",
"line",
",",
"maxsplit",
"=",
"3",
")",
"key",
"=",
"self",
".",
"_get_key",
"(",
"row",
",",
"col",
",",
... | Updates code in pys code_array | [
"Updates",
"code",
"in",
"pys",
"code_array"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/interfaces/pys.py#L168-L174 |
250,314 | manns/pyspread | pyspread/src/interfaces/pys.py | Pys._attributes2pys | def _attributes2pys(self):
"""Writes attributes to pys file
Format:
<selection[0]>\t[...]\t<tab>\t<key>\t<value>\t[...]\n
"""
# Remove doublettes
purged_cell_attributes = []
purged_cell_attributes_keys = []
for selection, tab, attr_dict in self.code_arr... | python | def _attributes2pys(self):
# Remove doublettes
purged_cell_attributes = []
purged_cell_attributes_keys = []
for selection, tab, attr_dict in self.code_array.cell_attributes:
if purged_cell_attributes_keys and \
(selection, tab) == purged_cell_attributes_keys[-1... | [
"def",
"_attributes2pys",
"(",
"self",
")",
":",
"# Remove doublettes",
"purged_cell_attributes",
"=",
"[",
"]",
"purged_cell_attributes_keys",
"=",
"[",
"]",
"for",
"selection",
",",
"tab",
",",
"attr_dict",
"in",
"self",
".",
"code_array",
".",
"cell_attributes"... | Writes attributes to pys file
Format:
<selection[0]>\t[...]\t<tab>\t<key>\t<value>\t[...]\n | [
"Writes",
"attributes",
"to",
"pys",
"file"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/interfaces/pys.py#L176-L211 |
250,315 | manns/pyspread | pyspread/src/interfaces/pys.py | Pys._row_heights2pys | def _row_heights2pys(self):
"""Writes row_heights to pys file
Format: <row>\t<tab>\t<value>\n
"""
for row, tab in self.code_array.dict_grid.row_heights:
if row < self.code_array.shape[0] and \
tab < self.code_array.shape[2]:
height = self.cod... | python | def _row_heights2pys(self):
for row, tab in self.code_array.dict_grid.row_heights:
if row < self.code_array.shape[0] and \
tab < self.code_array.shape[2]:
height = self.code_array.dict_grid.row_heights[(row, tab)]
height_strings = map(repr, [row, tab, h... | [
"def",
"_row_heights2pys",
"(",
"self",
")",
":",
"for",
"row",
",",
"tab",
"in",
"self",
".",
"code_array",
".",
"dict_grid",
".",
"row_heights",
":",
"if",
"row",
"<",
"self",
".",
"code_array",
".",
"shape",
"[",
"0",
"]",
"and",
"tab",
"<",
"self... | Writes row_heights to pys file
Format: <row>\t<tab>\t<value>\n | [
"Writes",
"row_heights",
"to",
"pys",
"file"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/interfaces/pys.py#L235-L247 |
250,316 | manns/pyspread | pyspread/src/interfaces/pys.py | Pys._col_widths2pys | def _col_widths2pys(self):
"""Writes col_widths to pys file
Format: <col>\t<tab>\t<value>\n
"""
for col, tab in self.code_array.dict_grid.col_widths:
if col < self.code_array.shape[1] and \
tab < self.code_array.shape[2]:
width = self.code_ar... | python | def _col_widths2pys(self):
for col, tab in self.code_array.dict_grid.col_widths:
if col < self.code_array.shape[1] and \
tab < self.code_array.shape[2]:
width = self.code_array.dict_grid.col_widths[(col, tab)]
width_strings = map(repr, [col, tab, width]... | [
"def",
"_col_widths2pys",
"(",
"self",
")",
":",
"for",
"col",
",",
"tab",
"in",
"self",
".",
"code_array",
".",
"dict_grid",
".",
"col_widths",
":",
"if",
"col",
"<",
"self",
".",
"code_array",
".",
"shape",
"[",
"1",
"]",
"and",
"tab",
"<",
"self",... | Writes col_widths to pys file
Format: <col>\t<tab>\t<value>\n | [
"Writes",
"col_widths",
"to",
"pys",
"file"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/interfaces/pys.py#L266-L278 |
250,317 | manns/pyspread | pyspread/src/interfaces/pys.py | Pys._macros2pys | def _macros2pys(self):
"""Writes macros to pys file
Format: <macro code line>\n
"""
macros = self.code_array.dict_grid.macros
pys_macros = macros.encode("utf-8")
self.pys_file.write(pys_macros) | python | def _macros2pys(self):
macros = self.code_array.dict_grid.macros
pys_macros = macros.encode("utf-8")
self.pys_file.write(pys_macros) | [
"def",
"_macros2pys",
"(",
"self",
")",
":",
"macros",
"=",
"self",
".",
"code_array",
".",
"dict_grid",
".",
"macros",
"pys_macros",
"=",
"macros",
".",
"encode",
"(",
"\"utf-8\"",
")",
"self",
".",
"pys_file",
".",
"write",
"(",
"pys_macros",
")"
] | Writes macros to pys file
Format: <macro code line>\n | [
"Writes",
"macros",
"to",
"pys",
"file"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/interfaces/pys.py#L297-L306 |
250,318 | manns/pyspread | pyspread/src/interfaces/pys.py | Pys._pys2macros | def _pys2macros(self, line):
"""Updates macros in code_array"""
if self.code_array.dict_grid.macros and \
self.code_array.dict_grid.macros[-1] != "\n":
# The last macro line does not end with \n
# Therefore, if not new line is inserted, the codeis broken
s... | python | def _pys2macros(self, line):
if self.code_array.dict_grid.macros and \
self.code_array.dict_grid.macros[-1] != "\n":
# The last macro line does not end with \n
# Therefore, if not new line is inserted, the codeis broken
self.code_array.dict_grid.macros += "\n"
... | [
"def",
"_pys2macros",
"(",
"self",
",",
"line",
")",
":",
"if",
"self",
".",
"code_array",
".",
"dict_grid",
".",
"macros",
"and",
"self",
".",
"code_array",
".",
"dict_grid",
".",
"macros",
"[",
"-",
"1",
"]",
"!=",
"\"\\n\"",
":",
"# The last macro lin... | Updates macros in code_array | [
"Updates",
"macros",
"in",
"code_array"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/interfaces/pys.py#L308-L317 |
250,319 | manns/pyspread | pyspread/src/interfaces/pys.py | Pys._fonts2pys | def _fonts2pys(self):
"""Writes fonts to pys file"""
# Get mapping from fonts to fontfiles
system_fonts = font_manager.findSystemFonts()
font_name2font_file = {}
for sys_font in system_fonts:
font_name = font_manager.FontProperties(fname=sys_font).get_name()
... | python | def _fonts2pys(self):
# Get mapping from fonts to fontfiles
system_fonts = font_manager.findSystemFonts()
font_name2font_file = {}
for sys_font in system_fonts:
font_name = font_manager.FontProperties(fname=sys_font).get_name()
if font_name in self.fonts_used:
... | [
"def",
"_fonts2pys",
"(",
"self",
")",
":",
"# Get mapping from fonts to fontfiles",
"system_fonts",
"=",
"font_manager",
".",
"findSystemFonts",
"(",
")",
"font_name2font_file",
"=",
"{",
"}",
"for",
"sys_font",
"in",
"system_fonts",
":",
"font_name",
"=",
"font_ma... | Writes fonts to pys file | [
"Writes",
"fonts",
"to",
"pys",
"file"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/interfaces/pys.py#L319-L341 |
250,320 | manns/pyspread | pyspread/src/interfaces/pys.py | Pys._pys2fonts | def _pys2fonts(self, line):
"""Updates custom font list"""
font_name, ascii_font_data = self._split_tidy(line)
font_data = base64.b64decode(ascii_font_data)
# Get system font names
system_fonts = font_manager.findSystemFonts()
system_font_names = []
for sys_fon... | python | def _pys2fonts(self, line):
font_name, ascii_font_data = self._split_tidy(line)
font_data = base64.b64decode(ascii_font_data)
# Get system font names
system_fonts = font_manager.findSystemFonts()
system_font_names = []
for sys_font in system_fonts:
system_fo... | [
"def",
"_pys2fonts",
"(",
"self",
",",
"line",
")",
":",
"font_name",
",",
"ascii_font_data",
"=",
"self",
".",
"_split_tidy",
"(",
"line",
")",
"font_data",
"=",
"base64",
".",
"b64decode",
"(",
"ascii_font_data",
")",
"# Get system font names",
"system_fonts",... | Updates custom font list | [
"Updates",
"custom",
"font",
"list"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/interfaces/pys.py#L343-L369 |
250,321 | manns/pyspread | pyspread/src/interfaces/pys.py | Pys.from_code_array | def from_code_array(self):
"""Replaces everything in pys_file from code_array"""
for key in self._section2writer:
self.pys_file.write(key)
self._section2writer[key]()
try:
if self.pys_file.aborted:
break
except Attribu... | python | def from_code_array(self):
for key in self._section2writer:
self.pys_file.write(key)
self._section2writer[key]()
try:
if self.pys_file.aborted:
break
except AttributeError:
# pys_file is not opened via fileio.BZ... | [
"def",
"from_code_array",
"(",
"self",
")",
":",
"for",
"key",
"in",
"self",
".",
"_section2writer",
":",
"self",
".",
"pys_file",
".",
"write",
"(",
"key",
")",
"self",
".",
"_section2writer",
"[",
"key",
"]",
"(",
")",
"try",
":",
"if",
"self",
"."... | Replaces everything in pys_file from code_array | [
"Replaces",
"everything",
"in",
"pys_file",
"from",
"code_array"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/interfaces/pys.py#L374-L390 |
250,322 | manns/pyspread | pyspread/src/interfaces/pys.py | Pys.to_code_array | def to_code_array(self):
"""Replaces everything in code_array from pys_file"""
state = None
# Check if version section starts with first line
first_line = True
# Reset pys_file to start to enable multiple calls of this method
self.pys_file.seek(0)
for line in ... | python | def to_code_array(self):
state = None
# Check if version section starts with first line
first_line = True
# Reset pys_file to start to enable multiple calls of this method
self.pys_file.seek(0)
for line in self.pys_file:
if first_line:
# If ... | [
"def",
"to_code_array",
"(",
"self",
")",
":",
"state",
"=",
"None",
"# Check if version section starts with first line",
"first_line",
"=",
"True",
"# Reset pys_file to start to enable multiple calls of this method",
"self",
".",
"pys_file",
".",
"seek",
"(",
"0",
")",
"... | Replaces everything in code_array from pys_file | [
"Replaces",
"everything",
"in",
"code_array",
"from",
"pys_file"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/interfaces/pys.py#L392-L416 |
250,323 | manns/pyspread | pyspread/src/gui/_widgets.py | PythonSTC._style | def _style(self):
"""Set editor style"""
self.fold_symbols = 2
"""
Fold symbols
------------
The following styles are pre-defined:
"arrows" Arrow pointing right for contracted folders,
arrow pointing down for expanded
"p... | python | def _style(self):
self.fold_symbols = 2
"""
Fold symbols
------------
The following styles are pre-defined:
"arrows" Arrow pointing right for contracted folders,
arrow pointing down for expanded
"plusminus" Plus for contracted ... | [
"def",
"_style",
"(",
"self",
")",
":",
"self",
".",
"fold_symbols",
"=",
"2",
"\"\"\"\n Fold symbols\n ------------\n\n The following styles are pre-defined:\n \"arrows\" Arrow pointing right for contracted folders,\n arrow pointing do... | Set editor style | [
"Set",
"editor",
"style"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_widgets.py#L140-L270 |
250,324 | manns/pyspread | pyspread/src/gui/_widgets.py | PythonSTC.OnUpdateUI | def OnUpdateUI(self, evt):
"""Syntax highlighting while editing"""
# check for matching braces
brace_at_caret = -1
brace_opposite = -1
char_before = None
caret_pos = self.GetCurrentPos()
if caret_pos > 0:
char_before = self.GetCharAt(caret_pos - 1)
... | python | def OnUpdateUI(self, evt):
# check for matching braces
brace_at_caret = -1
brace_opposite = -1
char_before = None
caret_pos = self.GetCurrentPos()
if caret_pos > 0:
char_before = self.GetCharAt(caret_pos - 1)
style_before = self.GetStyleAt(caret_p... | [
"def",
"OnUpdateUI",
"(",
"self",
",",
"evt",
")",
":",
"# check for matching braces",
"brace_at_caret",
"=",
"-",
"1",
"brace_opposite",
"=",
"-",
"1",
"char_before",
"=",
"None",
"caret_pos",
"=",
"self",
".",
"GetCurrentPos",
"(",
")",
"if",
"caret_pos",
... | Syntax highlighting while editing | [
"Syntax",
"highlighting",
"while",
"editing"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_widgets.py#L272-L305 |
250,325 | manns/pyspread | pyspread/src/gui/_widgets.py | PythonSTC.OnMarginClick | def OnMarginClick(self, evt):
"""When clicked, old and unfold as needed"""
if evt.GetMargin() == 2:
if evt.GetShift() and evt.GetControl():
self.fold_all()
else:
line_clicked = self.LineFromPosition(evt.GetPosition())
if self.GetF... | python | def OnMarginClick(self, evt):
if evt.GetMargin() == 2:
if evt.GetShift() and evt.GetControl():
self.fold_all()
else:
line_clicked = self.LineFromPosition(evt.GetPosition())
if self.GetFoldLevel(line_clicked) & \
stc.STC_... | [
"def",
"OnMarginClick",
"(",
"self",
",",
"evt",
")",
":",
"if",
"evt",
".",
"GetMargin",
"(",
")",
"==",
"2",
":",
"if",
"evt",
".",
"GetShift",
"(",
")",
"and",
"evt",
".",
"GetControl",
"(",
")",
":",
"self",
".",
"fold_all",
"(",
")",
"else",... | When clicked, old and unfold as needed | [
"When",
"clicked",
"old",
"and",
"unfold",
"as",
"needed"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_widgets.py#L307-L329 |
250,326 | manns/pyspread | pyspread/src/gui/_widgets.py | PythonSTC.expand | def expand(self, line, do_expand, force=False, vislevels=0, level=-1):
"""Multi-purpose expand method from original STC class"""
lastchild = self.GetLastChild(line, level)
line += 1
while line <= lastchild:
if force:
if vislevels > 0:
sel... | python | def expand(self, line, do_expand, force=False, vislevels=0, level=-1):
lastchild = self.GetLastChild(line, level)
line += 1
while line <= lastchild:
if force:
if vislevels > 0:
self.ShowLines(line, line)
else:
s... | [
"def",
"expand",
"(",
"self",
",",
"line",
",",
"do_expand",
",",
"force",
"=",
"False",
",",
"vislevels",
"=",
"0",
",",
"level",
"=",
"-",
"1",
")",
":",
"lastchild",
"=",
"self",
".",
"GetLastChild",
"(",
"line",
",",
"level",
")",
"line",
"+=",... | Multi-purpose expand method from original STC class | [
"Multi",
"-",
"purpose",
"expand",
"method",
"from",
"original",
"STC",
"class"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_widgets.py#L363-L392 |
250,327 | manns/pyspread | pyspread/src/gui/_widgets.py | ImageComboBox.OnDrawBackground | def OnDrawBackground(self, dc, rect, item, flags):
"""Called for drawing the background area of each item
Overridden from OwnerDrawnComboBox
"""
# If the item is selected, or its item is even,
# or if we are painting the combo control itself
# then use the default rend... | python | def OnDrawBackground(self, dc, rect, item, flags):
# If the item is selected, or its item is even,
# or if we are painting the combo control itself
# then use the default rendering.
if (item & 1 == 0 or flags & (wx.combo.ODCB_PAINTING_CONTROL |
wx.c... | [
"def",
"OnDrawBackground",
"(",
"self",
",",
"dc",
",",
"rect",
",",
"item",
",",
"flags",
")",
":",
"# If the item is selected, or its item is even,",
"# or if we are painting the combo control itself",
"# then use the default rendering.",
"if",
"(",
"item",
"&",
"1",
"=... | Called for drawing the background area of each item
Overridden from OwnerDrawnComboBox | [
"Called",
"for",
"drawing",
"the",
"background",
"area",
"of",
"each",
"item"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_widgets.py#L404-L429 |
250,328 | manns/pyspread | pyspread/src/gui/_widgets.py | MatplotlibStyleChoice.get_style_code | def get_style_code(self, label):
"""Returns code for given label string
Inverse of get_code
Parameters
----------
label: String
\tLlabel string, field 0 of style tuple
"""
for style in self.styles:
if style[0] == label:
retu... | python | def get_style_code(self, label):
for style in self.styles:
if style[0] == label:
return style[1]
msg = _("Label {label} is invalid.").format(label=label)
raise ValueError(msg) | [
"def",
"get_style_code",
"(",
"self",
",",
"label",
")",
":",
"for",
"style",
"in",
"self",
".",
"styles",
":",
"if",
"style",
"[",
"0",
"]",
"==",
"label",
":",
"return",
"style",
"[",
"1",
"]",
"msg",
"=",
"_",
"(",
"\"Label {label} is invalid.\"",
... | Returns code for given label string
Inverse of get_code
Parameters
----------
label: String
\tLlabel string, field 0 of style tuple | [
"Returns",
"code",
"for",
"given",
"label",
"string"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_widgets.py#L471-L488 |
250,329 | manns/pyspread | pyspread/src/gui/_widgets.py | MatplotlibStyleChoice.get_label | def get_label(self, code):
"""Returns string label for given code string
Inverse of get_code
Parameters
----------
code: String
\tCode string, field 1 of style tuple
"""
for style in self.styles:
if style[1] == code:
return ... | python | def get_label(self, code):
for style in self.styles:
if style[1] == code:
return style[0]
msg = _("Code {code} is invalid.").format(code=code)
raise ValueError(msg) | [
"def",
"get_label",
"(",
"self",
",",
"code",
")",
":",
"for",
"style",
"in",
"self",
".",
"styles",
":",
"if",
"style",
"[",
"1",
"]",
"==",
"code",
":",
"return",
"style",
"[",
"0",
"]",
"msg",
"=",
"_",
"(",
"\"Code {code} is invalid.\"",
")",
"... | Returns string label for given code string
Inverse of get_code
Parameters
----------
code: String
\tCode string, field 1 of style tuple | [
"Returns",
"string",
"label",
"for",
"given",
"code",
"string"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_widgets.py#L490-L507 |
250,330 | manns/pyspread | pyspread/src/gui/_widgets.py | BitmapToggleButton.toggle | def toggle(self, event):
"""Toggles state to next bitmap"""
if self.state < len(self.bitmap_list) - 1:
self.state += 1
else:
self.state = 0
self.SetBitmapLabel(self.bitmap_list[self.state])
try:
event.Skip()
except AttributeError:
... | python | def toggle(self, event):
if self.state < len(self.bitmap_list) - 1:
self.state += 1
else:
self.state = 0
self.SetBitmapLabel(self.bitmap_list[self.state])
try:
event.Skip()
except AttributeError:
pass
"""For compatibility... | [
"def",
"toggle",
"(",
"self",
",",
"event",
")",
":",
"if",
"self",
".",
"state",
"<",
"len",
"(",
"self",
".",
"bitmap_list",
")",
"-",
"1",
":",
"self",
".",
"state",
"+=",
"1",
"else",
":",
"self",
".",
"state",
"=",
"0",
"self",
".",
"SetBi... | Toggles state to next bitmap | [
"Toggles",
"state",
"to",
"next",
"bitmap"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_widgets.py#L686-L702 |
250,331 | manns/pyspread | pyspread/src/gui/_widgets.py | EntryLinePanel.OnToggle | def OnToggle(self, event):
"""Toggle button event handler"""
if self.selection_toggle_button.GetValue():
self.entry_line.last_selection = self.entry_line.GetSelection()
self.entry_line.last_selection_string = \
self.entry_line.GetStringSelection()
sel... | python | def OnToggle(self, event):
if self.selection_toggle_button.GetValue():
self.entry_line.last_selection = self.entry_line.GetSelection()
self.entry_line.last_selection_string = \
self.entry_line.GetStringSelection()
self.entry_line.last_table = self.main_window.... | [
"def",
"OnToggle",
"(",
"self",
",",
"event",
")",
":",
"if",
"self",
".",
"selection_toggle_button",
".",
"GetValue",
"(",
")",
":",
"self",
".",
"entry_line",
".",
"last_selection",
"=",
"self",
".",
"entry_line",
".",
"GetSelection",
"(",
")",
"self",
... | Toggle button event handler | [
"Toggle",
"button",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_widgets.py#L792-L807 |
250,332 | manns/pyspread | pyspread/src/gui/_widgets.py | EntryLine.OnContentChange | def OnContentChange(self, event):
"""Event handler for updating the content"""
self.ignore_changes = True
self.SetValue(u"" if event.text is None else event.text)
self.ignore_changes = False
event.Skip() | python | def OnContentChange(self, event):
self.ignore_changes = True
self.SetValue(u"" if event.text is None else event.text)
self.ignore_changes = False
event.Skip() | [
"def",
"OnContentChange",
"(",
"self",
",",
"event",
")",
":",
"self",
".",
"ignore_changes",
"=",
"True",
"self",
".",
"SetValue",
"(",
"u\"\"",
"if",
"event",
".",
"text",
"is",
"None",
"else",
"event",
".",
"text",
")",
"self",
".",
"ignore_changes",
... | Event handler for updating the content | [
"Event",
"handler",
"for",
"updating",
"the",
"content"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_widgets.py#L854-L862 |
250,333 | manns/pyspread | pyspread/src/gui/_widgets.py | EntryLine.OnGridSelection | def OnGridSelection(self, event):
"""Event handler for grid selection in selection mode adds text"""
current_table = copy(self.main_window.grid.current_table)
post_command_event(self, self.GridActionTableSwitchMsg,
newtable=self.last_table)
if is_gtk():
... | python | def OnGridSelection(self, event):
current_table = copy(self.main_window.grid.current_table)
post_command_event(self, self.GridActionTableSwitchMsg,
newtable=self.last_table)
if is_gtk():
try:
wx.Yield()
except:
p... | [
"def",
"OnGridSelection",
"(",
"self",
",",
"event",
")",
":",
"current_table",
"=",
"copy",
"(",
"self",
".",
"main_window",
".",
"grid",
".",
"current_table",
")",
"post_command_event",
"(",
"self",
",",
"self",
".",
"GridActionTableSwitchMsg",
",",
"newtabl... | Event handler for grid selection in selection mode adds text | [
"Event",
"handler",
"for",
"grid",
"selection",
"in",
"selection",
"mode",
"adds",
"text"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_widgets.py#L864-L887 |
250,334 | manns/pyspread | pyspread/src/gui/_widgets.py | EntryLine.OnText | def OnText(self, event):
"""Text event method evals the cell and updates the grid"""
if not self.ignore_changes:
post_command_event(self, self.CodeEntryMsg, code=event.GetString())
self.main_window.grid.grid_renderer.cell_cache.clear()
event.Skip() | python | def OnText(self, event):
if not self.ignore_changes:
post_command_event(self, self.CodeEntryMsg, code=event.GetString())
self.main_window.grid.grid_renderer.cell_cache.clear()
event.Skip() | [
"def",
"OnText",
"(",
"self",
",",
"event",
")",
":",
"if",
"not",
"self",
".",
"ignore_changes",
":",
"post_command_event",
"(",
"self",
",",
"self",
".",
"CodeEntryMsg",
",",
"code",
"=",
"event",
".",
"GetString",
"(",
")",
")",
"self",
".",
"main_w... | Text event method evals the cell and updates the grid | [
"Text",
"event",
"method",
"evals",
"the",
"cell",
"and",
"updates",
"the",
"grid"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_widgets.py#L894-L902 |
250,335 | manns/pyspread | pyspread/src/gui/_widgets.py | EntryLine.OnChar | def OnChar(self, event):
"""Key event method
* Forces grid update on <Enter> key
* Handles insertion of cell access code
"""
if not self.ignore_changes:
# Handle special keys
keycode = event.GetKeyCode()
if keycode == 13 and not self.Get... | python | def OnChar(self, event):
if not self.ignore_changes:
# Handle special keys
keycode = event.GetKeyCode()
if keycode == 13 and not self.GetStringSelection():
# <Enter> pressed and no selection --> Focus on grid
self.main_window.grid.SetFocus()
... | [
"def",
"OnChar",
"(",
"self",
",",
"event",
")",
":",
"if",
"not",
"self",
".",
"ignore_changes",
":",
"# Handle special keys",
"keycode",
"=",
"event",
".",
"GetKeyCode",
"(",
")",
"if",
"keycode",
"==",
"13",
"and",
"not",
"self",
".",
"GetStringSelectio... | Key event method
* Forces grid update on <Enter> key
* Handles insertion of cell access code | [
"Key",
"event",
"method"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_widgets.py#L904-L1013 |
250,336 | manns/pyspread | pyspread/src/gui/_widgets.py | StatusBar.Reposition | def Reposition(self):
"""Reposition the checkbox"""
rect = self.GetFieldRect(1)
self.safemode_staticbmp.SetPosition((rect.x, rect.y))
self.size_changed = False | python | def Reposition(self):
rect = self.GetFieldRect(1)
self.safemode_staticbmp.SetPosition((rect.x, rect.y))
self.size_changed = False | [
"def",
"Reposition",
"(",
"self",
")",
":",
"rect",
"=",
"self",
".",
"GetFieldRect",
"(",
"1",
")",
"self",
".",
"safemode_staticbmp",
".",
"SetPosition",
"(",
"(",
"rect",
".",
"x",
",",
"rect",
".",
"y",
")",
")",
"self",
".",
"size_changed",
"=",... | Reposition the checkbox | [
"Reposition",
"the",
"checkbox"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_widgets.py#L1088-L1093 |
250,337 | manns/pyspread | pyspread/src/gui/_widgets.py | TableChoiceIntCtrl.change_max | def change_max(self, no_tabs):
"""Updates to a new number of tables
Fixes current table if out of bounds.
Parameters
----------
no_tabs: Integer
\tNumber of tables for choice
"""
self.no_tabs = no_tabs
if self.GetValue() >= no_tabs:
... | python | def change_max(self, no_tabs):
self.no_tabs = no_tabs
if self.GetValue() >= no_tabs:
self.SetValue(no_tabs - 1) | [
"def",
"change_max",
"(",
"self",
",",
"no_tabs",
")",
":",
"self",
".",
"no_tabs",
"=",
"no_tabs",
"if",
"self",
".",
"GetValue",
"(",
")",
">=",
"no_tabs",
":",
"self",
".",
"SetValue",
"(",
"no_tabs",
"-",
"1",
")"
] | Updates to a new number of tables
Fixes current table if out of bounds.
Parameters
----------
no_tabs: Integer
\tNumber of tables for choice | [
"Updates",
"to",
"a",
"new",
"number",
"of",
"tables"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_widgets.py#L1139-L1154 |
250,338 | manns/pyspread | pyspread/src/gui/_widgets.py | TableChoiceIntCtrl._fromGUI | def _fromGUI(self, value):
"""
Conversion function used in getting the value of the control.
"""
# One or more of the underlying text control implementations
# issue an intermediate EVT_TEXT when replacing the control's
# value, where the intermediate value is an empty ... | python | def _fromGUI(self, value):
# One or more of the underlying text control implementations
# issue an intermediate EVT_TEXT when replacing the control's
# value, where the intermediate value is an empty string.
# So, to ensure consistency and to prevent spurious ValueErrors,
# we ma... | [
"def",
"_fromGUI",
"(",
"self",
",",
"value",
")",
":",
"# One or more of the underlying text control implementations",
"# issue an intermediate EVT_TEXT when replacing the control's",
"# value, where the intermediate value is an empty string.",
"# So, to ensure consistency and to prevent spur... | Conversion function used in getting the value of the control. | [
"Conversion",
"function",
"used",
"in",
"getting",
"the",
"value",
"of",
"the",
"control",
"."
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_widgets.py#L1163-L1191 |
250,339 | manns/pyspread | pyspread/src/gui/_widgets.py | TableChoiceIntCtrl.OnInt | def OnInt(self, event):
"""IntCtrl event method that updates the current table"""
value = event.GetValue()
current_time = time.clock()
if current_time < self.last_change_s + 0.01:
return
self.last_change_s = current_time
self.cursor_pos = wx.TextCtrl.GetIns... | python | def OnInt(self, event):
value = event.GetValue()
current_time = time.clock()
if current_time < self.last_change_s + 0.01:
return
self.last_change_s = current_time
self.cursor_pos = wx.TextCtrl.GetInsertionPoint(self) + 1
if event.GetValue() > self.no_tabs -... | [
"def",
"OnInt",
"(",
"self",
",",
"event",
")",
":",
"value",
"=",
"event",
".",
"GetValue",
"(",
")",
"current_time",
"=",
"time",
".",
"clock",
"(",
")",
"if",
"current_time",
"<",
"self",
".",
"last_change_s",
"+",
"0.01",
":",
"return",
"self",
"... | IntCtrl event method that updates the current table | [
"IntCtrl",
"event",
"method",
"that",
"updates",
"the",
"current",
"table"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_widgets.py#L1193-L1210 |
250,340 | manns/pyspread | pyspread/src/gui/_widgets.py | TableChoiceListCtrl.OnItemSelected | def OnItemSelected(self, event):
"""Item selection event handler"""
value = event.m_itemIndex
self.startIndex = value
self.switching = True
post_command_event(self, self.GridActionTableSwitchMsg, newtable=value)
self.switching = False
event.Skip() | python | def OnItemSelected(self, event):
value = event.m_itemIndex
self.startIndex = value
self.switching = True
post_command_event(self, self.GridActionTableSwitchMsg, newtable=value)
self.switching = False
event.Skip() | [
"def",
"OnItemSelected",
"(",
"self",
",",
"event",
")",
":",
"value",
"=",
"event",
".",
"m_itemIndex",
"self",
".",
"startIndex",
"=",
"value",
"self",
".",
"switching",
"=",
"True",
"post_command_event",
"(",
"self",
",",
"self",
".",
"GridActionTableSwit... | Item selection event handler | [
"Item",
"selection",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_widgets.py#L1302-L1312 |
250,341 | manns/pyspread | pyspread/src/gui/_widgets.py | TableChoiceListCtrl.OnResizeGrid | def OnResizeGrid(self, event):
"""Event handler for grid resizing"""
shape = min(event.shape[2], 2**30)
self.SetItemCount(shape)
event.Skip() | python | def OnResizeGrid(self, event):
shape = min(event.shape[2], 2**30)
self.SetItemCount(shape)
event.Skip() | [
"def",
"OnResizeGrid",
"(",
"self",
",",
"event",
")",
":",
"shape",
"=",
"min",
"(",
"event",
".",
"shape",
"[",
"2",
"]",
",",
"2",
"**",
"30",
")",
"self",
".",
"SetItemCount",
"(",
"shape",
")",
"event",
".",
"Skip",
"(",
")"
] | Event handler for grid resizing | [
"Event",
"handler",
"for",
"grid",
"resizing"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_widgets.py#L1314-L1319 |
250,342 | manns/pyspread | pyspread/src/gui/_widgets.py | TableChoiceListCtrl.OnMouseUp | def OnMouseUp(self, event):
"""Generate a dropIndex.
Process: check self.IsInControl, check self.IsDrag, HitTest,
compare HitTest value
The mouse can end up in 5 different places:
Outside the Control
On itself
Above its starting point and on another item... | python | def OnMouseUp(self, event):
if not self.IsInControl: # 1. Outside the control : Do Nothing
self.IsDrag = False
elif self.IsDrag:
if not self.IsDrag:
# In control and is a drag event : Determine Location
self.hitIndex = self.HitTest(event.GetPositi... | [
"def",
"OnMouseUp",
"(",
"self",
",",
"event",
")",
":",
"if",
"not",
"self",
".",
"IsInControl",
":",
"# 1. Outside the control : Do Nothing",
"self",
".",
"IsDrag",
"=",
"False",
"elif",
"self",
".",
"IsDrag",
":",
"if",
"not",
"self",
".",
"IsDrag",
":"... | Generate a dropIndex.
Process: check self.IsInControl, check self.IsDrag, HitTest,
compare HitTest value
The mouse can end up in 5 different places:
Outside the Control
On itself
Above its starting point and on another item
Below its starting point and o... | [
"Generate",
"a",
"dropIndex",
"."
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_widgets.py#L1352-L1401 |
250,343 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindow._set_properties | def _set_properties(self):
"""Setup title, icon, size, scale, statusbar, main grid"""
self.set_icon(icons["PyspreadLogo"])
# Without minimum size, initial size is minimum size in wxGTK
self.minSizeSet = False
# Leave save mode
post_command_event(self, self.SafeModeExit... | python | def _set_properties(self):
self.set_icon(icons["PyspreadLogo"])
# Without minimum size, initial size is minimum size in wxGTK
self.minSizeSet = False
# Leave save mode
post_command_event(self, self.SafeModeExitMsg) | [
"def",
"_set_properties",
"(",
"self",
")",
":",
"self",
".",
"set_icon",
"(",
"icons",
"[",
"\"PyspreadLogo\"",
"]",
")",
"# Without minimum size, initial size is minimum size in wxGTK",
"self",
".",
"minSizeSet",
"=",
"False",
"# Leave save mode",
"post_command_event",
... | Setup title, icon, size, scale, statusbar, main grid | [
"Setup",
"title",
"icon",
"size",
"scale",
"statusbar",
"main",
"grid"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L203-L212 |
250,344 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindow._set_menu_toggles | def _set_menu_toggles(self):
"""Enable menu bar view item checkmarks"""
toggles = [
(self.main_toolbar, "main_window_toolbar", _("Main toolbar")),
(self.macro_toolbar, "macro_toolbar", _("Macro toolbar")),
(self.macro_panel, "macro_panel", _("Macro panel")),
... | python | def _set_menu_toggles(self):
toggles = [
(self.main_toolbar, "main_window_toolbar", _("Main toolbar")),
(self.macro_toolbar, "macro_toolbar", _("Macro toolbar")),
(self.macro_panel, "macro_panel", _("Macro panel")),
(self.attributes_toolbar, "attributes_toolbar",
... | [
"def",
"_set_menu_toggles",
"(",
"self",
")",
":",
"toggles",
"=",
"[",
"(",
"self",
".",
"main_toolbar",
",",
"\"main_window_toolbar\"",
",",
"_",
"(",
"\"Main toolbar\"",
")",
")",
",",
"(",
"self",
".",
"macro_toolbar",
",",
"\"macro_toolbar\"",
",",
"_",... | Enable menu bar view item checkmarks | [
"Enable",
"menu",
"bar",
"view",
"item",
"checkmarks"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L214-L240 |
250,345 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindow.set_icon | def set_icon(self, bmp):
"""Sets main window icon to given wx.Bitmap"""
_icon = wx.EmptyIcon()
_icon.CopyFromBitmap(bmp)
self.SetIcon(_icon) | python | def set_icon(self, bmp):
_icon = wx.EmptyIcon()
_icon.CopyFromBitmap(bmp)
self.SetIcon(_icon) | [
"def",
"set_icon",
"(",
"self",
",",
"bmp",
")",
":",
"_icon",
"=",
"wx",
".",
"EmptyIcon",
"(",
")",
"_icon",
".",
"CopyFromBitmap",
"(",
"bmp",
")",
"self",
".",
"SetIcon",
"(",
"_icon",
")"
] | Sets main window icon to given wx.Bitmap | [
"Sets",
"main",
"window",
"icon",
"to",
"given",
"wx",
".",
"Bitmap"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L412-L417 |
250,346 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers.OnToggleFullscreen | def OnToggleFullscreen(self, event):
"""Fullscreen event handler"""
is_full_screen = self.main_window.IsFullScreen()
# Make sure that only the grid is shown in fullscreen mode
if is_full_screen:
try:
self.main_window.grid.SetRowLabelSize(self.row_label_size)... | python | def OnToggleFullscreen(self, event):
is_full_screen = self.main_window.IsFullScreen()
# Make sure that only the grid is shown in fullscreen mode
if is_full_screen:
try:
self.main_window.grid.SetRowLabelSize(self.row_label_size)
self.main_window.grid.S... | [
"def",
"OnToggleFullscreen",
"(",
"self",
",",
"event",
")",
":",
"is_full_screen",
"=",
"self",
".",
"main_window",
".",
"IsFullScreen",
"(",
")",
"# Make sure that only the grid is shown in fullscreen mode",
"if",
"is_full_screen",
":",
"try",
":",
"self",
".",
"m... | Fullscreen event handler | [
"Fullscreen",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L455-L491 |
250,347 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers.OnContentChanged | def OnContentChanged(self, event):
"""Titlebar star adjustment event handler"""
self.main_window.grid.update_attribute_toolbar()
title = self.main_window.GetTitle()
if undo.stack().haschanged():
# Put * in front of title
if title[:2] != "* ":
ne... | python | def OnContentChanged(self, event):
self.main_window.grid.update_attribute_toolbar()
title = self.main_window.GetTitle()
if undo.stack().haschanged():
# Put * in front of title
if title[:2] != "* ":
new_title = "* " + title
post_command_ev... | [
"def",
"OnContentChanged",
"(",
"self",
",",
"event",
")",
":",
"self",
".",
"main_window",
".",
"grid",
".",
"update_attribute_toolbar",
"(",
")",
"title",
"=",
"self",
".",
"main_window",
".",
"GetTitle",
"(",
")",
"if",
"undo",
".",
"stack",
"(",
")",... | Titlebar star adjustment event handler | [
"Titlebar",
"star",
"adjustment",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L493-L511 |
250,348 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers.OnSafeModeEntry | def OnSafeModeEntry(self, event):
"""Safe mode entry event handler"""
# Enable menu item for leaving safe mode
self.main_window.main_menu.enable_file_approve(True)
self.main_window.grid.Refresh()
event.Skip() | python | def OnSafeModeEntry(self, event):
# Enable menu item for leaving safe mode
self.main_window.main_menu.enable_file_approve(True)
self.main_window.grid.Refresh()
event.Skip() | [
"def",
"OnSafeModeEntry",
"(",
"self",
",",
"event",
")",
":",
"# Enable menu item for leaving safe mode",
"self",
".",
"main_window",
".",
"main_menu",
".",
"enable_file_approve",
"(",
"True",
")",
"self",
".",
"main_window",
".",
"grid",
".",
"Refresh",
"(",
"... | Safe mode entry event handler | [
"Safe",
"mode",
"entry",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L518-L527 |
250,349 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers.OnSafeModeExit | def OnSafeModeExit(self, event):
"""Safe mode exit event handler"""
# Run macros
# self.MainGrid.model.pysgrid.sgrid.execute_macros(safe_mode=False)
# Disable menu item for leaving safe mode
self.main_window.main_menu.enable_file_approve(False)
self.main_window.grid.... | python | def OnSafeModeExit(self, event):
# Run macros
# self.MainGrid.model.pysgrid.sgrid.execute_macros(safe_mode=False)
# Disable menu item for leaving safe mode
self.main_window.main_menu.enable_file_approve(False)
self.main_window.grid.Refresh()
event.Skip() | [
"def",
"OnSafeModeExit",
"(",
"self",
",",
"event",
")",
":",
"# Run macros",
"# self.MainGrid.model.pysgrid.sgrid.execute_macros(safe_mode=False)",
"# Disable menu item for leaving safe mode",
"self",
".",
"main_window",
".",
"main_menu",
".",
"enable_file_approve",
"(",
"Fals... | Safe mode exit event handler | [
"Safe",
"mode",
"exit",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L529-L542 |
250,350 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers.OnClose | def OnClose(self, event):
"""Program exit event handler"""
# If changes have taken place save of old grid
if undo.stack().haschanged():
save_choice = self.interfaces.get_save_request_from_user()
if save_choice is None:
# Cancelled close operation
... | python | def OnClose(self, event):
# If changes have taken place save of old grid
if undo.stack().haschanged():
save_choice = self.interfaces.get_save_request_from_user()
if save_choice is None:
# Cancelled close operation
return
elif save_ch... | [
"def",
"OnClose",
"(",
"self",
",",
"event",
")",
":",
"# If changes have taken place save of old grid",
"if",
"undo",
".",
"stack",
"(",
")",
".",
"haschanged",
"(",
")",
":",
"save_choice",
"=",
"self",
".",
"interfaces",
".",
"get_save_request_from_user",
"("... | Program exit event handler | [
"Program",
"exit",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L544-L583 |
250,351 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers.OnSpellCheckToggle | def OnSpellCheckToggle(self, event):
"""Spell checking toggle event handler"""
spelltoolid = self.main_window.main_toolbar.label2id["CheckSpelling"]
self.main_window.main_toolbar.ToggleTool(spelltoolid,
not config["check_spelling"])
conf... | python | def OnSpellCheckToggle(self, event):
spelltoolid = self.main_window.main_toolbar.label2id["CheckSpelling"]
self.main_window.main_toolbar.ToggleTool(spelltoolid,
not config["check_spelling"])
config["check_spelling"] = repr(not config["check_spell... | [
"def",
"OnSpellCheckToggle",
"(",
"self",
",",
"event",
")",
":",
"spelltoolid",
"=",
"self",
".",
"main_window",
".",
"main_toolbar",
".",
"label2id",
"[",
"\"CheckSpelling\"",
"]",
"self",
".",
"main_window",
".",
"main_toolbar",
".",
"ToggleTool",
"(",
"spe... | Spell checking toggle event handler | [
"Spell",
"checking",
"toggle",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L585-L595 |
250,352 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers.OnPreferences | def OnPreferences(self, event):
"""Preferences event handler that launches preferences dialog"""
preferences = self.interfaces.get_preferences_from_user()
if preferences:
for key in preferences:
if type(config[key]) in (type(u""), type("")):
conf... | python | def OnPreferences(self, event):
preferences = self.interfaces.get_preferences_from_user()
if preferences:
for key in preferences:
if type(config[key]) in (type(u""), type("")):
config[key] = preferences[key]
else:
confi... | [
"def",
"OnPreferences",
"(",
"self",
",",
"event",
")",
":",
"preferences",
"=",
"self",
".",
"interfaces",
".",
"get_preferences_from_user",
"(",
")",
"if",
"preferences",
":",
"for",
"key",
"in",
"preferences",
":",
"if",
"type",
"(",
"config",
"[",
"key... | Preferences event handler that launches preferences dialog | [
"Preferences",
"event",
"handler",
"that",
"launches",
"preferences",
"dialog"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L599-L612 |
250,353 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers.OnNewGpgKey | def OnNewGpgKey(self, event):
"""New GPG key event handler.
Launches GPG choice and creation dialog
"""
if gnupg is None:
return
if genkey is None:
# gnupg is not present
self.interfaces.display_warning(
_("Python gnupg not ... | python | def OnNewGpgKey(self, event):
if gnupg is None:
return
if genkey is None:
# gnupg is not present
self.interfaces.display_warning(
_("Python gnupg not found. No key selected."),
_("Key selection failed."))
else:
# gn... | [
"def",
"OnNewGpgKey",
"(",
"self",
",",
"event",
")",
":",
"if",
"gnupg",
"is",
"None",
":",
"return",
"if",
"genkey",
"is",
"None",
":",
"# gnupg is not present",
"self",
".",
"interfaces",
".",
"display_warning",
"(",
"_",
"(",
"\"Python gnupg not found. No ... | New GPG key event handler.
Launches GPG choice and creation dialog | [
"New",
"GPG",
"key",
"event",
"handler",
"."
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L614-L631 |
250,354 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers._toggle_pane | def _toggle_pane(self, pane):
"""Toggles visibility of given aui pane
Parameters
----------
pane: String
\tPane name
"""
if pane.IsShown():
pane.Hide()
else:
pane.Show()
self.main_window._mgr.Update() | python | def _toggle_pane(self, pane):
if pane.IsShown():
pane.Hide()
else:
pane.Show()
self.main_window._mgr.Update() | [
"def",
"_toggle_pane",
"(",
"self",
",",
"pane",
")",
":",
"if",
"pane",
".",
"IsShown",
"(",
")",
":",
"pane",
".",
"Hide",
"(",
")",
"else",
":",
"pane",
".",
"Show",
"(",
")",
"self",
".",
"main_window",
".",
"_mgr",
".",
"Update",
"(",
")"
] | Toggles visibility of given aui pane
Parameters
----------
pane: String
\tPane name | [
"Toggles",
"visibility",
"of",
"given",
"aui",
"pane"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L635-L651 |
250,355 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers.OnMainToolbarToggle | def OnMainToolbarToggle(self, event):
"""Main window toolbar toggle event handler"""
self.main_window.main_toolbar.SetGripperVisible(True)
main_toolbar_info = \
self.main_window._mgr.GetPane("main_window_toolbar")
self._toggle_pane(main_toolbar_info)
event.Skip() | python | def OnMainToolbarToggle(self, event):
self.main_window.main_toolbar.SetGripperVisible(True)
main_toolbar_info = \
self.main_window._mgr.GetPane("main_window_toolbar")
self._toggle_pane(main_toolbar_info)
event.Skip() | [
"def",
"OnMainToolbarToggle",
"(",
"self",
",",
"event",
")",
":",
"self",
".",
"main_window",
".",
"main_toolbar",
".",
"SetGripperVisible",
"(",
"True",
")",
"main_toolbar_info",
"=",
"self",
".",
"main_window",
".",
"_mgr",
".",
"GetPane",
"(",
"\"main_wind... | Main window toolbar toggle event handler | [
"Main",
"window",
"toolbar",
"toggle",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L653-L662 |
250,356 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers.OnMacroToolbarToggle | def OnMacroToolbarToggle(self, event):
"""Macro toolbar toggle event handler"""
self.main_window.macro_toolbar.SetGripperVisible(True)
macro_toolbar_info = self.main_window._mgr.GetPane("macro_toolbar")
self._toggle_pane(macro_toolbar_info)
event.Skip() | python | def OnMacroToolbarToggle(self, event):
self.main_window.macro_toolbar.SetGripperVisible(True)
macro_toolbar_info = self.main_window._mgr.GetPane("macro_toolbar")
self._toggle_pane(macro_toolbar_info)
event.Skip() | [
"def",
"OnMacroToolbarToggle",
"(",
"self",
",",
"event",
")",
":",
"self",
".",
"main_window",
".",
"macro_toolbar",
".",
"SetGripperVisible",
"(",
"True",
")",
"macro_toolbar_info",
"=",
"self",
".",
"main_window",
".",
"_mgr",
".",
"GetPane",
"(",
"\"macro_... | Macro toolbar toggle event handler | [
"Macro",
"toolbar",
"toggle",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L664-L672 |
250,357 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers.OnWidgetToolbarToggle | def OnWidgetToolbarToggle(self, event):
"""Widget toolbar toggle event handler"""
self.main_window.widget_toolbar.SetGripperVisible(True)
widget_toolbar_info = self.main_window._mgr.GetPane("widget_toolbar")
self._toggle_pane(widget_toolbar_info)
event.Skip() | python | def OnWidgetToolbarToggle(self, event):
self.main_window.widget_toolbar.SetGripperVisible(True)
widget_toolbar_info = self.main_window._mgr.GetPane("widget_toolbar")
self._toggle_pane(widget_toolbar_info)
event.Skip() | [
"def",
"OnWidgetToolbarToggle",
"(",
"self",
",",
"event",
")",
":",
"self",
".",
"main_window",
".",
"widget_toolbar",
".",
"SetGripperVisible",
"(",
"True",
")",
"widget_toolbar_info",
"=",
"self",
".",
"main_window",
".",
"_mgr",
".",
"GetPane",
"(",
"\"wid... | Widget toolbar toggle event handler | [
"Widget",
"toolbar",
"toggle",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L674-L682 |
250,358 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers.OnAttributesToolbarToggle | def OnAttributesToolbarToggle(self, event):
"""Format toolbar toggle event handler"""
self.main_window.attributes_toolbar.SetGripperVisible(True)
attributes_toolbar_info = \
self.main_window._mgr.GetPane("attributes_toolbar")
self._toggle_pane(attributes_toolbar_info)
... | python | def OnAttributesToolbarToggle(self, event):
self.main_window.attributes_toolbar.SetGripperVisible(True)
attributes_toolbar_info = \
self.main_window._mgr.GetPane("attributes_toolbar")
self._toggle_pane(attributes_toolbar_info)
event.Skip() | [
"def",
"OnAttributesToolbarToggle",
"(",
"self",
",",
"event",
")",
":",
"self",
".",
"main_window",
".",
"attributes_toolbar",
".",
"SetGripperVisible",
"(",
"True",
")",
"attributes_toolbar_info",
"=",
"self",
".",
"main_window",
".",
"_mgr",
".",
"GetPane",
"... | Format toolbar toggle event handler | [
"Format",
"toolbar",
"toggle",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L684-L693 |
250,359 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers.OnFindToolbarToggle | def OnFindToolbarToggle(self, event):
"""Search toolbar toggle event handler"""
self.main_window.find_toolbar.SetGripperVisible(True)
find_toolbar_info = self.main_window._mgr.GetPane("find_toolbar")
self._toggle_pane(find_toolbar_info)
event.Skip() | python | def OnFindToolbarToggle(self, event):
self.main_window.find_toolbar.SetGripperVisible(True)
find_toolbar_info = self.main_window._mgr.GetPane("find_toolbar")
self._toggle_pane(find_toolbar_info)
event.Skip() | [
"def",
"OnFindToolbarToggle",
"(",
"self",
",",
"event",
")",
":",
"self",
".",
"main_window",
".",
"find_toolbar",
".",
"SetGripperVisible",
"(",
"True",
")",
"find_toolbar_info",
"=",
"self",
".",
"main_window",
".",
"_mgr",
".",
"GetPane",
"(",
"\"find_tool... | Search toolbar toggle event handler | [
"Search",
"toolbar",
"toggle",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L695-L704 |
250,360 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers.OnEntryLineToggle | def OnEntryLineToggle(self, event):
"""Entry line toggle event handler"""
entry_line_panel_info = \
self.main_window._mgr.GetPane("entry_line_panel")
self._toggle_pane(entry_line_panel_info)
event.Skip() | python | def OnEntryLineToggle(self, event):
entry_line_panel_info = \
self.main_window._mgr.GetPane("entry_line_panel")
self._toggle_pane(entry_line_panel_info)
event.Skip() | [
"def",
"OnEntryLineToggle",
"(",
"self",
",",
"event",
")",
":",
"entry_line_panel_info",
"=",
"self",
".",
"main_window",
".",
"_mgr",
".",
"GetPane",
"(",
"\"entry_line_panel\"",
")",
"self",
".",
"_toggle_pane",
"(",
"entry_line_panel_info",
")",
"event",
"."... | Entry line toggle event handler | [
"Entry",
"line",
"toggle",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L706-L714 |
250,361 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers.OnTableListToggle | def OnTableListToggle(self, event):
"""Table list toggle event handler"""
table_list_panel_info = \
self.main_window._mgr.GetPane("table_list_panel")
self._toggle_pane(table_list_panel_info)
event.Skip() | python | def OnTableListToggle(self, event):
table_list_panel_info = \
self.main_window._mgr.GetPane("table_list_panel")
self._toggle_pane(table_list_panel_info)
event.Skip() | [
"def",
"OnTableListToggle",
"(",
"self",
",",
"event",
")",
":",
"table_list_panel_info",
"=",
"self",
".",
"main_window",
".",
"_mgr",
".",
"GetPane",
"(",
"\"table_list_panel\"",
")",
"self",
".",
"_toggle_pane",
"(",
"table_list_panel_info",
")",
"event",
"."... | Table list toggle event handler | [
"Table",
"list",
"toggle",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L726-L734 |
250,362 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers.OnNew | def OnNew(self, event):
"""New grid event handler"""
# If changes have taken place save of old grid
if undo.stack().haschanged():
save_choice = self.interfaces.get_save_request_from_user()
if save_choice is None:
# Cancelled close operation
... | python | def OnNew(self, event):
# If changes have taken place save of old grid
if undo.stack().haschanged():
save_choice = self.interfaces.get_save_request_from_user()
if save_choice is None:
# Cancelled close operation
return
elif save_choi... | [
"def",
"OnNew",
"(",
"self",
",",
"event",
")",
":",
"# If changes have taken place save of old grid",
"if",
"undo",
".",
"stack",
"(",
")",
".",
"haschanged",
"(",
")",
":",
"save_choice",
"=",
"self",
".",
"interfaces",
".",
"get_save_request_from_user",
"(",
... | New grid event handler | [
"New",
"grid",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L757-L830 |
250,363 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers.OnOpen | def OnOpen(self, event):
"""File open event handler"""
# If changes have taken place save of old grid
if undo.stack().haschanged():
save_choice = self.interfaces.get_save_request_from_user()
if save_choice is None:
# Cancelled close operation
... | python | def OnOpen(self, event):
# If changes have taken place save of old grid
if undo.stack().haschanged():
save_choice = self.interfaces.get_save_request_from_user()
if save_choice is None:
# Cancelled close operation
return
elif save_choi... | [
"def",
"OnOpen",
"(",
"self",
",",
"event",
")",
":",
"# If changes have taken place save of old grid",
"if",
"undo",
".",
"stack",
"(",
")",
".",
"haschanged",
"(",
")",
":",
"save_choice",
"=",
"self",
".",
"interfaces",
".",
"get_save_request_from_user",
"(",... | File open event handler | [
"File",
"open",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L832-L905 |
250,364 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers.OnSave | def OnSave(self, event):
"""File save event handler"""
try:
filetype = event.attr["filetype"]
except (KeyError, AttributeError):
filetype = None
filepath = self.main_window.filepath
if filepath is None:
filetype = config["default_save_filety... | python | def OnSave(self, event):
try:
filetype = event.attr["filetype"]
except (KeyError, AttributeError):
filetype = None
filepath = self.main_window.filepath
if filepath is None:
filetype = config["default_save_filetype"]
if filetype is None:
... | [
"def",
"OnSave",
"(",
"self",
",",
"event",
")",
":",
"try",
":",
"filetype",
"=",
"event",
".",
"attr",
"[",
"\"filetype\"",
"]",
"except",
"(",
"KeyError",
",",
"AttributeError",
")",
":",
"filetype",
"=",
"None",
"filepath",
"=",
"self",
".",
"main_... | File save event handler | [
"File",
"save",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L908-L954 |
250,365 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers.OnSaveAs | def OnSaveAs(self, event):
"""File save as event handler"""
# Get filepath from user
f2w = get_filetypes2wildcards(["pys", "pysu", "xls", "all"])
filetypes = f2w.keys()
wildcards = f2w.values()
wildcard = "|".join(wildcards)
message = _("Choose filename for sa... | python | def OnSaveAs(self, event):
# Get filepath from user
f2w = get_filetypes2wildcards(["pys", "pysu", "xls", "all"])
filetypes = f2w.keys()
wildcards = f2w.values()
wildcard = "|".join(wildcards)
message = _("Choose filename for saving.")
style = wx.SAVE
d... | [
"def",
"OnSaveAs",
"(",
"self",
",",
"event",
")",
":",
"# Get filepath from user",
"f2w",
"=",
"get_filetypes2wildcards",
"(",
"[",
"\"pys\"",
",",
"\"pysu\"",
",",
"\"xls\"",
",",
"\"all\"",
"]",
")",
"filetypes",
"=",
"f2w",
".",
"keys",
"(",
")",
"wild... | File save as event handler | [
"File",
"save",
"as",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L956-L1025 |
250,366 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers.OnImport | def OnImport(self, event):
"""File import event handler"""
# Get filepath from user
wildcards = get_filetypes2wildcards(["csv", "txt"]).values()
wildcard = "|".join(wildcards)
message = _("Choose file to import.")
style = wx.OPEN
filepath, filterindex = \
... | python | def OnImport(self, event):
# Get filepath from user
wildcards = get_filetypes2wildcards(["csv", "txt"]).values()
wildcard = "|".join(wildcards)
message = _("Choose file to import.")
style = wx.OPEN
filepath, filterindex = \
self.interfaces.get_filepath_finde... | [
"def",
"OnImport",
"(",
"self",
",",
"event",
")",
":",
"# Get filepath from user",
"wildcards",
"=",
"get_filetypes2wildcards",
"(",
"[",
"\"csv\"",
",",
"\"txt\"",
"]",
")",
".",
"values",
"(",
")",
"wildcard",
"=",
"\"|\"",
".",
"join",
"(",
"wildcards",
... | File import event handler | [
"File",
"import",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L1027-L1057 |
250,367 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers.OnExport | def OnExport(self, event):
"""File export event handler
Currently, only CSV export is supported
"""
code_array = self.main_window.grid.code_array
tab = self.main_window.grid.current_table
selection = self.main_window.grid.selection
# Check if no selection is ... | python | def OnExport(self, event):
code_array = self.main_window.grid.code_array
tab = self.main_window.grid.current_table
selection = self.main_window.grid.selection
# Check if no selection is present
selection_bbox = selection.get_bbox()
f2w = get_filetypes2wildcards(["csv"... | [
"def",
"OnExport",
"(",
"self",
",",
"event",
")",
":",
"code_array",
"=",
"self",
".",
"main_window",
".",
"grid",
".",
"code_array",
"tab",
"=",
"self",
".",
"main_window",
".",
"grid",
".",
"current_table",
"selection",
"=",
"self",
".",
"main_window",
... | File export event handler
Currently, only CSV export is supported | [
"File",
"export",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L1059-L1143 |
250,368 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers.OnExportPDF | def OnExportPDF(self, event):
"""Export PDF event handler"""
wildcards = get_filetypes2wildcards(["pdf"]).values()
if not wildcards:
return
wildcard = "|".join(wildcards)
# Get filepath from user
message = _("Choose file path for PDF export.")
sty... | python | def OnExportPDF(self, event):
wildcards = get_filetypes2wildcards(["pdf"]).values()
if not wildcards:
return
wildcard = "|".join(wildcards)
# Get filepath from user
message = _("Choose file path for PDF export.")
style = wx.SAVE
filepath, filterind... | [
"def",
"OnExportPDF",
"(",
"self",
",",
"event",
")",
":",
"wildcards",
"=",
"get_filetypes2wildcards",
"(",
"[",
"\"pdf\"",
"]",
")",
".",
"values",
"(",
")",
"if",
"not",
"wildcards",
":",
"return",
"wildcard",
"=",
"\"|\"",
".",
"join",
"(",
"wildcard... | Export PDF event handler | [
"Export",
"PDF",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L1145-L1168 |
250,369 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers.OnApprove | def OnApprove(self, event):
"""File approve event handler"""
if not self.main_window.safe_mode:
return
msg = _(u"You are going to approve and trust a file that\n"
u"you have not created yourself.\n"
u"After proceeding, the file is executed.\n \n"
... | python | def OnApprove(self, event):
if not self.main_window.safe_mode:
return
msg = _(u"You are going to approve and trust a file that\n"
u"you have not created yourself.\n"
u"After proceeding, the file is executed.\n \n"
u"It may harm your system as ... | [
"def",
"OnApprove",
"(",
"self",
",",
"event",
")",
":",
"if",
"not",
"self",
".",
"main_window",
".",
"safe_mode",
":",
"return",
"msg",
"=",
"_",
"(",
"u\"You are going to approve and trust a file that\\n\"",
"u\"you have not created yourself.\\n\"",
"u\"After proceed... | File approve event handler | [
"File",
"approve",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L1170-L1193 |
250,370 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers.OnClearGlobals | def OnClearGlobals(self, event):
"""Clear globals event handler"""
msg = _("Deleting globals and reloading modules cannot be undone."
" Proceed?")
short_msg = _("Really delete globals and modules?")
choice = self.main_window.interfaces.get_warning_choice(msg, short_msg)... | python | def OnClearGlobals(self, event):
msg = _("Deleting globals and reloading modules cannot be undone."
" Proceed?")
short_msg = _("Really delete globals and modules?")
choice = self.main_window.interfaces.get_warning_choice(msg, short_msg)
if choice:
self.main_... | [
"def",
"OnClearGlobals",
"(",
"self",
",",
"event",
")",
":",
"msg",
"=",
"_",
"(",
"\"Deleting globals and reloading modules cannot be undone.\"",
"\" Proceed?\"",
")",
"short_msg",
"=",
"_",
"(",
"\"Really delete globals and modules?\"",
")",
"choice",
"=",
"self",
... | Clear globals event handler | [
"Clear",
"globals",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L1195-L1209 |
250,371 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers.OnPageSetup | def OnPageSetup(self, event):
"""Page setup handler for printing framework"""
print_data = self.main_window.print_data
new_print_data = \
self.main_window.interfaces.get_print_setup(print_data)
self.main_window.print_data = new_print_data | python | def OnPageSetup(self, event):
print_data = self.main_window.print_data
new_print_data = \
self.main_window.interfaces.get_print_setup(print_data)
self.main_window.print_data = new_print_data | [
"def",
"OnPageSetup",
"(",
"self",
",",
"event",
")",
":",
"print_data",
"=",
"self",
".",
"main_window",
".",
"print_data",
"new_print_data",
"=",
"self",
".",
"main_window",
".",
"interfaces",
".",
"get_print_setup",
"(",
"print_data",
")",
"self",
".",
"m... | Page setup handler for printing framework | [
"Page",
"setup",
"handler",
"for",
"printing",
"framework"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L1213-L1219 |
250,372 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers._get_print_area | def _get_print_area(self):
"""Returns selection bounding box or visible area"""
# Get print area from current selection
selection = self.main_window.grid.selection
print_area = selection.get_bbox()
# If there is no selection use the visible area on the screen
if print_a... | python | def _get_print_area(self):
# Get print area from current selection
selection = self.main_window.grid.selection
print_area = selection.get_bbox()
# If there is no selection use the visible area on the screen
if print_area is None:
print_area = self.main_window.grid.ac... | [
"def",
"_get_print_area",
"(",
"self",
")",
":",
"# Get print area from current selection",
"selection",
"=",
"self",
".",
"main_window",
".",
"grid",
".",
"selection",
"print_area",
"=",
"selection",
".",
"get_bbox",
"(",
")",
"# If there is no selection use the visibl... | Returns selection bounding box or visible area | [
"Returns",
"selection",
"bounding",
"box",
"or",
"visible",
"area"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L1221-L1232 |
250,373 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers.OnPrintPreview | def OnPrintPreview(self, event):
"""Print preview handler"""
print_area = self._get_print_area()
print_data = self.main_window.print_data
self.main_window.actions.print_preview(print_area, print_data) | python | def OnPrintPreview(self, event):
print_area = self._get_print_area()
print_data = self.main_window.print_data
self.main_window.actions.print_preview(print_area, print_data) | [
"def",
"OnPrintPreview",
"(",
"self",
",",
"event",
")",
":",
"print_area",
"=",
"self",
".",
"_get_print_area",
"(",
")",
"print_data",
"=",
"self",
".",
"main_window",
".",
"print_data",
"self",
".",
"main_window",
".",
"actions",
".",
"print_preview",
"("... | Print preview handler | [
"Print",
"preview",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L1234-L1240 |
250,374 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers.OnPrint | def OnPrint(self, event):
"""Print event handler"""
print_area = self._get_print_area()
print_data = self.main_window.print_data
self.main_window.actions.printout(print_area, print_data) | python | def OnPrint(self, event):
print_area = self._get_print_area()
print_data = self.main_window.print_data
self.main_window.actions.printout(print_area, print_data) | [
"def",
"OnPrint",
"(",
"self",
",",
"event",
")",
":",
"print_area",
"=",
"self",
".",
"_get_print_area",
"(",
")",
"print_data",
"=",
"self",
".",
"main_window",
".",
"print_data",
"self",
".",
"main_window",
".",
"actions",
".",
"printout",
"(",
"print_a... | Print event handler | [
"Print",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L1242-L1248 |
250,375 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers.OnCut | def OnCut(self, event):
"""Clipboard cut event handler"""
entry_line = \
self.main_window.entry_line_panel.entry_line_panel.entry_line
if wx.Window.FindFocus() != entry_line:
selection = self.main_window.grid.selection
with undo.group(_("Cut")):
... | python | def OnCut(self, event):
entry_line = \
self.main_window.entry_line_panel.entry_line_panel.entry_line
if wx.Window.FindFocus() != entry_line:
selection = self.main_window.grid.selection
with undo.group(_("Cut")):
data = self.main_window.actions.cut(se... | [
"def",
"OnCut",
"(",
"self",
",",
"event",
")",
":",
"entry_line",
"=",
"self",
".",
"main_window",
".",
"entry_line_panel",
".",
"entry_line_panel",
".",
"entry_line",
"if",
"wx",
".",
"Window",
".",
"FindFocus",
"(",
")",
"!=",
"entry_line",
":",
"select... | Clipboard cut event handler | [
"Clipboard",
"cut",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L1252-L1271 |
250,376 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers.OnCopy | def OnCopy(self, event):
"""Clipboard copy event handler"""
focus = self.main_window.FindFocus()
if isinstance(focus, wx.TextCtrl):
# Copy selection from TextCtrl if in focus
focus.Copy()
else:
selection = self.main_window.grid.selection
... | python | def OnCopy(self, event):
focus = self.main_window.FindFocus()
if isinstance(focus, wx.TextCtrl):
# Copy selection from TextCtrl if in focus
focus.Copy()
else:
selection = self.main_window.grid.selection
data = self.main_window.actions.copy(select... | [
"def",
"OnCopy",
"(",
"self",
",",
"event",
")",
":",
"focus",
"=",
"self",
".",
"main_window",
".",
"FindFocus",
"(",
")",
"if",
"isinstance",
"(",
"focus",
",",
"wx",
".",
"TextCtrl",
")",
":",
"# Copy selection from TextCtrl if in focus",
"focus",
".",
... | Clipboard copy event handler | [
"Clipboard",
"copy",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L1273-L1287 |
250,377 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers.OnCopyResult | def OnCopyResult(self, event):
"""Clipboard copy results event handler"""
selection = self.main_window.grid.selection
data = self.main_window.actions.copy_result(selection)
# Check if result is a bitmap
if type(data) is wx._gdi.Bitmap:
# Copy bitmap to clipboard
... | python | def OnCopyResult(self, event):
selection = self.main_window.grid.selection
data = self.main_window.actions.copy_result(selection)
# Check if result is a bitmap
if type(data) is wx._gdi.Bitmap:
# Copy bitmap to clipboard
self.main_window.clipboard.set_clipboard(da... | [
"def",
"OnCopyResult",
"(",
"self",
",",
"event",
")",
":",
"selection",
"=",
"self",
".",
"main_window",
".",
"grid",
".",
"selection",
"data",
"=",
"self",
".",
"main_window",
".",
"actions",
".",
"copy_result",
"(",
"selection",
")",
"# Check if result is... | Clipboard copy results event handler | [
"Clipboard",
"copy",
"results",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L1289-L1305 |
250,378 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers.OnPaste | def OnPaste(self, event):
"""Clipboard paste event handler"""
data = self.main_window.clipboard.get_clipboard()
focus = self.main_window.FindFocus()
if isinstance(focus, wx.TextCtrl):
# Paste into TextCtrl if in focus
focus.WriteText(data)
else:
... | python | def OnPaste(self, event):
data = self.main_window.clipboard.get_clipboard()
focus = self.main_window.FindFocus()
if isinstance(focus, wx.TextCtrl):
# Paste into TextCtrl if in focus
focus.WriteText(data)
else:
# We got a grid selection
k... | [
"def",
"OnPaste",
"(",
"self",
",",
"event",
")",
":",
"data",
"=",
"self",
".",
"main_window",
".",
"clipboard",
".",
"get_clipboard",
"(",
")",
"focus",
"=",
"self",
".",
"main_window",
".",
"FindFocus",
"(",
")",
"if",
"isinstance",
"(",
"focus",
",... | Clipboard paste event handler | [
"Clipboard",
"paste",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L1307-L1327 |
250,379 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers.OnPasteAs | def OnPasteAs(self, event):
"""Clipboard paste as event handler"""
data = self.main_window.clipboard.get_clipboard()
key = self.main_window.grid.actions.cursor
with undo.group(_("Paste As...")):
self.main_window.actions.paste_as(key, data)
self.main_window.grid.For... | python | def OnPasteAs(self, event):
data = self.main_window.clipboard.get_clipboard()
key = self.main_window.grid.actions.cursor
with undo.group(_("Paste As...")):
self.main_window.actions.paste_as(key, data)
self.main_window.grid.ForceRefresh()
event.Skip() | [
"def",
"OnPasteAs",
"(",
"self",
",",
"event",
")",
":",
"data",
"=",
"self",
".",
"main_window",
".",
"clipboard",
".",
"get_clipboard",
"(",
")",
"key",
"=",
"self",
".",
"main_window",
".",
"grid",
".",
"actions",
".",
"cursor",
"with",
"undo",
".",... | Clipboard paste as event handler | [
"Clipboard",
"paste",
"as",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L1329-L1340 |
250,380 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers.OnSelectAll | def OnSelectAll(self, event):
"""Select all cells event handler"""
entry_line = \
self.main_window.entry_line_panel.entry_line_panel.entry_line
if wx.Window.FindFocus() != entry_line:
self.main_window.grid.SelectAll()
else:
entry_line.SelectAll() | python | def OnSelectAll(self, event):
entry_line = \
self.main_window.entry_line_panel.entry_line_panel.entry_line
if wx.Window.FindFocus() != entry_line:
self.main_window.grid.SelectAll()
else:
entry_line.SelectAll() | [
"def",
"OnSelectAll",
"(",
"self",
",",
"event",
")",
":",
"entry_line",
"=",
"self",
".",
"main_window",
".",
"entry_line_panel",
".",
"entry_line_panel",
".",
"entry_line",
"if",
"wx",
".",
"Window",
".",
"FindFocus",
"(",
")",
"!=",
"entry_line",
":",
"... | Select all cells event handler | [
"Select",
"all",
"cells",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L1343-L1353 |
250,381 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers.OnFontDialog | def OnFontDialog(self, event):
"""Event handler for launching font dialog"""
# Get current font data from current cell
cursor = self.main_window.grid.actions.cursor
attr = self.main_window.grid.code_array.cell_attributes[cursor]
size, style, weight, font = \
[attr[n... | python | def OnFontDialog(self, event):
# Get current font data from current cell
cursor = self.main_window.grid.actions.cursor
attr = self.main_window.grid.code_array.cell_attributes[cursor]
size, style, weight, font = \
[attr[name] for name in ["pointsize", "fontstyle", "fontweight... | [
"def",
"OnFontDialog",
"(",
"self",
",",
"event",
")",
":",
"# Get current font data from current cell",
"cursor",
"=",
"self",
".",
"main_window",
".",
"grid",
".",
"actions",
".",
"cursor",
"attr",
"=",
"self",
".",
"main_window",
".",
"grid",
".",
"code_arr... | Event handler for launching font dialog | [
"Event",
"handler",
"for",
"launching",
"font",
"dialog"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L1364-L1405 |
250,382 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers.OnTextColorDialog | def OnTextColorDialog(self, event):
"""Event handler for launching text color dialog"""
dlg = wx.ColourDialog(self.main_window)
# Ensure the full colour dialog is displayed,
# not the abbreviated version.
dlg.GetColourData().SetChooseFull(True)
if dlg.ShowModal() == wx... | python | def OnTextColorDialog(self, event):
dlg = wx.ColourDialog(self.main_window)
# Ensure the full colour dialog is displayed,
# not the abbreviated version.
dlg.GetColourData().SetChooseFull(True)
if dlg.ShowModal() == wx.ID_OK:
# Fetch color data
data = dl... | [
"def",
"OnTextColorDialog",
"(",
"self",
",",
"event",
")",
":",
"dlg",
"=",
"wx",
".",
"ColourDialog",
"(",
"self",
".",
"main_window",
")",
"# Ensure the full colour dialog is displayed,",
"# not the abbreviated version.",
"dlg",
".",
"GetColourData",
"(",
")",
".... | Event handler for launching text color dialog | [
"Event",
"handler",
"for",
"launching",
"text",
"color",
"dialog"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L1407-L1425 |
250,383 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers.OnMacroListLoad | def OnMacroListLoad(self, event):
"""Macro list load event handler"""
# Get filepath from user
wildcards = get_filetypes2wildcards(["py", "all"]).values()
wildcard = "|".join(wildcards)
message = _("Choose macro file.")
style = wx.OPEN
filepath, filterindex =... | python | def OnMacroListLoad(self, event):
# Get filepath from user
wildcards = get_filetypes2wildcards(["py", "all"]).values()
wildcard = "|".join(wildcards)
message = _("Choose macro file.")
style = wx.OPEN
filepath, filterindex = \
self.interfaces.get_filepath_f... | [
"def",
"OnMacroListLoad",
"(",
"self",
",",
"event",
")",
":",
"# Get filepath from user",
"wildcards",
"=",
"get_filetypes2wildcards",
"(",
"[",
"\"py\"",
",",
"\"all\"",
"]",
")",
".",
"values",
"(",
")",
"wildcard",
"=",
"\"|\"",
".",
"join",
"(",
"wildca... | Macro list load event handler | [
"Macro",
"list",
"load",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L1460-L1487 |
250,384 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers.OnMacroListSave | def OnMacroListSave(self, event):
"""Macro list save event handler"""
# Get filepath from user
wildcards = get_filetypes2wildcards(["py", "all"]).values()
wildcard = "|".join(wildcards)
message = _("Choose macro file.")
style = wx.SAVE
filepath, filterindex =... | python | def OnMacroListSave(self, event):
# Get filepath from user
wildcards = get_filetypes2wildcards(["py", "all"]).values()
wildcard = "|".join(wildcards)
message = _("Choose macro file.")
style = wx.SAVE
filepath, filterindex = \
self.interfaces.get_filepath_f... | [
"def",
"OnMacroListSave",
"(",
"self",
",",
"event",
")",
":",
"# Get filepath from user",
"wildcards",
"=",
"get_filetypes2wildcards",
"(",
"[",
"\"py\"",
",",
"\"all\"",
"]",
")",
".",
"values",
"(",
")",
"wildcard",
"=",
"\"|\"",
".",
"join",
"(",
"wildca... | Macro list save event handler | [
"Macro",
"list",
"save",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L1489-L1513 |
250,385 | manns/pyspread | pyspread/src/gui/_main_window.py | MainWindowEventHandlers.OnDependencies | def OnDependencies(self, event):
"""Display dependency dialog"""
dlg = DependencyDialog(self.main_window)
dlg.ShowModal()
dlg.Destroy() | python | def OnDependencies(self, event):
dlg = DependencyDialog(self.main_window)
dlg.ShowModal()
dlg.Destroy() | [
"def",
"OnDependencies",
"(",
"self",
",",
"event",
")",
":",
"dlg",
"=",
"DependencyDialog",
"(",
"self",
".",
"main_window",
")",
"dlg",
".",
"ShowModal",
"(",
")",
"dlg",
".",
"Destroy",
"(",
")"
] | Display dependency dialog | [
"Display",
"dependency",
"dialog"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L1540-L1545 |
250,386 | manns/pyspread | pyspread/src/gui/_menubars.py | _filledMenu._add_submenu | def _add_submenu(self, parent, data):
"""Adds items in data as a submenu to parent"""
for item in data:
obj = item[0]
if obj == wx.Menu:
try:
__, menuname, submenu, menu_id = item
except ValueError:
__, menu... | python | def _add_submenu(self, parent, data):
for item in data:
obj = item[0]
if obj == wx.Menu:
try:
__, menuname, submenu, menu_id = item
except ValueError:
__, menuname, submenu = item
menu_id = -1
... | [
"def",
"_add_submenu",
"(",
"self",
",",
"parent",
",",
"data",
")",
":",
"for",
"item",
"in",
"data",
":",
"obj",
"=",
"item",
"[",
"0",
"]",
"if",
"obj",
"==",
"wx",
".",
"Menu",
":",
"try",
":",
"__",
",",
"menuname",
",",
"submenu",
",",
"m... | Adds items in data as a submenu to parent | [
"Adds",
"items",
"in",
"data",
"as",
"a",
"submenu",
"to",
"parent"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_menubars.py#L96-L142 |
250,387 | manns/pyspread | pyspread/src/gui/_menubars.py | _filledMenu.OnMenu | def OnMenu(self, event):
"""Menu event handler"""
msgtype = self.ids_msgs[event.GetId()]
post_command_event(self.parent, msgtype) | python | def OnMenu(self, event):
msgtype = self.ids_msgs[event.GetId()]
post_command_event(self.parent, msgtype) | [
"def",
"OnMenu",
"(",
"self",
",",
"event",
")",
":",
"msgtype",
"=",
"self",
".",
"ids_msgs",
"[",
"event",
".",
"GetId",
"(",
")",
"]",
"post_command_event",
"(",
"self",
".",
"parent",
",",
"msgtype",
")"
] | Menu event handler | [
"Menu",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_menubars.py#L144-L148 |
250,388 | manns/pyspread | pyspread/src/gui/_menubars.py | _filledMenu.OnUpdate | def OnUpdate(self, event):
"""Menu state update"""
if wx.ID_UNDO in self.id2menuitem:
undo_item = self.id2menuitem[wx.ID_UNDO]
undo_item.Enable(undo.stack().canundo())
if wx.ID_REDO in self.id2menuitem:
redo_item = self.id2menuitem[wx.ID_REDO]
re... | python | def OnUpdate(self, event):
if wx.ID_UNDO in self.id2menuitem:
undo_item = self.id2menuitem[wx.ID_UNDO]
undo_item.Enable(undo.stack().canundo())
if wx.ID_REDO in self.id2menuitem:
redo_item = self.id2menuitem[wx.ID_REDO]
redo_item.Enable(undo.stack().canre... | [
"def",
"OnUpdate",
"(",
"self",
",",
"event",
")",
":",
"if",
"wx",
".",
"ID_UNDO",
"in",
"self",
".",
"id2menuitem",
":",
"undo_item",
"=",
"self",
".",
"id2menuitem",
"[",
"wx",
".",
"ID_UNDO",
"]",
"undo_item",
".",
"Enable",
"(",
"undo",
".",
"st... | Menu state update | [
"Menu",
"state",
"update"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_menubars.py#L150-L161 |
250,389 | manns/pyspread | pyspread/src/gui/_chart_dialog.py | TextEditor.OnFont | def OnFont(self, event):
"""Check event handler"""
font_data = wx.FontData()
# Disable color chooser on Windows
font_data.EnableEffects(False)
if self.chosen_font:
font_data.SetInitialFont(self.chosen_font)
dlg = wx.FontDialog(self, font_data)
if ... | python | def OnFont(self, event):
font_data = wx.FontData()
# Disable color chooser on Windows
font_data.EnableEffects(False)
if self.chosen_font:
font_data.SetInitialFont(self.chosen_font)
dlg = wx.FontDialog(self, font_data)
if dlg.ShowModal() == wx.ID_OK:
... | [
"def",
"OnFont",
"(",
"self",
",",
"event",
")",
":",
"font_data",
"=",
"wx",
".",
"FontData",
"(",
")",
"# Disable color chooser on Windows",
"font_data",
".",
"EnableEffects",
"(",
"False",
")",
"if",
"self",
".",
"chosen_font",
":",
"font_data",
".",
"Set... | Check event handler | [
"Check",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_chart_dialog.py#L445-L470 |
250,390 | manns/pyspread | pyspread/src/gui/_chart_dialog.py | TickParamsEditor.OnDirectionChoice | def OnDirectionChoice(self, event):
"""Direction choice event handler"""
label = self.direction_choicectrl.GetItems()[event.GetSelection()]
param = self.choice_label2param[label]
self.attrs["direction"] = param
post_command_event(self, self.DrawChartMsg) | python | def OnDirectionChoice(self, event):
label = self.direction_choicectrl.GetItems()[event.GetSelection()]
param = self.choice_label2param[label]
self.attrs["direction"] = param
post_command_event(self, self.DrawChartMsg) | [
"def",
"OnDirectionChoice",
"(",
"self",
",",
"event",
")",
":",
"label",
"=",
"self",
".",
"direction_choicectrl",
".",
"GetItems",
"(",
")",
"[",
"event",
".",
"GetSelection",
"(",
")",
"]",
"param",
"=",
"self",
".",
"choice_label2param",
"[",
"label",
... | Direction choice event handler | [
"Direction",
"choice",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_chart_dialog.py#L630-L637 |
250,391 | manns/pyspread | pyspread/src/gui/_chart_dialog.py | TickParamsEditor.OnSecondaryCheckbox | def OnSecondaryCheckbox(self, event):
"""Top Checkbox event handler"""
self.attrs["top"] = event.IsChecked()
self.attrs["right"] = event.IsChecked()
post_command_event(self, self.DrawChartMsg) | python | def OnSecondaryCheckbox(self, event):
self.attrs["top"] = event.IsChecked()
self.attrs["right"] = event.IsChecked()
post_command_event(self, self.DrawChartMsg) | [
"def",
"OnSecondaryCheckbox",
"(",
"self",
",",
"event",
")",
":",
"self",
".",
"attrs",
"[",
"\"top\"",
"]",
"=",
"event",
".",
"IsChecked",
"(",
")",
"self",
".",
"attrs",
"[",
"\"right\"",
"]",
"=",
"event",
".",
"IsChecked",
"(",
")",
"post_command... | Top Checkbox event handler | [
"Top",
"Checkbox",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_chart_dialog.py#L639-L645 |
250,392 | manns/pyspread | pyspread/src/gui/_chart_dialog.py | TickParamsEditor.OnPadIntCtrl | def OnPadIntCtrl(self, event):
"""Pad IntCtrl event handler"""
self.attrs["pad"] = event.GetValue()
post_command_event(self, self.DrawChartMsg) | python | def OnPadIntCtrl(self, event):
self.attrs["pad"] = event.GetValue()
post_command_event(self, self.DrawChartMsg) | [
"def",
"OnPadIntCtrl",
"(",
"self",
",",
"event",
")",
":",
"self",
".",
"attrs",
"[",
"\"pad\"",
"]",
"=",
"event",
".",
"GetValue",
"(",
")",
"post_command_event",
"(",
"self",
",",
"self",
".",
"DrawChartMsg",
")"
] | Pad IntCtrl event handler | [
"Pad",
"IntCtrl",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_chart_dialog.py#L647-L652 |
250,393 | manns/pyspread | pyspread/src/gui/_chart_dialog.py | TickParamsEditor.OnLabelSizeIntCtrl | def OnLabelSizeIntCtrl(self, event):
"""Label size IntCtrl event handler"""
self.attrs["labelsize"] = event.GetValue()
post_command_event(self, self.DrawChartMsg) | python | def OnLabelSizeIntCtrl(self, event):
self.attrs["labelsize"] = event.GetValue()
post_command_event(self, self.DrawChartMsg) | [
"def",
"OnLabelSizeIntCtrl",
"(",
"self",
",",
"event",
")",
":",
"self",
".",
"attrs",
"[",
"\"labelsize\"",
"]",
"=",
"event",
".",
"GetValue",
"(",
")",
"post_command_event",
"(",
"self",
",",
"self",
".",
"DrawChartMsg",
")"
] | Label size IntCtrl event handler | [
"Label",
"size",
"IntCtrl",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_chart_dialog.py#L654-L659 |
250,394 | manns/pyspread | pyspread/src/gui/_chart_dialog.py | StyleEditorMixin.get_code | def get_code(self):
"""Returns code representation of value of widget"""
selection = self.GetSelection()
if selection == wx.NOT_FOUND:
selection = 0
# Return code string
return self.styles[selection][1] | python | def get_code(self):
selection = self.GetSelection()
if selection == wx.NOT_FOUND:
selection = 0
# Return code string
return self.styles[selection][1] | [
"def",
"get_code",
"(",
"self",
")",
":",
"selection",
"=",
"self",
".",
"GetSelection",
"(",
")",
"if",
"selection",
"==",
"wx",
".",
"NOT_FOUND",
":",
"selection",
"=",
"0",
"# Return code string",
"return",
"self",
".",
"styles",
"[",
"selection",
"]",
... | Returns code representation of value of widget | [
"Returns",
"code",
"representation",
"of",
"value",
"of",
"widget"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_chart_dialog.py#L712-L721 |
250,395 | manns/pyspread | pyspread/src/gui/_chart_dialog.py | SeriesAttributesPanelBase.update | def update(self, series_data):
"""Updates self.data from series data
Parameters
----------
* series_data: dict
\tKey value pairs for self.data, which correspond to chart attributes
"""
for key in series_data:
try:
data_list = list(s... | python | def update(self, series_data):
for key in series_data:
try:
data_list = list(self.data[key])
data_list[2] = str(series_data[key])
self.data[key] = tuple(data_list)
except KeyError:
pass | [
"def",
"update",
"(",
"self",
",",
"series_data",
")",
":",
"for",
"key",
"in",
"series_data",
":",
"try",
":",
"data_list",
"=",
"list",
"(",
"self",
".",
"data",
"[",
"key",
"]",
")",
"data_list",
"[",
"2",
"]",
"=",
"str",
"(",
"series_data",
"[... | Updates self.data from series data
Parameters
----------
* series_data: dict
\tKey value pairs for self.data, which correspond to chart attributes | [
"Updates",
"self",
".",
"data",
"from",
"series",
"data"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_chart_dialog.py#L894-L910 |
250,396 | manns/pyspread | pyspread/src/gui/_chart_dialog.py | SeriesPanel.get_plot_panel | def get_plot_panel(self):
"""Returns current plot_panel"""
plot_type_no = self.chart_type_book.GetSelection()
return self.chart_type_book.GetPage(plot_type_no) | python | def get_plot_panel(self):
plot_type_no = self.chart_type_book.GetSelection()
return self.chart_type_book.GetPage(plot_type_no) | [
"def",
"get_plot_panel",
"(",
"self",
")",
":",
"plot_type_no",
"=",
"self",
".",
"chart_type_book",
".",
"GetSelection",
"(",
")",
"return",
"self",
".",
"chart_type_book",
".",
"GetPage",
"(",
"plot_type_no",
")"
] | Returns current plot_panel | [
"Returns",
"current",
"plot_panel"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_chart_dialog.py#L1423-L1427 |
250,397 | manns/pyspread | pyspread/src/gui/_chart_dialog.py | SeriesPanel.set_plot_type | def set_plot_type(self, plot_type):
"""Sets plot type"""
ptypes = [pt["type"] for pt in self.plot_types]
self.plot_panel = ptypes.index(plot_type) | python | def set_plot_type(self, plot_type):
ptypes = [pt["type"] for pt in self.plot_types]
self.plot_panel = ptypes.index(plot_type) | [
"def",
"set_plot_type",
"(",
"self",
",",
"plot_type",
")",
":",
"ptypes",
"=",
"[",
"pt",
"[",
"\"type\"",
"]",
"for",
"pt",
"in",
"self",
".",
"plot_types",
"]",
"self",
".",
"plot_panel",
"=",
"ptypes",
".",
"index",
"(",
"plot_type",
")"
] | Sets plot type | [
"Sets",
"plot",
"type"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_chart_dialog.py#L1441-L1445 |
250,398 | manns/pyspread | pyspread/src/gui/_chart_dialog.py | AllSeriesPanel.update | def update(self, series_list):
"""Updates widget content from series_list
Parameters
----------
series_list: List of dict
\tList of dicts with data from all series
"""
if not series_list:
self.series_notebook.AddPage(wx.Panel(self, -1), _("+"))
... | python | def update(self, series_list):
if not series_list:
self.series_notebook.AddPage(wx.Panel(self, -1), _("+"))
return
self.updating = True
# Delete all tabs in the notebook
self.series_notebook.DeleteAllPages()
# Add as many tabs as there are series in cod... | [
"def",
"update",
"(",
"self",
",",
"series_list",
")",
":",
"if",
"not",
"series_list",
":",
"self",
".",
"series_notebook",
".",
"AddPage",
"(",
"wx",
".",
"Panel",
"(",
"self",
",",
"-",
"1",
")",
",",
"_",
"(",
"\"+\"",
")",
")",
"return",
"self... | Updates widget content from series_list
Parameters
----------
series_list: List of dict
\tList of dicts with data from all series | [
"Updates",
"widget",
"content",
"from",
"series_list"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_chart_dialog.py#L1494-L1523 |
250,399 | manns/pyspread | pyspread/src/gui/_chart_dialog.py | AllSeriesPanel.OnSeriesChanged | def OnSeriesChanged(self, event):
"""FlatNotebook change event handler"""
selection = event.GetSelection()
if not self.updating and \
selection == self.series_notebook.GetPageCount() - 1:
# Add new series
new_panel = SeriesPanel(self, {"type": "plot"})
... | python | def OnSeriesChanged(self, event):
selection = event.GetSelection()
if not self.updating and \
selection == self.series_notebook.GetPageCount() - 1:
# Add new series
new_panel = SeriesPanel(self, {"type": "plot"})
self.series_notebook.InsertPage(selection, ... | [
"def",
"OnSeriesChanged",
"(",
"self",
",",
"event",
")",
":",
"selection",
"=",
"event",
".",
"GetSelection",
"(",
")",
"if",
"not",
"self",
".",
"updating",
"and",
"selection",
"==",
"self",
".",
"series_notebook",
".",
"GetPageCount",
"(",
")",
"-",
"... | FlatNotebook change event handler | [
"FlatNotebook",
"change",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_chart_dialog.py#L1528-L1539 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.