rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
font_metrics = QtGui.QFontMetrics(self.font) displaywidth = max(5, (self.width() / font_metrics.width(' ')) - 1)
width = self._control.viewport().width() char_width = QtGui.QFontMetrics(self.font).width(' ') displaywidth = max(5, width / char_width)
def _format_as_columns(self, items, separator=' '): """ Transform a list of strings into a single string with columns.
d8e2563a51a708df8b057088661cd230053ff9a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/d8e2563a51a708df8b057088661cd230053ff9a4/console_widget.py
self._set_top_cursor(self._get_prompt_cursor())
prompt_cursor = self._get_prompt_cursor() if self._get_cursor().blockNumber() < prompt_cursor.blockNumber(): self._set_cursor(prompt_cursor) self._set_top_cursor(prompt_cursor)
def prompt_to_top(self): """ Moves the prompt to the top of the viewport. """ if not self._executing: self._set_top_cursor(self._get_prompt_cursor())
dce5323df534b3c926d8dd0139870847def37795 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/dce5323df534b3c926d8dd0139870847def37795/console_widget.py
""" Displays text using the pager if it exceeds the height of the viewport.
""" Displays text using the pager if it exceeds the height of the viewport.
def _page(self, text, html=False): """ Displays text using the pager if it exceeds the height of the viewport.
dce5323df534b3c926d8dd0139870847def37795 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/dce5323df534b3c926d8dd0139870847def37795/console_widget.py
if self.paging != 'none' and re.match("(?:[^\n]*\n){%i}" % minlines, text):
if self.paging != 'none' and \ re.match("(?:[^\n]*\n){%i}" % minlines, text):
def _page(self, text, html=False): """ Displays text using the pager if it exceeds the height of the viewport.
dce5323df534b3c926d8dd0139870847def37795 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/dce5323df534b3c926d8dd0139870847def37795/console_widget.py
if diff < 0:
if diff < 0 and document.blockCount() == document.maximumBlockCount():
def _adjust_scrollbars(self): """ Expands the vertical scrollbar beyond the range set by Qt. """ # This code is adapted from _q_adjustScrollbars in qplaintextedit.cpp # and qtextedit.cpp. document = self._control.document() scrollbar = self._control.verticalScrollBar() viewport_height = self._control.viewport().height(...
dce5323df534b3c926d8dd0139870847def37795 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/dce5323df534b3c926d8dd0139870847def37795/console_widget.py
_input_splitter_class = IPythonInputSplitter
def __init__(self, block, length, number): self.block = block self.length = length self.number = number
eebb3d43497665c41133f79f0c678df538d16f5d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/eebb3d43497665c41133f79f0c678df538d16f5d/ipython_widget.py
high = max(0, document.lineCount() - 1)
maximum = max(0, document.lineCount() - 1)
def _adjust_scrollbars(self): """ Expands the vertical scrollbar beyond the range set by Qt. """ # This code is adapted from _q_adjustScrollbars in qplaintextedit.cpp # and qtextedit.cpp. document = self._control.document() scrollbar = self._control.verticalScrollBar() viewport_height = self._control.viewport().height(...
70b361ee6030f2757ac72e8796d0610bb5cd8bac /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/70b361ee6030f2757ac72e8796d0610bb5cd8bac/console_widget.py
high = document.size().height()
maximum = document.size().height()
def _adjust_scrollbars(self): """ Expands the vertical scrollbar beyond the range set by Qt. """ # This code is adapted from _q_adjustScrollbars in qplaintextedit.cpp # and qtextedit.cpp. document = self._control.document() scrollbar = self._control.verticalScrollBar() viewport_height = self._control.viewport().height(...
70b361ee6030f2757ac72e8796d0610bb5cd8bac /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/70b361ee6030f2757ac72e8796d0610bb5cd8bac/console_widget.py
scrollbar.setRange(0, high)
diff = maximum - scrollbar.maximum() scrollbar.setRange(0, maximum)
def _adjust_scrollbars(self): """ Expands the vertical scrollbar beyond the range set by Qt. """ # This code is adapted from _q_adjustScrollbars in qplaintextedit.cpp # and qtextedit.cpp. document = self._control.document() scrollbar = self._control.verticalScrollBar() viewport_height = self._control.viewport().height(...
70b361ee6030f2757ac72e8796d0610bb5cd8bac /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/70b361ee6030f2757ac72e8796d0610bb5cd8bac/console_widget.py
len_prompt = len(self._continuation_prompt)
line, col = cursor.blockNumber(), cursor.columnNumber()
def _event_filter_console_keypress(self, event): """ Filter key events for the underlying text widget to create a console-like interface. """ intercepted = False cursor = self._control.textCursor() position = cursor.position() key = event.key() ctrl_down = self._control_key_down(event.modifiers()) alt_down = event.modi...
4212c3a5a35f1a8330abc93ed6ed15b0e6ceb3a1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/4212c3a5a35f1a8330abc93ed6ed15b0e6ceb3a1/console_widget.py
cursor.columnNumber() == len_prompt and \ position != self._prompt_pos:
col == len(self._continuation_prompt) and \ line > self._get_prompt_cursor().blockNumber():
def _event_filter_console_keypress(self, event): """ Filter key events for the underlying text widget to create a console-like interface. """ intercepted = False cursor = self._control.textCursor() position = cursor.position() key = event.key() ctrl_down = self._control_key_down(event.modifiers()) alt_down = event.modi...
4212c3a5a35f1a8330abc93ed6ed15b0e6ceb3a1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/4212c3a5a35f1a8330abc93ed6ed15b0e6ceb3a1/console_widget.py
if not self._reading and cursor.atBlockEnd() and not \ cursor.hasSelection():
if not self._reading and self._in_buffer(position) and \ cursor.atBlockEnd() and not cursor.hasSelection():
def _event_filter_console_keypress(self, event): """ Filter key events for the underlying text widget to create a console-like interface. """ intercepted = False cursor = self._control.textCursor() position = cursor.position() key = event.key() ctrl_down = self._control_key_down(event.modifiers()) alt_down = event.modi...
4212c3a5a35f1a8330abc93ed6ed15b0e6ceb3a1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/4212c3a5a35f1a8330abc93ed6ed15b0e6ceb3a1/console_widget.py
self.setLineWrapMode(QtGui.QPlainTextEdit.WidgetWidth) self.setMaximumBlockCount(500) self.setUndoRedoEnabled(False)
def __init__(self, parent=None): QtGui.QPlainTextEdit.__init__(self, parent)
42f4d276a2dd5e83fe3b689888be8f6185e81aa1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/42f4d276a2dd5e83fe3b689888be8f6185e81aa1/console_widget.py
if ctrl_down:
if event.matches(QtGui.QKeySequence.Paste): self.paste() intercepted = True elif ctrl_down:
def keyPressEvent(self, event): """ Reimplemented to create a console-like interface. """ intercepted = False cursor = self.textCursor() position = cursor.position() key = event.key() ctrl_down = event.modifiers() & QtCore.Qt.ControlModifier alt_down = event.modifiers() & QtCore.Qt.AltModifier shift_down = event.modifi...
42f4d276a2dd5e83fe3b689888be8f6185e81aa1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/42f4d276a2dd5e83fe3b689888be8f6185e81aa1/console_widget.py
self._executing = True
def keyPressEvent(self, event): """ Reimplemented to create a console-like interface. """ intercepted = False cursor = self.textCursor() position = cursor.position() key = event.key() ctrl_down = event.modifiers() & QtCore.Qt.ControlModifier alt_down = event.modifiers() & QtCore.Qt.AltModifier shift_down = event.modifi...
42f4d276a2dd5e83fe3b689888be8f6185e81aa1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/42f4d276a2dd5e83fe3b689888be8f6185e81aa1/console_widget.py
def keyPressEvent(self, event): """ Reimplemented to create a console-like interface. """ intercepted = False cursor = self.textCursor() position = cursor.position() key = event.key() ctrl_down = event.modifiers() & QtCore.Qt.ControlModifier alt_down = event.modifiers() & QtCore.Qt.AltModifier shift_down = event.modifi...
42f4d276a2dd5e83fe3b689888be8f6185e81aa1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/42f4d276a2dd5e83fe3b689888be8f6185e81aa1/console_widget.py
self.setReadOnly(False)
def _prompt_started(self): """ Called immediately after a new prompt is displayed. """ self.moveCursor(QtGui.QTextCursor.End) self.centerCursor() self.setReadOnly(False) self._executing = False self._prompt_started_hook()
42f4d276a2dd5e83fe3b689888be8f6185e81aa1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/42f4d276a2dd5e83fe3b689888be8f6185e81aa1/console_widget.py
QtGui.QListWidget.hideEvent(self, event)
QtGui.QLabel.hideEvent(self, event)
def hideEvent(self, event): """ Reimplemented to disconnect the cursor movement handler. """ QtGui.QListWidget.hideEvent(self, event) self.parent().cursorPositionChanged.disconnect(self._update_tip)
b1ca27e1b9ad9d787b4ddfa1654745bfda57a8ca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/b1ca27e1b9ad9d787b4ddfa1654745bfda57a8ca/call_tip_widget.py
QtGui.QListWidget.showEvent(self, event)
QtGui.QLabel.showEvent(self, event)
def showEvent(self, event): """ Reimplemented to connect the cursor movement handler. """ QtGui.QListWidget.showEvent(self, event) self.parent().cursorPositionChanged.connect(self._update_tip)
b1ca27e1b9ad9d787b4ddfa1654745bfda57a8ca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/b1ca27e1b9ad9d787b4ddfa1654745bfda57a8ca/call_tip_widget.py
first_reply = QtCore.pyqtSignal(object)
first_reply = QtCore.pyqtSignal()
def stop(self): """ Reimplemented to emit signal. """ super(SocketChannelQObject, self).stop() self.stopped.emit()
8a8d9e9fc17dff90e897ebf654d23cd0f6c741e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/8a8d9e9fc17dff90e897ebf654d23cd0f6c741e5/kernelmanager.py
if (etype == QtCore.QEvent.KeyPress and event.key() in (QtCore.Qt.Key_Enter, QtCore.Qt.Key_Return, QtCore.Qt.Key_Escape)): self.hide()
if etype == QtCore.QEvent.KeyPress: key = event.key() if key in (QtCore.Qt.Key_Enter, QtCore.Qt.Key_Return): self.hide() elif key == QtCore.Qt.Key_Escape: self.hide() return True
def eventFilter(self, obj, event): """ Reimplemented to hide on certain key presses and on parent focus changes. """ if obj == self.parent(): etype = event.type() if (etype == QtCore.QEvent.KeyPress and event.key() in (QtCore.Qt.Key_Enter, QtCore.Qt.Key_Return, QtCore.Qt.Key_Escape)): self.hide() elif etype == QtCore.Q...
dccf8517350f004c2c78d554593ddb9cd39b3cf1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/dccf8517350f004c2c78d554593ddb9cd39b3cf1/call_tip_widget.py
width = font_metrics.maxWidth() * 81 + margin
width = font_metrics.width(' ') * 81 + margin
def sizeHint(self): """ Reimplemented to suggest a size that is 80 characters wide and 25 lines high. """ font_metrics = QtGui.QFontMetrics(self.font) margin = (self._control.frameWidth() + self._control.document().documentMargin()) * 2 style = self.style() splitwidth = style.pixelMetric(QtGui.QStyle.PM_SplitterWidth)
a15035c6a848ca97d262a28caefc88d331d40042 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/a15035c6a848ca97d262a28caefc88d331d40042/console_widget.py
char_width = QtGui.QFontMetrics(self.font).maxWidth()
char_width = QtGui.QFontMetrics(self.font).width(' ')
def _format_as_columns(self, items, separator=' '): """ Transform a list of strings into a single string with columns.
a15035c6a848ca97d262a28caefc88d331d40042 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/a15035c6a848ca97d262a28caefc88d331d40042/console_widget.py
self._control.moveCursor(QtGui.QTextCursor.PreviousBlock) self._control.moveCursor(QtGui.QTextCursor.EndOfBlock)
self._control.moveCursor(QtGui.QTextCursor.PreviousBlock, mode=anchormode) self._control.moveCursor(QtGui.QTextCursor.EndOfBlock, mode=anchormode)
def _event_filter_console_keypress(self, event): """ Filter key events for the underlying text widget to create a console-like interface. """ intercepted = False cursor = self._control.textCursor() position = cursor.position() key = event.key() ctrl_down = self._control_key_down(event.modifiers()) alt_down = event.modi...
d6369591970a4d6d7402ff5750453e0ea58aff17 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/d6369591970a4d6d7402ff5750453e0ea58aff17/console_widget.py
cursor.movePosition(QtGui.QTextCursor.Right)
cursor.movePosition(QtGui.QTextCursor.Right, mode=anchormode)
def _event_filter_console_keypress(self, event): """ Filter key events for the underlying text widget to create a console-like interface. """ intercepted = False cursor = self._control.textCursor() position = cursor.position() key = event.key() ctrl_down = self._control_key_down(event.modifiers()) alt_down = event.modi...
d6369591970a4d6d7402ff5750453e0ea58aff17 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/d6369591970a4d6d7402ff5750453e0ea58aff17/console_widget.py
n=len(self._continuation_prompt))
n=len(self._continuation_prompt), mode=anchormode)
def _event_filter_console_keypress(self, event): """ Filter key events for the underlying text widget to create a console-like interface. """ intercepted = False cursor = self._control.textCursor() position = cursor.position() key = event.key() ctrl_down = self._control_key_down(event.modifiers()) alt_down = event.modi...
d6369591970a4d6d7402ff5750453e0ea58aff17 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/d6369591970a4d6d7402ff5750453e0ea58aff17/console_widget.py
self._context_menu = self._create_context_menu()
def __init__(self, kind='plain', parent=None): """ Create a ConsoleWidget. Parameters ---------- kind : str, optional [default 'plain'] The type of text widget to use. Valid values are 'plain', which specifies a QPlainTextEdit, and 'rich', which specifies an QTextEdit.
9b3b0bb4f8d4fbc9e2f47305210f0a0c86a5e540 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/9b3b0bb4f8d4fbc9e2f47305210f0a0c86a5e540/console_widget.py
if etype == QtCore.QEvent.ContextMenu: self._context_menu.exec_(event.globalPos()) return True
def eventFilter(self, obj, event): """ Reimplemented to ensure a console-like behavior in the underlying text widget. """ if obj == self._control: etype = event.type()
9b3b0bb4f8d4fbc9e2f47305210f0a0c86a5e540 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/9b3b0bb4f8d4fbc9e2f47305210f0a0c86a5e540/console_widget.py
elif etype == QtCore.QEvent.DragMove:
if etype == QtCore.QEvent.DragMove:
def eventFilter(self, obj, event): """ Reimplemented to ensure a console-like behavior in the underlying text widget. """ if obj == self._control: etype = event.type()
9b3b0bb4f8d4fbc9e2f47305210f0a0c86a5e540 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/9b3b0bb4f8d4fbc9e2f47305210f0a0c86a5e540/console_widget.py
def _create_context_menu(self): """ Creates a context menu for the underlying text widget. """ menu = QtGui.QMenu(self) clipboard = QtGui.QApplication.clipboard() copy_action = QtGui.QAction('Copy', self) copy_action.triggered.connect(self.copy) self.copy_available.connect(copy_action.setEnabled) menu.addAction(copy_a...
def _create_context_menu(self): """ Creates a context menu for the underlying text widget. """ menu = QtGui.QMenu(self) clipboard = QtGui.QApplication.clipboard()
9b3b0bb4f8d4fbc9e2f47305210f0a0c86a5e540 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/9b3b0bb4f8d4fbc9e2f47305210f0a0c86a5e540/console_widget.py
replaced_event = None
def _event_filter_keypress(self, event): """ Filter key events for the underlying text widget to create a console-like interface. """ intercepted = False replaced_event = None cursor = self._control.textCursor() position = cursor.position() key = event.key() ctrl_down = self._control_key_down(event.modifiers()) alt_dow...
9b3b0bb4f8d4fbc9e2f47305210f0a0c86a5e540 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/9b3b0bb4f8d4fbc9e2f47305210f0a0c86a5e540/console_widget.py
key = event.key() ctrl_down = self._control_key_down(event.modifiers())
def _event_filter_keypress(self, event): """ Filter key events for the underlying text widget to create a console-like interface. """ intercepted = False replaced_event = None cursor = self._control.textCursor() position = cursor.position() key = event.key() ctrl_down = self._control_key_down(event.modifiers()) alt_dow...
9b3b0bb4f8d4fbc9e2f47305210f0a0c86a5e540 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/9b3b0bb4f8d4fbc9e2f47305210f0a0c86a5e540/console_widget.py
def _event_filter_keypress(self, event): """ Filter key events for the underlying text widget to create a console-like interface. """ intercepted = False replaced_event = None cursor = self._control.textCursor() position = cursor.position() key = event.key() ctrl_down = self._control_key_down(event.modifiers()) alt_dow...
9b3b0bb4f8d4fbc9e2f47305210f0a0c86a5e540 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/9b3b0bb4f8d4fbc9e2f47305210f0a0c86a5e540/console_widget.py
if key in self._ctrl_down_remap: ctrl_down = False key = self._ctrl_down_remap[key] replaced_event = QtGui.QKeyEvent(QtCore.QEvent.KeyPress, key, QtCore.Qt.NoModifier) elif key == QtCore.Qt.Key_K:
if key == QtCore.Qt.Key_K:
def _event_filter_keypress(self, event): """ Filter key events for the underlying text widget to create a console-like interface. """ intercepted = False replaced_event = None cursor = self._control.textCursor() position = cursor.position() key = event.key() ctrl_down = self._control_key_down(event.modifiers()) alt_dow...
9b3b0bb4f8d4fbc9e2f47305210f0a0c86a5e540 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/9b3b0bb4f8d4fbc9e2f47305210f0a0c86a5e540/console_widget.py
if self._completion_widget.isVisible(): self._completion_widget.keyPressEvent(event) intercepted = event.isAccepted()
def _event_filter_keypress(self, event): """ Filter key events for the underlying text widget to create a console-like interface. """ intercepted = False replaced_event = None cursor = self._control.textCursor() position = cursor.position() key = event.key() ctrl_down = self._control_key_down(event.modifiers()) alt_dow...
9b3b0bb4f8d4fbc9e2f47305210f0a0c86a5e540 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/9b3b0bb4f8d4fbc9e2f47305210f0a0c86a5e540/console_widget.py
def _event_filter_keypress(self, event): """ Filter key events for the underlying text widget to create a console-like interface. """ intercepted = False replaced_event = None cursor = self._control.textCursor() position = cursor.position() key = event.key() ctrl_down = self._control_key_down(event.modifiers()) alt_dow...
9b3b0bb4f8d4fbc9e2f47305210f0a0c86a5e540 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/9b3b0bb4f8d4fbc9e2f47305210f0a0c86a5e540/console_widget.py
if not intercepted and replaced_event: QtGui.qApp.sendEvent(self._control, replaced_event)
def _event_filter_keypress(self, event): """ Filter key events for the underlying text widget to create a console-like interface. """ intercepted = False replaced_event = None cursor = self._control.textCursor() position = cursor.position() key = event.key() ctrl_down = self._control_key_down(event.modifiers()) alt_dow...
9b3b0bb4f8d4fbc9e2f47305210f0a0c86a5e540 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/9b3b0bb4f8d4fbc9e2f47305210f0a0c86a5e540/console_widget.py
""" Reimplemented to prompt the user and close the kernel cleanly, or close without prompt only if the exit magic is used.
""" Close the window and the kernel (if necessary). This will prompt the user if they are finished with the kernel, and if so, closes the kernel cleanly. Alternatively, if the exit magic is used, it closes without prompt.
def closeEvent(self, event): """ Reimplemented to prompt the user and close the kernel cleanly, or close without prompt only if the exit magic is used. """ keepkernel = None #Use the prompt by default if hasattr(self._frontend,'_keep_kernel_on_exit'): #set by exit magic keepkernel = self._frontend._keep_kernel_on_exit ...
52ccc11d08d6b00dd27876d6ab3d79a4e9c296f1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/52ccc11d08d6b00dd27876d6ab3d79a4e9c296f1/ipythonqt.py
custom_edit_requested = QtCore.pyqtSignal(object, int)
custom_edit_requested = QtCore.pyqtSignal(object, object)
def __init__(self, block, length, number): self.block = block self.length = length self.number = number
f83435d36197a68fa4d1daf4086e09f533512115 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/f83435d36197a68fa4d1daf4086e09f533512115/ipython_widget.py
self._highlighter.highlighting_on = True if self._get_prompt_cursor().blockNumber() != \ self._get_end_cursor().blockNumber(): self.appendPlainText(' ' * self._input_splitter.indent_spaces)
if not self._reading: self._highlighter.highlighting_on = True if self._get_prompt_cursor().blockNumber() != \ self._get_end_cursor().blockNumber(): self.appendPlainText(' ' * self._input_splitter.indent_spaces)
def _prompt_started_hook(self): """ Called immediately after a new prompt is displayed. """ self._highlighter.highlighting_on = True
76b9cfdea11e04c38dcba2a599becc5aaa293f4e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/76b9cfdea11e04c38dcba2a599becc5aaa293f4e/frontend_widget.py
self._highlighter.highlighting_on = False
if not self._reading: self._highlighter.highlighting_on = False
def _prompt_finished_hook(self): """ Called immediately after a prompt is finished, i.e. when some input will be processed and a new prompt displayed. """ self._highlighter.highlighting_on = False
76b9cfdea11e04c38dcba2a599becc5aaa293f4e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/76b9cfdea11e04c38dcba2a599becc5aaa293f4e/frontend_widget.py
if block.isValid():
if block.isValid() and not block.text().isEmpty():
def _show_interpreter_prompt_for_reply(self, msg): """ Reimplemented for IPython-style prompts. """ # Update the old prompt number if necessary. content = msg['content'] previous_prompt_number = content['prompt_number'] if self._previous_prompt_obj and \ self._previous_prompt_obj.number != previous_prompt_number: block...
9c365888c3d76b0998e11122cef8918d890b5d17 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/9c365888c3d76b0998e11122cef8918d890b5d17/ipython_widget.py
intercept = True
intercepted = True
def _event_filter_console_keypress(self, event): """ Filter key events for the underlying text widget to create a console-like interface. """ intercepted = False cursor = self._control.textCursor() position = cursor.position() key = event.key() ctrl_down = self._control_key_down(event.modifiers()) alt_down = event.modi...
c76b6ce15f4489326a67b4d247b5789f1bfe8c22 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/c76b6ce15f4489326a67b4d247b5789f1bfe8c22/console_widget.py
self.parent().cursorPositionChanged.disconnect(self._update_current)
try: self.parent().cursorPositionChanged.disconnect(self._update_current) except TypeError: pass
def hideEvent(self, event): """ Reimplemented to disconnect the cursor movement handler. """ QtGui.QListWidget.hideEvent(self, event) self.parent().cursorPositionChanged.disconnect(self._update_current)
291ed79f7c1ce0781457e059c3c645c630a45ace /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/291ed79f7c1ce0781457e059c3c645c630a45ace/completion_widget.py
if not existing:
if existing:
def __init__(self, app, frontend, existing=False, may_close=True): """ Create a MainWindow for the specified FrontendWidget. The app is passed as an argument to allow for different closing behavior depending on whether we are the Kernel's parent. If existing is True, then this Console does not own the Kernel. If may...
163d1150866128903fc1f7ef74152c6906c2146e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/163d1150866128903fc1f7ef74152c6906c2146e/ipythonqt.py
kernel_manager.start_kernel(ipython=False)
kwargs['ipython']=False
def main(): """ Entry point for application. """ # Parse command line arguments. parser = ArgumentParser() kgroup = parser.add_argument_group('kernel options') kgroup.add_argument('-e', '--existing', action='store_true', help='connect to an existing kernel') kgroup.add_argument('--ip', type=str, default=LOCALHOST, help...
163d1150866128903fc1f7ef74152c6906c2146e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/163d1150866128903fc1f7ef74152c6906c2146e/ipythonqt.py
kernel_manager.start_kernel(pylab=args.pylab) else: kernel_manager.start_kernel()
kwargs['pylab']=args.pylab kernel_manager.start_kernel(**kwargs)
def main(): """ Entry point for application. """ # Parse command line arguments. parser = ArgumentParser() kgroup = parser.add_argument_group('kernel options') kgroup.add_argument('-e', '--existing', action='store_true', help='connect to an existing kernel') kgroup.add_argument('--ip', type=str, default=LOCALHOST, help...
163d1150866128903fc1f7ef74152c6906c2146e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/163d1150866128903fc1f7ef74152c6906c2146e/ipythonqt.py
str(self._control.toHtml().toUtf8())))
html))
def export_html(self, parent = None, inline = False): """ Export the contents of the ConsoleWidget as HTML.
f0e3716c4d1de7f5cfb4c39e71ed1a57d6b27d35 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/f0e3716c4d1de7f5cfb4c39e71ed1a57d6b27d35/console_widget.py
if self._reading: intercepted = False elif not self._tab_pressed():
if self._tab_pressed(): intercepted = not self._in_buffer() else:
def _event_filter_console_keypress(self, event): """ Filter key events for the underlying text widget to create a console-like interface. """ intercepted = False cursor = self._control.textCursor() position = cursor.position() key = event.key() ctrl_down = self._control_key_down(event.modifiers()) alt_down = event.modi...
989dd1222c3988c677cf376b7d118f061a329425 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/989dd1222c3988c677cf376b7d118f061a329425/console_widget.py
else: intercepted = not self._in_buffer()
def _event_filter_console_keypress(self, event): """ Filter key events for the underlying text widget to create a console-like interface. """ intercepted = False cursor = self._control.textCursor() position = cursor.position() key = event.key() ctrl_down = self._control_key_down(event.modifiers()) alt_down = event.modi...
989dd1222c3988c677cf376b7d118f061a329425 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/989dd1222c3988c677cf376b7d118f061a329425/console_widget.py
elif obj == self._control: if etype == QtCore.QEvent.DragMove: return True elif etype == QtCore.QEvent.KeyPress:
elif etype == QtCore.QEvent.KeyPress: if obj == self._control:
def eventFilter(self, obj, event): """ Reimplemented to ensure a console-like behavior in the underlying text widget. """ # Re-map keys for all filtered widgets. etype = event.type() if etype == QtCore.QEvent.KeyPress and \ self._control_key_down(event.modifiers()) and \ event.key() in self._ctrl_down_remap: new_event ...
4a81ff91f3d0e29f82274635146715cff4a62256 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/4a81ff91f3d0e29f82274635146715cff4a62256/console_widget.py
elif obj == self._page_control: if etype == QtCore.QEvent.KeyPress:
elif obj == self._page_control:
def eventFilter(self, obj, event): """ Reimplemented to ensure a console-like behavior in the underlying text widget. """ # Re-map keys for all filtered widgets. etype = event.type() if etype == QtCore.QEvent.KeyPress and \ self._control_key_down(event.modifiers()) and \ event.key() in self._ctrl_down_remap: new_event ...
4a81ff91f3d0e29f82274635146715cff4a62256 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/4a81ff91f3d0e29f82274635146715cff4a62256/console_widget.py
control = QtGui.QPlainTextEdit()
control = ConsolePlainTextEdit()
def _create_control(self, kind): """ Creates and connects the underlying text widget. """ if kind == 'plain': control = QtGui.QPlainTextEdit() elif kind == 'rich': control = QtGui.QTextEdit() control.setAcceptRichText(False) else: raise ValueError("Kind %s unknown." % repr(kind)) control.installEventFilter(self) contro...
4a81ff91f3d0e29f82274635146715cff4a62256 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/4a81ff91f3d0e29f82274635146715cff4a62256/console_widget.py
control = QtGui.QTextEdit()
control = ConsoleTextEdit()
def _create_control(self, kind): """ Creates and connects the underlying text widget. """ if kind == 'plain': control = QtGui.QPlainTextEdit() elif kind == 'rich': control = QtGui.QTextEdit() control.setAcceptRichText(False) else: raise ValueError("Kind %s unknown." % repr(kind)) control.installEventFilter(self) contro...
4a81ff91f3d0e29f82274635146715cff4a62256 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/4a81ff91f3d0e29f82274635146715cff4a62256/console_widget.py
control = QtGui.QPlainTextEdit()
control = ConsolePlainTextEdit()
def _create_page_control(self): """ Creates and connects the underlying paging widget. """ control = QtGui.QPlainTextEdit() control.installEventFilter(self) control.setReadOnly(True) control.setUndoRedoEnabled(False) control.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn) return control
4a81ff91f3d0e29f82274635146715cff4a62256 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/4a81ff91f3d0e29f82274635146715cff4a62256/console_widget.py
self._append_plain_text(msg['content']['data'])
text = msg['content']['data'].expandtabs(8) self._append_plain_text(text)
def _handle_stream(self, msg): """ Handle stdout, stderr, and stdin. """ if not self._hidden and self._is_from_this_session(msg): self._append_plain_text(msg['content']['data']) self._control.moveCursor(QtGui.QTextCursor.End)
7b3e676064a5fe33ec24a21c9d224609fdc1e314 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/7b3e676064a5fe33ec24a21c9d224609fdc1e314/frontend_widget.py
elif etype == QtCore.QEvent.Resize: QtCore.QTimer.singleShot(0, self._adjust_scrollbars)
elif etype == QtCore.QEvent.Resize and not self._filter_resize: self._filter_resize = True QtGui.qApp.sendEvent(obj, event) self._adjust_scrollbars() self._filter_resize = False return True
def eventFilter(self, obj, event): """ Reimplemented to ensure a console-like behavior in the underlying text widgets. """ etype = event.type() if etype == QtCore.QEvent.KeyPress:
abe32d1d12a1aaa0e4cd63a548247790f0a91480 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/abe32d1d12a1aaa0e4cd63a548247790f0a91480/console_widget.py
self._control.setTextCursor(cursor)
def eventFilter(self, obj, event): """ Reimplemented to ensure a console-like behavior in the underlying text widgets. """ etype = event.type() if etype == QtCore.QEvent.KeyPress:
9ef471da588e333547e025acd8b584976b9e878b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/9ef471da588e333547e025acd8b584976b9e878b/console_widget.py
self._insert_plain_text_into_buffer(text)
self._insert_plain_text_into_buffer(cursor, text)
def eventFilter(self, obj, event): """ Reimplemented to ensure a console-like behavior in the underlying text widgets. """ etype = event.type() if etype == QtCore.QEvent.KeyPress:
9ef471da588e333547e025acd8b584976b9e878b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/9ef471da588e333547e025acd8b584976b9e878b/console_widget.py
lines = string.splitlines(True) if lines: self._append_plain_text(lines[0]) for i in xrange(1, len(lines)): if self._continuation_prompt_html is None: self._append_plain_text(self._continuation_prompt) else: self._append_html(self._continuation_prompt_html) self._append_plain_text(lines[i])
self._insert_plain_text_into_buffer(self._get_prompt_cursor(), string)
def _set_input_buffer(self, string): """ Replaces the text in the input buffer with 'string'. """ # For now, it is an error to modify the input buffer during execution. if self._executing: raise RuntimeError("Cannot change input buffer during execution.")
9ef471da588e333547e025acd8b584976b9e878b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/9ef471da588e333547e025acd8b584976b9e878b/console_widget.py
self._insert_plain_text_into_buffer(dedent(text))
self._insert_plain_text_into_buffer(cursor, dedent(text))
def paste(self, mode=QtGui.QClipboard.Clipboard): """ Paste the contents of the clipboard into the input region.
9ef471da588e333547e025acd8b584976b9e878b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/9ef471da588e333547e025acd8b584976b9e878b/console_widget.py
def _insert_plain_text_into_buffer(self, text): """ Inserts text into the input buffer at the current cursor position, ensuring that continuation prompts are inserted as necessary.
def _insert_plain_text_into_buffer(self, cursor, text): """ Inserts text into the input buffer using the specified cursor (which must be in the input buffer), ensuring that continuation prompts are inserted as necessary.
def _insert_plain_text_into_buffer(self, text): """ Inserts text into the input buffer at the current cursor position, ensuring that continuation prompts are inserted as necessary. """ lines = unicode(text).splitlines(True) if lines: self._keep_cursor_in_buffer() cursor = self._control.textCursor() cursor.beginEditBloc...
9ef471da588e333547e025acd8b584976b9e878b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/9ef471da588e333547e025acd8b584976b9e878b/console_widget.py
self._keep_cursor_in_buffer() cursor = self._control.textCursor()
def _insert_plain_text_into_buffer(self, text): """ Inserts text into the input buffer at the current cursor position, ensuring that continuation prompts are inserted as necessary. """ lines = unicode(text).splitlines(True) if lines: self._keep_cursor_in_buffer() cursor = self._control.textCursor() cursor.beginEditBloc...
9ef471da588e333547e025acd8b584976b9e878b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/9ef471da588e333547e025acd8b584976b9e878b/console_widget.py
self._control.setTextCursor(cursor)
def _insert_plain_text_into_buffer(self, text): """ Inserts text into the input buffer at the current cursor position, ensuring that continuation prompts are inserted as necessary. """ lines = unicode(text).splitlines(True) if lines: self._keep_cursor_in_buffer() cursor = self._control.textCursor() cursor.beginEditBloc...
9ef471da588e333547e025acd8b584976b9e878b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/9ef471da588e333547e025acd8b584976b9e878b/console_widget.py
def resizeEvent(self, event): """ Adjust the scrollbars manually after a resize event. """ super(ConsoleWidget, self).resizeEvent(event) self._adjust_scrollbars()
def eventFilter(self, obj, event): """ Reimplemented to ensure a console-like behavior in the underlying text widgets. """ etype = event.type() if etype == QtCore.QEvent.KeyPress:
7e6af656096ba9fcb482652426daf69fbd977c58 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4217/7e6af656096ba9fcb482652426daf69fbd977c58/console_widget.py
while (time<final_time):
while time < final_time:
def Maxwell2D(d, Hx, Hy, Ez, final_time): """Integrate TM-mode Maxwell's until final_time starting with initial conditions Hx, Hy, Ez. """ l = d.ldis time = 0 # Runge-Kutta residual storage resHx = np.zeros_like(Hx) resHy = np.zeros_like(Hx) resEz = np.zeros_like(Hx) # compute time step size rLGL = JacobiGQ(0,0, l.N...
fb87d5a9c39b63bebdf189c0c801f04ce9cdc10b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10367/fb87d5a9c39b63bebdf189c0c801f04ce9cdc10b/nudg.py
size_H= l.Nfp*l.Nfaces
size_H = l.Nfp*l.Nfaces
def MaxwellRHS2D(discr, Hx, Hy, Ez): """Evaluate RHS flux in 2D Maxwell TM form.""" d = discr l = discr.ldis # Define field differences at faces vmapM = d.vmapM.reshape(l.Nfp*l.Nfaces, d.K, order='F') vmapP = d.vmapP.reshape(l.Nfp*l.Nfaces, d.K, order='F') Im, Jm = ind2sub(vmapM, l.Np) Ip, Jp = ind2sub(vmapP, l.Np) ...
fb87d5a9c39b63bebdf189c0c801f04ce9cdc10b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10367/fb87d5a9c39b63bebdf189c0c801f04ce9cdc10b/nudg.py
print lift_dev.strides
def prepare_dev_data(self): ldis = self.ldis
b769fd037350b5e3cb3a44881d3b41eb3702788b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10367/b769fd037350b5e3cb3a44881d3b41eb3702788b/opencl.py
tagSet = univ.Integer.tagSet.tagImplicitly(
tagSet = univ.OctetString.tagSet.tagImplicitly(
def prettyOut(self, value): return ipAddressPrettyOut(value)
1f5b15288ab1c25c05a51a26e9c6f05fda6f5d56 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/1f5b15288ab1c25c05a51a26e9c6f05fda6f5d56/rfc1155.py
continue
break
def loadModules(self, *modNames): # Build a list of available modules if not modNames: modNames = {} for mibSource in self.__mibSources: for modName in mibSource.listdir(): modNames[modName] = None modNames = modNames.keys() if not modNames: raise error.SmiError( 'No MIB module to load at %s' % (self,) ) for modName i...
1e7ec9b5ddef5c2b44b509a04bde0a750c7d0b1d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/1e7ec9b5ddef5c2b44b509a04bde0a750c7d0b1d/builder.py
if not cbFun(sendRequestHandle, None,
if not cbFun(sendRequestHandle, errorIndication,
def _handleResponse( self, snmpEngine, transportDomain, transportAddress, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, timeout, retryCount, pMod, rspPDU, sendRequestHandle, (cbFun, cbCtx) ): varBindTable = pMod.apiBulkPDU.getVarBindTable(PDU, rspPDU)
27e2d28b7cb3e387c17a11f2e2a8deb4ce7a6aa1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/27e2d28b7cb3e387c17a11f2e2a8deb4ce7a6aa1/cmdgen.py
debug.logger & debug.flagDsp and debug.logger('sendPdu: new sendPduHandle %s' % sendPduHandle)
debug.logger & debug.flagDsp and debug.logger('sendPdu: new sendPduHandle %s, context %s' % (sendPduHandle, expectResponse))
def sendPdu( self, snmpEngine, transportDomain, transportAddress, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, expectResponse ): """PDU dispatcher -- prepare and serialize a request or notification""" # 4.1.1.2 mpHandler = snmpEngine.messageProcessin...
2476dc5084cdba361adfd7e75f8f0b085cbb0fa8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/2476dc5084cdba361adfd7e75f8f0b085cbb0fa8/rfc3412.py
if string.find(arg, 'egg') == -1:
if string.find(arg, 'egg') != -1:
def howto_install_setuptools(): print """Error: You need setuptools Python package!
32aa05a37f43e73edbe016e397e10d59a979dc8d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/32aa05a37f43e73edbe016e397e10d59a979dc8d/setup.py
if contextName is not None:
if contextName is None:
def addV1System(snmpEngine, securityName, communityName, contextEngineId=None, contextName=None, transportTag=None): snmpCommunityEntry, tblIdx, snmpEngineID = __cookV1SystemInfo( snmpEngine, securityName ) if contextEngineId is None: contextEngineId = snmpEngineID.syntax if contextName is not None: contextName = comm...
591b0902bfef17383a3b3e7d3927705c060026be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/591b0902bfef17383a3b3e7d3927705c060026be/config.py
readSubTree=(), writeSubTree=(), notifySubTree=()):
readSubTree=(), writeSubTree=(), notifySubTree=(), contextName=''):
def addVacmUser(snmpEngine, securityModel, securityName, securityLevel, readSubTree=(), writeSubTree=(), notifySubTree=()): ( groupName, securityLevel, readView, writeView, notifyView ) = __cookVacmUserInfo( snmpEngine, securityModel, securityName, securityLevel, ) addVacmGroup( snmpEngine, groupName, securityModel, se...
591b0902bfef17383a3b3e7d3927705c060026be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/591b0902bfef17383a3b3e7d3927705c060026be/config.py
snmpEngine, groupName, '', securityModel, securityLevel, 1,
snmpEngine, groupName, contextName, securityModel, securityLevel, 1,
def addVacmUser(snmpEngine, securityModel, securityName, securityLevel, readSubTree=(), writeSubTree=(), notifySubTree=()): ( groupName, securityLevel, readView, writeView, notifyView ) = __cookVacmUserInfo( snmpEngine, securityModel, securityName, securityLevel, ) addVacmGroup( snmpEngine, groupName, securityModel, se...
591b0902bfef17383a3b3e7d3927705c060026be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/591b0902bfef17383a3b3e7d3927705c060026be/config.py
nonRepeaters = int(self.getNonRepeaters(reqPDU)) N = min(nonRepeaters, len(self.getVarBindList(reqPDU))) R = max(len(self.getVarBindList(reqPDU))-N, 0) if R == 0: M = 0 else: M = int(min(self.getMaxRepetitions(reqPDU), (len(apiPDU.getVarBindList(rspPDU))-N))/R) varBindList = apiPDU.getVarBindList(rspPDU) varBindRows = ...
nonRepeaters = self.getNonRepeaters(reqPDU) maxRepetitions = self.getMaxRepetitions(reqPDU) reqVarBinds = self.getVarBinds(reqPDU) N = min(int(nonRepeaters), len(reqVarBinds)) M = int(maxRepetitions) R = max(len(reqVarBinds)-N, 0) rspVarBinds = self.getVarBinds(rspPDU) varBindTable = [] if R: for i in range(0, len...
def getVarBindTable(self, reqPDU, rspPDU): nonRepeaters = int(self.getNonRepeaters(reqPDU)) N = min(nonRepeaters, len(self.getVarBindList(reqPDU))) R = max(len(self.getVarBindList(reqPDU))-N, 0) if R == 0: M = 0 else: M = int(min(self.getMaxRepetitions(reqPDU), (len(apiPDU.getVarBindList(rspPDU))-N))/R) varBindList = a...
ab821d4cbf15873b69e7238abdb296ad787114a5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/ab821d4cbf15873b69e7238abdb296ad787114a5/v2c.py
val = None if len(varBindRow) < colIdx+N+1: varBindRow.append((oid, val)) else: varBindRow[colIdx] = (oid, val)
varBindRow[idx] = (oid, None)
def getVarBindTable(self, reqPDU, rspPDU): nonRepeaters = int(self.getNonRepeaters(reqPDU)) N = min(nonRepeaters, len(self.getVarBindList(reqPDU))) R = max(len(self.getVarBindList(reqPDU))-N, 0) if R == 0: M = 0 else: M = int(min(self.getMaxRepetitions(reqPDU), (len(apiPDU.getVarBindList(rspPDU))-N))/R) varBindList = a...
ab821d4cbf15873b69e7238abdb296ad787114a5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/ab821d4cbf15873b69e7238abdb296ad787114a5/v2c.py
def getVarBindTable(self, reqPDU, rspPDU): nonRepeaters = int(self.getNonRepeaters(reqPDU)) N = min(nonRepeaters, len(self.getVarBindList(reqPDU))) R = max(len(self.getVarBindList(reqPDU))-N, 0) if R == 0: M = 0 else: M = int(min(self.getMaxRepetitions(reqPDU), (len(apiPDU.getVarBindList(rspPDU))-N))/R) varBindList = a...
ab821d4cbf15873b69e7238abdb296ad787114a5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/ab821d4cbf15873b69e7238abdb296ad787114a5/v2c.py
del self.__timeline[engineIdKey] debug.logger & debug.flagSM and debug.logger('__expireEnginesInfo: expiring %s' % (engineIdKey,))
if self.__timeline.has_key(engineIdKey): del self.__timeline[engineIdKey] debug.logger & debug.flagSM and debug.logger('__expireEnginesInfo: expiring %s' % (engineIdKey,))
def __expireTimelineInfo(self): if self.__timelineExpQueue.has_key(self.__expirationTimer): for engineIdKey in self.__timelineExpQueue[self.__expirationTimer]: del self.__timeline[engineIdKey] debug.logger & debug.flagSM and debug.logger('__expireEnginesInfo: expiring %s' % (engineIdKey,)) del self.__timelineExpQueue[s...
1d3b05579f5c34573d90df1dd9e7814bb7adf864 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/1d3b05579f5c34573d90df1dd9e7814bb7adf864/service.py
maxSizeResponseScopedPDU = maxMessageSize - 512 if maxSizeResponseScopedPDU < 0:
try: maxSizeResponseScopedPDU = maxMessageSize - len(securityParameters) - 48 except PyAsn1Error:
def processIncomingMsg( self, snmpEngine, messageProcessingModel, maxMessageSize, securityParameters, securityModel, securityLevel, wholeMsg, msg # XXX ): # 3.2.1 try: securityParameters, rest = decoder.decode( securityParameters, asn1Spec=self._securityParametersSpec ) except PyAsn1Error: snmpInASNParseErrs, = snmpEn...
31247da8724281b62dbebe1a3e26b84b0eca24b5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/31247da8724281b62dbebe1a3e26b84b0eca24b5/service.py
def processIncomingMsg( self, snmpEngine, messageProcessingModel, maxMessageSize, securityParameters, securityModel, securityLevel, wholeMsg, msg # XXX ): # 3.2.1 try: securityParameters, rest = decoder.decode( securityParameters, asn1Spec=self._securityParametersSpec ) except PyAsn1Error: snmpInASNParseErrs, = snmpEn...
31247da8724281b62dbebe1a3e26b84b0eca24b5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/31247da8724281b62dbebe1a3e26b84b0eca24b5/service.py
if tag in string.split(str(mibNode.syntax), ' '):
if tag in string.split(str(mibNode.syntax)):
def getTargetNames(snmpEngine, tag): mibInstrumController = snmpEngine.msgAndPduDsp.mibInstrumController # Transport endpoint ( snmpTargetAddrEntry, snmpTargetAddrTagList ) = mibInstrumController.mibBuilder.importSymbols( 'SNMP-TARGET-MIB', 'snmpTargetAddrEntry', 'snmpTargetAddrTagList' ) targetNames = [] nextName = s...
5d8fddc85e92d4f622db2de8e61c18a232ecc742 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/5d8fddc85e92d4f622db2de8e61c18a232ecc742/config.py
'PySNMP example command responder at %s' % __file__
'PySNMP example command responder'
def __call__(self, protoVer): return api.protoModules[protoVer].OctetString( 'PySNMP example command responder at %s' % __file__ )
b89db642ae19b887359695321740e18e9464cd74 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/b89db642ae19b887359695321740e18e9464cd74/implementing-scalar-mib-objects.py
'provides': [ 'pysnmp' ],
def howto_install_setuptools(): print """Error: You need setuptools Python package!
7ad9a45fd7e610622f04487df26f996398d67228 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/7ad9a45fd7e610622f04487df26f996398d67228/setup.py
'requires': [ 'pyasn1', 'pycrypto' ], 'provides': [ 'pysnmp' ]
'requires': [ 'pyasn1', 'pycrypto' ]
def howto_install_setuptools(): print """Error: You need setuptools Python package!
7ad9a45fd7e610622f04487df26f996398d67228 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/7ad9a45fd7e610622f04487df26f996398d67228/setup.py
errorIndication = 'dataMispatch'
errorIndication = 'dataMismatch'
def prepareDataElements( self, snmpEngine, transportDomain, transportAddress, wholeMsg ): # 7.2.2 try: msg, restOfwholeMsg = decoder.decode( wholeMsg, asn1Spec=self._snmpMsgSpec ) except PyAsn1Error: snmpInASNParseErrs, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMPv2-MIB', 'snmpInASNPa...
9b001dd5f441ae7e0b2df684ada7358d06b0b5b2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/9b001dd5f441ae7e0b2df684ada7358d06b0b5b2/rfc3412.py
errorIndication = 'engineIDMispatch'
errorIndication = 'engineIDMismatch'
def prepareDataElements( self, snmpEngine, transportDomain, transportAddress, wholeMsg ): # 7.2.2 try: msg, restOfwholeMsg = decoder.decode( wholeMsg, asn1Spec=self._snmpMsgSpec ) except PyAsn1Error: snmpInASNParseErrs, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMPv2-MIB', 'snmpInASNPa...
9b001dd5f441ae7e0b2df684ada7358d06b0b5b2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/9b001dd5f441ae7e0b2df684ada7358d06b0b5b2/rfc3412.py
appReturn['errorStatus'] = errorStatus appReturn['errorIndex'] = errorIndex appReturn['varBindTable'] = varBindTable
if errorStatus == 2: appReturn['errorStatus'] = errorStatus.clone(0) appReturn['errorIndex'] = errorIndex.clone(0) else: appReturn['errorStatus'] = errorStatus appReturn['errorIndex'] = errorIndex appReturn['varBindTable'] = varBindTotalTable
def __cbFun( sendRequestHandle, errorIndication, errorStatus, errorIndex, varBindTable, (varBindHead, varBindTotalTable, appReturn) ): if errorIndication or errorStatus: appReturn['errorIndication'] = errorIndication appReturn['errorStatus'] = errorStatus appReturn['errorIndex'] = errorIndex appReturn['varBindTable'] =...
0da7a2c26153ccd07c2546bf55faa9de43158385 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/0da7a2c26153ccd07c2546bf55faa9de43158385/cmdgen.py
self.writeCleanup(name, val, idx, (acFun, acCtx))
self.writeUndo(name, val, idx, (acFun, acCtx))
def createUndo(self, name, val, idx, (acFun, acCtx)): if val is not None: self.writeCleanup(name, val, idx, (acFun, acCtx))
cd1e3e347a572bce3309dffe24a02753e446f4e3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/cd1e3e347a572bce3309dffe24a02753e446f4e3/SNMPv2-SMI.py
del self.__createdInstances[name]
del self.__createdInstances[name]
def createUndo(self, name, val, idx, (acFun, acCtx)): # Set back previous column instance, drop the new one if self.__createdInstances.has_key(name): self._vars[name] = self.__createdInstances[name] del self.__createdInstances[name] # Remove new instance on rollback if self._vars[name] is None: del self._vars[name] els...
cd1e3e347a572bce3309dffe24a02753e446f4e3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/cd1e3e347a572bce3309dffe24a02753e446f4e3/SNMPv2-SMI.py
self._vars[name].createUndo(name, val, idx, (acFun, acCtx))
try: self._vars[name] == 0 except PyAsn1Error: del self._vars[name] else: self._vars[name].createUndo(name, val, idx, (acFun, acCtx))
def createUndo(self, name, val, idx, (acFun, acCtx)): # Set back previous column instance, drop the new one if self.__createdInstances.has_key(name): self._vars[name] = self.__createdInstances[name] del self.__createdInstances[name] # Remove new instance on rollback if self._vars[name] is None: del self._vars[name] els...
cd1e3e347a572bce3309dffe24a02753e446f4e3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/cd1e3e347a572bce3309dffe24a02753e446f4e3/SNMPv2-SMI.py
self.__timerCbFuns = [] self.__timeToGo = 0
self.__timerCallables = []
def __init__(self): self.__transports = {} self.__jobs = {} self.__recvCbFun = None self.__timerCbFuns = [] self.__timeToGo = 0
df20074873bcf69ba59049cf2dcc13cf17c8f977 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/df20074873bcf69ba59049cf2dcc13cf17c8f977/base.py
def registerTimerCbFun(self, timerCbFun): self.__timerCbFuns.append(timerCbFun)
def registerTimerCbFun(self, timerCbFun, tickInterval=1.0): self.__timerCallables.append(TimerCallable(timerCbFun, tickInterval))
def registerTimerCbFun(self, timerCbFun): self.__timerCbFuns.append(timerCbFun)
df20074873bcf69ba59049cf2dcc13cf17c8f977 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/df20074873bcf69ba59049cf2dcc13cf17c8f977/base.py
self.__timerCbFuns = []
self.__timerCallables = []
def unregisterTimerCbFun(self, timerCbFun=None): if timerCbFun is None: self.__timerCbFuns = [] else: self.__timerCbFuns.remove(timerCbFun)
df20074873bcf69ba59049cf2dcc13cf17c8f977 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/df20074873bcf69ba59049cf2dcc13cf17c8f977/base.py
self.__timerCbFuns.remove(timerCbFun)
self.__timerCallables.remove(timerCbFun)
def unregisterTimerCbFun(self, timerCbFun=None): if timerCbFun is None: self.__timerCbFuns = [] else: self.__timerCbFuns.remove(timerCbFun)
df20074873bcf69ba59049cf2dcc13cf17c8f977 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/df20074873bcf69ba59049cf2dcc13cf17c8f977/base.py
if self.__timerCbFuns and self.__timeToGo < timeNow: for timerCbFun in self.__timerCbFuns: timerCbFun(timeNow) self.__timeToGo = timeNow + 1
for timerCallable in self.__timerCallables: timerCallable(timeNow)
def handleTimerTick(self, timeNow): if self.__timerCbFuns and self.__timeToGo < timeNow: for timerCbFun in self.__timerCbFuns: timerCbFun(timeNow) self.__timeToGo = timeNow + 1
df20074873bcf69ba59049cf2dcc13cf17c8f977 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/df20074873bcf69ba59049cf2dcc13cf17c8f977/base.py
salt = string.join(map(lambda x: chr(x), salt), '')
salt = string.join(map(chr, salt), '')
def __getEncryptionKey(self, privKey, snmpEngineBoots, snmpEngineTime): salt = [ self._localInt>>56&0xff, self._localInt>>48&0xff, self._localInt>>40&0xff, self._localInt>>32&0xff, self._localInt>>24&0xff, self._localInt>>16&0xff, self._localInt>>8&0xff, self._localInt&0xff ] if self._localInt == 0xffffffffffffffffL: ...
6c6728a9fa75cbf5dad50de60795de1d16d64891 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/6c6728a9fa75cbf5dad50de60795de1d16d64891/aes.py
ord(salt[7]),
ord(salt[0]), ord(salt[1]), ord(salt[2]), ord(salt[3]), ord(salt[4]), ord(salt[5]),
def __getDecryptionKey(self, privKey, snmpEngineBoots, snmpEngineTime, salt): snmpEngineBoots, snmpEngineTime, salt = ( long(snmpEngineBoots), long(snmpEngineTime), str(salt) )
6c6728a9fa75cbf5dad50de60795de1d16d64891 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/6c6728a9fa75cbf5dad50de60795de1d16d64891/aes.py
ord(salt[5]), ord(salt[4]), ord(salt[3]), ord(salt[2]), ord(salt[1]), ord(salt[0])
ord(salt[7])
def __getDecryptionKey(self, privKey, snmpEngineBoots, snmpEngineTime, salt): snmpEngineBoots, snmpEngineTime, salt = ( long(snmpEngineBoots), long(snmpEngineTime), str(salt) )
6c6728a9fa75cbf5dad50de60795de1d16d64891 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/6c6728a9fa75cbf5dad50de60795de1d16d64891/aes.py