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 75 19.8k | code_tokens list | docstring stringlengths 3 17.3k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 87 242 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
manns/pyspread | pyspread/src/lib/vlc.py | Instance.vlm_add_input | def vlm_add_input(self, psz_name, psz_input):
'''Add a media's input MRL. This will add the specified one.
@param psz_name: the media to work on.
@param psz_input: the input MRL.
@return: 0 on success, -1 on error.
'''
return libvlc_vlm_add_input(self, str_to_bytes(psz_na... | python | def vlm_add_input(self, psz_name, psz_input):
'''Add a media's input MRL. This will add the specified one.
@param psz_name: the media to work on.
@param psz_input: the input MRL.
@return: 0 on success, -1 on error.
'''
return libvlc_vlm_add_input(self, str_to_bytes(psz_na... | [
"def",
"vlm_add_input",
"(",
"self",
",",
"psz_name",
",",
"psz_input",
")",
":",
"return",
"libvlc_vlm_add_input",
"(",
"self",
",",
"str_to_bytes",
"(",
"psz_name",
")",
",",
"str_to_bytes",
"(",
"psz_input",
")",
")"
] | Add a media's input MRL. This will add the specified one.
@param psz_name: the media to work on.
@param psz_input: the input MRL.
@return: 0 on success, -1 on error. | [
"Add",
"a",
"media",
"s",
"input",
"MRL",
".",
"This",
"will",
"add",
"the",
"specified",
"one",
"."
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/lib/vlc.py#L1869-L1875 | train |
manns/pyspread | pyspread/src/lib/vlc.py | Instance.vlm_change_media | def vlm_change_media(self, psz_name, psz_input, psz_output, i_options, ppsz_options, b_enabled, b_loop):
'''Edit the parameters of a media. This will delete all existing inputs and
add the specified one.
@param psz_name: the name of the new broadcast.
@param psz_input: the input MRL.
... | python | def vlm_change_media(self, psz_name, psz_input, psz_output, i_options, ppsz_options, b_enabled, b_loop):
'''Edit the parameters of a media. This will delete all existing inputs and
add the specified one.
@param psz_name: the name of the new broadcast.
@param psz_input: the input MRL.
... | [
"def",
"vlm_change_media",
"(",
"self",
",",
"psz_name",
",",
"psz_input",
",",
"psz_output",
",",
"i_options",
",",
"ppsz_options",
",",
"b_enabled",
",",
"b_loop",
")",
":",
"return",
"libvlc_vlm_change_media",
"(",
"self",
",",
"str_to_bytes",
"(",
"psz_name"... | Edit the parameters of a media. This will delete all existing inputs and
add the specified one.
@param psz_name: the name of the new broadcast.
@param psz_input: the input MRL.
@param psz_output: the output MRL (the parameter to the "sout" variable).
@param i_options: number of a... | [
"Edit",
"the",
"parameters",
"of",
"a",
"media",
".",
"This",
"will",
"delete",
"all",
"existing",
"inputs",
"and",
"add",
"the",
"specified",
"one",
"."
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/lib/vlc.py#L1896-L1908 | train |
manns/pyspread | pyspread/src/lib/vlc.py | MediaPlayer.set_mrl | def set_mrl(self, mrl, *options):
"""Set the MRL to play.
Warning: most audio and video options, such as text renderer,
have no effects on an individual media. These options must be
set at the vlc.Instance or vlc.MediaPlayer instanciation.
@param mrl: The MRL
@param opt... | python | def set_mrl(self, mrl, *options):
"""Set the MRL to play.
Warning: most audio and video options, such as text renderer,
have no effects on an individual media. These options must be
set at the vlc.Instance or vlc.MediaPlayer instanciation.
@param mrl: The MRL
@param opt... | [
"def",
"set_mrl",
"(",
"self",
",",
"mrl",
",",
"*",
"options",
")",
":",
"m",
"=",
"self",
".",
"get_instance",
"(",
")",
".",
"media_new",
"(",
"mrl",
",",
"*",
"options",
")",
"self",
".",
"set_media",
"(",
"m",
")",
"return",
"m"
] | Set the MRL to play.
Warning: most audio and video options, such as text renderer,
have no effects on an individual media. These options must be
set at the vlc.Instance or vlc.MediaPlayer instanciation.
@param mrl: The MRL
@param options: optional media option=value strings
... | [
"Set",
"the",
"MRL",
"to",
"play",
"."
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/lib/vlc.py#L2727-L2740 | train |
manns/pyspread | pyspread/src/lib/undo.py | _Action.do | def do(self):
'Do or redo the action'
self._runner = self._generator(*self.args, **self.kwargs)
rets = next(self._runner)
if isinstance(rets, tuple):
self._text = rets[0]
return rets[1:]
elif rets is None:
self._text = ''
r... | python | def do(self):
'Do or redo the action'
self._runner = self._generator(*self.args, **self.kwargs)
rets = next(self._runner)
if isinstance(rets, tuple):
self._text = rets[0]
return rets[1:]
elif rets is None:
self._text = ''
r... | [
"def",
"do",
"(",
"self",
")",
":",
"'Do or redo the action'",
"self",
".",
"_runner",
"=",
"self",
".",
"_generator",
"(",
"*",
"self",
".",
"args",
",",
"**",
"self",
".",
"kwargs",
")",
"rets",
"=",
"next",
"(",
"self",
".",
"_runner",
")",
"if",
... | Do or redo the action | [
"Do",
"or",
"redo",
"the",
"action"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/lib/undo.py#L44-L56 | train |
manns/pyspread | pyspread/src/lib/undo.py | Stack.redo | def redo(self):
''' Redo the last undone action.
This is only possible if no other actions have occurred since the
last undo call.
'''
if self.canredo():
undoable = self._redos.pop()
with self._pausereceiver():
try:
... | python | def redo(self):
''' Redo the last undone action.
This is only possible if no other actions have occurred since the
last undo call.
'''
if self.canredo():
undoable = self._redos.pop()
with self._pausereceiver():
try:
... | [
"def",
"redo",
"(",
"self",
")",
":",
"if",
"self",
".",
"canredo",
"(",
")",
":",
"undoable",
"=",
"self",
".",
"_redos",
".",
"pop",
"(",
")",
"with",
"self",
".",
"_pausereceiver",
"(",
")",
":",
"try",
":",
"undoable",
".",
"do",
"(",
")",
... | Redo the last undone action.
This is only possible if no other actions have occurred since the
last undo call. | [
"Redo",
"the",
"last",
"undone",
"action",
".",
"This",
"is",
"only",
"possible",
"if",
"no",
"other",
"actions",
"have",
"occurred",
"since",
"the",
"last",
"undo",
"call",
"."
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/lib/undo.py#L214-L230 | train |
manns/pyspread | pyspread/src/lib/undo.py | Stack.clear | def clear(self):
''' Clear the undo list. '''
self._undos.clear()
self._redos.clear()
self._savepoint = None
self._receiver = self._undos | python | def clear(self):
''' Clear the undo list. '''
self._undos.clear()
self._redos.clear()
self._savepoint = None
self._receiver = self._undos | [
"def",
"clear",
"(",
"self",
")",
":",
"self",
".",
"_undos",
".",
"clear",
"(",
")",
"self",
".",
"_redos",
".",
"clear",
"(",
")",
"self",
".",
"_savepoint",
"=",
"None",
"self",
".",
"_receiver",
"=",
"self",
".",
"_undos"
] | Clear the undo list. | [
"Clear",
"the",
"undo",
"list",
"."
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/lib/undo.py#L246-L251 | train |
manns/pyspread | pyspread/src/lib/xrect.py | Rect.is_bbox_not_intersecting | def is_bbox_not_intersecting(self, other):
"""Returns False iif bounding boxed of self and other intersect"""
self_x_min, self_x_max, self_y_min, self_y_max = self.get_bbox()
other_x_min, other_x_max, other_y_min, other_y_max = other.get_bbox()
return \
self_x_min > other_x... | python | def is_bbox_not_intersecting(self, other):
"""Returns False iif bounding boxed of self and other intersect"""
self_x_min, self_x_max, self_y_min, self_y_max = self.get_bbox()
other_x_min, other_x_max, other_y_min, other_y_max = other.get_bbox()
return \
self_x_min > other_x... | [
"def",
"is_bbox_not_intersecting",
"(",
"self",
",",
"other",
")",
":",
"self_x_min",
",",
"self_x_max",
",",
"self_y_min",
",",
"self_y_max",
"=",
"self",
".",
"get_bbox",
"(",
")",
"other_x_min",
",",
"other_x_max",
",",
"other_y_min",
",",
"other_y_max",
"=... | Returns False iif bounding boxed of self and other intersect | [
"Returns",
"False",
"iif",
"bounding",
"boxed",
"of",
"self",
"and",
"other",
"intersect"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/lib/xrect.py#L47-L57 | train |
manns/pyspread | pyspread/src/lib/xrect.py | RotoOriginRect.is_edge_not_excluding_vertices | def is_edge_not_excluding_vertices(self, other):
"""Returns False iif any edge excludes all vertices of other."""
c_a = cos(self.angle)
s_a = sin(self.angle)
# Get min and max of other.
other_x_min, other_x_max, other_y_min, other_y_max = other.get_bbox()
self_x_diff ... | python | def is_edge_not_excluding_vertices(self, other):
"""Returns False iif any edge excludes all vertices of other."""
c_a = cos(self.angle)
s_a = sin(self.angle)
# Get min and max of other.
other_x_min, other_x_max, other_y_min, other_y_max = other.get_bbox()
self_x_diff ... | [
"def",
"is_edge_not_excluding_vertices",
"(",
"self",
",",
"other",
")",
":",
"c_a",
"=",
"cos",
"(",
"self",
".",
"angle",
")",
"s_a",
"=",
"sin",
"(",
"self",
".",
"angle",
")",
"other_x_min",
",",
"other_x_max",
",",
"other_y_min",
",",
"other_y_max",
... | Returns False iif any edge excludes all vertices of other. | [
"Returns",
"False",
"iif",
"any",
"edge",
"excludes",
"all",
"vertices",
"of",
"other",
"."
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/lib/xrect.py#L151-L192 | train |
manns/pyspread | pyspread/src/lib/xrect.py | RotoOriginRect.collides | def collides(self, other):
"""Returns collision with axis aligned rect"""
angle = self.angle
width = self.width
height = self.height
if angle == 0:
return other.collides(Rect(-0.5 * width,
-0.5 * height, width, height))
... | python | def collides(self, other):
"""Returns collision with axis aligned rect"""
angle = self.angle
width = self.width
height = self.height
if angle == 0:
return other.collides(Rect(-0.5 * width,
-0.5 * height, width, height))
... | [
"def",
"collides",
"(",
"self",
",",
"other",
")",
":",
"angle",
"=",
"self",
".",
"angle",
"width",
"=",
"self",
".",
"width",
"height",
"=",
"self",
".",
"height",
"if",
"angle",
"==",
"0",
":",
"return",
"other",
".",
"collides",
"(",
"Rect",
"(... | Returns collision with axis aligned rect | [
"Returns",
"collision",
"with",
"axis",
"aligned",
"rect"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/lib/xrect.py#L194-L224 | train |
manns/pyspread | pyspread/src/lib/xrect.py | RotoRect.get_vec_lr | def get_vec_lr(self):
"""Returns vector from left to right"""
return self.width * self.cos_a(), -self.width * self.sin_a() | python | def get_vec_lr(self):
"""Returns vector from left to right"""
return self.width * self.cos_a(), -self.width * self.sin_a() | [
"def",
"get_vec_lr",
"(",
"self",
")",
":",
"return",
"self",
".",
"width",
"*",
"self",
".",
"cos_a",
"(",
")",
",",
"-",
"self",
".",
"width",
"*",
"self",
".",
"sin_a",
"(",
")"
] | Returns vector from left to right | [
"Returns",
"vector",
"from",
"left",
"to",
"right"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/lib/xrect.py#L268-L271 | train |
manns/pyspread | pyspread/src/lib/xrect.py | RotoRect.get_vec_tb | def get_vec_tb(self):
"""Returns vector from top to bottom"""
return self.height * self.sin_a(), self.height * self.cos_a() | python | def get_vec_tb(self):
"""Returns vector from top to bottom"""
return self.height * self.sin_a(), self.height * self.cos_a() | [
"def",
"get_vec_tb",
"(",
"self",
")",
":",
"return",
"self",
".",
"height",
"*",
"self",
".",
"sin_a",
"(",
")",
",",
"self",
".",
"height",
"*",
"self",
".",
"cos_a",
"(",
")"
] | Returns vector from top to bottom | [
"Returns",
"vector",
"from",
"top",
"to",
"bottom"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/lib/xrect.py#L273-L276 | train |
manns/pyspread | pyspread/src/lib/xrect.py | RotoRect.get_center | def get_center(self):
"""Returns rectangle center"""
lr_x, lr_y = self.get_vec_lr()
tb_x, tb_y = self.get_vec_tb()
center_x = self.x + (lr_x + tb_x) / 2.0
center_y = self.y + (lr_y + tb_y) / 2.0
return center_x, center_y | python | def get_center(self):
"""Returns rectangle center"""
lr_x, lr_y = self.get_vec_lr()
tb_x, tb_y = self.get_vec_tb()
center_x = self.x + (lr_x + tb_x) / 2.0
center_y = self.y + (lr_y + tb_y) / 2.0
return center_x, center_y | [
"def",
"get_center",
"(",
"self",
")",
":",
"lr_x",
",",
"lr_y",
"=",
"self",
".",
"get_vec_lr",
"(",
")",
"tb_x",
",",
"tb_y",
"=",
"self",
".",
"get_vec_tb",
"(",
")",
"center_x",
"=",
"self",
".",
"x",
"+",
"(",
"lr_x",
"+",
"tb_x",
")",
"/",
... | Returns rectangle center | [
"Returns",
"rectangle",
"center"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/lib/xrect.py#L279-L288 | train |
manns/pyspread | pyspread/src/lib/xrect.py | RotoRect.get_edges | def get_edges(self):
"""Returns 2-tuples for each edge
top_left
top_right
bottom_left
bottom_right
"""
lr_x, lr_y = self.get_vec_lr()
tb_x, tb_y = self.get_vec_tb()
top_left = self.x, self.y
top_right = self.x + lr_x, self.y + lr_y
... | python | def get_edges(self):
"""Returns 2-tuples for each edge
top_left
top_right
bottom_left
bottom_right
"""
lr_x, lr_y = self.get_vec_lr()
tb_x, tb_y = self.get_vec_tb()
top_left = self.x, self.y
top_right = self.x + lr_x, self.y + lr_y
... | [
"def",
"get_edges",
"(",
"self",
")",
":",
"lr_x",
",",
"lr_y",
"=",
"self",
".",
"get_vec_lr",
"(",
")",
"tb_x",
",",
"tb_y",
"=",
"self",
".",
"get_vec_tb",
"(",
")",
"top_left",
"=",
"self",
".",
"x",
",",
"self",
".",
"y",
"top_right",
"=",
"... | Returns 2-tuples for each edge
top_left
top_right
bottom_left
bottom_right | [
"Returns",
"2",
"-",
"tuples",
"for",
"each",
"edge"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/lib/xrect.py#L290-L308 | train |
manns/pyspread | pyspread/src/lib/xrect.py | RotoRect.collides_axisaligned_rect | def collides_axisaligned_rect(self, other):
"""Returns collision with axis aligned other rect"""
# Shift both rects so that self is centered at origin
self_shifted = RotoOriginRect(self.width, self.height, -self.angle)
s_a = self.sin_a()
c_a = self.cos_a()
center_x = ... | python | def collides_axisaligned_rect(self, other):
"""Returns collision with axis aligned other rect"""
# Shift both rects so that self is centered at origin
self_shifted = RotoOriginRect(self.width, self.height, -self.angle)
s_a = self.sin_a()
c_a = self.cos_a()
center_x = ... | [
"def",
"collides_axisaligned_rect",
"(",
"self",
",",
"other",
")",
":",
"self_shifted",
"=",
"RotoOriginRect",
"(",
"self",
".",
"width",
",",
"self",
".",
"height",
",",
"-",
"self",
".",
"angle",
")",
"s_a",
"=",
"self",
".",
"sin_a",
"(",
")",
"c_a... | Returns collision with axis aligned other rect | [
"Returns",
"collision",
"with",
"axis",
"aligned",
"other",
"rect"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/lib/xrect.py#L310-L328 | train |
manns/pyspread | pyspread/src/gui/icons.py | GtkArtProvider.get_paths | def get_paths(self, theme, icon_size):
"""Returns tuple of theme, icon, action and toggle paths"""
_size_str = "x".join(map(str, icon_size))
theme_path = get_program_path() + "share" + os.sep + "icons" + os.sep
icon_path = theme_path + theme + os.sep + _size_str + os.sep
action... | python | def get_paths(self, theme, icon_size):
"""Returns tuple of theme, icon, action and toggle paths"""
_size_str = "x".join(map(str, icon_size))
theme_path = get_program_path() + "share" + os.sep + "icons" + os.sep
icon_path = theme_path + theme + os.sep + _size_str + os.sep
action... | [
"def",
"get_paths",
"(",
"self",
",",
"theme",
",",
"icon_size",
")",
":",
"_size_str",
"=",
"\"x\"",
".",
"join",
"(",
"map",
"(",
"str",
",",
"icon_size",
")",
")",
"theme_path",
"=",
"get_program_path",
"(",
")",
"+",
"\"share\"",
"+",
"os",
".",
... | Returns tuple of theme, icon, action and toggle paths | [
"Returns",
"tuple",
"of",
"theme",
"icon",
"action",
"and",
"toggle",
"paths"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/icons.py#L108-L118 | train |
manns/pyspread | pyspread/src/gui/icons.py | GtkArtProvider.CreateBitmap | def CreateBitmap(self, artid, client, size):
"""Adds custom images to Artprovider"""
if artid in self.extra_icons:
return wx.Bitmap(self.extra_icons[artid], wx.BITMAP_TYPE_ANY)
else:
return wx.ArtProvider.GetBitmap(artid, client, size) | python | def CreateBitmap(self, artid, client, size):
"""Adds custom images to Artprovider"""
if artid in self.extra_icons:
return wx.Bitmap(self.extra_icons[artid], wx.BITMAP_TYPE_ANY)
else:
return wx.ArtProvider.GetBitmap(artid, client, size) | [
"def",
"CreateBitmap",
"(",
"self",
",",
"artid",
",",
"client",
",",
"size",
")",
":",
"if",
"artid",
"in",
"self",
".",
"extra_icons",
":",
"return",
"wx",
".",
"Bitmap",
"(",
"self",
".",
"extra_icons",
"[",
"artid",
"]",
",",
"wx",
".",
"BITMAP_T... | Adds custom images to Artprovider | [
"Adds",
"custom",
"images",
"to",
"Artprovider"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/icons.py#L120-L127 | train |
manns/pyspread | pyspread/src/lib/fileio.py | AOpenMixin.set_initial_state | def set_initial_state(self, kwargs):
"""Sets class state from kwargs attributes, pops extra kwargs"""
self.main_window = kwargs.pop("main_window")
try:
statustext = kwargs.pop("statustext")
except KeyError:
statustext = ""
try:
self.total_l... | python | def set_initial_state(self, kwargs):
"""Sets class state from kwargs attributes, pops extra kwargs"""
self.main_window = kwargs.pop("main_window")
try:
statustext = kwargs.pop("statustext")
except KeyError:
statustext = ""
try:
self.total_l... | [
"def",
"set_initial_state",
"(",
"self",
",",
"kwargs",
")",
":",
"self",
".",
"main_window",
"=",
"kwargs",
".",
"pop",
"(",
"\"main_window\"",
")",
"try",
":",
"statustext",
"=",
"kwargs",
".",
"pop",
"(",
"\"statustext\"",
")",
"except",
"KeyError",
":"... | Sets class state from kwargs attributes, pops extra kwargs | [
"Sets",
"class",
"state",
"from",
"kwargs",
"attributes",
"pops",
"extra",
"kwargs"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/lib/fileio.py#L53-L86 | train |
manns/pyspread | pyspread/src/lib/fileio.py | AOpenMixin.progress_status | def progress_status(self):
"""Displays progress in statusbar"""
if self.line % self.freq == 0:
text = self.statustext.format(nele=self.line,
totalele=self.total_lines)
if self.main_window.grid.actions.pasting:
try:
... | python | def progress_status(self):
"""Displays progress in statusbar"""
if self.line % self.freq == 0:
text = self.statustext.format(nele=self.line,
totalele=self.total_lines)
if self.main_window.grid.actions.pasting:
try:
... | [
"def",
"progress_status",
"(",
"self",
")",
":",
"if",
"self",
".",
"line",
"%",
"self",
".",
"freq",
"==",
"0",
":",
"text",
"=",
"self",
".",
"statustext",
".",
"format",
"(",
"nele",
"=",
"self",
".",
"line",
",",
"totalele",
"=",
"self",
".",
... | Displays progress in statusbar | [
"Displays",
"progress",
"in",
"statusbar"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/lib/fileio.py#L117-L145 | train |
manns/pyspread | pyspread/src/lib/fileio.py | AOpenMixin.on_key | def on_key(self, event):
"""Sets aborted state if escape is pressed"""
if self.main_window.grid.actions.pasting and \
event.GetKeyCode() == wx.WXK_ESCAPE:
self.aborted = True
event.Skip() | python | def on_key(self, event):
"""Sets aborted state if escape is pressed"""
if self.main_window.grid.actions.pasting and \
event.GetKeyCode() == wx.WXK_ESCAPE:
self.aborted = True
event.Skip() | [
"def",
"on_key",
"(",
"self",
",",
"event",
")",
":",
"if",
"self",
".",
"main_window",
".",
"grid",
".",
"actions",
".",
"pasting",
"and",
"event",
".",
"GetKeyCode",
"(",
")",
"==",
"wx",
".",
"WXK_ESCAPE",
":",
"self",
".",
"aborted",
"=",
"True",... | Sets aborted state if escape is pressed | [
"Sets",
"aborted",
"state",
"if",
"escape",
"is",
"pressed"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/lib/fileio.py#L147-L154 | train |
manns/pyspread | pyspread/src/interfaces/ods.py | Ods._get_tables | def _get_tables(self, ods):
"""Returns list of table nodes from ods object"""
childnodes = ods.spreadsheet.childNodes
qname_childnodes = [(s.qname[1], s) for s in childnodes]
return [node for name, node in qname_childnodes if name == u"table"] | python | def _get_tables(self, ods):
"""Returns list of table nodes from ods object"""
childnodes = ods.spreadsheet.childNodes
qname_childnodes = [(s.qname[1], s) for s in childnodes]
return [node for name, node in qname_childnodes if name == u"table"] | [
"def",
"_get_tables",
"(",
"self",
",",
"ods",
")",
":",
"childnodes",
"=",
"ods",
".",
"spreadsheet",
".",
"childNodes",
"qname_childnodes",
"=",
"[",
"(",
"s",
".",
"qname",
"[",
"1",
"]",
",",
"s",
")",
"for",
"s",
"in",
"childnodes",
"]",
"return... | Returns list of table nodes from ods object | [
"Returns",
"list",
"of",
"table",
"nodes",
"from",
"ods",
"object"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/interfaces/ods.py#L67-L72 | train |
manns/pyspread | pyspread/src/interfaces/ods.py | Ods._get_rows | def _get_rows(self, table):
"""Returns rows from table"""
childnodes = table.childNodes
qname_childnodes = [(s.qname[1], s) for s in childnodes]
return [node for name, node in qname_childnodes
if name == u'table-row'] | python | def _get_rows(self, table):
"""Returns rows from table"""
childnodes = table.childNodes
qname_childnodes = [(s.qname[1], s) for s in childnodes]
return [node for name, node in qname_childnodes
if name == u'table-row'] | [
"def",
"_get_rows",
"(",
"self",
",",
"table",
")",
":",
"childnodes",
"=",
"table",
".",
"childNodes",
"qname_childnodes",
"=",
"[",
"(",
"s",
".",
"qname",
"[",
"1",
"]",
",",
"s",
")",
"for",
"s",
"in",
"childnodes",
"]",
"return",
"[",
"node",
... | Returns rows from table | [
"Returns",
"rows",
"from",
"table"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/interfaces/ods.py#L74-L80 | train |
manns/pyspread | pyspread/src/interfaces/ods.py | Ods._get_cells | def _get_cells(self, row):
"""Returns rows from row"""
childnodes = row.childNodes
qname_childnodes = [(s.qname[1], s) for s in childnodes]
return [node for name, node in qname_childnodes
if name == u'table-cell'] | python | def _get_cells(self, row):
"""Returns rows from row"""
childnodes = row.childNodes
qname_childnodes = [(s.qname[1], s) for s in childnodes]
return [node for name, node in qname_childnodes
if name == u'table-cell'] | [
"def",
"_get_cells",
"(",
"self",
",",
"row",
")",
":",
"childnodes",
"=",
"row",
".",
"childNodes",
"qname_childnodes",
"=",
"[",
"(",
"s",
".",
"qname",
"[",
"1",
"]",
",",
"s",
")",
"for",
"s",
"in",
"childnodes",
"]",
"return",
"[",
"node",
"fo... | Returns rows from row | [
"Returns",
"rows",
"from",
"row"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/interfaces/ods.py#L82-L88 | train |
manns/pyspread | pyspread/src/interfaces/ods.py | Ods._ods2code | def _ods2code(self):
"""Updates code in code_array"""
ods = ODSReader(self.ods_file, clonespannedcolumns=True)
tables = ods.sheets
for tab_id, table in enumerate(tables):
for row_id in xrange(len(table)):
for col_id in xrange(len(table[row_id])):
... | python | def _ods2code(self):
"""Updates code in code_array"""
ods = ODSReader(self.ods_file, clonespannedcolumns=True)
tables = ods.sheets
for tab_id, table in enumerate(tables):
for row_id in xrange(len(table)):
for col_id in xrange(len(table[row_id])):
... | [
"def",
"_ods2code",
"(",
"self",
")",
":",
"ods",
"=",
"ODSReader",
"(",
"self",
".",
"ods_file",
",",
"clonespannedcolumns",
"=",
"True",
")",
"tables",
"=",
"ods",
".",
"sheets",
"for",
"tab_id",
",",
"table",
"in",
"enumerate",
"(",
"tables",
")",
"... | Updates code in code_array | [
"Updates",
"code",
"in",
"code_array"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/interfaces/ods.py#L90-L100 | train |
manns/pyspread | pyspread/src/pyspread.py | pyspread | def pyspread(S=None):
"""Holds application main loop"""
# Initialize main application
app = MainApplication(S=S, redirect=False)
app.MainLoop() | python | def pyspread(S=None):
"""Holds application main loop"""
# Initialize main application
app = MainApplication(S=S, redirect=False)
app.MainLoop() | [
"def",
"pyspread",
"(",
"S",
"=",
"None",
")",
":",
"app",
"=",
"MainApplication",
"(",
"S",
"=",
"S",
",",
"redirect",
"=",
"False",
")",
"app",
".",
"MainLoop",
"(",
")"
] | Holds application main loop | [
"Holds",
"application",
"main",
"loop"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/pyspread.py#L230-L236 | train |
manns/pyspread | pyspread/src/lib/ODSReader.py | ODSReader.readSheet | def readSheet(self, sheet):
"""Reads a sheet in the sheet dictionary
Stores each sheet as an array (rows) of arrays (columns)
"""
name = sheet.getAttribute("name")
rows = sheet.getElementsByType(TableRow)
arrRows = []
# for each row
for row in rows:
... | python | def readSheet(self, sheet):
"""Reads a sheet in the sheet dictionary
Stores each sheet as an array (rows) of arrays (columns)
"""
name = sheet.getAttribute("name")
rows = sheet.getElementsByType(TableRow)
arrRows = []
# for each row
for row in rows:
... | [
"def",
"readSheet",
"(",
"self",
",",
"sheet",
")",
":",
"name",
"=",
"sheet",
".",
"getAttribute",
"(",
"\"name\"",
")",
"rows",
"=",
"sheet",
".",
"getElementsByType",
"(",
"TableRow",
")",
"arrRows",
"=",
"[",
"]",
"for",
"row",
"in",
"rows",
":",
... | Reads a sheet in the sheet dictionary
Stores each sheet as an array (rows) of arrays (columns) | [
"Reads",
"a",
"sheet",
"in",
"the",
"sheet",
"dictionary"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/lib/ODSReader.py#L41-L105 | train |
manns/pyspread | pyspread/src/lib/__csv.py | sniff | def sniff(filepath):
"""
Sniffs CSV dialect and header info from csvfilepath
Returns a tuple of dialect and has_header
"""
with open(filepath, "rb") as csvfile:
sample = csvfile.read(config["sniff_size"])
sniffer = csv.Sniffer()
dialect = sniffer.sniff(sample)()
has_header = ... | python | def sniff(filepath):
"""
Sniffs CSV dialect and header info from csvfilepath
Returns a tuple of dialect and has_header
"""
with open(filepath, "rb") as csvfile:
sample = csvfile.read(config["sniff_size"])
sniffer = csv.Sniffer()
dialect = sniffer.sniff(sample)()
has_header = ... | [
"def",
"sniff",
"(",
"filepath",
")",
":",
"with",
"open",
"(",
"filepath",
",",
"\"rb\"",
")",
"as",
"csvfile",
":",
"sample",
"=",
"csvfile",
".",
"read",
"(",
"config",
"[",
"\"sniff_size\"",
"]",
")",
"sniffer",
"=",
"csv",
".",
"Sniffer",
"(",
"... | Sniffs CSV dialect and header info from csvfilepath
Returns a tuple of dialect and has_header | [
"Sniffs",
"CSV",
"dialect",
"and",
"header",
"info",
"from",
"csvfilepath"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/lib/__csv.py#L58-L73 | train |
manns/pyspread | pyspread/src/lib/__csv.py | get_first_line | def get_first_line(filepath, dialect):
"""Returns List of first line items of file filepath"""
with open(filepath, "rb") as csvfile:
csvreader = csv.reader(csvfile, dialect=dialect)
for first_line in csvreader:
break
return first_line | python | def get_first_line(filepath, dialect):
"""Returns List of first line items of file filepath"""
with open(filepath, "rb") as csvfile:
csvreader = csv.reader(csvfile, dialect=dialect)
for first_line in csvreader:
break
return first_line | [
"def",
"get_first_line",
"(",
"filepath",
",",
"dialect",
")",
":",
"with",
"open",
"(",
"filepath",
",",
"\"rb\"",
")",
"as",
"csvfile",
":",
"csvreader",
"=",
"csv",
".",
"reader",
"(",
"csvfile",
",",
"dialect",
"=",
"dialect",
")",
"for",
"first_line... | Returns List of first line items of file filepath | [
"Returns",
"List",
"of",
"first",
"line",
"items",
"of",
"file",
"filepath"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/lib/__csv.py#L76-L85 | train |
manns/pyspread | pyspread/src/lib/__csv.py | digested_line | def digested_line(line, digest_types):
"""Returns list of digested values in line"""
digested_line = []
for i, ele in enumerate(line):
try:
digest_key = digest_types[i]
except IndexError:
digest_key = digest_types[0]
digest = Digest(acceptable_types=[digest... | python | def digested_line(line, digest_types):
"""Returns list of digested values in line"""
digested_line = []
for i, ele in enumerate(line):
try:
digest_key = digest_types[i]
except IndexError:
digest_key = digest_types[0]
digest = Digest(acceptable_types=[digest... | [
"def",
"digested_line",
"(",
"line",
",",
"digest_types",
")",
":",
"digested_line",
"=",
"[",
"]",
"for",
"i",
",",
"ele",
"in",
"enumerate",
"(",
"line",
")",
":",
"try",
":",
"digest_key",
"=",
"digest_types",
"[",
"i",
"]",
"except",
"IndexError",
... | Returns list of digested values in line | [
"Returns",
"list",
"of",
"digested",
"values",
"in",
"line"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/lib/__csv.py#L88-L107 | train |
manns/pyspread | pyspread/src/lib/__csv.py | csv_digest_gen | def csv_digest_gen(filepath, dialect, has_header, digest_types):
"""Generator of digested values from csv file in filepath
Parameters
----------
filepath:String
\tFile path of csv file to read
dialect: Object
\tCsv dialect
digest_types: tuple of types
\tTypes of data for each col
... | python | def csv_digest_gen(filepath, dialect, has_header, digest_types):
"""Generator of digested values from csv file in filepath
Parameters
----------
filepath:String
\tFile path of csv file to read
dialect: Object
\tCsv dialect
digest_types: tuple of types
\tTypes of data for each col
... | [
"def",
"csv_digest_gen",
"(",
"filepath",
",",
"dialect",
",",
"has_header",
",",
"digest_types",
")",
":",
"with",
"open",
"(",
"filepath",
",",
"\"rb\"",
")",
"as",
"csvfile",
":",
"csvreader",
"=",
"csv",
".",
"reader",
"(",
"csvfile",
",",
"dialect",
... | Generator of digested values from csv file in filepath
Parameters
----------
filepath:String
\tFile path of csv file to read
dialect: Object
\tCsv dialect
digest_types: tuple of types
\tTypes of data for each col | [
"Generator",
"of",
"digested",
"values",
"from",
"csv",
"file",
"in",
"filepath"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/lib/__csv.py#L110-L133 | train |
manns/pyspread | pyspread/src/lib/__csv.py | cell_key_val_gen | def cell_key_val_gen(iterable, shape, topleft=(0, 0)):
"""Generator of row, col, value tuple from iterable of iterables
it: Iterable of iterables
\tMatrix that shall be mapped on target grid
shape: Tuple of Integer
\tShape of target grid
topleft: 2-tuple of Integer
\tTop left cell for inser... | python | def cell_key_val_gen(iterable, shape, topleft=(0, 0)):
"""Generator of row, col, value tuple from iterable of iterables
it: Iterable of iterables
\tMatrix that shall be mapped on target grid
shape: Tuple of Integer
\tShape of target grid
topleft: 2-tuple of Integer
\tTop left cell for inser... | [
"def",
"cell_key_val_gen",
"(",
"iterable",
",",
"shape",
",",
"topleft",
"=",
"(",
"0",
",",
"0",
")",
")",
":",
"top",
",",
"left",
"=",
"topleft",
"for",
"__row",
",",
"line",
"in",
"enumerate",
"(",
"iterable",
")",
":",
"row",
"=",
"top",
"+",... | Generator of row, col, value tuple from iterable of iterables
it: Iterable of iterables
\tMatrix that shall be mapped on target grid
shape: Tuple of Integer
\tShape of target grid
topleft: 2-tuple of Integer
\tTop left cell for insertion of it | [
"Generator",
"of",
"row",
"col",
"value",
"tuple",
"from",
"iterable",
"of",
"iterables"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/lib/__csv.py#L136-L160 | train |
manns/pyspread | pyspread/src/lib/__csv.py | encode_gen | def encode_gen(line, encoding="utf-8"):
"""Encodes all Unicode strings in line to encoding
Parameters
----------
line: Iterable of Unicode strings
\tDate to be encoded
encoding: String, defaults to "utf-8"
\tTarget encoding
"""
for ele in line:
if isinstance(ele, types.Uni... | python | def encode_gen(line, encoding="utf-8"):
"""Encodes all Unicode strings in line to encoding
Parameters
----------
line: Iterable of Unicode strings
\tDate to be encoded
encoding: String, defaults to "utf-8"
\tTarget encoding
"""
for ele in line:
if isinstance(ele, types.Uni... | [
"def",
"encode_gen",
"(",
"line",
",",
"encoding",
"=",
"\"utf-8\"",
")",
":",
"for",
"ele",
"in",
"line",
":",
"if",
"isinstance",
"(",
"ele",
",",
"types",
".",
"UnicodeType",
")",
":",
"yield",
"ele",
".",
"encode",
"(",
"encoding",
")",
"else",
"... | Encodes all Unicode strings in line to encoding
Parameters
----------
line: Iterable of Unicode strings
\tDate to be encoded
encoding: String, defaults to "utf-8"
\tTarget encoding | [
"Encodes",
"all",
"Unicode",
"strings",
"in",
"line",
"to",
"encoding"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/lib/__csv.py#L163-L179 | train |
manns/pyspread | pyspread/src/lib/__csv.py | CsvInterface._get_csv_cells_gen | def _get_csv_cells_gen(self, line):
"""Generator of values in a csv line"""
digest_types = self.digest_types
for j, value in enumerate(line):
if self.first_line:
digest_key = None
digest = lambda x: x.decode(self.encoding)
else:
... | python | def _get_csv_cells_gen(self, line):
"""Generator of values in a csv line"""
digest_types = self.digest_types
for j, value in enumerate(line):
if self.first_line:
digest_key = None
digest = lambda x: x.decode(self.encoding)
else:
... | [
"def",
"_get_csv_cells_gen",
"(",
"self",
",",
"line",
")",
":",
"digest_types",
"=",
"self",
".",
"digest_types",
"for",
"j",
",",
"value",
"in",
"enumerate",
"(",
"line",
")",
":",
"if",
"self",
".",
"first_line",
":",
"digest_key",
"=",
"None",
"diges... | Generator of values in a csv line | [
"Generator",
"of",
"values",
"in",
"a",
"csv",
"line"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/lib/__csv.py#L402-L432 | train |
manns/pyspread | pyspread/src/lib/__csv.py | CsvInterface.write | def write(self, iterable):
"""Writes values from iterable into CSV file"""
io_error_text = _("Error writing to file {filepath}.")
io_error_text = io_error_text.format(filepath=self.path)
try:
with open(self.path, "wb") as csvfile:
csv_writer = csv.writer(cs... | python | def write(self, iterable):
"""Writes values from iterable into CSV file"""
io_error_text = _("Error writing to file {filepath}.")
io_error_text = io_error_text.format(filepath=self.path)
try:
with open(self.path, "wb") as csvfile:
csv_writer = csv.writer(cs... | [
"def",
"write",
"(",
"self",
",",
"iterable",
")",
":",
"io_error_text",
"=",
"_",
"(",
"\"Error writing to file {filepath}.\"",
")",
"io_error_text",
"=",
"io_error_text",
".",
"format",
"(",
"filepath",
"=",
"self",
".",
"path",
")",
"try",
":",
"with",
"o... | Writes values from iterable into CSV file | [
"Writes",
"values",
"from",
"iterable",
"into",
"CSV",
"file"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/lib/__csv.py#L434-L459 | train |
manns/pyspread | pyspread/src/interfaces/xls.py | Xls._shape2xls | def _shape2xls(self, worksheets):
"""Writes shape to xls file
Format: <rows>\t<cols>\t<tabs>\n
"""
__, __, tabs = self.code_array.shape
if tabs > self.xls_max_tabs:
tabs = self.xls_max_tabs
for tab in xrange(tabs):
worksheet = self.workbook.ad... | python | def _shape2xls(self, worksheets):
"""Writes shape to xls file
Format: <rows>\t<cols>\t<tabs>\n
"""
__, __, tabs = self.code_array.shape
if tabs > self.xls_max_tabs:
tabs = self.xls_max_tabs
for tab in xrange(tabs):
worksheet = self.workbook.ad... | [
"def",
"_shape2xls",
"(",
"self",
",",
"worksheets",
")",
":",
"__",
",",
"__",
",",
"tabs",
"=",
"self",
".",
"code_array",
".",
"shape",
"if",
"tabs",
">",
"self",
".",
"xls_max_tabs",
":",
"tabs",
"=",
"self",
".",
"xls_max_tabs",
"for",
"tab",
"i... | Writes shape to xls file
Format: <rows>\t<cols>\t<tabs>\n | [
"Writes",
"shape",
"to",
"xls",
"file"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/interfaces/xls.py#L121-L135 | train |
manns/pyspread | pyspread/src/interfaces/xls.py | Xls._code2xls | def _code2xls(self, worksheets):
"""Writes code to xls file
Format: <row>\t<col>\t<tab>\t<code>\n
"""
code_array = self.code_array
xls_max_shape = self.xls_max_rows, self.xls_max_cols, self.xls_max_tabs
for key in code_array:
if all(kele < mele for kele, ... | python | def _code2xls(self, worksheets):
"""Writes code to xls file
Format: <row>\t<col>\t<tab>\t<code>\n
"""
code_array = self.code_array
xls_max_shape = self.xls_max_rows, self.xls_max_cols, self.xls_max_tabs
for key in code_array:
if all(kele < mele for kele, ... | [
"def",
"_code2xls",
"(",
"self",
",",
"worksheets",
")",
":",
"code_array",
"=",
"self",
".",
"code_array",
"xls_max_shape",
"=",
"self",
".",
"xls_max_rows",
",",
"self",
".",
"xls_max_cols",
",",
"self",
".",
"xls_max_tabs",
"for",
"key",
"in",
"code_array... | Writes code to xls file
Format: <row>\t<col>\t<tab>\t<code>\n | [
"Writes",
"code",
"to",
"xls",
"file"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/interfaces/xls.py#L150-L203 | train |
manns/pyspread | pyspread/src/interfaces/xls.py | Xls._xls2code | def _xls2code(self, worksheet, tab):
"""Updates code in xls code_array"""
def xlrddate2datetime(xlrd_date):
"""Returns datetime from xlrd_date"""
try:
xldate_tuple = xlrd.xldate_as_tuple(xlrd_date,
self.workboo... | python | def _xls2code(self, worksheet, tab):
"""Updates code in xls code_array"""
def xlrddate2datetime(xlrd_date):
"""Returns datetime from xlrd_date"""
try:
xldate_tuple = xlrd.xldate_as_tuple(xlrd_date,
self.workboo... | [
"def",
"_xls2code",
"(",
"self",
",",
"worksheet",
",",
"tab",
")",
":",
"def",
"xlrddate2datetime",
"(",
"xlrd_date",
")",
":",
"try",
":",
"xldate_tuple",
"=",
"xlrd",
".",
"xldate_as_tuple",
"(",
"xlrd_date",
",",
"self",
".",
"workbook",
".",
"datemode... | Updates code in xls code_array | [
"Updates",
"code",
"in",
"xls",
"code_array"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/interfaces/xls.py#L205-L236 | train |
manns/pyspread | pyspread/src/interfaces/xls.py | Xls._get_font | def _get_font(self, pys_style):
"""Returns xlwt.Font for pyspread style"""
# Return None if there is no font
if "textfont" not in pys_style:
return
font = xlwt.Font()
font.name = pys_style["textfont"]
if "pointsize" in pys_style:
font.height = ... | python | def _get_font(self, pys_style):
"""Returns xlwt.Font for pyspread style"""
# Return None if there is no font
if "textfont" not in pys_style:
return
font = xlwt.Font()
font.name = pys_style["textfont"]
if "pointsize" in pys_style:
font.height = ... | [
"def",
"_get_font",
"(",
"self",
",",
"pys_style",
")",
":",
"if",
"\"textfont\"",
"not",
"in",
"pys_style",
":",
"return",
"font",
"=",
"xlwt",
".",
"Font",
"(",
")",
"font",
".",
"name",
"=",
"pys_style",
"[",
"\"textfont\"",
"]",
"if",
"\"pointsize\""... | Returns xlwt.Font for pyspread style | [
"Returns",
"xlwt",
".",
"Font",
"for",
"pyspread",
"style"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/interfaces/xls.py#L238-L269 | train |
manns/pyspread | pyspread/src/interfaces/xls.py | Xls._get_alignment | def _get_alignment(self, pys_style):
"""Returns xlwt.Alignment for pyspread style"""
# Return None if there is no alignment
alignment_styles = ["justification", "vertical_align", "angle"]
if not any(astyle in pys_style for astyle in alignment_styles):
return
def ang... | python | def _get_alignment(self, pys_style):
"""Returns xlwt.Alignment for pyspread style"""
# Return None if there is no alignment
alignment_styles = ["justification", "vertical_align", "angle"]
if not any(astyle in pys_style for astyle in alignment_styles):
return
def ang... | [
"def",
"_get_alignment",
"(",
"self",
",",
"pys_style",
")",
":",
"alignment_styles",
"=",
"[",
"\"justification\"",
",",
"\"vertical_align\"",
",",
"\"angle\"",
"]",
"if",
"not",
"any",
"(",
"astyle",
"in",
"pys_style",
"for",
"astyle",
"in",
"alignment_styles"... | Returns xlwt.Alignment for pyspread style | [
"Returns",
"xlwt",
".",
"Alignment",
"for",
"pyspread",
"style"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/interfaces/xls.py#L271-L324 | train |
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):
"""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... | [
"def",
"_get_pattern",
"(",
"self",
",",
"pys_style",
")",
":",
"if",
"\"bgcolor\"",
"not",
"in",
"pys_style",
":",
"return",
"pattern",
"=",
"xlwt",
".",
"Pattern",
"(",
")",
"pattern",
".",
"pattern",
"=",
"xlwt",
".",
"Pattern",
".",
"SOLID_PATTERN",
... | 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 | train |
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):
"""Returns xlwt.Borders for pyspread style"""
# Return None if there is no border key
border_keys = [
"borderwidth_right",
"borderwidth_bottom",
"bordercolor_right",
"bordercolor_... | [
"def",
"_get_borders",
"(",
"self",
",",
"pys_style",
",",
"pys_style_above",
",",
"pys_style_left",
")",
":",
"border_keys",
"=",
"[",
"\"borderwidth_right\"",
",",
"\"borderwidth_bottom\"",
",",
"\"bordercolor_right\"",
",",
"\"bordercolor_bottom\"",
",",
"]",
"if",... | 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 | train |
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):
"""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 ... | [
"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 | train |
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):
"""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?
... | [
"def",
"_cell_attribute_append",
"(",
"self",
",",
"selection",
",",
"tab",
",",
"attributes",
")",
":",
"cell_attributes",
"=",
"self",
".",
"code_array",
".",
"cell_attributes",
"thick_bottom_cells",
"=",
"[",
"]",
"thick_right_cells",
"=",
"[",
"]",
"if",
"... | 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 | train |
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):
"""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... | [
"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 | train |
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):
"""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) | [
"def",
"pys_width2xls_width",
"(",
"self",
",",
"pys_width",
")",
":",
"width_0",
"=",
"get_default_text_extent",
"(",
"\"0\"",
")",
"[",
"0",
"]",
"width_0_char",
"=",
"pys_width",
"*",
"1.2",
"/",
"width_0",
"return",
"int",
"(",
"width_0_char",
"*",
"256.... | 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 | train |
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):
"""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... | [
"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 | train |
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):
"""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 | [
"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 | train |
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):
"""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... | [
"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 | train |
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):
"""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) | [
"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 | train |
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):
"""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) | [
"def",
"_pys_assert_version",
"(",
"self",
",",
"line",
")",
":",
"if",
"float",
"(",
"line",
".",
"strip",
"(",
")",
")",
">",
"1.0",
":",
"msg",
"=",
"_",
"(",
"\"File version {version} unsupported (>1.0).\"",
")",
".",
"format",
"(",
"version",
"=",
"... | Asserts pys file version | [
"Asserts",
"pys",
"file",
"version"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/interfaces/pys.py#L120-L127 | train |
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):
"""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) | [
"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 | train |
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):
"""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... | [
"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 | train |
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):
"""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') | [
"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 | train |
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):
"""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... | [
"def",
"_attributes2pys",
"(",
"self",
")",
":",
"purged_cell_attributes",
"=",
"[",
"]",
"purged_cell_attributes_keys",
"=",
"[",
"]",
"for",
"selection",
",",
"tab",
",",
"attr_dict",
"in",
"self",
".",
"code_array",
".",
"cell_attributes",
":",
"if",
"purge... | 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 | train |
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):
"""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... | [
"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 | train |
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):
"""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... | [
"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 | train |
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):
"""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) | [
"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 | train |
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):
"""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... | [
"def",
"_pys2macros",
"(",
"self",
",",
"line",
")",
":",
"if",
"self",
".",
"code_array",
".",
"dict_grid",
".",
"macros",
"and",
"self",
".",
"code_array",
".",
"dict_grid",
".",
"macros",
"[",
"-",
"1",
"]",
"!=",
"\"\\n\"",
":",
"self",
".",
"cod... | 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 | train |
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):
"""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()
... | [
"def",
"_fonts2pys",
"(",
"self",
")",
":",
"system_fonts",
"=",
"font_manager",
".",
"findSystemFonts",
"(",
")",
"font_name2font_file",
"=",
"{",
"}",
"for",
"sys_font",
"in",
"system_fonts",
":",
"font_name",
"=",
"font_manager",
".",
"FontProperties",
"(",
... | 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 | train |
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):
"""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... | [
"def",
"_pys2fonts",
"(",
"self",
",",
"line",
")",
":",
"font_name",
",",
"ascii_font_data",
"=",
"self",
".",
"_split_tidy",
"(",
"line",
")",
"font_data",
"=",
"base64",
".",
"b64decode",
"(",
"ascii_font_data",
")",
"system_fonts",
"=",
"font_manager",
"... | Updates custom font list | [
"Updates",
"custom",
"font",
"list"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/interfaces/pys.py#L343-L369 | train |
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):
"""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... | [
"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 | train |
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):
"""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 ... | [
"def",
"to_code_array",
"(",
"self",
")",
":",
"state",
"=",
"None",
"first_line",
"=",
"True",
"self",
".",
"pys_file",
".",
"seek",
"(",
"0",
")",
"for",
"line",
"in",
"self",
".",
"pys_file",
":",
"if",
"first_line",
":",
"if",
"line",
"==",
"\"[P... | 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 | train |
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):
"""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... | [
"def",
"_style",
"(",
"self",
")",
":",
"self",
".",
"fold_symbols",
"=",
"2",
"self",
".",
"faces",
"=",
"{",
"'times'",
":",
"'Times'",
",",
"'mono'",
":",
"'Courier'",
",",
"'helv'",
":",
"wx",
".",
"SystemSettings",
".",
"GetFont",
"(",
"wx",
"."... | Set editor style | [
"Set",
"editor",
"style"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_widgets.py#L140-L270 | train |
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):
"""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)
... | [
"def",
"OnUpdateUI",
"(",
"self",
",",
"evt",
")",
":",
"brace_at_caret",
"=",
"-",
"1",
"brace_opposite",
"=",
"-",
"1",
"char_before",
"=",
"None",
"caret_pos",
"=",
"self",
".",
"GetCurrentPos",
"(",
")",
"if",
"caret_pos",
">",
"0",
":",
"char_before... | Syntax highlighting while editing | [
"Syntax",
"highlighting",
"while",
"editing"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_widgets.py#L272-L305 | train |
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):
"""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... | [
"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 | train |
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):
"""Multi-purpose expand method from original STC class"""
lastchild = self.GetLastChild(line, level)
line += 1
while line <= lastchild:
if force:
if vislevels > 0:
sel... | [
"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 | train |
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):
"""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... | [
"def",
"OnDrawBackground",
"(",
"self",
",",
"dc",
",",
"rect",
",",
"item",
",",
"flags",
")",
":",
"if",
"(",
"item",
"&",
"1",
"==",
"0",
"or",
"flags",
"&",
"(",
"wx",
".",
"combo",
".",
"ODCB_PAINTING_CONTROL",
"|",
"wx",
".",
"combo",
".",
... | 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 | train |
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):
"""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... | [
"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 | train |
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):
"""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 ... | [
"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 | train |
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):
"""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:
... | [
"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 | train |
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):
"""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... | [
"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 | train |
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):
"""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() | [
"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 | train |
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):
"""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():
... | [
"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 | train |
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):
"""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() | [
"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 | train |
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):
"""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... | [
"def",
"OnChar",
"(",
"self",
",",
"event",
")",
":",
"if",
"not",
"self",
".",
"ignore_changes",
":",
"keycode",
"=",
"event",
".",
"GetKeyCode",
"(",
")",
"if",
"keycode",
"==",
"13",
"and",
"not",
"self",
".",
"GetStringSelection",
"(",
")",
":",
... | 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 | train |
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):
"""Reposition the checkbox"""
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 | train |
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):
"""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:
... | [
"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 | train |
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):
"""
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 ... | [
"def",
"_fromGUI",
"(",
"self",
",",
"value",
")",
":",
"if",
"value",
"==",
"''",
":",
"if",
"not",
"self",
".",
"IsNoneAllowed",
"(",
")",
":",
"return",
"0",
"else",
":",
"return",
"else",
":",
"try",
":",
"return",
"int",
"(",
"value",
")",
"... | 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 | train |
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):
"""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... | [
"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 | train |
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):
"""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() | [
"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 | train |
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):
"""Event handler for grid resizing"""
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 | train |
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):
"""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... | [
"def",
"OnMouseUp",
"(",
"self",
",",
"event",
")",
":",
"if",
"not",
"self",
".",
"IsInControl",
":",
"self",
".",
"IsDrag",
"=",
"False",
"elif",
"self",
".",
"IsDrag",
":",
"if",
"not",
"self",
".",
"IsDrag",
":",
"self",
".",
"hitIndex",
"=",
"... | 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 | train |
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):
"""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... | [
"def",
"_set_properties",
"(",
"self",
")",
":",
"self",
".",
"set_icon",
"(",
"icons",
"[",
"\"PyspreadLogo\"",
"]",
")",
"self",
".",
"minSizeSet",
"=",
"False",
"post_command_event",
"(",
"self",
",",
"self",
".",
"SafeModeExitMsg",
")"
] | 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 | train |
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):
"""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")),
... | [
"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 | train |
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):
"""Sets main window icon to given wx.Bitmap"""
_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 | train |
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):
"""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)... | [
"def",
"OnToggleFullscreen",
"(",
"self",
",",
"event",
")",
":",
"is_full_screen",
"=",
"self",
".",
"main_window",
".",
"IsFullScreen",
"(",
")",
"if",
"is_full_screen",
":",
"try",
":",
"self",
".",
"main_window",
".",
"grid",
".",
"SetRowLabelSize",
"(",... | Fullscreen event handler | [
"Fullscreen",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L455-L491 | train |
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):
"""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... | [
"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 | train |
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):
"""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() | [
"def",
"OnSafeModeEntry",
"(",
"self",
",",
"event",
")",
":",
"self",
".",
"main_window",
".",
"main_menu",
".",
"enable_file_approve",
"(",
"True",
")",
"self",
".",
"main_window",
".",
"grid",
".",
"Refresh",
"(",
")",
"event",
".",
"Skip",
"(",
")"
] | 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 | train |
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):
"""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.... | [
"def",
"OnSafeModeExit",
"(",
"self",
",",
"event",
")",
":",
"self",
".",
"main_window",
".",
"main_menu",
".",
"enable_file_approve",
"(",
"False",
")",
"self",
".",
"main_window",
".",
"grid",
".",
"Refresh",
"(",
")",
"event",
".",
"Skip",
"(",
")"
] | 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 | train |
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):
"""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
... | [
"def",
"OnClose",
"(",
"self",
",",
"event",
")",
":",
"if",
"undo",
".",
"stack",
"(",
")",
".",
"haschanged",
"(",
")",
":",
"save_choice",
"=",
"self",
".",
"interfaces",
".",
"get_save_request_from_user",
"(",
")",
"if",
"save_choice",
"is",
"None",
... | Program exit event handler | [
"Program",
"exit",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_main_window.py#L544-L583 | train |
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):
"""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... | [
"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 | train |
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 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... | [
"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 | train |
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):
"""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 ... | [
"def",
"OnNewGpgKey",
"(",
"self",
",",
"event",
")",
":",
"if",
"gnupg",
"is",
"None",
":",
"return",
"if",
"genkey",
"is",
"None",
":",
"self",
".",
"interfaces",
".",
"display_warning",
"(",
"_",
"(",
"\"Python gnupg not found. No key selected.\"",
")",
"... | 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 | train |
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):
"""Toggles visibility of given aui pane
Parameters
----------
pane: String
\tPane name
"""
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 | train |
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):
"""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() | [
"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 | train |
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):
"""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() | [
"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 | train |
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):
"""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() | [
"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 | train |
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):
"""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)
... | [
"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 | train |
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):
"""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() | [
"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 | train |
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 toggle event handler"""
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 | train |
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 toggle event handler"""
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 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.