repo
stringlengths
7
54
path
stringlengths
4
223
func_name
stringlengths
1
134
original_string
stringlengths
75
104k
language
stringclasses
1 value
code
stringlengths
75
104k
code_tokens
listlengths
20
28.4k
docstring
stringlengths
1
46.3k
docstring_tokens
listlengths
1
1.66k
sha
stringlengths
40
40
url
stringlengths
87
315
partition
stringclasses
1 value
summary
stringlengths
4
350
obf_code
stringlengths
7.85k
764k
spyder-ide/spyder
spyder/utils/syntaxhighlighters.py
guess_pygments_highlighter
def guess_pygments_highlighter(filename): """Factory to generate syntax highlighter for the given filename. If a syntax highlighter is not available for a particular file, this function will attempt to generate one based on the lexers in Pygments. If Pygments is not available or does not have an ...
python
def guess_pygments_highlighter(filename): """Factory to generate syntax highlighter for the given filename. If a syntax highlighter is not available for a particular file, this function will attempt to generate one based on the lexers in Pygments. If Pygments is not available or does not have an ...
[ "def", "guess_pygments_highlighter", "(", "filename", ")", ":", "try", ":", "from", "pygments", ".", "lexers", "import", "get_lexer_for_filename", ",", "get_lexer_by_name", "except", "Exception", ":", "return", "TextSH", "root", ",", "ext", "=", "os", ".", "path...
Factory to generate syntax highlighter for the given filename. If a syntax highlighter is not available for a particular file, this function will attempt to generate one based on the lexers in Pygments. If Pygments is not available or does not have an appropriate lexer, TextSH will be returned in...
[ "Factory", "to", "generate", "syntax", "highlighter", "for", "the", "given", "filename", ".", "If", "a", "syntax", "highlighter", "is", "not", "available", "for", "a", "particular", "file", "this", "function", "will", "attempt", "to", "generate", "one", "based...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/syntaxhighlighters.py#L1233-L1259
train
Factory to generate a syntax highlighter for a given filename.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/utils/syntaxhighlighters.py
BaseSH.highlightBlock
def highlightBlock(self, text): """ Highlights a block of text. Please do not override, this method. Instead you should implement :func:`spyder.utils.syntaxhighplighters.SyntaxHighlighter.highlight_block`. :param text: text to highlight. """ self.highligh...
python
def highlightBlock(self, text): """ Highlights a block of text. Please do not override, this method. Instead you should implement :func:`spyder.utils.syntaxhighplighters.SyntaxHighlighter.highlight_block`. :param text: text to highlight. """ self.highligh...
[ "def", "highlightBlock", "(", "self", ",", "text", ")", ":", "self", ".", "highlight_block", "(", "text", ")", "# Process blocks for fold detection\r", "current_block", "=", "self", ".", "currentBlock", "(", ")", "previous_block", "=", "self", ".", "_find_prev_non...
Highlights a block of text. Please do not override, this method. Instead you should implement :func:`spyder.utils.syntaxhighplighters.SyntaxHighlighter.highlight_block`. :param text: text to highlight.
[ "Highlights", "a", "block", "of", "text", ".", "Please", "do", "not", "override", "this", "method", ".", "Instead", "you", "should", "implement", ":", "func", ":", "spyder", ".", "utils", ".", "syntaxhighplighters", ".", "SyntaxHighlighter", ".", "highlight_bl...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/syntaxhighlighters.py#L219-L236
train
Highlights a block of text.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/utils/syntaxhighlighters.py
BaseSH.highlight_spaces
def highlight_spaces(self, text, offset=0): """ Make blank space less apparent by setting the foreground alpha. This only has an effect when 'Show blank space' is turned on. Derived classes could call this function at the end of highlightBlock(). """ flags_...
python
def highlight_spaces(self, text, offset=0): """ Make blank space less apparent by setting the foreground alpha. This only has an effect when 'Show blank space' is turned on. Derived classes could call this function at the end of highlightBlock(). """ flags_...
[ "def", "highlight_spaces", "(", "self", ",", "text", ",", "offset", "=", "0", ")", ":", "flags_text", "=", "self", ".", "document", "(", ")", ".", "defaultTextOption", "(", ")", ".", "flags", "(", ")", "show_blanks", "=", "flags_text", "&", "QTextOption"...
Make blank space less apparent by setting the foreground alpha. This only has an effect when 'Show blank space' is turned on. Derived classes could call this function at the end of highlightBlock().
[ "Make", "blank", "space", "less", "apparent", "by", "setting", "the", "foreground", "alpha", ".", "This", "only", "has", "an", "effect", "when", "Show", "blank", "space", "is", "turned", "on", ".", "Derived", "classes", "could", "call", "this", "function", ...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/syntaxhighlighters.py#L247-L275
train
Highlights the blank spaces at the specified offset in the text.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/utils/syntaxhighlighters.py
PythonSH.highlight_block
def highlight_block(self, text): """Implement specific highlight for Python.""" text = to_text_string(text) prev_state = tbh.get_state(self.currentBlock().previous()) if prev_state == self.INSIDE_DQ3STRING: offset = -4 text = r'""" '+text elif prev_...
python
def highlight_block(self, text): """Implement specific highlight for Python.""" text = to_text_string(text) prev_state = tbh.get_state(self.currentBlock().previous()) if prev_state == self.INSIDE_DQ3STRING: offset = -4 text = r'""" '+text elif prev_...
[ "def", "highlight_block", "(", "self", ",", "text", ")", ":", "text", "=", "to_text_string", "(", "text", ")", "prev_state", "=", "tbh", ".", "get_state", "(", "self", ".", "currentBlock", "(", ")", ".", "previous", "(", ")", ")", "if", "prev_state", "...
Implement specific highlight for Python.
[ "Implement", "specific", "highlight", "for", "Python", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/syntaxhighlighters.py#L426-L557
train
Implement specific highlight for Python.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/utils/syntaxhighlighters.py
CppSH.highlight_block
def highlight_block(self, text): """Implement highlight specific for C/C++.""" text = to_text_string(text) inside_comment = tbh.get_state(self.currentBlock().previous()) == self.INSIDE_COMMENT self.setFormat(0, len(text), self.formats["comment" if inside_comme...
python
def highlight_block(self, text): """Implement highlight specific for C/C++.""" text = to_text_string(text) inside_comment = tbh.get_state(self.currentBlock().previous()) == self.INSIDE_COMMENT self.setFormat(0, len(text), self.formats["comment" if inside_comme...
[ "def", "highlight_block", "(", "self", ",", "text", ")", ":", "text", "=", "to_text_string", "(", "text", ")", "inside_comment", "=", "tbh", ".", "get_state", "(", "self", ".", "currentBlock", "(", ")", ".", "previous", "(", ")", ")", "==", "self", "."...
Implement highlight specific for C/C++.
[ "Implement", "highlight", "specific", "for", "C", "/", "C", "++", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/syntaxhighlighters.py#L644-L680
train
Implement highlight specific for C ++ and C ++.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/utils/syntaxhighlighters.py
FortranSH.highlight_block
def highlight_block(self, text): """Implement highlight specific for Fortran.""" text = to_text_string(text) self.setFormat(0, len(text), self.formats["normal"]) match = self.PROG.search(text) index = 0 while match: for key, value in list(matc...
python
def highlight_block(self, text): """Implement highlight specific for Fortran.""" text = to_text_string(text) self.setFormat(0, len(text), self.formats["normal"]) match = self.PROG.search(text) index = 0 while match: for key, value in list(matc...
[ "def", "highlight_block", "(", "self", ",", "text", ")", ":", "text", "=", "to_text_string", "(", "text", ")", "self", ".", "setFormat", "(", "0", ",", "len", "(", "text", ")", ",", "self", ".", "formats", "[", "\"normal\"", "]", ")", "match", "=", ...
Implement highlight specific for Fortran.
[ "Implement", "highlight", "specific", "for", "Fortran", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/syntaxhighlighters.py#L733-L755
train
Implement highlight specific for Fortran.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/utils/syntaxhighlighters.py
Fortran77SH.highlight_block
def highlight_block(self, text): """Implement highlight specific for Fortran77.""" text = to_text_string(text) if text.startswith(("c", "C")): self.setFormat(0, len(text), self.formats["comment"]) self.highlight_spaces(text) else: FortranSH.high...
python
def highlight_block(self, text): """Implement highlight specific for Fortran77.""" text = to_text_string(text) if text.startswith(("c", "C")): self.setFormat(0, len(text), self.formats["comment"]) self.highlight_spaces(text) else: FortranSH.high...
[ "def", "highlight_block", "(", "self", ",", "text", ")", ":", "text", "=", "to_text_string", "(", "text", ")", "if", "text", ".", "startswith", "(", "(", "\"c\"", ",", "\"C\"", ")", ")", ":", "self", ".", "setFormat", "(", "0", ",", "len", "(", "te...
Implement highlight specific for Fortran77.
[ "Implement", "highlight", "specific", "for", "Fortran77", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/syntaxhighlighters.py#L759-L769
train
Implement highlight specific for Fortran77 and FortranSH.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/utils/syntaxhighlighters.py
DiffSH.highlight_block
def highlight_block(self, text): """Implement highlight specific Diff/Patch files.""" text = to_text_string(text) if text.startswith("+++"): self.setFormat(0, len(text), self.formats["keyword"]) elif text.startswith("---"): self.setFormat(0, len(text), self....
python
def highlight_block(self, text): """Implement highlight specific Diff/Patch files.""" text = to_text_string(text) if text.startswith("+++"): self.setFormat(0, len(text), self.formats["keyword"]) elif text.startswith("---"): self.setFormat(0, len(text), self....
[ "def", "highlight_block", "(", "self", ",", "text", ")", ":", "text", "=", "to_text_string", "(", "text", ")", "if", "text", ".", "startswith", "(", "\"+++\"", ")", ":", "self", ".", "setFormat", "(", "0", ",", "len", "(", "text", ")", ",", "self", ...
Implement highlight specific Diff/Patch files.
[ "Implement", "highlight", "specific", "Diff", "/", "Patch", "files", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/syntaxhighlighters.py#L809-L823
train
Implement highlight specific Diff / Patch files.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/utils/syntaxhighlighters.py
BaseWebSH.highlight_block
def highlight_block(self, text): """Implement highlight specific for CSS and HTML.""" text = to_text_string(text) previous_state = tbh.get_state(self.currentBlock().previous()) if previous_state == self.COMMENT: self.setFormat(0, len(text), self.formats["commen...
python
def highlight_block(self, text): """Implement highlight specific for CSS and HTML.""" text = to_text_string(text) previous_state = tbh.get_state(self.currentBlock().previous()) if previous_state == self.COMMENT: self.setFormat(0, len(text), self.formats["commen...
[ "def", "highlight_block", "(", "self", ",", "text", ")", ":", "text", "=", "to_text_string", "(", "text", ")", "previous_state", "=", "tbh", ".", "get_state", "(", "self", ".", "currentBlock", "(", ")", ".", "previous", "(", ")", ")", "if", "previous_sta...
Implement highlight specific for CSS and HTML.
[ "Implement", "highlight", "specific", "for", "CSS", "and", "HTML", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/syntaxhighlighters.py#L911-L960
train
Implement highlight specific for CSS and HTML.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/utils/syntaxhighlighters.py
PygmentsSH.make_charlist
def make_charlist(self): """Parses the complete text and stores format for each character.""" def worker_output(worker, output, error): """Worker finished callback.""" self._charlist = output if error is None and output: self._allow_highlight =...
python
def make_charlist(self): """Parses the complete text and stores format for each character.""" def worker_output(worker, output, error): """Worker finished callback.""" self._charlist = output if error is None and output: self._allow_highlight =...
[ "def", "make_charlist", "(", "self", ")", ":", "def", "worker_output", "(", "worker", ",", "output", ",", "error", ")", ":", "\"\"\"Worker finished callback.\"\"\"", "self", ".", "_charlist", "=", "output", "if", "error", "is", "None", "and", "output", ":", ...
Parses the complete text and stores format for each character.
[ "Parses", "the", "complete", "text", "and", "stores", "format", "for", "each", "character", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/syntaxhighlighters.py#L1161-L1186
train
Parses the complete text and stores the format for each character.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/utils/syntaxhighlighters.py
PygmentsSH._make_charlist
def _make_charlist(self, tokens, tokmap, formats): """ Parses the complete text and stores format for each character. Uses the attached lexer to parse into a list of tokens and Pygments token types. Then breaks tokens into individual letters, each with a Spyder token type...
python
def _make_charlist(self, tokens, tokmap, formats): """ Parses the complete text and stores format for each character. Uses the attached lexer to parse into a list of tokens and Pygments token types. Then breaks tokens into individual letters, each with a Spyder token type...
[ "def", "_make_charlist", "(", "self", ",", "tokens", ",", "tokmap", ",", "formats", ")", ":", "def", "_get_fmt", "(", "typ", ")", ":", "\"\"\"Get the Spyder format code for the given Pygments token type.\"\"\"", "# Exact matches first\r", "if", "typ", "in", "tokmap", ...
Parses the complete text and stores format for each character. Uses the attached lexer to parse into a list of tokens and Pygments token types. Then breaks tokens into individual letters, each with a Spyder token type attached. Stores this list as self._charlist. It's attached ...
[ "Parses", "the", "complete", "text", "and", "stores", "format", "for", "each", "character", ".", "Uses", "the", "attached", "lexer", "to", "parse", "into", "a", "list", "of", "tokens", "and", "Pygments", "token", "types", ".", "Then", "breaks", "tokens", "...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/syntaxhighlighters.py#L1188-L1218
train
Parses the text and stores the format code for each character in the list.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/utils/syntaxhighlighters.py
PygmentsSH.highlightBlock
def highlightBlock(self, text): """ Actually highlight the block""" # Note that an undefined blockstate is equal to -1, so the first block # will have the correct behaviour of starting at 0. if self._allow_highlight: start = self.previousBlockState() + 1 end...
python
def highlightBlock(self, text): """ Actually highlight the block""" # Note that an undefined blockstate is equal to -1, so the first block # will have the correct behaviour of starting at 0. if self._allow_highlight: start = self.previousBlockState() + 1 end...
[ "def", "highlightBlock", "(", "self", ",", "text", ")", ":", "# Note that an undefined blockstate is equal to -1, so the first block\r", "# will have the correct behaviour of starting at 0.\r", "if", "self", ".", "_allow_highlight", ":", "start", "=", "self", ".", "previousBloc...
Actually highlight the block
[ "Actually", "highlight", "the", "block" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/syntaxhighlighters.py#L1220-L1230
train
Highlight the block.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/utils/introspection/module_completion.py
get_submodules
def get_submodules(mod): """Get all submodules of a given module""" def catch_exceptions(module): pass try: m = __import__(mod) submodules = [mod] submods = pkgutil.walk_packages(m.__path__, m.__name__ + '.', catch_exceptions) ...
python
def get_submodules(mod): """Get all submodules of a given module""" def catch_exceptions(module): pass try: m = __import__(mod) submodules = [mod] submods = pkgutil.walk_packages(m.__path__, m.__name__ + '.', catch_exceptions) ...
[ "def", "get_submodules", "(", "mod", ")", ":", "def", "catch_exceptions", "(", "module", ")", ":", "pass", "try", ":", "m", "=", "__import__", "(", "mod", ")", "submodules", "=", "[", "mod", "]", "submods", "=", "pkgutil", ".", "walk_packages", "(", "m...
Get all submodules of a given module
[ "Get", "all", "submodules", "of", "a", "given", "module" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/introspection/module_completion.py#L34-L51
train
Get all submodules of a given module
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/utils/introspection/module_completion.py
get_preferred_submodules
def get_preferred_submodules(): """ Get all submodules of the main scientific modules and others of our interest """ # Path to the modules database modules_path = get_conf_path('db') # Modules database modules_db = PickleShareDB(modules_path) if 'submodules' in modules_d...
python
def get_preferred_submodules(): """ Get all submodules of the main scientific modules and others of our interest """ # Path to the modules database modules_path = get_conf_path('db') # Modules database modules_db = PickleShareDB(modules_path) if 'submodules' in modules_d...
[ "def", "get_preferred_submodules", "(", ")", ":", "# Path to the modules database\r", "modules_path", "=", "get_conf_path", "(", "'db'", ")", "# Modules database\r", "modules_db", "=", "PickleShareDB", "(", "modules_path", ")", "if", "'submodules'", "in", "modules_db", ...
Get all submodules of the main scientific modules and others of our interest
[ "Get", "all", "submodules", "of", "the", "main", "scientific", "modules", "and", "others", "of", "our", "interest" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/introspection/module_completion.py#L54-L75
train
Get all submodules of the main scientific modules and others of our
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/config/base.py
is_stable_version
def is_stable_version(version): """ Return true if version is stable, i.e. with letters in the final component. Stable version examples: ``1.2``, ``1.3.4``, ``1.0.5``. Non-stable version examples: ``1.3.4beta``, ``0.1.0rc1``, ``3.0.0dev0``. """ if not isinstance(version, tuple): ...
python
def is_stable_version(version): """ Return true if version is stable, i.e. with letters in the final component. Stable version examples: ``1.2``, ``1.3.4``, ``1.0.5``. Non-stable version examples: ``1.3.4beta``, ``0.1.0rc1``, ``3.0.0dev0``. """ if not isinstance(version, tuple): ...
[ "def", "is_stable_version", "(", "version", ")", ":", "if", "not", "isinstance", "(", "version", ",", "tuple", ")", ":", "version", "=", "version", ".", "split", "(", "'.'", ")", "last_part", "=", "version", "[", "-", "1", "]", "if", "not", "re", "."...
Return true if version is stable, i.e. with letters in the final component. Stable version examples: ``1.2``, ``1.3.4``, ``1.0.5``. Non-stable version examples: ``1.3.4beta``, ``0.1.0rc1``, ``3.0.0dev0``.
[ "Return", "true", "if", "version", "is", "stable", "i", ".", "e", ".", "with", "letters", "in", "the", "final", "component", ".", "Stable", "version", "examples", ":", "1", ".", "2", "1", ".", "3", ".", "4", "1", ".", "0", ".", "5", ".", "Non", ...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/config/base.py#L60-L74
train
Returns true if version is stable i. e. with letters in the final component.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/config/base.py
use_dev_config_dir
def use_dev_config_dir(use_dev_config_dir=USE_DEV_CONFIG_DIR): """Return whether the dev configuration directory should used.""" if use_dev_config_dir is not None: if use_dev_config_dir.lower() in {'false', '0'}: use_dev_config_dir = False else: use_dev_config_dir = DEV or ...
python
def use_dev_config_dir(use_dev_config_dir=USE_DEV_CONFIG_DIR): """Return whether the dev configuration directory should used.""" if use_dev_config_dir is not None: if use_dev_config_dir.lower() in {'false', '0'}: use_dev_config_dir = False else: use_dev_config_dir = DEV or ...
[ "def", "use_dev_config_dir", "(", "use_dev_config_dir", "=", "USE_DEV_CONFIG_DIR", ")", ":", "if", "use_dev_config_dir", "is", "not", "None", ":", "if", "use_dev_config_dir", ".", "lower", "(", ")", "in", "{", "'false'", ",", "'0'", "}", ":", "use_dev_config_dir...
Return whether the dev configuration directory should used.
[ "Return", "whether", "the", "dev", "configuration", "directory", "should", "used", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/config/base.py#L77-L84
train
Return whether the dev configuration directory should be used.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/config/base.py
debug_print
def debug_print(*message): """Output debug messages to stdout""" warnings.warn("debug_print is deprecated; use the logging module instead.") if get_debug_level(): ss = STDOUT if PY3: # This is needed after restarting and using debug_print for m in message: ...
python
def debug_print(*message): """Output debug messages to stdout""" warnings.warn("debug_print is deprecated; use the logging module instead.") if get_debug_level(): ss = STDOUT if PY3: # This is needed after restarting and using debug_print for m in message: ...
[ "def", "debug_print", "(", "*", "message", ")", ":", "warnings", ".", "warn", "(", "\"debug_print is deprecated; use the logging module instead.\"", ")", "if", "get_debug_level", "(", ")", ":", "ss", "=", "STDOUT", "if", "PY3", ":", "# This is needed after restarting ...
Output debug messages to stdout
[ "Output", "debug", "messages", "to", "stdout" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/config/base.py#L102-L113
train
Output debug messages to stdout
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/config/base.py
get_home_dir
def get_home_dir(): """ Return user home directory """ try: # expanduser() returns a raw byte string which needs to be # decoded with the codec that the OS is using to represent # file paths. path = encoding.to_unicode_from_fs(osp.expanduser('~')) except Exce...
python
def get_home_dir(): """ Return user home directory """ try: # expanduser() returns a raw byte string which needs to be # decoded with the codec that the OS is using to represent # file paths. path = encoding.to_unicode_from_fs(osp.expanduser('~')) except Exce...
[ "def", "get_home_dir", "(", ")", ":", "try", ":", "# expanduser() returns a raw byte string which needs to be\r", "# decoded with the codec that the OS is using to represent\r", "# file paths.\r", "path", "=", "encoding", ".", "to_unicode_from_fs", "(", "osp", ".", "expanduser", ...
Return user home directory
[ "Return", "user", "home", "directory" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/config/base.py#L145-L174
train
Returns the user home directory path for the current user.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/config/base.py
get_clean_conf_dir
def get_clean_conf_dir(): """ Return the path to a temp clean configuration dir, for tests and safe mode. """ if sys.platform.startswith("win"): current_user = '' else: current_user = '-' + str(getpass.getuser()) conf_dir = osp.join(str(tempfile.gettempdir()), ...
python
def get_clean_conf_dir(): """ Return the path to a temp clean configuration dir, for tests and safe mode. """ if sys.platform.startswith("win"): current_user = '' else: current_user = '-' + str(getpass.getuser()) conf_dir = osp.join(str(tempfile.gettempdir()), ...
[ "def", "get_clean_conf_dir", "(", ")", ":", "if", "sys", ".", "platform", ".", "startswith", "(", "\"win\"", ")", ":", "current_user", "=", "''", "else", ":", "current_user", "=", "'-'", "+", "str", "(", "getpass", ".", "getuser", "(", ")", ")", "conf_...
Return the path to a temp clean configuration dir, for tests and safe mode.
[ "Return", "the", "path", "to", "a", "temp", "clean", "configuration", "dir", "for", "tests", "and", "safe", "mode", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/config/base.py#L177-L189
train
Returns the path to a temp clean configuration dir for tests and safe mode.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/config/base.py
get_conf_path
def get_conf_path(filename=None): """Return absolute path to the config file with the specified filename.""" # Define conf_dir if running_under_pytest() or SAFE_MODE: # Use clean config dir if running tests or the user requests it. conf_dir = get_clean_conf_dir() elif sys.platform....
python
def get_conf_path(filename=None): """Return absolute path to the config file with the specified filename.""" # Define conf_dir if running_under_pytest() or SAFE_MODE: # Use clean config dir if running tests or the user requests it. conf_dir = get_clean_conf_dir() elif sys.platform....
[ "def", "get_conf_path", "(", "filename", "=", "None", ")", ":", "# Define conf_dir\r", "if", "running_under_pytest", "(", ")", "or", "SAFE_MODE", ":", "# Use clean config dir if running tests or the user requests it.\r", "conf_dir", "=", "get_clean_conf_dir", "(", ")", "e...
Return absolute path to the config file with the specified filename.
[ "Return", "absolute", "path", "to", "the", "config", "file", "with", "the", "specified", "filename", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/config/base.py#L192-L219
train
Return absolute path to the config file with the specified filename.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/config/base.py
get_module_path
def get_module_path(modname): """Return module *modname* base path""" return osp.abspath(osp.dirname(sys.modules[modname].__file__))
python
def get_module_path(modname): """Return module *modname* base path""" return osp.abspath(osp.dirname(sys.modules[modname].__file__))
[ "def", "get_module_path", "(", "modname", ")", ":", "return", "osp", ".", "abspath", "(", "osp", ".", "dirname", "(", "sys", ".", "modules", "[", "modname", "]", ".", "__file__", ")", ")" ]
Return module *modname* base path
[ "Return", "module", "*", "modname", "*", "base", "path" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/config/base.py#L222-L224
train
Return module *modname * base path
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/config/base.py
get_module_data_path
def get_module_data_path(modname, relpath=None, attr_name='DATAPATH'): """Return module *modname* data path Note: relpath is ignored if module has an attribute named *attr_name* Handles py2exe/cx_Freeze distributions""" datapath = getattr(sys.modules[modname], attr_name, '') if datapath: ...
python
def get_module_data_path(modname, relpath=None, attr_name='DATAPATH'): """Return module *modname* data path Note: relpath is ignored if module has an attribute named *attr_name* Handles py2exe/cx_Freeze distributions""" datapath = getattr(sys.modules[modname], attr_name, '') if datapath: ...
[ "def", "get_module_data_path", "(", "modname", ",", "relpath", "=", "None", ",", "attr_name", "=", "'DATAPATH'", ")", ":", "datapath", "=", "getattr", "(", "sys", ".", "modules", "[", "modname", "]", ",", "attr_name", ",", "''", ")", "if", "datapath", ":...
Return module *modname* data path Note: relpath is ignored if module has an attribute named *attr_name* Handles py2exe/cx_Freeze distributions
[ "Return", "module", "*", "modname", "*", "data", "path", "Note", ":", "relpath", "is", "ignored", "if", "module", "has", "an", "attribute", "named", "*", "attr_name", "*", "Handles", "py2exe", "/", "cx_Freeze", "distributions" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/config/base.py#L227-L245
train
Returns the path to the data directory of a module.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/config/base.py
get_module_source_path
def get_module_source_path(modname, basename=None): """Return module *modname* source path If *basename* is specified, return *modname.basename* path where *modname* is a package containing the module *basename* *basename* is a filename (not a module name), so it must include the file ex...
python
def get_module_source_path(modname, basename=None): """Return module *modname* source path If *basename* is specified, return *modname.basename* path where *modname* is a package containing the module *basename* *basename* is a filename (not a module name), so it must include the file ex...
[ "def", "get_module_source_path", "(", "modname", ",", "basename", "=", "None", ")", ":", "srcpath", "=", "get_module_path", "(", "modname", ")", "parentdir", "=", "osp", ".", "join", "(", "srcpath", ",", "osp", ".", "pardir", ")", "if", "osp", ".", "isfi...
Return module *modname* source path If *basename* is specified, return *modname.basename* path where *modname* is a package containing the module *basename* *basename* is a filename (not a module name), so it must include the file extension: .py or .pyw Handles py2exe/cx_Freeze dis...
[ "Return", "module", "*", "modname", "*", "source", "path", "If", "*", "basename", "*", "is", "specified", "return", "*", "modname", ".", "basename", "*", "path", "where", "*", "modname", "*", "is", "a", "package", "containing", "the", "module", "*", "bas...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/config/base.py#L248-L266
train
Return the absolute path of the module containing the basename
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/config/base.py
get_image_path
def get_image_path(name, default="not_found.png"): """Return image absolute path""" for img_path in IMG_PATH: full_path = osp.join(img_path, name) if osp.isfile(full_path): return osp.abspath(full_path) if default is not None: img_path = osp.join(get_module_path('s...
python
def get_image_path(name, default="not_found.png"): """Return image absolute path""" for img_path in IMG_PATH: full_path = osp.join(img_path, name) if osp.isfile(full_path): return osp.abspath(full_path) if default is not None: img_path = osp.join(get_module_path('s...
[ "def", "get_image_path", "(", "name", ",", "default", "=", "\"not_found.png\"", ")", ":", "for", "img_path", "in", "IMG_PATH", ":", "full_path", "=", "osp", ".", "join", "(", "img_path", ",", "name", ")", "if", "osp", ".", "isfile", "(", "full_path", ")"...
Return image absolute path
[ "Return", "image", "absolute", "path" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/config/base.py#L289-L297
train
Return image absolute path
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/config/base.py
get_available_translations
def get_available_translations(): """ List available translations for spyder based on the folders found in the locale folder. This function checks if LANGUAGE_CODES contain the same information that is found in the 'locale' folder to ensure that when a new language is added, LANGUAGE_CODES is u...
python
def get_available_translations(): """ List available translations for spyder based on the folders found in the locale folder. This function checks if LANGUAGE_CODES contain the same information that is found in the 'locale' folder to ensure that when a new language is added, LANGUAGE_CODES is u...
[ "def", "get_available_translations", "(", ")", ":", "locale_path", "=", "get_module_data_path", "(", "\"spyder\"", ",", "relpath", "=", "\"locale\"", ",", "attr_name", "=", "'LOCALEPATH'", ")", "listdir", "=", "os", ".", "listdir", "(", "locale_path", ")", "lang...
List available translations for spyder based on the folders found in the locale folder. This function checks if LANGUAGE_CODES contain the same information that is found in the 'locale' folder to ensure that when a new language is added, LANGUAGE_CODES is updated.
[ "List", "available", "translations", "for", "spyder", "based", "on", "the", "folders", "found", "in", "the", "locale", "folder", ".", "This", "function", "checks", "if", "LANGUAGE_CODES", "contain", "the", "same", "information", "that", "is", "found", "in", "t...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/config/base.py#L322-L346
train
Returns a list of available translations for Spyder based on the folders found in the LOCALEPATH folder.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/config/base.py
get_interface_language
def get_interface_language(): """ If Spyder has a translation available for the locale language, it will return the version provided by Spyder adjusted for language subdifferences, otherwise it will return DEFAULT_LANGUAGE. Example: 1.) Spyder provides ('en', 'de', 'fr', 'es' 'hu' and '...
python
def get_interface_language(): """ If Spyder has a translation available for the locale language, it will return the version provided by Spyder adjusted for language subdifferences, otherwise it will return DEFAULT_LANGUAGE. Example: 1.) Spyder provides ('en', 'de', 'fr', 'es' 'hu' and '...
[ "def", "get_interface_language", "(", ")", ":", "# Solves issue #3627\r", "try", ":", "locale_language", "=", "locale", ".", "getdefaultlocale", "(", ")", "[", "0", "]", "except", "ValueError", ":", "locale_language", "=", "DEFAULT_LANGUAGE", "# Tests expect English a...
If Spyder has a translation available for the locale language, it will return the version provided by Spyder adjusted for language subdifferences, otherwise it will return DEFAULT_LANGUAGE. Example: 1.) Spyder provides ('en', 'de', 'fr', 'es' 'hu' and 'pt_BR'), if the locale is either 'en_US...
[ "If", "Spyder", "has", "a", "translation", "available", "for", "the", "locale", "language", "it", "will", "return", "the", "version", "provided", "by", "Spyder", "adjusted", "for", "language", "subdifferences", "otherwise", "it", "will", "return", "DEFAULT_LANGUAG...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/config/base.py#L349-L386
train
Returns the language of the most recent available language for the given locale.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/config/base.py
load_lang_conf
def load_lang_conf(): """ Load language setting from language config file if it exists, otherwise try to use the local settings if Spyder provides a translation, or return the default if no translation provided. """ if osp.isfile(LANG_FILE): with open(LANG_FILE, 'r') as f: ...
python
def load_lang_conf(): """ Load language setting from language config file if it exists, otherwise try to use the local settings if Spyder provides a translation, or return the default if no translation provided. """ if osp.isfile(LANG_FILE): with open(LANG_FILE, 'r') as f: ...
[ "def", "load_lang_conf", "(", ")", ":", "if", "osp", ".", "isfile", "(", "LANG_FILE", ")", ":", "with", "open", "(", "LANG_FILE", ",", "'r'", ")", "as", "f", ":", "lang", "=", "f", ".", "read", "(", ")", "else", ":", "lang", "=", "get_interface_lan...
Load language setting from language config file if it exists, otherwise try to use the local settings if Spyder provides a translation, or return the default if no translation provided.
[ "Load", "language", "setting", "from", "language", "config", "file", "if", "it", "exists", "otherwise", "try", "to", "use", "the", "local", "settings", "if", "Spyder", "provides", "a", "translation", "or", "return", "the", "default", "if", "no", "translation",...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/config/base.py#L401-L419
train
Load language setting from language config file if it exists otherwise use the local settings.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/config/base.py
get_translation
def get_translation(modname, dirname=None): """Return translation callback for module *modname*""" if dirname is None: dirname = modname def translate_dumb(x): """Dumb function to not use translations.""" if not is_unicode(x): return to_text_string(x, "utf-8") ...
python
def get_translation(modname, dirname=None): """Return translation callback for module *modname*""" if dirname is None: dirname = modname def translate_dumb(x): """Dumb function to not use translations.""" if not is_unicode(x): return to_text_string(x, "utf-8") ...
[ "def", "get_translation", "(", "modname", ",", "dirname", "=", "None", ")", ":", "if", "dirname", "is", "None", ":", "dirname", "=", "modname", "def", "translate_dumb", "(", "x", ")", ":", "\"\"\"Dumb function to not use translations.\"\"\"", "if", "not", "is_un...
Return translation callback for module *modname*
[ "Return", "translation", "callback", "for", "module", "*", "modname", "*" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/config/base.py#L422-L464
train
Returns a callback that returns the translation of the module modname.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/config/base.py
reset_config_files
def reset_config_files(): """Remove all config files""" print("*** Reset Spyder settings to defaults ***", file=STDERR) for fname in SAVED_CONFIG_FILES: cfg_fname = get_conf_path(fname) if osp.isfile(cfg_fname) or osp.islink(cfg_fname): os.remove(cfg_fname) elif os...
python
def reset_config_files(): """Remove all config files""" print("*** Reset Spyder settings to defaults ***", file=STDERR) for fname in SAVED_CONFIG_FILES: cfg_fname = get_conf_path(fname) if osp.isfile(cfg_fname) or osp.islink(cfg_fname): os.remove(cfg_fname) elif os...
[ "def", "reset_config_files", "(", ")", ":", "print", "(", "\"*** Reset Spyder settings to defaults ***\"", ",", "file", "=", "STDERR", ")", "for", "fname", "in", "SAVED_CONFIG_FILES", ":", "cfg_fname", "=", "get_conf_path", "(", "fname", ")", "if", "osp", ".", "...
Remove all config files
[ "Remove", "all", "config", "files" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/config/base.py#L512-L523
train
Remove all config files that are not in SAVED_CONFIG_FILES
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/plugins/explorer/plugin.py
Explorer.register_plugin
def register_plugin(self): """Register plugin in Spyder's main window""" ipyconsole = self.main.ipyconsole treewidget = self.fileexplorer.treewidget self.main.add_dockwidget(self) self.fileexplorer.sig_open_file.connect(self.main.open_file) self.register_widget_sh...
python
def register_plugin(self): """Register plugin in Spyder's main window""" ipyconsole = self.main.ipyconsole treewidget = self.fileexplorer.treewidget self.main.add_dockwidget(self) self.fileexplorer.sig_open_file.connect(self.main.open_file) self.register_widget_sh...
[ "def", "register_plugin", "(", "self", ")", ":", "ipyconsole", "=", "self", ".", "main", ".", "ipyconsole", "treewidget", "=", "self", ".", "fileexplorer", ".", "treewidget", "self", ".", "main", ".", "add_dockwidget", "(", "self", ")", "self", ".", "filee...
Register plugin in Spyder's main window
[ "Register", "plugin", "in", "Spyder", "s", "main", "window" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/plugin.py#L70-L106
train
Register plugin in Spyder s main window
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/plugins/explorer/plugin.py
Explorer.refresh_plugin
def refresh_plugin(self, new_path=None, force_current=True): """Refresh explorer widget""" self.fileexplorer.treewidget.update_history(new_path) self.fileexplorer.treewidget.refresh(new_path, force_current=force_current)
python
def refresh_plugin(self, new_path=None, force_current=True): """Refresh explorer widget""" self.fileexplorer.treewidget.update_history(new_path) self.fileexplorer.treewidget.refresh(new_path, force_current=force_current)
[ "def", "refresh_plugin", "(", "self", ",", "new_path", "=", "None", ",", "force_current", "=", "True", ")", ":", "self", ".", "fileexplorer", ".", "treewidget", ".", "update_history", "(", "new_path", ")", "self", ".", "fileexplorer", ".", "treewidget", ".",...
Refresh explorer widget
[ "Refresh", "explorer", "widget" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/explorer/plugin.py#L108-L112
train
Refresh the explorer widget
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/py3compat.py
is_type_text_string
def is_type_text_string(obj): """Return True if `obj` is type text string, False if it is anything else, like an instance of a class that extends the basestring class.""" if PY2: # Python 2 return type(obj) in [str, unicode] else: # Python 3 return type(obj) in [s...
python
def is_type_text_string(obj): """Return True if `obj` is type text string, False if it is anything else, like an instance of a class that extends the basestring class.""" if PY2: # Python 2 return type(obj) in [str, unicode] else: # Python 3 return type(obj) in [s...
[ "def", "is_type_text_string", "(", "obj", ")", ":", "if", "PY2", ":", "# Python 2\r", "return", "type", "(", "obj", ")", "in", "[", "str", ",", "unicode", "]", "else", ":", "# Python 3\r", "return", "type", "(", "obj", ")", "in", "[", "str", ",", "by...
Return True if `obj` is type text string, False if it is anything else, like an instance of a class that extends the basestring class.
[ "Return", "True", "if", "obj", "is", "type", "text", "string", "False", "if", "it", "is", "anything", "else", "like", "an", "instance", "of", "a", "class", "that", "extends", "the", "basestring", "class", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/py3compat.py#L87-L95
train
Return True if obj is type text string False otherwise.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/py3compat.py
to_binary_string
def to_binary_string(obj, encoding=None): """Convert `obj` to binary string (bytes in Python 3, str in Python 2)""" if PY2: # Python 2 if encoding is None: return str(obj) else: return obj.encode(encoding) else: # Python 3 return byte...
python
def to_binary_string(obj, encoding=None): """Convert `obj` to binary string (bytes in Python 3, str in Python 2)""" if PY2: # Python 2 if encoding is None: return str(obj) else: return obj.encode(encoding) else: # Python 3 return byte...
[ "def", "to_binary_string", "(", "obj", ",", "encoding", "=", "None", ")", ":", "if", "PY2", ":", "# Python 2\r", "if", "encoding", "is", "None", ":", "return", "str", "(", "obj", ")", "else", ":", "return", "obj", ".", "encode", "(", "encoding", ")", ...
Convert `obj` to binary string (bytes in Python 3, str in Python 2)
[ "Convert", "obj", "to", "binary", "string", "(", "bytes", "in", "Python", "3", "str", "in", "Python", "2", ")" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/py3compat.py#L150-L160
train
Convert obj to binary string in Python 3 or str in Python 2
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/plugins/onlinehelp/onlinehelp.py
OnlineHelp.save_history
def save_history(self): """Save history to a text file in user home directory""" open(self.LOG_PATH, 'w').write("\n".join( \ [to_text_string(self.pydocbrowser.url_combo.itemText(index)) for index in range(self.pydocbrowser.url_combo.count())]))
python
def save_history(self): """Save history to a text file in user home directory""" open(self.LOG_PATH, 'w').write("\n".join( \ [to_text_string(self.pydocbrowser.url_combo.itemText(index)) for index in range(self.pydocbrowser.url_combo.count())]))
[ "def", "save_history", "(", "self", ")", ":", "open", "(", "self", ".", "LOG_PATH", ",", "'w'", ")", ".", "write", "(", "\"\\n\"", ".", "join", "(", "[", "to_text_string", "(", "self", ".", "pydocbrowser", ".", "url_combo", ".", "itemText", "(", "index...
Save history to a text file in user home directory
[ "Save", "history", "to", "a", "text", "file", "in", "user", "home", "directory" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/onlinehelp/onlinehelp.py#L57-L61
train
Save history to a text file in user home directory
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/plugins/onlinehelp/onlinehelp.py
OnlineHelp.visibility_changed
def visibility_changed(self, enable): """DockWidget visibility has changed""" super(SpyderPluginWidget, self).visibility_changed(enable) if enable and not self.pydocbrowser.is_server_running(): self.pydocbrowser.initialize()
python
def visibility_changed(self, enable): """DockWidget visibility has changed""" super(SpyderPluginWidget, self).visibility_changed(enable) if enable and not self.pydocbrowser.is_server_running(): self.pydocbrowser.initialize()
[ "def", "visibility_changed", "(", "self", ",", "enable", ")", ":", "super", "(", "SpyderPluginWidget", ",", "self", ")", ".", "visibility_changed", "(", "enable", ")", "if", "enable", "and", "not", "self", ".", "pydocbrowser", ".", "is_server_running", "(", ...
DockWidget visibility has changed
[ "DockWidget", "visibility", "has", "changed" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/onlinehelp/onlinehelp.py#L64-L68
train
Override visibility has changed
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/plugins/onlinehelp/onlinehelp.py
OnlineHelp.get_focus_widget
def get_focus_widget(self): """ Return the widget to give focus to when this plugin's dockwidget is raised on top-level """ self.pydocbrowser.url_combo.lineEdit().selectAll() return self.pydocbrowser.url_combo
python
def get_focus_widget(self): """ Return the widget to give focus to when this plugin's dockwidget is raised on top-level """ self.pydocbrowser.url_combo.lineEdit().selectAll() return self.pydocbrowser.url_combo
[ "def", "get_focus_widget", "(", "self", ")", ":", "self", ".", "pydocbrowser", ".", "url_combo", ".", "lineEdit", "(", ")", ".", "selectAll", "(", ")", "return", "self", ".", "pydocbrowser", ".", "url_combo" ]
Return the widget to give focus to when this plugin's dockwidget is raised on top-level
[ "Return", "the", "widget", "to", "give", "focus", "to", "when", "this", "plugin", "s", "dockwidget", "is", "raised", "on", "top", "-", "level" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/onlinehelp/onlinehelp.py#L75-L81
train
Returns the widget to give focus to when the dockwidget is raised on top - level
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/plugins/onlinehelp/onlinehelp.py
OnlineHelp.closing_plugin
def closing_plugin(self, cancelable=False): """Perform actions before parent main window is closed""" self.save_history() self.set_option('zoom_factor', self.pydocbrowser.webview.get_zoom_factor()) return True
python
def closing_plugin(self, cancelable=False): """Perform actions before parent main window is closed""" self.save_history() self.set_option('zoom_factor', self.pydocbrowser.webview.get_zoom_factor()) return True
[ "def", "closing_plugin", "(", "self", ",", "cancelable", "=", "False", ")", ":", "self", ".", "save_history", "(", ")", "self", ".", "set_option", "(", "'zoom_factor'", ",", "self", ".", "pydocbrowser", ".", "webview", ".", "get_zoom_factor", "(", ")", ")"...
Perform actions before parent main window is closed
[ "Perform", "actions", "before", "parent", "main", "window", "is", "closed" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/onlinehelp/onlinehelp.py#L83-L88
train
Perform actions before parent main window is closed
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/pathmanager.py
PathManager.synchronize
def synchronize(self): """ Synchronize Spyder's path list with PYTHONPATH environment variable Only apply to: current user, on Windows platforms """ answer = QMessageBox.question(self, _("Synchronize"), _("This will synchronize Spyder's path list with " ...
python
def synchronize(self): """ Synchronize Spyder's path list with PYTHONPATH environment variable Only apply to: current user, on Windows platforms """ answer = QMessageBox.question(self, _("Synchronize"), _("This will synchronize Spyder's path list with " ...
[ "def", "synchronize", "(", "self", ")", ":", "answer", "=", "QMessageBox", ".", "question", "(", "self", ",", "_", "(", "\"Synchronize\"", ")", ",", "_", "(", "\"This will synchronize Spyder's path list with \"", "\"<b>PYTHONPATH</b> environment variable for current user,...
Synchronize Spyder's path list with PYTHONPATH environment variable Only apply to: current user, on Windows platforms
[ "Synchronize", "Spyder", "s", "path", "list", "with", "PYTHONPATH", "environment", "variable", "Only", "apply", "to", ":", "current", "user", "on", "Windows", "platforms" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/pathmanager.py#L151-L183
train
Synchronize Spyder s path list with the current user s Python path.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/pathmanager.py
PathManager.update_list
def update_list(self): """Update path list""" self.listwidget.clear() for name in self.pathlist+self.ro_pathlist: item = QListWidgetItem(name) item.setIcon(ima.icon('DirClosedIcon')) if name in self.ro_pathlist: item.setFlags(Qt.NoItemFl...
python
def update_list(self): """Update path list""" self.listwidget.clear() for name in self.pathlist+self.ro_pathlist: item = QListWidgetItem(name) item.setIcon(ima.icon('DirClosedIcon')) if name in self.ro_pathlist: item.setFlags(Qt.NoItemFl...
[ "def", "update_list", "(", "self", ")", ":", "self", ".", "listwidget", ".", "clear", "(", ")", "for", "name", "in", "self", ".", "pathlist", "+", "self", ".", "ro_pathlist", ":", "item", "=", "QListWidgetItem", "(", "name", ")", "item", ".", "setIcon"...
Update path list
[ "Update", "path", "list" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/pathmanager.py#L204-L220
train
Update the list with the new ones
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/pathmanager.py
PathManager.refresh
def refresh(self, row=None): """Refresh widget""" for widget in self.selection_widgets: widget.setEnabled(self.listwidget.currentItem() is not None) not_empty = self.listwidget.count() > 0 if self.sync_button is not None: self.sync_button.setEnabled(not_empt...
python
def refresh(self, row=None): """Refresh widget""" for widget in self.selection_widgets: widget.setEnabled(self.listwidget.currentItem() is not None) not_empty = self.listwidget.count() > 0 if self.sync_button is not None: self.sync_button.setEnabled(not_empt...
[ "def", "refresh", "(", "self", ",", "row", "=", "None", ")", ":", "for", "widget", "in", "self", ".", "selection_widgets", ":", "widget", ".", "setEnabled", "(", "self", ".", "listwidget", ".", "currentItem", "(", ")", "is", "not", "None", ")", "not_em...
Refresh widget
[ "Refresh", "widget" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/pathmanager.py#L222-L228
train
Refresh the list widget with the current items.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/tabs.py
EditTabNamePopup.eventFilter
def eventFilter(self, widget, event): """Catch clicks outside the object and ESC key press.""" if ((event.type() == QEvent.MouseButtonPress and not self.geometry().contains(event.globalPos())) or (event.type() == QEvent.KeyPress and event.key() == Q...
python
def eventFilter(self, widget, event): """Catch clicks outside the object and ESC key press.""" if ((event.type() == QEvent.MouseButtonPress and not self.geometry().contains(event.globalPos())) or (event.type() == QEvent.KeyPress and event.key() == Q...
[ "def", "eventFilter", "(", "self", ",", "widget", ",", "event", ")", ":", "if", "(", "(", "event", ".", "type", "(", ")", "==", "QEvent", ".", "MouseButtonPress", "and", "not", "self", ".", "geometry", "(", ")", ".", "contains", "(", "event", ".", ...
Catch clicks outside the object and ESC key press.
[ "Catch", "clicks", "outside", "the", "object", "and", "ESC", "key", "press", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/tabs.py#L77-L89
train
Catch clicks outside the object and ESC key press.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/tabs.py
EditTabNamePopup.edit_tab
def edit_tab(self, index): """Activate the edit tab.""" # Sets focus, shows cursor self.setFocus(True) # Updates tab index self.tab_index = index # Gets tab size and shrinks to avoid overlapping tab borders rect = self.main.tabRect(index) rec...
python
def edit_tab(self, index): """Activate the edit tab.""" # Sets focus, shows cursor self.setFocus(True) # Updates tab index self.tab_index = index # Gets tab size and shrinks to avoid overlapping tab borders rect = self.main.tabRect(index) rec...
[ "def", "edit_tab", "(", "self", ",", "index", ")", ":", "# Sets focus, shows cursor\r", "self", ".", "setFocus", "(", "True", ")", "# Updates tab index\r", "self", ".", "tab_index", "=", "index", "# Gets tab size and shrinks to avoid overlapping tab borders\r", "rect", ...
Activate the edit tab.
[ "Activate", "the", "edit", "tab", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/tabs.py#L91-L121
train
Activate the edit tab.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/tabs.py
EditTabNamePopup.edit_finished
def edit_finished(self): """On clean exit, update tab name.""" # Hides editor self.hide() if isinstance(self.tab_index, int) and self.tab_index >= 0: # We are editing a valid tab, update name tab_text = to_text_string(self.text()) self.main.se...
python
def edit_finished(self): """On clean exit, update tab name.""" # Hides editor self.hide() if isinstance(self.tab_index, int) and self.tab_index >= 0: # We are editing a valid tab, update name tab_text = to_text_string(self.text()) self.main.se...
[ "def", "edit_finished", "(", "self", ")", ":", "# Hides editor\r", "self", ".", "hide", "(", ")", "if", "isinstance", "(", "self", ".", "tab_index", ",", "int", ")", "and", "self", ".", "tab_index", ">=", "0", ":", "# We are editing a valid tab, update name\r"...
On clean exit, update tab name.
[ "On", "clean", "exit", "update", "tab", "name", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/tabs.py#L123-L132
train
On clean exit update tab name.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/tabs.py
TabBar.mousePressEvent
def mousePressEvent(self, event): """Reimplement Qt method""" if event.button() == Qt.LeftButton: self.__drag_start_pos = QPoint(event.pos()) QTabBar.mousePressEvent(self, event)
python
def mousePressEvent(self, event): """Reimplement Qt method""" if event.button() == Qt.LeftButton: self.__drag_start_pos = QPoint(event.pos()) QTabBar.mousePressEvent(self, event)
[ "def", "mousePressEvent", "(", "self", ",", "event", ")", ":", "if", "event", ".", "button", "(", ")", "==", "Qt", ".", "LeftButton", ":", "self", ".", "__drag_start_pos", "=", "QPoint", "(", "event", ".", "pos", "(", ")", ")", "QTabBar", ".", "mouse...
Reimplement Qt method
[ "Reimplement", "Qt", "method" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/tabs.py#L164-L168
train
Reimplement Qt method
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/tabs.py
TabBar.dragEnterEvent
def dragEnterEvent(self, event): """Override Qt method""" mimeData = event.mimeData() formats = list(mimeData.formats()) if "parent-id" in formats and \ int(mimeData.data("parent-id")) == id(self.ancestor): event.acceptProposedAction() QTabBar.dra...
python
def dragEnterEvent(self, event): """Override Qt method""" mimeData = event.mimeData() formats = list(mimeData.formats()) if "parent-id" in formats and \ int(mimeData.data("parent-id")) == id(self.ancestor): event.acceptProposedAction() QTabBar.dra...
[ "def", "dragEnterEvent", "(", "self", ",", "event", ")", ":", "mimeData", "=", "event", ".", "mimeData", "(", ")", "formats", "=", "list", "(", "mimeData", ".", "formats", "(", ")", ")", "if", "\"parent-id\"", "in", "formats", "and", "int", "(", "mimeD...
Override Qt method
[ "Override", "Qt", "method" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/tabs.py#L197-L206
train
Override Qt method
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/tabs.py
TabBar.dropEvent
def dropEvent(self, event): """Override Qt method""" mimeData = event.mimeData() index_from = int(mimeData.data("source-index")) index_to = self.tabAt(event.pos()) if index_to == -1: index_to = self.count() if int(mimeData.data("tabbar-id")) != id(self)...
python
def dropEvent(self, event): """Override Qt method""" mimeData = event.mimeData() index_from = int(mimeData.data("source-index")) index_to = self.tabAt(event.pos()) if index_to == -1: index_to = self.count() if int(mimeData.data("tabbar-id")) != id(self)...
[ "def", "dropEvent", "(", "self", ",", "event", ")", ":", "mimeData", "=", "event", ".", "mimeData", "(", ")", "index_from", "=", "int", "(", "mimeData", ".", "data", "(", "\"source-index\"", ")", ")", "index_to", "=", "self", ".", "tabAt", "(", "event"...
Override Qt method
[ "Override", "Qt", "method" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/tabs.py#L208-L228
train
Override Qt method to handle drop events.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/tabs.py
TabBar.mouseDoubleClickEvent
def mouseDoubleClickEvent(self, event): """Override Qt method to trigger the tab name editor.""" if self.rename_tabs is True and \ event.buttons() == Qt.MouseButtons(Qt.LeftButton): # Tab index index = self.tabAt(event.pos()) if index >= 0: ...
python
def mouseDoubleClickEvent(self, event): """Override Qt method to trigger the tab name editor.""" if self.rename_tabs is True and \ event.buttons() == Qt.MouseButtons(Qt.LeftButton): # Tab index index = self.tabAt(event.pos()) if index >= 0: ...
[ "def", "mouseDoubleClickEvent", "(", "self", ",", "event", ")", ":", "if", "self", ".", "rename_tabs", "is", "True", "and", "event", ".", "buttons", "(", ")", "==", "Qt", ".", "MouseButtons", "(", "Qt", ".", "LeftButton", ")", ":", "# Tab index\r", "inde...
Override Qt method to trigger the tab name editor.
[ "Override", "Qt", "method", "to", "trigger", "the", "tab", "name", "editor", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/tabs.py#L230-L241
train
Override Qt method to trigger the tab name editor.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/tabs.py
BaseTabs.update_browse_tabs_menu
def update_browse_tabs_menu(self): """Update browse tabs menu""" self.browse_tabs_menu.clear() names = [] dirnames = [] for index in range(self.count()): if self.menu_use_tooltips: text = to_text_string(self.tabToolTip(index)) else:...
python
def update_browse_tabs_menu(self): """Update browse tabs menu""" self.browse_tabs_menu.clear() names = [] dirnames = [] for index in range(self.count()): if self.menu_use_tooltips: text = to_text_string(self.tabToolTip(index)) else:...
[ "def", "update_browse_tabs_menu", "(", "self", ")", ":", "self", ".", "browse_tabs_menu", ".", "clear", "(", ")", "names", "=", "[", "]", "dirnames", "=", "[", "]", "for", "index", "in", "range", "(", "self", ".", "count", "(", ")", ")", ":", "if", ...
Update browse tabs menu
[ "Update", "browse", "tabs", "menu" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/tabs.py#L288-L322
train
Update browse tabs menu
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/tabs.py
BaseTabs.set_corner_widgets
def set_corner_widgets(self, corner_widgets): """ Set tabs corner widgets corner_widgets: dictionary of (corner, widgets) corner: Qt.TopLeftCorner or Qt.TopRightCorner widgets: list of widgets (may contains integers to add spacings) """ assert isinstance(co...
python
def set_corner_widgets(self, corner_widgets): """ Set tabs corner widgets corner_widgets: dictionary of (corner, widgets) corner: Qt.TopLeftCorner or Qt.TopRightCorner widgets: list of widgets (may contains integers to add spacings) """ assert isinstance(co...
[ "def", "set_corner_widgets", "(", "self", ",", "corner_widgets", ")", ":", "assert", "isinstance", "(", "corner_widgets", ",", "dict", ")", "assert", "all", "(", "key", "in", "(", "Qt", ".", "TopLeftCorner", ",", "Qt", ".", "TopRightCorner", ")", "for", "k...
Set tabs corner widgets corner_widgets: dictionary of (corner, widgets) corner: Qt.TopLeftCorner or Qt.TopRightCorner widgets: list of widgets (may contains integers to add spacings)
[ "Set", "tabs", "corner", "widgets", "corner_widgets", ":", "dictionary", "of", "(", "corner", "widgets", ")", "corner", ":", "Qt", ".", "TopLeftCorner", "or", "Qt", ".", "TopRightCorner", "widgets", ":", "list", "of", "widgets", "(", "may", "contains", "inte...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/tabs.py#L324-L350
train
Set tabs corner widgets
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/tabs.py
BaseTabs.contextMenuEvent
def contextMenuEvent(self, event): """Override Qt method""" self.setCurrentIndex(self.tabBar().tabAt(event.pos())) if self.menu: self.menu.popup(event.globalPos())
python
def contextMenuEvent(self, event): """Override Qt method""" self.setCurrentIndex(self.tabBar().tabAt(event.pos())) if self.menu: self.menu.popup(event.globalPos())
[ "def", "contextMenuEvent", "(", "self", ",", "event", ")", ":", "self", ".", "setCurrentIndex", "(", "self", ".", "tabBar", "(", ")", ".", "tabAt", "(", "event", ".", "pos", "(", ")", ")", ")", "if", "self", ".", "menu", ":", "self", ".", "menu", ...
Override Qt method
[ "Override", "Qt", "method" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/tabs.py#L356-L360
train
Override Qt method to handle context menu events
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/tabs.py
BaseTabs.mousePressEvent
def mousePressEvent(self, event): """Override Qt method""" if event.button() == Qt.MidButton: index = self.tabBar().tabAt(event.pos()) if index >= 0: self.sig_close_tab.emit(index) event.accept() return QTabWidget.mo...
python
def mousePressEvent(self, event): """Override Qt method""" if event.button() == Qt.MidButton: index = self.tabBar().tabAt(event.pos()) if index >= 0: self.sig_close_tab.emit(index) event.accept() return QTabWidget.mo...
[ "def", "mousePressEvent", "(", "self", ",", "event", ")", ":", "if", "event", ".", "button", "(", ")", "==", "Qt", ".", "MidButton", ":", "index", "=", "self", ".", "tabBar", "(", ")", ".", "tabAt", "(", "event", ".", "pos", "(", ")", ")", "if", ...
Override Qt method
[ "Override", "Qt", "method" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/tabs.py#L362-L370
train
Override Qt method to emit close signal when tab is clicked.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/tabs.py
BaseTabs.keyPressEvent
def keyPressEvent(self, event): """Override Qt method""" ctrl = event.modifiers() & Qt.ControlModifier key = event.key() handled = False if ctrl and self.count() > 0: index = self.currentIndex() if key == Qt.Key_PageUp: if index > 0...
python
def keyPressEvent(self, event): """Override Qt method""" ctrl = event.modifiers() & Qt.ControlModifier key = event.key() handled = False if ctrl and self.count() > 0: index = self.currentIndex() if key == Qt.Key_PageUp: if index > 0...
[ "def", "keyPressEvent", "(", "self", ",", "event", ")", ":", "ctrl", "=", "event", ".", "modifiers", "(", ")", "&", "Qt", ".", "ControlModifier", "key", "=", "event", ".", "key", "(", ")", "handled", "=", "False", "if", "ctrl", "and", "self", ".", ...
Override Qt method
[ "Override", "Qt", "method" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/tabs.py#L372-L392
train
Override Qt method to handle key press events.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/tabs.py
BaseTabs.tab_navigate
def tab_navigate(self, delta=1): """Ctrl+Tab""" if delta > 0 and self.currentIndex() == self.count()-1: index = delta-1 elif delta < 0 and self.currentIndex() == 0: index = self.count()+delta else: index = self.currentIndex()+delta self...
python
def tab_navigate(self, delta=1): """Ctrl+Tab""" if delta > 0 and self.currentIndex() == self.count()-1: index = delta-1 elif delta < 0 and self.currentIndex() == 0: index = self.count()+delta else: index = self.currentIndex()+delta self...
[ "def", "tab_navigate", "(", "self", ",", "delta", "=", "1", ")", ":", "if", "delta", ">", "0", "and", "self", ".", "currentIndex", "(", ")", "==", "self", ".", "count", "(", ")", "-", "1", ":", "index", "=", "delta", "-", "1", "elif", "delta", ...
Ctrl+Tab
[ "Ctrl", "+", "Tab" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/tabs.py#L394-L402
train
Navigate to the next tab.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/tabs.py
BaseTabs.set_close_function
def set_close_function(self, func): """Setting Tabs close function None -> tabs are not closable""" state = func is not None if state: self.sig_close_tab.connect(func) try: # Assuming Qt >= 4.5 QTabWidget.setTabsClosable(self, state) ...
python
def set_close_function(self, func): """Setting Tabs close function None -> tabs are not closable""" state = func is not None if state: self.sig_close_tab.connect(func) try: # Assuming Qt >= 4.5 QTabWidget.setTabsClosable(self, state) ...
[ "def", "set_close_function", "(", "self", ",", "func", ")", ":", "state", "=", "func", "is", "not", "None", "if", "state", ":", "self", ".", "sig_close_tab", ".", "connect", "(", "func", ")", "try", ":", "# Assuming Qt >= 4.5\r", "QTabWidget", ".", "setTab...
Setting Tabs close function None -> tabs are not closable
[ "Setting", "Tabs", "close", "function", "None", "-", ">", "tabs", "are", "not", "closable" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/tabs.py#L404-L419
train
Sets the close function for the tabs.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/tabs.py
Tabs.move_tab
def move_tab(self, index_from, index_to): """Move tab inside a tabwidget""" self.move_data.emit(index_from, index_to) tip, text = self.tabToolTip(index_from), self.tabText(index_from) icon, widget = self.tabIcon(index_from), self.widget(index_from) current_widget = self.cu...
python
def move_tab(self, index_from, index_to): """Move tab inside a tabwidget""" self.move_data.emit(index_from, index_to) tip, text = self.tabToolTip(index_from), self.tabText(index_from) icon, widget = self.tabIcon(index_from), self.widget(index_from) current_widget = self.cu...
[ "def", "move_tab", "(", "self", ",", "index_from", ",", "index_to", ")", ":", "self", ".", "move_data", ".", "emit", "(", "index_from", ",", "index_to", ")", "tip", ",", "text", "=", "self", ".", "tabToolTip", "(", "index_from", ")", ",", "self", ".", ...
Move tab inside a tabwidget
[ "Move", "tab", "inside", "a", "tabwidget" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/tabs.py#L454-L467
train
Move tab inside a tabwidget
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/tabs.py
Tabs.move_tab_from_another_tabwidget
def move_tab_from_another_tabwidget(self, tabwidget_from, index_from, index_to): """Move tab from a tabwidget to another""" # We pass self object IDs as QString objs, because otherwise it would # depend on the platform: long for 64bit, i...
python
def move_tab_from_another_tabwidget(self, tabwidget_from, index_from, index_to): """Move tab from a tabwidget to another""" # We pass self object IDs as QString objs, because otherwise it would # depend on the platform: long for 64bit, i...
[ "def", "move_tab_from_another_tabwidget", "(", "self", ",", "tabwidget_from", ",", "index_from", ",", "index_to", ")", ":", "# We pass self object IDs as QString objs, because otherwise it would \r", "# depend on the platform: long for 64bit, int for 32bit. Replacing \r", "# by long all ...
Move tab from a tabwidget to another
[ "Move", "tab", "from", "a", "tabwidget", "to", "another" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/tabs.py#L470-L479
train
Move tab from a tabwidget to another
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/preferences/runconfig.py
get_run_configuration
def get_run_configuration(fname): """Return script *fname* run configuration""" configurations = _get_run_configurations() for filename, options in configurations: if fname == filename: runconf = RunConfiguration() runconf.set(options) return runconf
python
def get_run_configuration(fname): """Return script *fname* run configuration""" configurations = _get_run_configurations() for filename, options in configurations: if fname == filename: runconf = RunConfiguration() runconf.set(options) return runconf
[ "def", "get_run_configuration", "(", "fname", ")", ":", "configurations", "=", "_get_run_configurations", "(", ")", "for", "filename", ",", "options", "in", "configurations", ":", "if", "fname", "==", "filename", ":", "runconf", "=", "RunConfiguration", "(", ")"...
Return script *fname* run configuration
[ "Return", "script", "*", "fname", "*", "run", "configuration" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/runconfig.py#L150-L157
train
Return a RunConfiguration object for the given script name.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/preferences/runconfig.py
RunConfigOptions.select_directory
def select_directory(self): """Select directory""" basedir = to_text_string(self.wd_edit.text()) if not osp.isdir(basedir): basedir = getcwd_or_home() directory = getexistingdirectory(self, _("Select directory"), basedir) if directory: self.wd_edit....
python
def select_directory(self): """Select directory""" basedir = to_text_string(self.wd_edit.text()) if not osp.isdir(basedir): basedir = getcwd_or_home() directory = getexistingdirectory(self, _("Select directory"), basedir) if directory: self.wd_edit....
[ "def", "select_directory", "(", "self", ")", ":", "basedir", "=", "to_text_string", "(", "self", ".", "wd_edit", ".", "text", "(", ")", ")", "if", "not", "osp", ".", "isdir", "(", "basedir", ")", ":", "basedir", "=", "getcwd_or_home", "(", ")", "direct...
Select directory
[ "Select", "directory" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/runconfig.py#L263-L271
train
Select directory in the current directory.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/preferences/runconfig.py
BaseRunConfigDialog.add_widgets
def add_widgets(self, *widgets_or_spacings): """Add widgets/spacing to dialog vertical layout""" layout = self.layout() for widget_or_spacing in widgets_or_spacings: if isinstance(widget_or_spacing, int): layout.addSpacing(widget_or_spacing) else: ...
python
def add_widgets(self, *widgets_or_spacings): """Add widgets/spacing to dialog vertical layout""" layout = self.layout() for widget_or_spacing in widgets_or_spacings: if isinstance(widget_or_spacing, int): layout.addSpacing(widget_or_spacing) else: ...
[ "def", "add_widgets", "(", "self", ",", "*", "widgets_or_spacings", ")", ":", "layout", "=", "self", ".", "layout", "(", ")", "for", "widget_or_spacing", "in", "widgets_or_spacings", ":", "if", "isinstance", "(", "widget_or_spacing", ",", "int", ")", ":", "l...
Add widgets/spacing to dialog vertical layout
[ "Add", "widgets", "/", "spacing", "to", "dialog", "vertical", "layout" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/runconfig.py#L342-L349
train
Add widgets to dialog vertical layout
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/preferences/runconfig.py
BaseRunConfigDialog.add_button_box
def add_button_box(self, stdbtns): """Create dialog button box and add it to the dialog layout""" bbox = QDialogButtonBox(stdbtns) run_btn = bbox.addButton(_("Run"), QDialogButtonBox.AcceptRole) run_btn.clicked.connect(self.run_btn_clicked) bbox.accepted.connect(self.accept)...
python
def add_button_box(self, stdbtns): """Create dialog button box and add it to the dialog layout""" bbox = QDialogButtonBox(stdbtns) run_btn = bbox.addButton(_("Run"), QDialogButtonBox.AcceptRole) run_btn.clicked.connect(self.run_btn_clicked) bbox.accepted.connect(self.accept)...
[ "def", "add_button_box", "(", "self", ",", "stdbtns", ")", ":", "bbox", "=", "QDialogButtonBox", "(", "stdbtns", ")", "run_btn", "=", "bbox", ".", "addButton", "(", "_", "(", "\"Run\"", ")", ",", "QDialogButtonBox", ".", "AcceptRole", ")", "run_btn", ".", ...
Create dialog button box and add it to the dialog layout
[ "Create", "dialog", "button", "box", "and", "add", "it", "to", "the", "dialog", "layout" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/runconfig.py#L351-L361
train
Create dialog button box and add it to the dialog layout
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/preferences/runconfig.py
RunConfigOneDialog.setup
def setup(self, fname): """Setup Run Configuration dialog with filename *fname*""" self.filename = fname self.runconfigoptions = RunConfigOptions(self) self.runconfigoptions.set(RunConfiguration(fname).get()) self.add_widgets(self.runconfigoptions) self.add_button_b...
python
def setup(self, fname): """Setup Run Configuration dialog with filename *fname*""" self.filename = fname self.runconfigoptions = RunConfigOptions(self) self.runconfigoptions.set(RunConfiguration(fname).get()) self.add_widgets(self.runconfigoptions) self.add_button_b...
[ "def", "setup", "(", "self", ",", "fname", ")", ":", "self", ".", "filename", "=", "fname", "self", ".", "runconfigoptions", "=", "RunConfigOptions", "(", "self", ")", "self", ".", "runconfigoptions", ".", "set", "(", "RunConfiguration", "(", "fname", ")",...
Setup Run Configuration dialog with filename *fname*
[ "Setup", "Run", "Configuration", "dialog", "with", "filename", "*", "fname", "*" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/runconfig.py#L387-L394
train
Setup Run Configuration dialog with filename fname
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/preferences/runconfig.py
RunConfigOneDialog.accept
def accept(self): """Reimplement Qt method""" if not self.runconfigoptions.is_valid(): return configurations = _get_run_configurations() configurations.insert(0, (self.filename, self.runconfigoptions.get())) _set_run_configurations(configurations) QDial...
python
def accept(self): """Reimplement Qt method""" if not self.runconfigoptions.is_valid(): return configurations = _get_run_configurations() configurations.insert(0, (self.filename, self.runconfigoptions.get())) _set_run_configurations(configurations) QDial...
[ "def", "accept", "(", "self", ")", ":", "if", "not", "self", ".", "runconfigoptions", ".", "is_valid", "(", ")", ":", "return", "configurations", "=", "_get_run_configurations", "(", ")", "configurations", ".", "insert", "(", "0", ",", "(", "self", ".", ...
Reimplement Qt method
[ "Reimplement", "Qt", "method" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/runconfig.py#L397-L404
train
Reimplement Qt method accept
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/preferences/runconfig.py
RunConfigDialog.setup
def setup(self, fname): """Setup Run Configuration dialog with filename *fname*""" combo_label = QLabel(_("Select a run configuration:")) self.combo = QComboBox() self.combo.setMaxVisibleItems(20) self.combo.setSizeAdjustPolicy(QComboBox.AdjustToMinimumContentsLength) ...
python
def setup(self, fname): """Setup Run Configuration dialog with filename *fname*""" combo_label = QLabel(_("Select a run configuration:")) self.combo = QComboBox() self.combo.setMaxVisibleItems(20) self.combo.setSizeAdjustPolicy(QComboBox.AdjustToMinimumContentsLength) ...
[ "def", "setup", "(", "self", ",", "fname", ")", ":", "combo_label", "=", "QLabel", "(", "_", "(", "\"Select a run configuration:\"", ")", ")", "self", ".", "combo", "=", "QComboBox", "(", ")", "self", ".", "combo", ".", "setMaxVisibleItems", "(", "20", "...
Setup Run Configuration dialog with filename *fname*
[ "Setup", "Run", "Configuration", "dialog", "with", "filename", "*", "fname", "*" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/runconfig.py#L424-L455
train
Setup Run Configuration dialog with filename fname
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/preferences/runconfig.py
RunConfigDialog.accept
def accept(self): """Reimplement Qt method""" configurations = [] for index in range(self.stack.count()): filename = to_text_string(self.combo.itemText(index)) runconfigoptions = self.stack.widget(index) if index == self.stack.currentIndex() and\ ...
python
def accept(self): """Reimplement Qt method""" configurations = [] for index in range(self.stack.count()): filename = to_text_string(self.combo.itemText(index)) runconfigoptions = self.stack.widget(index) if index == self.stack.currentIndex() and\ ...
[ "def", "accept", "(", "self", ")", ":", "configurations", "=", "[", "]", "for", "index", "in", "range", "(", "self", ".", "stack", ".", "count", "(", ")", ")", ":", "filename", "=", "to_text_string", "(", "self", ".", "combo", ".", "itemText", "(", ...
Reimplement Qt method
[ "Reimplement", "Qt", "method" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/preferences/runconfig.py#L457-L469
train
Reimplement Qt method
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/plugins/editor/panels/linenumber.py
LineNumberArea.paintEvent
def paintEvent(self, event): """Override Qt method. Painting line number area """ painter = QPainter(self) painter.fillRect(event.rect(), self.editor.sideareas_color) # This is needed to make that the font size of line numbers # be the same as the text one when z...
python
def paintEvent(self, event): """Override Qt method. Painting line number area """ painter = QPainter(self) painter.fillRect(event.rect(), self.editor.sideareas_color) # This is needed to make that the font size of line numbers # be the same as the text one when z...
[ "def", "paintEvent", "(", "self", ",", "event", ")", ":", "painter", "=", "QPainter", "(", "self", ")", "painter", ".", "fillRect", "(", "event", ".", "rect", "(", ")", ",", "self", ".", "editor", ".", "sideareas_color", ")", "# This is needed to make that...
Override Qt method. Painting line number area
[ "Override", "Qt", "method", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/panels/linenumber.py#L55-L108
train
Override Qt method. Painting line number area.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/plugins/editor/panels/linenumber.py
LineNumberArea.mouseMoveEvent
def mouseMoveEvent(self, event): """Override Qt method. Show code analisis, if left button pressed select lines. """ line_number = self.editor.get_linenumber_from_mouse_event(event) block = self.editor.document().findBlockByNumber(line_number-1) data = block.userData() ...
python
def mouseMoveEvent(self, event): """Override Qt method. Show code analisis, if left button pressed select lines. """ line_number = self.editor.get_linenumber_from_mouse_event(event) block = self.editor.document().findBlockByNumber(line_number-1) data = block.userData() ...
[ "def", "mouseMoveEvent", "(", "self", ",", "event", ")", ":", "line_number", "=", "self", ".", "editor", ".", "get_linenumber_from_mouse_event", "(", "event", ")", "block", "=", "self", ".", "editor", ".", "document", "(", ")", ".", "findBlockByNumber", "(",...
Override Qt method. Show code analisis, if left button pressed select lines.
[ "Override", "Qt", "method", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/panels/linenumber.py#L114-L134
train
Override Qt method. mouseMoveEvent Show code analisis if left button pressed select lines.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/plugins/editor/panels/linenumber.py
LineNumberArea.mousePressEvent
def mousePressEvent(self, event): """Override Qt method Select line, and starts selection """ line_number = self.editor.get_linenumber_from_mouse_event(event) self._pressed = line_number self._released = line_number self.editor.select_lines(self._pressed, ...
python
def mousePressEvent(self, event): """Override Qt method Select line, and starts selection """ line_number = self.editor.get_linenumber_from_mouse_event(event) self._pressed = line_number self._released = line_number self.editor.select_lines(self._pressed, ...
[ "def", "mousePressEvent", "(", "self", ",", "event", ")", ":", "line_number", "=", "self", ".", "editor", ".", "get_linenumber_from_mouse_event", "(", "event", ")", "self", ".", "_pressed", "=", "line_number", "self", ".", "_released", "=", "line_number", "sel...
Override Qt method Select line, and starts selection
[ "Override", "Qt", "method" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/panels/linenumber.py#L136-L145
train
Override Qt method mousePressEvent Select line and starts selection
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/plugins/editor/panels/linenumber.py
LineNumberArea.compute_width
def compute_width(self): """Compute and return line number area width""" if not self._enabled: return 0 digits = 1 maxb = max(1, self.editor.blockCount()) while maxb >= 10: maxb /= 10 digits += 1 if self._margin: margin = 3+...
python
def compute_width(self): """Compute and return line number area width""" if not self._enabled: return 0 digits = 1 maxb = max(1, self.editor.blockCount()) while maxb >= 10: maxb /= 10 digits += 1 if self._margin: margin = 3+...
[ "def", "compute_width", "(", "self", ")", ":", "if", "not", "self", ".", "_enabled", ":", "return", "0", "digits", "=", "1", "maxb", "=", "max", "(", "1", ",", "self", ".", "editor", ".", "blockCount", "(", ")", ")", "while", "maxb", ">=", "10", ...
Compute and return line number area width
[ "Compute", "and", "return", "line", "number", "area", "width" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/panels/linenumber.py#L159-L172
train
Compute and return line number area width
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/plugins/editor/panels/linenumber.py
LineNumberArea.setup_margins
def setup_margins(self, linenumbers=True, markers=True): """ Setup margin settings (except font, now set in editor.set_font) """ self._margin = linenumbers self._markers_margin = markers self.set_enabled(linenumbers or markers)
python
def setup_margins(self, linenumbers=True, markers=True): """ Setup margin settings (except font, now set in editor.set_font) """ self._margin = linenumbers self._markers_margin = markers self.set_enabled(linenumbers or markers)
[ "def", "setup_margins", "(", "self", ",", "linenumbers", "=", "True", ",", "markers", "=", "True", ")", ":", "self", ".", "_margin", "=", "linenumbers", "self", ".", "_markers_margin", "=", "markers", "self", ".", "set_enabled", "(", "linenumbers", "or", "...
Setup margin settings (except font, now set in editor.set_font)
[ "Setup", "margin", "settings", "(", "except", "font", "now", "set", "in", "editor", ".", "set_font", ")" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/editor/panels/linenumber.py#L180-L187
train
Setup margin settings for this locale
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/fileswitcher.py
process_python_symbol_data
def process_python_symbol_data(oedata): """Returns a list with line number, definition name, fold and token.""" symbol_list = [] for key in oedata: val = oedata[key] if val and key != 'found_cell_separators': if val.is_class_or_function(): symbol_list.append((key,...
python
def process_python_symbol_data(oedata): """Returns a list with line number, definition name, fold and token.""" symbol_list = [] for key in oedata: val = oedata[key] if val and key != 'found_cell_separators': if val.is_class_or_function(): symbol_list.append((key,...
[ "def", "process_python_symbol_data", "(", "oedata", ")", ":", "symbol_list", "=", "[", "]", "for", "key", "in", "oedata", ":", "val", "=", "oedata", "[", "key", "]", "if", "val", "and", "key", "!=", "'found_cell_separators'", ":", "if", "val", ".", "is_c...
Returns a list with line number, definition name, fold and token.
[ "Returns", "a", "list", "with", "line", "number", "definition", "name", "fold", "and", "token", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/fileswitcher.py#L32-L41
train
Returns a list with line number definition name fold level and token.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/fileswitcher.py
get_python_symbol_icons
def get_python_symbol_icons(oedata): """Return a list of icons for oedata of a python file.""" class_icon = ima.icon('class') method_icon = ima.icon('method') function_icon = ima.icon('function') private_icon = ima.icon('private1') super_private_icon = ima.icon('private2') symbols = process...
python
def get_python_symbol_icons(oedata): """Return a list of icons for oedata of a python file.""" class_icon = ima.icon('class') method_icon = ima.icon('method') function_icon = ima.icon('function') private_icon = ima.icon('private1') super_private_icon = ima.icon('private2') symbols = process...
[ "def", "get_python_symbol_icons", "(", "oedata", ")", ":", "class_icon", "=", "ima", ".", "icon", "(", "'class'", ")", "method_icon", "=", "ima", ".", "icon", "(", "'method'", ")", "function_icon", "=", "ima", ".", "icon", "(", "'function'", ")", "private_...
Return a list of icons for oedata of a python file.
[ "Return", "a", "list", "of", "icons", "for", "oedata", "of", "a", "python", "file", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/fileswitcher.py#L44-L92
train
Return a list of icons for a python file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/fileswitcher.py
shorten_paths
def shorten_paths(path_list, is_unsaved): """ Takes a list of paths and tries to "intelligently" shorten them all. The aim is to make it clear to the user where the paths differ, as that is likely what they care about. Note that this operates on a list of paths not on individual paths. If the p...
python
def shorten_paths(path_list, is_unsaved): """ Takes a list of paths and tries to "intelligently" shorten them all. The aim is to make it clear to the user where the paths differ, as that is likely what they care about. Note that this operates on a list of paths not on individual paths. If the p...
[ "def", "shorten_paths", "(", "path_list", ",", "is_unsaved", ")", ":", "# TODO: at the end, if the path is too long, should do a more dumb kind of", "# shortening, but not completely dumb.", "# Convert the path strings to a list of tokens and start building the", "# new_path using the drive", ...
Takes a list of paths and tries to "intelligently" shorten them all. The aim is to make it clear to the user where the paths differ, as that is likely what they care about. Note that this operates on a list of paths not on individual paths. If the path ends in an actual file name, it will be trimmed of...
[ "Takes", "a", "list", "of", "paths", "and", "tries", "to", "intelligently", "shorten", "them", "all", ".", "The", "aim", "is", "to", "make", "it", "clear", "to", "the", "user", "where", "the", "paths", "differ", "as", "that", "is", "likely", "what", "t...
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/fileswitcher.py#L95-L190
train
Takes a list of paths and tries to intelligently shorten them all.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/fileswitcher.py
FilesFilterLine.focusOutEvent
def focusOutEvent(self, event): """ Detect when the focus goes out of this widget. This is used to make the file switcher leave focus on the last selected file by the user. """ self.clicked_outside = True return super(QLineEdit, self).focusOutEvent(event)
python
def focusOutEvent(self, event): """ Detect when the focus goes out of this widget. This is used to make the file switcher leave focus on the last selected file by the user. """ self.clicked_outside = True return super(QLineEdit, self).focusOutEvent(event)
[ "def", "focusOutEvent", "(", "self", ",", "event", ")", ":", "self", ".", "clicked_outside", "=", "True", "return", "super", "(", "QLineEdit", ",", "self", ")", ".", "focusOutEvent", "(", "event", ")" ]
Detect when the focus goes out of this widget. This is used to make the file switcher leave focus on the last selected file by the user.
[ "Detect", "when", "the", "focus", "goes", "out", "of", "this", "widget", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/fileswitcher.py#L218-L226
train
Called when the focus goes out of this widget.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/fileswitcher.py
FileSwitcher.save_initial_state
def save_initial_state(self): """Save initial cursors and initial active widget.""" paths = self.paths self.initial_widget = self.get_widget() self.initial_cursors = {} for i, editor in enumerate(self.widgets): if editor is self.initial_widget: self.i...
python
def save_initial_state(self): """Save initial cursors and initial active widget.""" paths = self.paths self.initial_widget = self.get_widget() self.initial_cursors = {} for i, editor in enumerate(self.widgets): if editor is self.initial_widget: self.i...
[ "def", "save_initial_state", "(", "self", ")", ":", "paths", "=", "self", ".", "paths", "self", ".", "initial_widget", "=", "self", ".", "get_widget", "(", ")", "self", ".", "initial_cursors", "=", "{", "}", "for", "i", ",", "editor", "in", "enumerate", ...
Save initial cursors and initial active widget.
[ "Save", "initial", "cursors", "and", "initial", "active", "widget", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/fileswitcher.py#L380-L394
train
Save initial cursors and initial active widget.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/fileswitcher.py
FileSwitcher.restore_initial_state
def restore_initial_state(self): """Restores initial cursors and initial active editor.""" self.list.clear() self.is_visible = False widgets = self.widgets_by_path if not self.edit.clicked_outside: for path in self.initial_cursors: cursor = self.initi...
python
def restore_initial_state(self): """Restores initial cursors and initial active editor.""" self.list.clear() self.is_visible = False widgets = self.widgets_by_path if not self.edit.clicked_outside: for path in self.initial_cursors: cursor = self.initi...
[ "def", "restore_initial_state", "(", "self", ")", ":", "self", ".", "list", ".", "clear", "(", ")", "self", ".", "is_visible", "=", "False", "widgets", "=", "self", ".", "widgets_by_path", "if", "not", "self", ".", "edit", ".", "clicked_outside", ":", "f...
Restores initial cursors and initial active editor.
[ "Restores", "initial", "cursors", "and", "initial", "active", "editor", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/fileswitcher.py#L401-L415
train
Restores initial cursors and initial active editor.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/fileswitcher.py
FileSwitcher.set_dialog_position
def set_dialog_position(self): """Positions the file switcher dialog.""" parent = self.parent() geo = parent.geometry() width = self.list.width() # This has been set in setup left = parent.geometry().width()/2 - width/2 # Note: the +1 pixel on the top makes it look bette...
python
def set_dialog_position(self): """Positions the file switcher dialog.""" parent = self.parent() geo = parent.geometry() width = self.list.width() # This has been set in setup left = parent.geometry().width()/2 - width/2 # Note: the +1 pixel on the top makes it look bette...
[ "def", "set_dialog_position", "(", "self", ")", ":", "parent", "=", "self", ".", "parent", "(", ")", "geo", "=", "parent", ".", "geometry", "(", ")", "width", "=", "self", ".", "list", ".", "width", "(", ")", "# This has been set in setup", "left", "=", ...
Positions the file switcher dialog.
[ "Positions", "the", "file", "switcher", "dialog", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/fileswitcher.py#L417-L436
train
Positions the file switcher dialog.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/fileswitcher.py
FileSwitcher.get_item_size
def get_item_size(self, content): """ Get the max size (width and height) for the elements of a list of strings as a QLabel. """ strings = [] if content: for rich_text in content: label = QLabel(rich_text) label.setTextFormat(Qt...
python
def get_item_size(self, content): """ Get the max size (width and height) for the elements of a list of strings as a QLabel. """ strings = [] if content: for rich_text in content: label = QLabel(rich_text) label.setTextFormat(Qt...
[ "def", "get_item_size", "(", "self", ",", "content", ")", ":", "strings", "=", "[", "]", "if", "content", ":", "for", "rich_text", "in", "content", ":", "label", "=", "QLabel", "(", "rich_text", ")", "label", ".", "setTextFormat", "(", "Qt", ".", "Plai...
Get the max size (width and height) for the elements of a list of strings as a QLabel.
[ "Get", "the", "max", "size", "(", "width", "and", "height", ")", "for", "the", "elements", "of", "a", "list", "of", "strings", "as", "a", "QLabel", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/fileswitcher.py#L438-L451
train
Get the max size for the elements of a list of items as a QLabel.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/fileswitcher.py
FileSwitcher.fix_size
def fix_size(self, content): """ Adjusts the width and height of the file switcher based on the relative size of the parent and content. """ # Update size of dialog based on relative size of the parent if content: width, height = self.get_item_size(content) ...
python
def fix_size(self, content): """ Adjusts the width and height of the file switcher based on the relative size of the parent and content. """ # Update size of dialog based on relative size of the parent if content: width, height = self.get_item_size(content) ...
[ "def", "fix_size", "(", "self", ",", "content", ")", ":", "# Update size of dialog based on relative size of the parent", "if", "content", ":", "width", ",", "height", "=", "self", ".", "get_item_size", "(", "content", ")", "# Width", "parent", "=", "self", ".", ...
Adjusts the width and height of the file switcher based on the relative size of the parent and content.
[ "Adjusts", "the", "width", "and", "height", "of", "the", "file", "switcher", "based", "on", "the", "relative", "size", "of", "the", "parent", "and", "content", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/fileswitcher.py#L453-L478
train
Adjusts the width and height of the list based on the relative size of the parent and content.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/fileswitcher.py
FileSwitcher.select_row
def select_row(self, steps): """Select row in list widget based on a number of steps with direction. Steps can be positive (next rows) or negative (previous rows). """ row = self.current_row() + steps if 0 <= row < self.count(): self.set_current_row(row)
python
def select_row(self, steps): """Select row in list widget based on a number of steps with direction. Steps can be positive (next rows) or negative (previous rows). """ row = self.current_row() + steps if 0 <= row < self.count(): self.set_current_row(row)
[ "def", "select_row", "(", "self", ",", "steps", ")", ":", "row", "=", "self", ".", "current_row", "(", ")", "+", "steps", "if", "0", "<=", "row", "<", "self", ".", "count", "(", ")", ":", "self", ".", "set_current_row", "(", "row", ")" ]
Select row in list widget based on a number of steps with direction. Steps can be positive (next rows) or negative (previous rows).
[ "Select", "row", "in", "list", "widget", "based", "on", "a", "number", "of", "steps", "with", "direction", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/fileswitcher.py#L493-L500
train
Select a row in the list widget based on a number of steps with direction.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/fileswitcher.py
FileSwitcher.previous_row
def previous_row(self): """Select previous row in list widget.""" if self.mode == self.SYMBOL_MODE: self.select_row(-1) return prev_row = self.current_row() - 1 if prev_row >= 0: title = self.list.item(prev_row).text() else: title =...
python
def previous_row(self): """Select previous row in list widget.""" if self.mode == self.SYMBOL_MODE: self.select_row(-1) return prev_row = self.current_row() - 1 if prev_row >= 0: title = self.list.item(prev_row).text() else: title =...
[ "def", "previous_row", "(", "self", ")", ":", "if", "self", ".", "mode", "==", "self", ".", "SYMBOL_MODE", ":", "self", ".", "select_row", "(", "-", "1", ")", "return", "prev_row", "=", "self", ".", "current_row", "(", ")", "-", "1", "if", "prev_row"...
Select previous row in list widget.
[ "Select", "previous", "row", "in", "list", "widget", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/fileswitcher.py#L502-L518
train
Select previous row in list widget.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/fileswitcher.py
FileSwitcher.next_row
def next_row(self): """Select next row in list widget.""" if self.mode == self.SYMBOL_MODE: self.select_row(+1) return next_row = self.current_row() + 1 if next_row < self.count(): if '</b></big><br>' in self.list.item(next_row).text(): ...
python
def next_row(self): """Select next row in list widget.""" if self.mode == self.SYMBOL_MODE: self.select_row(+1) return next_row = self.current_row() + 1 if next_row < self.count(): if '</b></big><br>' in self.list.item(next_row).text(): ...
[ "def", "next_row", "(", "self", ")", ":", "if", "self", ".", "mode", "==", "self", ".", "SYMBOL_MODE", ":", "self", ".", "select_row", "(", "+", "1", ")", "return", "next_row", "=", "self", ".", "current_row", "(", ")", "+", "1", "if", "next_row", ...
Select next row in list widget.
[ "Select", "next", "row", "in", "list", "widget", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/fileswitcher.py#L520-L531
train
Select next row in list widget.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/fileswitcher.py
FileSwitcher.get_stack_index
def get_stack_index(self, stack_index, plugin_index): """Get the real index of the selected item.""" other_plugins_count = sum([other_tabs[0].count() \ for other_tabs in \ self.plugins_tabs[:plugin_index]]) real_index = stack_...
python
def get_stack_index(self, stack_index, plugin_index): """Get the real index of the selected item.""" other_plugins_count = sum([other_tabs[0].count() \ for other_tabs in \ self.plugins_tabs[:plugin_index]]) real_index = stack_...
[ "def", "get_stack_index", "(", "self", ",", "stack_index", ",", "plugin_index", ")", ":", "other_plugins_count", "=", "sum", "(", "[", "other_tabs", "[", "0", "]", ".", "count", "(", ")", "for", "other_tabs", "in", "self", ".", "plugins_tabs", "[", ":", ...
Get the real index of the selected item.
[ "Get", "the", "real", "index", "of", "the", "selected", "item", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/fileswitcher.py#L533-L540
train
Get the real index of the selected item.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/fileswitcher.py
FileSwitcher.get_plugin_data
def get_plugin_data(self, plugin): """Get the data object of the plugin's current tab manager.""" # The data object is named "data" in the editor plugin while it is # named "clients" in the notebook plugin. try: data = plugin.get_current_tab_manager().data except Attr...
python
def get_plugin_data(self, plugin): """Get the data object of the plugin's current tab manager.""" # The data object is named "data" in the editor plugin while it is # named "clients" in the notebook plugin. try: data = plugin.get_current_tab_manager().data except Attr...
[ "def", "get_plugin_data", "(", "self", ",", "plugin", ")", ":", "# The data object is named \"data\" in the editor plugin while it is", "# named \"clients\" in the notebook plugin.", "try", ":", "data", "=", "plugin", ".", "get_current_tab_manager", "(", ")", ".", "data", "...
Get the data object of the plugin's current tab manager.
[ "Get", "the", "data", "object", "of", "the", "plugin", "s", "current", "tab", "manager", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/fileswitcher.py#L543-L552
train
Get the data object of the plugin s current tab manager.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/fileswitcher.py
FileSwitcher.get_plugin_tabwidget
def get_plugin_tabwidget(self, plugin): """Get the tabwidget of the plugin's current tab manager.""" # The tab widget is named "tabs" in the editor plugin while it is # named "tabwidget" in the notebook plugin. try: tabwidget = plugin.get_current_tab_manager().tabs ex...
python
def get_plugin_tabwidget(self, plugin): """Get the tabwidget of the plugin's current tab manager.""" # The tab widget is named "tabs" in the editor plugin while it is # named "tabwidget" in the notebook plugin. try: tabwidget = plugin.get_current_tab_manager().tabs ex...
[ "def", "get_plugin_tabwidget", "(", "self", ",", "plugin", ")", ":", "# The tab widget is named \"tabs\" in the editor plugin while it is", "# named \"tabwidget\" in the notebook plugin.", "try", ":", "tabwidget", "=", "plugin", ".", "get_current_tab_manager", "(", ")", ".", ...
Get the tabwidget of the plugin's current tab manager.
[ "Get", "the", "tabwidget", "of", "the", "plugin", "s", "current", "tab", "manager", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/fileswitcher.py#L554-L563
train
Get the tabwidget of the plugin s current tab manager.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/fileswitcher.py
FileSwitcher.get_widget
def get_widget(self, index=None, path=None, tabs=None): """Get widget by index. If no tabs and index specified the current active widget is returned. """ if (index and tabs) or (path and tabs): return tabs.widget(index) elif self.plugin: return self.get_p...
python
def get_widget(self, index=None, path=None, tabs=None): """Get widget by index. If no tabs and index specified the current active widget is returned. """ if (index and tabs) or (path and tabs): return tabs.widget(index) elif self.plugin: return self.get_p...
[ "def", "get_widget", "(", "self", ",", "index", "=", "None", ",", "path", "=", "None", ",", "tabs", "=", "None", ")", ":", "if", "(", "index", "and", "tabs", ")", "or", "(", "path", "and", "tabs", ")", ":", "return", "tabs", ".", "widget", "(", ...
Get widget by index. If no tabs and index specified the current active widget is returned.
[ "Get", "widget", "by", "index", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/fileswitcher.py#L565-L575
train
Get widget by index.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/fileswitcher.py
FileSwitcher.set_editor_cursor
def set_editor_cursor(self, editor, cursor): """Set the cursor of an editor.""" pos = cursor.position() anchor = cursor.anchor() new_cursor = QTextCursor() if pos == anchor: new_cursor.movePosition(pos) else: new_cursor.movePosition(anchor) ...
python
def set_editor_cursor(self, editor, cursor): """Set the cursor of an editor.""" pos = cursor.position() anchor = cursor.anchor() new_cursor = QTextCursor() if pos == anchor: new_cursor.movePosition(pos) else: new_cursor.movePosition(anchor) ...
[ "def", "set_editor_cursor", "(", "self", ",", "editor", ",", "cursor", ")", ":", "pos", "=", "cursor", ".", "position", "(", ")", "anchor", "=", "cursor", ".", "anchor", "(", ")", "new_cursor", "=", "QTextCursor", "(", ")", "if", "pos", "==", "anchor",...
Set the cursor of an editor.
[ "Set", "the", "cursor", "of", "an", "editor", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/fileswitcher.py#L577-L588
train
Set the cursor of an editor.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/fileswitcher.py
FileSwitcher.goto_line
def goto_line(self, line_number): """Go to specified line number in current active editor.""" if line_number: line_number = int(line_number) try: self.plugin.go_to_line(line_number) except AttributeError: pass
python
def goto_line(self, line_number): """Go to specified line number in current active editor.""" if line_number: line_number = int(line_number) try: self.plugin.go_to_line(line_number) except AttributeError: pass
[ "def", "goto_line", "(", "self", ",", "line_number", ")", ":", "if", "line_number", ":", "line_number", "=", "int", "(", "line_number", ")", "try", ":", "self", ".", "plugin", ".", "go_to_line", "(", "line_number", ")", "except", "AttributeError", ":", "pa...
Go to specified line number in current active editor.
[ "Go", "to", "specified", "line", "number", "in", "current", "active", "editor", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/fileswitcher.py#L590-L597
train
Go to specified line number in current active editor.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/fileswitcher.py
FileSwitcher.item_selection_changed
def item_selection_changed(self): """List widget item selection change handler.""" row = self.current_row() if self.count() and row >= 0: if '</b></big><br>' in self.list.currentItem().text() and row == 0: self.next_row() if self.mode == self.FILE_MODE: ...
python
def item_selection_changed(self): """List widget item selection change handler.""" row = self.current_row() if self.count() and row >= 0: if '</b></big><br>' in self.list.currentItem().text() and row == 0: self.next_row() if self.mode == self.FILE_MODE: ...
[ "def", "item_selection_changed", "(", "self", ")", ":", "row", "=", "self", ".", "current_row", "(", ")", "if", "self", ".", "count", "(", ")", "and", "row", ">=", "0", ":", "if", "'</b></big><br>'", "in", "self", ".", "list", ".", "currentItem", "(", ...
List widget item selection change handler.
[ "List", "widget", "item", "selection", "change", "handler", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/fileswitcher.py#L609-L631
train
List widget item selection change handler.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/fileswitcher.py
FileSwitcher.setup_file_list
def setup_file_list(self, filter_text, current_path): """Setup list widget content for file list display.""" short_paths = shorten_paths(self.paths, self.save_status) paths = self.paths icons = self.icons results = [] trying_for_line_number = ':' in filter_text #...
python
def setup_file_list(self, filter_text, current_path): """Setup list widget content for file list display.""" short_paths = shorten_paths(self.paths, self.save_status) paths = self.paths icons = self.icons results = [] trying_for_line_number = ':' in filter_text #...
[ "def", "setup_file_list", "(", "self", ",", "filter_text", ",", "current_path", ")", ":", "short_paths", "=", "shorten_paths", "(", "self", ".", "paths", ",", "self", ".", "save_status", ")", "paths", "=", "self", ".", "paths", "icons", "=", "self", ".", ...
Setup list widget content for file list display.
[ "Setup", "list", "widget", "content", "for", "file", "list", "display", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/fileswitcher.py#L648-L767
train
Setup file list widget content for file list display.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/fileswitcher.py
FileSwitcher.setup_symbol_list
def setup_symbol_list(self, filter_text, current_path): """Setup list widget content for symbol list display.""" # Get optional symbol name filter_text, symbol_text = filter_text.split('@') # Fetch the Outline explorer data, get the icons and values oedata = self.get_symbol_list...
python
def setup_symbol_list(self, filter_text, current_path): """Setup list widget content for symbol list display.""" # Get optional symbol name filter_text, symbol_text = filter_text.split('@') # Fetch the Outline explorer data, get the icons and values oedata = self.get_symbol_list...
[ "def", "setup_symbol_list", "(", "self", ",", "filter_text", ",", "current_path", ")", ":", "# Get optional symbol name", "filter_text", ",", "symbol_text", "=", "filter_text", ".", "split", "(", "'@'", ")", "# Fetch the Outline explorer data, get the icons and values", "...
Setup list widget content for symbol list display.
[ "Setup", "list", "widget", "content", "for", "symbol", "list", "display", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/fileswitcher.py#L769-L820
train
Setup list widget content for symbol list display.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/fileswitcher.py
FileSwitcher.setup
def setup(self): """Setup list widget content.""" if len(self.plugins_tabs) == 0: self.close() return self.list.clear() current_path = self.current_path filter_text = self.filter_text # Get optional line or symbol to define mode and method handle...
python
def setup(self): """Setup list widget content.""" if len(self.plugins_tabs) == 0: self.close() return self.list.clear() current_path = self.current_path filter_text = self.filter_text # Get optional line or symbol to define mode and method handle...
[ "def", "setup", "(", "self", ")", ":", "if", "len", "(", "self", ".", "plugins_tabs", ")", "==", "0", ":", "self", ".", "close", "(", ")", "return", "self", ".", "list", ".", "clear", "(", ")", "current_path", "=", "self", ".", "current_path", "fil...
Setup list widget content.
[ "Setup", "list", "widget", "content", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/fileswitcher.py#L831-L852
train
Setup list widget content.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/fileswitcher.py
FileSwitcher.add_plugin
def add_plugin(self, plugin, tabs, data, icon): """Add a plugin to display its files.""" self.plugins_tabs.append((tabs, plugin)) self.plugins_data.append((data, icon)) self.plugins_instances.append(plugin)
python
def add_plugin(self, plugin, tabs, data, icon): """Add a plugin to display its files.""" self.plugins_tabs.append((tabs, plugin)) self.plugins_data.append((data, icon)) self.plugins_instances.append(plugin)
[ "def", "add_plugin", "(", "self", ",", "plugin", ",", "tabs", ",", "data", ",", "icon", ")", ":", "self", ".", "plugins_tabs", ".", "append", "(", "(", "tabs", ",", "plugin", ")", ")", "self", ".", "plugins_data", ".", "append", "(", "(", "data", "...
Add a plugin to display its files.
[ "Add", "a", "plugin", "to", "display", "its", "files", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/fileswitcher.py#L862-L866
train
Add a plugin to display its files.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/utils/external/binaryornot/check.py
is_binary
def is_binary(filename): """ :param filename: File to check. :returns: True if it's a binary file, otherwise False. """ logger.debug('is_binary: %(filename)r', locals()) # Check if the file extension is in a list of known binary types binary_extensions = ['pyc', 'iso', 'zip', 'pdf'] for...
python
def is_binary(filename): """ :param filename: File to check. :returns: True if it's a binary file, otherwise False. """ logger.debug('is_binary: %(filename)r', locals()) # Check if the file extension is in a list of known binary types binary_extensions = ['pyc', 'iso', 'zip', 'pdf'] for...
[ "def", "is_binary", "(", "filename", ")", ":", "logger", ".", "debug", "(", "'is_binary: %(filename)r'", ",", "locals", "(", ")", ")", "# Check if the file extension is in a list of known binary types", "binary_extensions", "=", "[", "'pyc'", ",", "'iso'", ",", "'zip'...
:param filename: File to check. :returns: True if it's a binary file, otherwise False.
[ ":", "param", "filename", ":", "File", "to", "check", ".", ":", "returns", ":", "True", "if", "it", "s", "a", "binary", "file", "otherwise", "False", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/external/binaryornot/check.py#L28-L43
train
Checks if the file is a binary file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/utils/vcs.py
get_vcs_info
def get_vcs_info(path): """Return support status dict if path is under VCS root""" for info in SUPPORTED: vcs_path = osp.join(path, info['rootdir']) if osp.isdir(vcs_path): return info
python
def get_vcs_info(path): """Return support status dict if path is under VCS root""" for info in SUPPORTED: vcs_path = osp.join(path, info['rootdir']) if osp.isdir(vcs_path): return info
[ "def", "get_vcs_info", "(", "path", ")", ":", "for", "info", "in", "SUPPORTED", ":", "vcs_path", "=", "osp", ".", "join", "(", "path", ",", "info", "[", "'rootdir'", "]", ")", "if", "osp", ".", "isdir", "(", "vcs_path", ")", ":", "return", "info" ]
Return support status dict if path is under VCS root
[ "Return", "support", "status", "dict", "if", "path", "is", "under", "VCS", "root" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/vcs.py#L52-L57
train
Return support status dict if path is under VCS root
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/utils/vcs.py
get_vcs_root
def get_vcs_root(path): """Return VCS root directory path Return None if path is not within a supported VCS repository""" previous_path = path while get_vcs_info(path) is None: path = abspardir(path) if path == previous_path: return else: previous...
python
def get_vcs_root(path): """Return VCS root directory path Return None if path is not within a supported VCS repository""" previous_path = path while get_vcs_info(path) is None: path = abspardir(path) if path == previous_path: return else: previous...
[ "def", "get_vcs_root", "(", "path", ")", ":", "previous_path", "=", "path", "while", "get_vcs_info", "(", "path", ")", "is", "None", ":", "path", "=", "abspardir", "(", "path", ")", "if", "path", "==", "previous_path", ":", "return", "else", ":", "previo...
Return VCS root directory path Return None if path is not within a supported VCS repository
[ "Return", "VCS", "root", "directory", "path", "Return", "None", "if", "path", "is", "not", "within", "a", "supported", "VCS", "repository" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/vcs.py#L60-L70
train
Return the VCS root directory path
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/utils/vcs.py
run_vcs_tool
def run_vcs_tool(path, action): """If path is a valid VCS repository, run the corresponding VCS tool Supported VCS actions: 'commit', 'browse' Return False if the VCS tool is not installed""" info = get_vcs_info(get_vcs_root(path)) tools = info['actions'][action] for tool, args in tools: ...
python
def run_vcs_tool(path, action): """If path is a valid VCS repository, run the corresponding VCS tool Supported VCS actions: 'commit', 'browse' Return False if the VCS tool is not installed""" info = get_vcs_info(get_vcs_root(path)) tools = info['actions'][action] for tool, args in tools: ...
[ "def", "run_vcs_tool", "(", "path", ",", "action", ")", ":", "info", "=", "get_vcs_info", "(", "get_vcs_root", "(", "path", ")", ")", "tools", "=", "info", "[", "'actions'", "]", "[", "action", "]", "for", "tool", ",", "args", "in", "tools", ":", "if...
If path is a valid VCS repository, run the corresponding VCS tool Supported VCS actions: 'commit', 'browse' Return False if the VCS tool is not installed
[ "If", "path", "is", "a", "valid", "VCS", "repository", "run", "the", "corresponding", "VCS", "tool", "Supported", "VCS", "actions", ":", "commit", "browse", "Return", "False", "if", "the", "VCS", "tool", "is", "not", "installed" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/vcs.py#L78-L93
train
Run the corresponding VCS tool on the given path
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/utils/vcs.py
get_hg_revision
def get_hg_revision(repopath): """Return Mercurial revision for the repository located at repopath Result is a tuple (global, local, branch), with None values on error For example: >>> get_hg_revision(".") ('eba7273c69df+', '2015+', 'default') """ try: ass...
python
def get_hg_revision(repopath): """Return Mercurial revision for the repository located at repopath Result is a tuple (global, local, branch), with None values on error For example: >>> get_hg_revision(".") ('eba7273c69df+', '2015+', 'default') """ try: ass...
[ "def", "get_hg_revision", "(", "repopath", ")", ":", "try", ":", "assert", "osp", ".", "isdir", "(", "osp", ".", "join", "(", "repopath", ",", "'.hg'", ")", ")", "proc", "=", "programs", ".", "run_program", "(", "'hg'", ",", "[", "'id'", ",", "'-nib'...
Return Mercurial revision for the repository located at repopath Result is a tuple (global, local, branch), with None values on error For example: >>> get_hg_revision(".") ('eba7273c69df+', '2015+', 'default')
[ "Return", "Mercurial", "revision", "for", "the", "repository", "located", "at", "repopath", "Result", "is", "a", "tuple", "(", "global", "local", "branch", ")", "with", "None", "values", "on", "error", "For", "example", ":", ">>>", "get_hg_revision", "(", "....
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/vcs.py#L100-L116
train
Return Mercurial revision for the repository located at repopath
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/utils/vcs.py
get_git_revision
def get_git_revision(repopath): """ Return Git revision for the repository located at repopath Result is a tuple (latest commit hash, branch), with None values on error """ try: git = programs.find_program('git') assert git is not None and osp.isdir(osp.join(repopat...
python
def get_git_revision(repopath): """ Return Git revision for the repository located at repopath Result is a tuple (latest commit hash, branch), with None values on error """ try: git = programs.find_program('git') assert git is not None and osp.isdir(osp.join(repopat...
[ "def", "get_git_revision", "(", "repopath", ")", ":", "try", ":", "git", "=", "programs", ".", "find_program", "(", "'git'", ")", "assert", "git", "is", "not", "None", "and", "osp", ".", "isdir", "(", "osp", ".", "join", "(", "repopath", ",", "'.git'",...
Return Git revision for the repository located at repopath Result is a tuple (latest commit hash, branch), with None values on error
[ "Return", "Git", "revision", "for", "the", "repository", "located", "at", "repopath", "Result", "is", "a", "tuple", "(", "latest", "commit", "hash", "branch", ")", "with", "None", "values", "on", "error" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/vcs.py#L119-L151
train
Returns the latest commit hash and branch for the repository located at repopath
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/utils/vcs.py
get_git_refs
def get_git_refs(repopath): """ Return Git active branch, state, branches (plus tags). """ tags = [] branches = [] branch = '' files_modifed = [] if os.path.isfile(repopath): repopath = os.path.dirname(repopath) try: git = programs.find_program('git')...
python
def get_git_refs(repopath): """ Return Git active branch, state, branches (plus tags). """ tags = [] branches = [] branch = '' files_modifed = [] if os.path.isfile(repopath): repopath = os.path.dirname(repopath) try: git = programs.find_program('git')...
[ "def", "get_git_refs", "(", "repopath", ")", ":", "tags", "=", "[", "]", "branches", "=", "[", "]", "branch", "=", "''", "files_modifed", "=", "[", "]", "if", "os", ".", "path", ".", "isfile", "(", "repopath", ")", ":", "repopath", "=", "os", ".", ...
Return Git active branch, state, branches (plus tags).
[ "Return", "Git", "active", "branch", "state", "branches", "(", "plus", "tags", ")", "." ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/utils/vcs.py#L154-L210
train
Returns a list of tags branches and files modified by the git refs.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
spyder-ide/spyder
spyder/widgets/comboboxes.py
is_module_or_package
def is_module_or_package(path): """Return True if path is a Python module/package""" is_module = osp.isfile(path) and osp.splitext(path)[1] in ('.py', '.pyw') is_package = osp.isdir(path) and osp.isfile(osp.join(path, '__init__.py')) return is_module or is_package
python
def is_module_or_package(path): """Return True if path is a Python module/package""" is_module = osp.isfile(path) and osp.splitext(path)[1] in ('.py', '.pyw') is_package = osp.isdir(path) and osp.isfile(osp.join(path, '__init__.py')) return is_module or is_package
[ "def", "is_module_or_package", "(", "path", ")", ":", "is_module", "=", "osp", ".", "isfile", "(", "path", ")", "and", "osp", ".", "splitext", "(", "path", ")", "[", "1", "]", "in", "(", "'.py'", ",", "'.pyw'", ")", "is_package", "=", "osp", ".", "...
Return True if path is a Python module/package
[ "Return", "True", "if", "path", "is", "a", "Python", "module", "/", "package" ]
f76836ce1b924bcc4efd3f74f2960d26a4e528e0
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/widgets/comboboxes.py#L336-L340
train
Return True if path is a Python module or package
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...