repo
stringlengths
7
55
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
19
28.4k
docstring
stringlengths
1
46.9k
docstring_tokens
listlengths
1
1.97k
sha
stringlengths
40
40
url
stringlengths
87
315
partition
stringclasses
3 values
summary
stringlengths
4
350
bitesofcode/projexui
projexui/widgets/xcolortreewidget.py
XColorTreeWidget.setColorSet
def setColorSet( self, colorSet ): """ Resets the tree to use the inputed color set information. :param colorSet | <XColorSet> """ self.blockSignals(True) self.setUpdatesEnabled(False) self.clear() self._colorSet = colorSet ...
python
def setColorSet( self, colorSet ): """ Resets the tree to use the inputed color set information. :param colorSet | <XColorSet> """ self.blockSignals(True) self.setUpdatesEnabled(False) self.clear() self._colorSet = colorSet ...
[ "def", "setColorSet", "(", "self", ",", "colorSet", ")", ":", "self", ".", "blockSignals", "(", "True", ")", "self", ".", "setUpdatesEnabled", "(", "False", ")", "self", ".", "clear", "(", ")", "self", ".", "_colorSet", "=", "colorSet", "if", "(", "col...
Resets the tree to use the inputed color set information. :param colorSet | <XColorSet>
[ "Resets", "the", "tree", "to", "use", "the", "inputed", "color", "set", "information", ".", ":", "param", "colorSet", "|", "<XColorSet", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcolortreewidget.py#L172-L197
train
Sets the color set for this tree item.
bitesofcode/projexui
projexui/widgets/xcolortreewidget.py
XColorTreeWidget.setColumnCount
def setColumnCount( self, count ): """ Sets the number of columns used for this tree widget, updating the \ column resizing modes to stretch the first column. :param count | <int> """ super(XColorTreeWidget, self).setColumnCount(count) heade...
python
def setColumnCount( self, count ): """ Sets the number of columns used for this tree widget, updating the \ column resizing modes to stretch the first column. :param count | <int> """ super(XColorTreeWidget, self).setColumnCount(count) heade...
[ "def", "setColumnCount", "(", "self", ",", "count", ")", ":", "super", "(", "XColorTreeWidget", ",", "self", ")", ".", "setColumnCount", "(", "count", ")", "header", "=", "self", ".", "header", "(", ")", "header", ".", "setResizeMode", "(", "0", ",", "...
Sets the number of columns used for this tree widget, updating the \ column resizing modes to stretch the first column. :param count | <int>
[ "Sets", "the", "number", "of", "columns", "used", "for", "this", "tree", "widget", "updating", "the", "\\", "column", "resizing", "modes", "to", "stretch", "the", "first", "column", ".", ":", "param", "count", "|", "<int", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcolortreewidget.py#L207-L219
train
Updates the number of columns used for this tree widget updating the \ column resizing modes to stretch the first column.
bitesofcode/projexui
projexui/widgets/xcolortreewidget.py
XColorTreeWidget.setQuickColor
def setQuickColor( self, color ): """ Sets the quick color for the palette to the given color. :param color | <QColor> """ colorset = XPaletteColorSet() colorset.setPalette(QPalette(color)) self.setColorSet(colorset)
python
def setQuickColor( self, color ): """ Sets the quick color for the palette to the given color. :param color | <QColor> """ colorset = XPaletteColorSet() colorset.setPalette(QPalette(color)) self.setColorSet(colorset)
[ "def", "setQuickColor", "(", "self", ",", "color", ")", ":", "colorset", "=", "XPaletteColorSet", "(", ")", "colorset", ".", "setPalette", "(", "QPalette", "(", "color", ")", ")", "self", ".", "setColorSet", "(", "colorset", ")" ]
Sets the quick color for the palette to the given color. :param color | <QColor>
[ "Sets", "the", "quick", "color", "for", "the", "palette", "to", "the", "given", "color", ".", ":", "param", "color", "|", "<QColor", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcolortreewidget.py#L230-L238
train
Sets the quick color for the given palette.
bitesofcode/projexui
projexui/widgets/xganttwidget/xganttviewitem.py
XGanttViewItem.itemChange
def itemChange( self, change, value ): """ Overloads the base QGraphicsItem itemChange method to block user ability to move along the y-axis. :param change <int> :param value <variant> :return <variant> """ # onl...
python
def itemChange( self, change, value ): """ Overloads the base QGraphicsItem itemChange method to block user ability to move along the y-axis. :param change <int> :param value <variant> :return <variant> """ # onl...
[ "def", "itemChange", "(", "self", ",", "change", ",", "value", ")", ":", "# only operate when it is a visible, geometric change", "if", "not", "(", "self", ".", "isVisible", "(", ")", "and", "change", "==", "self", ".", "ItemPositionChange", ")", ":", "return", ...
Overloads the base QGraphicsItem itemChange method to block user ability to move along the y-axis. :param change <int> :param value <variant> :return <variant>
[ "Overloads", "the", "base", "QGraphicsItem", "itemChange", "method", "to", "block", "user", "ability", "to", "move", "along", "the", "y", "-", "axis", ".", ":", "param", "change", "<int", ">", ":", "param", "value", "<variant", ">", ":", "return", "<varian...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttviewitem.py#L140-L169
train
Overloads the base QGraphicsItem itemChange method to block user ability to move along the y - axis.
bitesofcode/projexui
projexui/widgets/xganttwidget/xganttviewitem.py
XGanttViewItem.mouseReleaseEvent
def mouseReleaseEvent(self, event): """ Overloads the mouse release event to apply the current changes. :param event | <QEvent> """ super(XGanttViewItem, self).mouseReleaseEvent(event) if not self.flags() & self.ItemIsMovable: r...
python
def mouseReleaseEvent(self, event): """ Overloads the mouse release event to apply the current changes. :param event | <QEvent> """ super(XGanttViewItem, self).mouseReleaseEvent(event) if not self.flags() & self.ItemIsMovable: r...
[ "def", "mouseReleaseEvent", "(", "self", ",", "event", ")", ":", "super", "(", "XGanttViewItem", ",", "self", ")", ".", "mouseReleaseEvent", "(", "event", ")", "if", "not", "self", ".", "flags", "(", ")", "&", "self", ".", "ItemIsMovable", ":", "return",...
Overloads the mouse release event to apply the current changes. :param event | <QEvent>
[ "Overloads", "the", "mouse", "release", "event", "to", "apply", "the", "current", "changes", ".", ":", "param", "event", "|", "<QEvent", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttviewitem.py#L182-L219
train
Updates the position of the item based on the current changes.
bitesofcode/projexui
projexui/widgets/xganttwidget/xganttviewitem.py
XGanttViewItem.paint
def paint( self, painter, option, widget ): """ Paints this item to the system. :param painter | <QPainter> option | <QStyleOptionGraphicItem> widget | <QWidget> """ style = self.itemStyle() ItemStyle ...
python
def paint( self, painter, option, widget ): """ Paints this item to the system. :param painter | <QPainter> option | <QStyleOptionGraphicItem> widget | <QWidget> """ style = self.itemStyle() ItemStyle ...
[ "def", "paint", "(", "self", ",", "painter", ",", "option", ",", "widget", ")", ":", "style", "=", "self", ".", "itemStyle", "(", ")", "ItemStyle", "=", "self", ".", "treeItem", "(", ")", ".", "ItemStyle", "if", "(", "style", "==", "ItemStyle", ".", ...
Paints this item to the system. :param painter | <QPainter> option | <QStyleOptionGraphicItem> widget | <QWidget>
[ "Paints", "this", "item", "to", "the", "system", ".", ":", "param", "painter", "|", "<QPainter", ">", "option", "|", "<QStyleOptionGraphicItem", ">", "widget", "|", "<QWidget", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttviewitem.py#L229-L247
train
Paints this item to the system.
bitesofcode/projexui
projexui/widgets/xganttwidget/xganttviewitem.py
XGanttViewItem.paintGroup
def paintGroup( self, painter ): """ Paints this item as the group look. :param painter | <QPainter> """ # generate the rect rect = self.rect() padding = self.padding() gantt = self.scene().ganttWidget() cell_w = gant...
python
def paintGroup( self, painter ): """ Paints this item as the group look. :param painter | <QPainter> """ # generate the rect rect = self.rect() padding = self.padding() gantt = self.scene().ganttWidget() cell_w = gant...
[ "def", "paintGroup", "(", "self", ",", "painter", ")", ":", "# generate the rect\r", "rect", "=", "self", ".", "rect", "(", ")", "padding", "=", "self", ".", "padding", "(", ")", "gantt", "=", "self", ".", "scene", "(", ")", ".", "ganttWidget", "(", ...
Paints this item as the group look. :param painter | <QPainter>
[ "Paints", "this", "item", "as", "the", "group", "look", ".", ":", "param", "painter", "|", "<QPainter", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttviewitem.py#L249-L324
train
Paints the group item.
bitesofcode/projexui
projexui/widgets/xganttwidget/xganttviewitem.py
XGanttViewItem.paintMilestone
def paintMilestone( self, painter ): """ Paints this item as the milestone look. :param painter | <QPainter> """ # generate the rect rect = self.rect() padding = self.padding() gantt = self.scene().ganttWidget() cell_w...
python
def paintMilestone( self, painter ): """ Paints this item as the milestone look. :param painter | <QPainter> """ # generate the rect rect = self.rect() padding = self.padding() gantt = self.scene().ganttWidget() cell_w...
[ "def", "paintMilestone", "(", "self", ",", "painter", ")", ":", "# generate the rect\r", "rect", "=", "self", ".", "rect", "(", ")", "padding", "=", "self", ".", "padding", "(", ")", "gantt", "=", "self", ".", "scene", "(", ")", ".", "ganttWidget", "("...
Paints this item as the milestone look. :param painter | <QPainter>
[ "Paints", "this", "item", "as", "the", "milestone", "look", ".", ":", "param", "painter", "|", "<QPainter", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttviewitem.py#L326-L377
train
Paints the milestone for this item.
bitesofcode/projexui
projexui/widgets/xganttwidget/xganttviewitem.py
XGanttViewItem.paintNormal
def paintNormal( self, painter ): """ Paints this item as the normal look. :param painter | <QPainter> """ # generate the rect rect = self.rect() x = 0 y = self.padding() w = rect.width() h...
python
def paintNormal( self, painter ): """ Paints this item as the normal look. :param painter | <QPainter> """ # generate the rect rect = self.rect() x = 0 y = self.padding() w = rect.width() h...
[ "def", "paintNormal", "(", "self", ",", "painter", ")", ":", "# generate the rect\r", "rect", "=", "self", ".", "rect", "(", ")", "x", "=", "0", "y", "=", "self", ".", "padding", "(", ")", "w", "=", "rect", ".", "width", "(", ")", "h", "=", "rect...
Paints this item as the normal look. :param painter | <QPainter>
[ "Paints", "this", "item", "as", "the", "normal", "look", ".", ":", "param", "painter", "|", "<QPainter", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttviewitem.py#L379-L440
train
Paints this item as the normal look.
bitesofcode/projexui
projexui/widgets/xganttwidget/xganttviewitem.py
XGanttViewItem.setColor
def setColor( self, color ): """ Sets the color for this widget. :param color | <QColor> || <str> """ self._color = QColor(color) self.setAlternateColor(self._color.darker(110))
python
def setColor( self, color ): """ Sets the color for this widget. :param color | <QColor> || <str> """ self._color = QColor(color) self.setAlternateColor(self._color.darker(110))
[ "def", "setColor", "(", "self", ",", "color", ")", ":", "self", ".", "_color", "=", "QColor", "(", "color", ")", "self", ".", "setAlternateColor", "(", "self", ".", "_color", ".", "darker", "(", "110", ")", ")" ]
Sets the color for this widget. :param color | <QColor> || <str>
[ "Sets", "the", "color", "for", "this", "widget", ".", ":", "param", "color", "|", "<QColor", ">", "||", "<str", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttviewitem.py#L492-L499
train
Sets the color for this widget.
bitesofcode/projexui
projexui/widgets/xganttwidget/xganttviewitem.py
XGanttViewItem.setHighlightColor
def setHighlightColor( self, color ): """ Sets the primary color used for highlighting this item. :param color | <QColor> """ self._highlightColor = QColor(color) self.setAlternateHighlightColor(self._highlightColor.darker(110))
python
def setHighlightColor( self, color ): """ Sets the primary color used for highlighting this item. :param color | <QColor> """ self._highlightColor = QColor(color) self.setAlternateHighlightColor(self._highlightColor.darker(110))
[ "def", "setHighlightColor", "(", "self", ",", "color", ")", ":", "self", ".", "_highlightColor", "=", "QColor", "(", "color", ")", "self", ".", "setAlternateHighlightColor", "(", "self", ".", "_highlightColor", ".", "darker", "(", "110", ")", ")" ]
Sets the primary color used for highlighting this item. :param color | <QColor>
[ "Sets", "the", "primary", "color", "used", "for", "highlighting", "this", "item", ".", ":", "param", "color", "|", "<QColor", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttviewitem.py#L501-L508
train
Sets the primary color used for highlighting this item.
bitesofcode/projexui
projexui/widgets/xganttwidget/xganttviewitem.py
XGanttViewItem.setProgressColor
def setProgressColor( self, color ): """ Sets the color that for the progress bar for this item. :param color | <QColor> """ self._progressColor = QColor(color) self.setAlternateProgressColor(self._progressColor.darker(110))
python
def setProgressColor( self, color ): """ Sets the color that for the progress bar for this item. :param color | <QColor> """ self._progressColor = QColor(color) self.setAlternateProgressColor(self._progressColor.darker(110))
[ "def", "setProgressColor", "(", "self", ",", "color", ")", ":", "self", ".", "_progressColor", "=", "QColor", "(", "color", ")", "self", ".", "setAlternateProgressColor", "(", "self", ".", "_progressColor", ".", "darker", "(", "110", ")", ")" ]
Sets the color that for the progress bar for this item. :param color | <QColor>
[ "Sets", "the", "color", "that", "for", "the", "progress", "bar", "for", "this", "item", ".", ":", "param", "color", "|", "<QColor", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttviewitem.py#L527-L534
train
Sets the color that will be used for the progress bar for this item.
bitesofcode/projexui
projexui/widgets/xtreewidget/xloaderitem.py
XLoaderItem.autoload
def autoload(self, state=True): """ Begins the process for autoloading this item when it becomes visible within the tree. :param state | <bool> """ if state and not self._timer: self._timer = QtCore.QTimer() self._timer.setIn...
python
def autoload(self, state=True): """ Begins the process for autoloading this item when it becomes visible within the tree. :param state | <bool> """ if state and not self._timer: self._timer = QtCore.QTimer() self._timer.setIn...
[ "def", "autoload", "(", "self", ",", "state", "=", "True", ")", ":", "if", "state", "and", "not", "self", ".", "_timer", ":", "self", ".", "_timer", "=", "QtCore", ".", "QTimer", "(", ")", "self", ".", "_timer", ".", "setInterval", "(", "500", ")",...
Begins the process for autoloading this item when it becomes visible within the tree. :param state | <bool>
[ "Begins", "the", "process", "for", "autoloading", "this", "item", "when", "it", "becomes", "visible", "within", "the", "tree", ".", ":", "param", "state", "|", "<bool", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xtreewidget/xloaderitem.py#L55-L71
train
Starts the process for autoloading this item when it becomes visible within the tree.
bitesofcode/projexui
projexui/widgets/xtreewidget/xloaderitem.py
XLoaderItem.startLoading
def startLoading(self): """ Updates this item to mark the item as loading. This will create a QLabel with the loading ajax spinner to indicate that progress is occurring. """ if self._loading: return False tree = self.treeWidget() ...
python
def startLoading(self): """ Updates this item to mark the item as loading. This will create a QLabel with the loading ajax spinner to indicate that progress is occurring. """ if self._loading: return False tree = self.treeWidget() ...
[ "def", "startLoading", "(", "self", ")", ":", "if", "self", ".", "_loading", ":", "return", "False", "tree", "=", "self", ".", "treeWidget", "(", ")", "if", "not", "tree", ":", "return", "self", ".", "_loading", "=", "True", "self", ".", "setText", "...
Updates this item to mark the item as loading. This will create a QLabel with the loading ajax spinner to indicate that progress is occurring.
[ "Updates", "this", "item", "to", "mark", "the", "item", "as", "loading", ".", "This", "will", "create", "a", "QLabel", "with", "the", "loading", "ajax", "spinner", "to", "indicate", "that", "progress", "is", "occurring", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xtreewidget/xloaderitem.py#L73-L100
train
Starts loading the item.
bitesofcode/projexui
projexui/widgets/xloggerwidget/xloggertreewidget.py
XLoggerDelegate.createEditor
def createEditor(self, parent, option, index): """ Creates a new editor for the given index parented to the inputed widget. :param parent | <QtGui.QWidget> option | <QtGui.QStyleOption> index | <QtGui.QModelIndex> :r...
python
def createEditor(self, parent, option, index): """ Creates a new editor for the given index parented to the inputed widget. :param parent | <QtGui.QWidget> option | <QtGui.QStyleOption> index | <QtGui.QModelIndex> :r...
[ "def", "createEditor", "(", "self", ",", "parent", ",", "option", ",", "index", ")", ":", "if", "index", ".", "column", "(", ")", "!=", "1", ":", "return", "None", "editor", "=", "QtGui", ".", "QComboBox", "(", "parent", ")", "# load the levels\r", "it...
Creates a new editor for the given index parented to the inputed widget. :param parent | <QtGui.QWidget> option | <QtGui.QStyleOption> index | <QtGui.QModelIndex> :return <QWidget> || None
[ "Creates", "a", "new", "editor", "for", "the", "given", "index", "parented", "to", "the", "inputed", "widget", ".", ":", "param", "parent", "|", "<QtGui", ".", "QWidget", ">", "option", "|", "<QtGui", ".", "QStyleOption", ">", "index", "|", "<QtGui", "."...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xloggerwidget/xloggertreewidget.py#L66-L87
train
Create a new editor for the given index.
bitesofcode/projexui
projexui/widgets/xloggerwidget/xloggertreewidget.py
XLoggerDelegate.setEditorData
def setEditorData(self, editor, index): """ Updates the editor with the model data. :param editor | <QtGui.QWidget> index | <QtGui.QModelIndex> """ data = unwrapVariant(index.data()) editor.setCurrentIndex(editor.findText(data))
python
def setEditorData(self, editor, index): """ Updates the editor with the model data. :param editor | <QtGui.QWidget> index | <QtGui.QModelIndex> """ data = unwrapVariant(index.data()) editor.setCurrentIndex(editor.findText(data))
[ "def", "setEditorData", "(", "self", ",", "editor", ",", "index", ")", ":", "data", "=", "unwrapVariant", "(", "index", ".", "data", "(", ")", ")", "editor", ".", "setCurrentIndex", "(", "editor", ".", "findText", "(", "data", ")", ")" ]
Updates the editor with the model data. :param editor | <QtGui.QWidget> index | <QtGui.QModelIndex>
[ "Updates", "the", "editor", "with", "the", "model", "data", ".", ":", "param", "editor", "|", "<QtGui", ".", "QWidget", ">", "index", "|", "<QtGui", ".", "QModelIndex", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xloggerwidget/xloggertreewidget.py#L89-L97
train
Updates the editor with the model data.
bitesofcode/projexui
projexui/widgets/xloggerwidget/xloggertreewidget.py
XLoggerDelegate.setModelData
def setModelData(self, editor, model, index): """ Updates the item with the new data value. :param editor | <QtGui.QWidget> model | <QtGui.QModel> index | <QtGui.QModelIndex> """ value = editor.currentText() ...
python
def setModelData(self, editor, model, index): """ Updates the item with the new data value. :param editor | <QtGui.QWidget> model | <QtGui.QModel> index | <QtGui.QModelIndex> """ value = editor.currentText() ...
[ "def", "setModelData", "(", "self", ",", "editor", ",", "model", ",", "index", ")", ":", "value", "=", "editor", ".", "currentText", "(", ")", "model", ".", "setData", "(", "index", ",", "wrapVariant", "(", "value", ")", ")" ]
Updates the item with the new data value. :param editor | <QtGui.QWidget> model | <QtGui.QModel> index | <QtGui.QModelIndex>
[ "Updates", "the", "item", "with", "the", "new", "data", "value", ".", ":", "param", "editor", "|", "<QtGui", ".", "QWidget", ">", "model", "|", "<QtGui", ".", "QModel", ">", "index", "|", "<QtGui", ".", "QModelIndex", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xloggerwidget/xloggertreewidget.py#L99-L108
train
Updates the item with the new data value.
ponty/pyavrutils
pyavrutils/arduino.py
Arduino.command_list_arscons
def command_list_arscons(self): '''command line as list''' cmd = [] cmd += ['scons'] if self.arduino_home: cmd += ['ARDUINO_HOME=' + self.arduino_home] # if os.environ.get('ARDUINO_HOME', None): # cmd += ['ARDUINO_HOME=' + os.environ.get('ARDUINO_HOME')] ...
python
def command_list_arscons(self): '''command line as list''' cmd = [] cmd += ['scons'] if self.arduino_home: cmd += ['ARDUINO_HOME=' + self.arduino_home] # if os.environ.get('ARDUINO_HOME', None): # cmd += ['ARDUINO_HOME=' + os.environ.get('ARDUINO_HOME')] ...
[ "def", "command_list_arscons", "(", "self", ")", ":", "cmd", "=", "[", "]", "cmd", "+=", "[", "'scons'", "]", "if", "self", ".", "arduino_home", ":", "cmd", "+=", "[", "'ARDUINO_HOME='", "+", "self", ".", "arduino_home", "]", "# if os.environ.get('ARD...
command line as list
[ "command", "line", "as", "list" ]
7a396a25b3ac076ede07b5cd5cbd416ebb578a28
https://github.com/ponty/pyavrutils/blob/7a396a25b3ac076ede07b5cd5cbd416ebb578a28/pyavrutils/arduino.py#L108-L138
train
command line as list
bitesofcode/projexui
projexui/xhistorystack.py
XHistoryStack.emitCurrentChanged
def emitCurrentChanged(self): """ Emits the current index changed signal provided signals are not blocked. """ if not self.signalsBlocked(): self.currentIndexChanged.emit(self.currentIndex()) self.currentUrlChanged.emit(self.currentUrl()) ...
python
def emitCurrentChanged(self): """ Emits the current index changed signal provided signals are not blocked. """ if not self.signalsBlocked(): self.currentIndexChanged.emit(self.currentIndex()) self.currentUrlChanged.emit(self.currentUrl()) ...
[ "def", "emitCurrentChanged", "(", "self", ")", ":", "if", "not", "self", ".", "signalsBlocked", "(", ")", ":", "self", ".", "currentIndexChanged", ".", "emit", "(", "self", ".", "currentIndex", "(", ")", ")", "self", ".", "currentUrlChanged", ".", "emit", ...
Emits the current index changed signal provided signals are not blocked.
[ "Emits", "the", "current", "index", "changed", "signal", "provided", "signals", "are", "not", "blocked", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xhistorystack.py#L94-L103
train
Emits the current index changed signal provided signals are not blocked.
bitesofcode/projexui
projexui/xhistorystack.py
XHistoryStack.goBack
def goBack(self): """ Goes up one level if possible and returns the url at the current level. If it cannot go up, then a blank string will be returned. :return <str> """ if not self.canGoBack(): return '' self._blockStack = Tru...
python
def goBack(self): """ Goes up one level if possible and returns the url at the current level. If it cannot go up, then a blank string will be returned. :return <str> """ if not self.canGoBack(): return '' self._blockStack = Tru...
[ "def", "goBack", "(", "self", ")", ":", "if", "not", "self", ".", "canGoBack", "(", ")", ":", "return", "''", "self", ".", "_blockStack", "=", "True", "self", ".", "_index", "-=", "1", "self", ".", "emitCurrentChanged", "(", ")", "self", ".", "_block...
Goes up one level if possible and returns the url at the current level. If it cannot go up, then a blank string will be returned. :return <str>
[ "Goes", "up", "one", "level", "if", "possible", "and", "returns", "the", "url", "at", "the", "current", "level", ".", "If", "it", "cannot", "go", "up", "then", "a", "blank", "string", "will", "be", "returned", ".", ":", "return", "<str", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xhistorystack.py#L125-L139
train
Goes up one level if possible and returns the url at the current level.
bitesofcode/projexui
projexui/xhistorystack.py
XHistoryStack.goHome
def goHome(self): """ Goes to the home url. If there is no home url specifically set, then \ this will go to the first url in the history. Otherwise, it will \ look to see if the home url is in the stack and go to that level, if \ the home url is not found, then it will be push...
python
def goHome(self): """ Goes to the home url. If there is no home url specifically set, then \ this will go to the first url in the history. Otherwise, it will \ look to see if the home url is in the stack and go to that level, if \ the home url is not found, then it will be push...
[ "def", "goHome", "(", "self", ")", ":", "if", "not", "self", ".", "canGoBack", "(", ")", ":", "return", "''", "if", "self", ".", "homeUrl", "(", ")", ":", "self", ".", "push", "(", "self", ".", "homeUrl", "(", ")", ")", "self", ".", "_blockStack"...
Goes to the home url. If there is no home url specifically set, then \ this will go to the first url in the history. Otherwise, it will \ look to see if the home url is in the stack and go to that level, if \ the home url is not found, then it will be pushed to the top of the \ stack u...
[ "Goes", "to", "the", "home", "url", ".", "If", "there", "is", "no", "home", "url", "specifically", "set", "then", "\\", "this", "will", "go", "to", "the", "first", "url", "in", "the", "history", ".", "Otherwise", "it", "will", "\\", "look", "to", "se...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xhistorystack.py#L141-L159
train
Goes to the home url.
bitesofcode/projexui
projexui/xhistorystack.py
XHistoryStack.goForward
def goForward(self): """ Goes down one level if possible and returns the url at the current \ level. If it cannot go down, then a blank string will be returned. :return <str> """ if not self.canGoForward(): return '' self._bloc...
python
def goForward(self): """ Goes down one level if possible and returns the url at the current \ level. If it cannot go down, then a blank string will be returned. :return <str> """ if not self.canGoForward(): return '' self._bloc...
[ "def", "goForward", "(", "self", ")", ":", "if", "not", "self", ".", "canGoForward", "(", ")", ":", "return", "''", "self", ".", "_blockStack", "=", "True", "self", ".", "_index", "+=", "1", "self", ".", "emitCurrentChanged", "(", ")", "self", ".", "...
Goes down one level if possible and returns the url at the current \ level. If it cannot go down, then a blank string will be returned. :return <str>
[ "Goes", "down", "one", "level", "if", "possible", "and", "returns", "the", "url", "at", "the", "current", "\\", "level", ".", "If", "it", "cannot", "go", "down", "then", "a", "blank", "string", "will", "be", "returned", ".", ":", "return", "<str", ">" ...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xhistorystack.py#L161-L175
train
Goes down one level if possible and returns the url at the current \ level.
bitesofcode/projexui
projexui/xhistorystack.py
XHistoryStack.indexOf
def indexOf(self, url): """ Returns the index of the inputed url for this stack. If the url is \ not found, then -1 is returned. :param url | <str> :return <int> """ for i, (m_url, _) in enumerate(self._stack): if m_url ==...
python
def indexOf(self, url): """ Returns the index of the inputed url for this stack. If the url is \ not found, then -1 is returned. :param url | <str> :return <int> """ for i, (m_url, _) in enumerate(self._stack): if m_url ==...
[ "def", "indexOf", "(", "self", ",", "url", ")", ":", "for", "i", ",", "(", "m_url", ",", "_", ")", "in", "enumerate", "(", "self", ".", "_stack", ")", ":", "if", "m_url", "==", "url", ":", "return", "i", "return", "-", "1" ]
Returns the index of the inputed url for this stack. If the url is \ not found, then -1 is returned. :param url | <str> :return <int>
[ "Returns", "the", "index", "of", "the", "inputed", "url", "for", "this", "stack", ".", "If", "the", "url", "is", "\\", "not", "found", "then", "-", "1", "is", "returned", ".", ":", "param", "url", "|", "<str", ">", ":", "return", "<int", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xhistorystack.py#L210-L222
train
Returns the index of the url in the stack.
bitesofcode/projexui
projexui/xhistorystack.py
XHistoryStack.push
def push(self, url, title=''): """ Pushes the url into the history stack at the current index. :param url | <str> :return <bool> | changed """ # ignore refreshes of the top level if self.currentUrl() == url or self._blockStack: ...
python
def push(self, url, title=''): """ Pushes the url into the history stack at the current index. :param url | <str> :return <bool> | changed """ # ignore refreshes of the top level if self.currentUrl() == url or self._blockStack: ...
[ "def", "push", "(", "self", ",", "url", ",", "title", "=", "''", ")", ":", "# ignore refreshes of the top level", "if", "self", ".", "currentUrl", "(", ")", "==", "url", "or", "self", ".", "_blockStack", ":", "return", "False", "self", ".", "_blockStack", ...
Pushes the url into the history stack at the current index. :param url | <str> :return <bool> | changed
[ "Pushes", "the", "url", "into", "the", "history", "stack", "at", "the", "current", "index", ".", ":", "param", "url", "|", "<str", ">", ":", "return", "<bool", ">", "|", "changed" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xhistorystack.py#L232-L259
train
Pushes the url into the history stack at the current index.
bitesofcode/projexui
projexui/xhistorystack.py
XHistoryStack.setCurrentIndex
def setCurrentIndex(self, index): """ Sets the current index for the history stack. :param index | <int> :return <bool> | success """ if 0 <= index and index < len(self._stack): self._blockStack = True self._index = inde...
python
def setCurrentIndex(self, index): """ Sets the current index for the history stack. :param index | <int> :return <bool> | success """ if 0 <= index and index < len(self._stack): self._blockStack = True self._index = inde...
[ "def", "setCurrentIndex", "(", "self", ",", "index", ")", ":", "if", "0", "<=", "index", "and", "index", "<", "len", "(", "self", ".", "_stack", ")", ":", "self", ".", "_blockStack", "=", "True", "self", ".", "_index", "=", "index", "self", ".", "e...
Sets the current index for the history stack. :param index | <int> :return <bool> | success
[ "Sets", "the", "current", "index", "for", "the", "history", "stack", ".", ":", "param", "index", "|", "<int", ">", ":", "return", "<bool", ">", "|", "success" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xhistorystack.py#L261-L275
train
Sets the current index for the history stack.
bitesofcode/projexui
projexui/xhistorystack.py
XHistoryStack.urlAt
def urlAt(self, index): """ Returns the url at the inputed index wihtin the stack. If the index \ is invalid, then a blank string is returned. :return <str> """ if 0 <= index and index < len(self._stack): return self._stack[index][0] retu...
python
def urlAt(self, index): """ Returns the url at the inputed index wihtin the stack. If the index \ is invalid, then a blank string is returned. :return <str> """ if 0 <= index and index < len(self._stack): return self._stack[index][0] retu...
[ "def", "urlAt", "(", "self", ",", "index", ")", ":", "if", "0", "<=", "index", "and", "index", "<", "len", "(", "self", ".", "_stack", ")", ":", "return", "self", ".", "_stack", "[", "index", "]", "[", "0", "]", "return", "''" ]
Returns the url at the inputed index wihtin the stack. If the index \ is invalid, then a blank string is returned. :return <str>
[ "Returns", "the", "url", "at", "the", "inputed", "index", "wihtin", "the", "stack", ".", "If", "the", "index", "\\", "is", "invalid", "then", "a", "blank", "string", "is", "returned", ".", ":", "return", "<str", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xhistorystack.py#L303-L312
train
Returns the url at the inputed index wihtin the stack.
bitesofcode/projexui
projexui/xhistorystack.py
XHistoryStack.titleOf
def titleOf(self, url): """ Returns the title for the inputed url. :param url | <str> :return <str> """ for m_url, m_title in self._stack: if url == m_url: return m_title return nativestri...
python
def titleOf(self, url): """ Returns the title for the inputed url. :param url | <str> :return <str> """ for m_url, m_title in self._stack: if url == m_url: return m_title return nativestri...
[ "def", "titleOf", "(", "self", ",", "url", ")", ":", "for", "m_url", ",", "m_title", "in", "self", ".", "_stack", ":", "if", "url", "==", "m_url", ":", "return", "m_title", "return", "nativestring", "(", "url", ")", ".", "split", "(", "'/'", ")", "...
Returns the title for the inputed url. :param url | <str> :return <str>
[ "Returns", "the", "title", "for", "the", "inputed", "url", ".", ":", "param", "url", "|", "<str", ">", ":", "return", "<str", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xhistorystack.py#L322-L334
train
Returns the title for the inputed url.
talkincode/txradius
txradius/openvpn/user_pass_verify.py
cli
def cli(conf): """ OpenVPN user_pass_verify method """ config = init_config(conf) nas_id = config.get('DEFAULT', 'nas_id') nas_addr = config.get('DEFAULT', 'nas_addr') secret = config.get('DEFAULT', 'radius_secret') radius_addr = config.get('DEFAULT', 'radius_addr') radius_auth_port = co...
python
def cli(conf): """ OpenVPN user_pass_verify method """ config = init_config(conf) nas_id = config.get('DEFAULT', 'nas_id') nas_addr = config.get('DEFAULT', 'nas_addr') secret = config.get('DEFAULT', 'radius_secret') radius_addr = config.get('DEFAULT', 'radius_addr') radius_auth_port = co...
[ "def", "cli", "(", "conf", ")", ":", "config", "=", "init_config", "(", "conf", ")", "nas_id", "=", "config", ".", "get", "(", "'DEFAULT'", ",", "'nas_id'", ")", "nas_addr", "=", "config", ".", "get", "(", "'DEFAULT'", ",", "'nas_addr'", ")", "secret",...
OpenVPN user_pass_verify method
[ "OpenVPN", "user_pass_verify", "method" ]
b86fdbc9be41183680b82b07d3a8e8ea10926e01
https://github.com/talkincode/txradius/blob/b86fdbc9be41183680b82b07d3a8e8ea10926e01/txradius/openvpn/user_pass_verify.py#L24-L78
train
OpenVPN user_pass_verify method
johnnoone/aioconsul
aioconsul/client/session_endpoint.py
SessionEndpoint.create
async def create(self, session, *, dc=None): """Creates a new session Parameters: session (Object): Session definition dc (str): Specify datacenter that will be used. Defaults to the agent's local datacenter. Returns: Object: ID of the ...
python
async def create(self, session, *, dc=None): """Creates a new session Parameters: session (Object): Session definition dc (str): Specify datacenter that will be used. Defaults to the agent's local datacenter. Returns: Object: ID of the ...
[ "async", "def", "create", "(", "self", ",", "session", ",", "*", ",", "dc", "=", "None", ")", ":", "response", "=", "await", "self", ".", "_api", ".", "put", "(", "\"/v1/session/create\"", ",", "data", "=", "session", ",", "params", "=", "{", "\"dc\"...
Creates a new session Parameters: session (Object): Session definition dc (str): Specify datacenter that will be used. Defaults to the agent's local datacenter. Returns: Object: ID of the created session The create endpoint is used to ...
[ "Creates", "a", "new", "session" ]
02f7a529d7dc2e49bed942111067aa5faf320e90
https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/session_endpoint.py#L18-L76
train
Creates a new session in the agent s local datacenter.
johnnoone/aioconsul
aioconsul/client/session_endpoint.py
SessionEndpoint.destroy
async def destroy(self, session, *, dc=None): """Destroys a given session Parameters: session (ObjectID): Session ID dc (str): Specify datacenter that will be used. Defaults to the agent's local datacenter. Returns: bool: ``True`` on suc...
python
async def destroy(self, session, *, dc=None): """Destroys a given session Parameters: session (ObjectID): Session ID dc (str): Specify datacenter that will be used. Defaults to the agent's local datacenter. Returns: bool: ``True`` on suc...
[ "async", "def", "destroy", "(", "self", ",", "session", ",", "*", ",", "dc", "=", "None", ")", ":", "session_id", "=", "extract_attr", "(", "session", ",", "keys", "=", "[", "\"ID\"", "]", ")", "response", "=", "await", "self", ".", "_api", ".", "p...
Destroys a given session Parameters: session (ObjectID): Session ID dc (str): Specify datacenter that will be used. Defaults to the agent's local datacenter. Returns: bool: ``True`` on success
[ "Destroys", "a", "given", "session" ]
02f7a529d7dc2e49bed942111067aa5faf320e90
https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/session_endpoint.py#L78-L91
train
Destroys a given session.
johnnoone/aioconsul
aioconsul/client/session_endpoint.py
SessionEndpoint.info
async def info(self, session, *, dc=None, watch=None, consistency=None): """Queries a given session Parameters: session (ObjectID): Session ID dc (str): Specify datacenter that will be used. Defaults to the agent's local datacenter. watch (Block...
python
async def info(self, session, *, dc=None, watch=None, consistency=None): """Queries a given session Parameters: session (ObjectID): Session ID dc (str): Specify datacenter that will be used. Defaults to the agent's local datacenter. watch (Block...
[ "async", "def", "info", "(", "self", ",", "session", ",", "*", ",", "dc", "=", "None", ",", "watch", "=", "None", ",", "consistency", "=", "None", ")", ":", "session_id", "=", "extract_attr", "(", "session", ",", "keys", "=", "[", "\"ID\"", "]", ")...
Queries a given session Parameters: session (ObjectID): Session ID dc (str): Specify datacenter that will be used. Defaults to the agent's local datacenter. watch (Blocking): Do a blocking query consistency (Consistency): Force consistency ...
[ "Queries", "a", "given", "session" ]
02f7a529d7dc2e49bed942111067aa5faf320e90
https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/session_endpoint.py#L95-L133
train
Queries a given session and returns the information for that session.
johnnoone/aioconsul
aioconsul/client/session_endpoint.py
SessionEndpoint.renew
async def renew(self, session, *, dc=None): """Renews a TTL-based session Parameters: session (ObjectID): Session ID dc (str): Specify datacenter that will be used. Defaults to the agent's local datacenter. Returns: ObjectMeta: where val...
python
async def renew(self, session, *, dc=None): """Renews a TTL-based session Parameters: session (ObjectID): Session ID dc (str): Specify datacenter that will be used. Defaults to the agent's local datacenter. Returns: ObjectMeta: where val...
[ "async", "def", "renew", "(", "self", ",", "session", ",", "*", ",", "dc", "=", "None", ")", ":", "session_id", "=", "extract_attr", "(", "session", ",", "keys", "=", "[", "\"ID\"", "]", ")", "response", "=", "await", "self", ".", "_api", ".", "put...
Renews a TTL-based session Parameters: session (ObjectID): Session ID dc (str): Specify datacenter that will be used. Defaults to the agent's local datacenter. Returns: ObjectMeta: where value is session Raises: NotFound: ses...
[ "Renews", "a", "TTL", "-", "based", "session" ]
02f7a529d7dc2e49bed942111067aa5faf320e90
https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/session_endpoint.py#L198-L237
train
Renews a TTL - based session.
adonisnafeh/urlvalidator
urlvalidator/utils.py
_lazy_re_compile
def _lazy_re_compile(regex, flags=0): """Lazily compile a regex with flags.""" def _compile(): # Compile the regex if it was not passed pre-compiled. if isinstance(regex, str): return re.compile(regex, flags) else: assert not flags, "flags must be empty if regex i...
python
def _lazy_re_compile(regex, flags=0): """Lazily compile a regex with flags.""" def _compile(): # Compile the regex if it was not passed pre-compiled. if isinstance(regex, str): return re.compile(regex, flags) else: assert not flags, "flags must be empty if regex i...
[ "def", "_lazy_re_compile", "(", "regex", ",", "flags", "=", "0", ")", ":", "def", "_compile", "(", ")", ":", "# Compile the regex if it was not passed pre-compiled.", "if", "isinstance", "(", "regex", ",", "str", ")", ":", "return", "re", ".", "compile", "(", ...
Lazily compile a regex with flags.
[ "Lazily", "compile", "a", "regex", "with", "flags", "." ]
008438365faa00b2c580e3991068ec6b161c3578
https://github.com/adonisnafeh/urlvalidator/blob/008438365faa00b2c580e3991068ec6b161c3578/urlvalidator/utils.py#L95-L104
train
Lazy compile a regex with flags.
adonisnafeh/urlvalidator
urlvalidator/utils.py
deconstructible
def deconstructible(*args, path=None): """ Class decorator that allows the decorated class to be serialized by the migrations subsystem. The `path` kwarg specifies the import path. """ def decorator(klass): def __new__(cls, *args, **kwargs): # We capture the arguments to mak...
python
def deconstructible(*args, path=None): """ Class decorator that allows the decorated class to be serialized by the migrations subsystem. The `path` kwarg specifies the import path. """ def decorator(klass): def __new__(cls, *args, **kwargs): # We capture the arguments to mak...
[ "def", "deconstructible", "(", "*", "args", ",", "path", "=", "None", ")", ":", "def", "decorator", "(", "klass", ")", ":", "def", "__new__", "(", "cls", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# We capture the arguments to make returning the...
Class decorator that allows the decorated class to be serialized by the migrations subsystem. The `path` kwarg specifies the import path.
[ "Class", "decorator", "that", "allows", "the", "decorated", "class", "to", "be", "serialized", "by", "the", "migrations", "subsystem", "." ]
008438365faa00b2c580e3991068ec6b161c3578
https://github.com/adonisnafeh/urlvalidator/blob/008438365faa00b2c580e3991068ec6b161c3578/urlvalidator/utils.py#L107-L127
train
Decorator that returns a class that can be serialized by the migrations subsystem.
bitesofcode/projexui
projexui/menus/xmenu.py
XSearchActionWidget.addItems
def addItems(self, menus, processed=None): """ Adds items to the completion tree from the menu. :param menus | [<QMenu>, ..] procesed | [<QAction>, ..] || None """ if processed is None: processed = [] for me...
python
def addItems(self, menus, processed=None): """ Adds items to the completion tree from the menu. :param menus | [<QMenu>, ..] procesed | [<QAction>, ..] || None """ if processed is None: processed = [] for me...
[ "def", "addItems", "(", "self", ",", "menus", ",", "processed", "=", "None", ")", ":", "if", "processed", "is", "None", ":", "processed", "=", "[", "]", "for", "menu", "in", "menus", ":", "for", "action", "in", "menu", ".", "actions", "(", ")", ":"...
Adds items to the completion tree from the menu. :param menus | [<QMenu>, ..] procesed | [<QAction>, ..] || None
[ "Adds", "items", "to", "the", "completion", "tree", "from", "the", "menu", ".", ":", "param", "menus", "|", "[", "<QMenu", ">", "..", "]", "procesed", "|", "[", "<QAction", ">", "..", "]", "||", "None" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/menus/xmenu.py#L122-L148
train
Adds items to the completion tree from the menu.
bitesofcode/projexui
projexui/menus/xmenu.py
XSearchActionWidget.clear
def clear(self): """ Clears the text from the search edit. """ self._searchEdit.blockSignals(True) self._searchEdit.setText('') self._searchEdit.blockSignals(False)
python
def clear(self): """ Clears the text from the search edit. """ self._searchEdit.blockSignals(True) self._searchEdit.setText('') self._searchEdit.blockSignals(False)
[ "def", "clear", "(", "self", ")", ":", "self", ".", "_searchEdit", ".", "blockSignals", "(", "True", ")", "self", ".", "_searchEdit", ".", "setText", "(", "''", ")", "self", ".", "_searchEdit", ".", "blockSignals", "(", "False", ")" ]
Clears the text from the search edit.
[ "Clears", "the", "text", "from", "the", "search", "edit", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/menus/xmenu.py#L150-L156
train
Clears the text from the search edit.
bitesofcode/projexui
projexui/menus/xmenu.py
XSearchActionWidget.eventFilter
def eventFilter(self, object, event): """ Listens for the key press event from the tree widget to pass along to the line edit. :param object | <QWidget> event | <QEvent> :return <bool> | consumed """ if eve...
python
def eventFilter(self, object, event): """ Listens for the key press event from the tree widget to pass along to the line edit. :param object | <QWidget> event | <QEvent> :return <bool> | consumed """ if eve...
[ "def", "eventFilter", "(", "self", ",", "object", ",", "event", ")", ":", "if", "event", ".", "type", "(", ")", "==", "event", ".", "KeyPress", ":", "if", "event", ".", "key", "(", ")", "==", "Qt", ".", "Key_Escape", ":", "self", ".", "_completer",...
Listens for the key press event from the tree widget to pass along to the line edit. :param object | <QWidget> event | <QEvent> :return <bool> | consumed
[ "Listens", "for", "the", "key", "press", "event", "from", "the", "tree", "widget", "to", "pass", "along", "to", "the", "line", "edit", ".", ":", "param", "object", "|", "<QWidget", ">", "event", "|", "<QEvent", ">", ":", "return", "<bool", ">", "|", ...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/menus/xmenu.py#L166-L188
train
Filter out the related items for the given event.
bitesofcode/projexui
projexui/menus/xmenu.py
XSearchActionWidget.filterOptions
def filterOptions(self, text): """ Filters the searched actions based on the inputed text. :param text | <str> """ if not text: self._completer.hide() self._completer.setCurrentItem(None) return # block the sig...
python
def filterOptions(self, text): """ Filters the searched actions based on the inputed text. :param text | <str> """ if not text: self._completer.hide() self._completer.setCurrentItem(None) return # block the sig...
[ "def", "filterOptions", "(", "self", ",", "text", ")", ":", "if", "not", "text", ":", "self", ".", "_completer", ".", "hide", "(", ")", "self", ".", "_completer", ".", "setCurrentItem", "(", "None", ")", "return", "# block the signals\r", "self", ".", "_...
Filters the searched actions based on the inputed text. :param text | <str>
[ "Filters", "the", "searched", "actions", "based", "on", "the", "inputed", "text", ".", ":", "param", "text", "|", "<str", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/menus/xmenu.py#L190-L234
train
Filters the searched actions based on the inputed text.
bitesofcode/projexui
projexui/menus/xmenu.py
XSearchActionWidget.triggerItem
def triggerItem(self, item): """ Triggers the item by calling its action's toggled state to display or hide the dock panel. :param item | <QtGui.QTreeWidgetItem> """ if not item: return # emit the trigger action ...
python
def triggerItem(self, item): """ Triggers the item by calling its action's toggled state to display or hide the dock panel. :param item | <QtGui.QTreeWidgetItem> """ if not item: return # emit the trigger action ...
[ "def", "triggerItem", "(", "self", ",", "item", ")", ":", "if", "not", "item", ":", "return", "# emit the trigger action\r", "self", ".", "_triggerText", "=", "item", ".", "text", "(", "0", ")", "self", ".", "_completer", ".", "hide", "(", ")", "self", ...
Triggers the item by calling its action's toggled state to display or hide the dock panel. :param item | <QtGui.QTreeWidgetItem>
[ "Triggers", "the", "item", "by", "calling", "its", "action", "s", "toggled", "state", "to", "display", "or", "hide", "the", "dock", "panel", ".", ":", "param", "item", "|", "<QtGui", ".", "QTreeWidgetItem", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/menus/xmenu.py#L252-L269
train
Triggers the item by calling its action s toggled state to display or hide the dock panel.
bitesofcode/projexui
projexui/menus/xmenu.py
XMenu.addMenu
def addMenu(self, submenu): """ Adds a new submenu to this menu. Overloads the base QMenu addMenu \ method so that it will return an XMenu instance vs. a QMenu when \ creating a submenu by passing in a string. :param submenu | <str> || <QMenu> :ret...
python
def addMenu(self, submenu): """ Adds a new submenu to this menu. Overloads the base QMenu addMenu \ method so that it will return an XMenu instance vs. a QMenu when \ creating a submenu by passing in a string. :param submenu | <str> || <QMenu> :ret...
[ "def", "addMenu", "(", "self", ",", "submenu", ")", ":", "# create a new submenu based on a string input", "if", "not", "isinstance", "(", "submenu", ",", "QMenu", ")", ":", "title", "=", "nativestring", "(", "submenu", ")", "submenu", "=", "XMenu", "(", "self...
Adds a new submenu to this menu. Overloads the base QMenu addMenu \ method so that it will return an XMenu instance vs. a QMenu when \ creating a submenu by passing in a string. :param submenu | <str> || <QMenu> :return <QMenu>
[ "Adds", "a", "new", "submenu", "to", "this", "menu", ".", "Overloads", "the", "base", "QMenu", "addMenu", "\\", "method", "so", "that", "it", "will", "return", "an", "XMenu", "instance", "vs", ".", "a", "QMenu", "when", "\\", "creating", "a", "submenu", ...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/menus/xmenu.py#L309-L331
train
Adds a new submenu to this menu.
bitesofcode/projexui
projexui/menus/xmenu.py
XMenu.addSection
def addSection(self, section): """ Adds a section to this menu. A section will create a label for the menu to separate sections of the menu out. :param section | <str> """ label = QLabel(section, self) label.setMinimumHeight(self.titleHeight...
python
def addSection(self, section): """ Adds a section to this menu. A section will create a label for the menu to separate sections of the menu out. :param section | <str> """ label = QLabel(section, self) label.setMinimumHeight(self.titleHeight...
[ "def", "addSection", "(", "self", ",", "section", ")", ":", "label", "=", "QLabel", "(", "section", ",", "self", ")", "label", ".", "setMinimumHeight", "(", "self", ".", "titleHeight", "(", ")", ")", "# setup font\r", "font", "=", "label", ".", "font", ...
Adds a section to this menu. A section will create a label for the menu to separate sections of the menu out. :param section | <str>
[ "Adds", "a", "section", "to", "this", "menu", ".", "A", "section", "will", "create", "a", "label", "for", "the", "menu", "to", "separate", "sections", "of", "the", "menu", "out", ".", ":", "param", "section", "|", "<str", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/menus/xmenu.py#L344-L372
train
Adds a section to the menu.
bitesofcode/projexui
projexui/menus/xmenu.py
XMenu.adjustMinimumWidth
def adjustMinimumWidth( self ): """ Updates the minimum width for this menu based on the font metrics \ for its title (if its shown). This method is called automatically \ when the menu is shown. """ if not self.showTitle(): return metrics = ...
python
def adjustMinimumWidth( self ): """ Updates the minimum width for this menu based on the font metrics \ for its title (if its shown). This method is called automatically \ when the menu is shown. """ if not self.showTitle(): return metrics = ...
[ "def", "adjustMinimumWidth", "(", "self", ")", ":", "if", "not", "self", ".", "showTitle", "(", ")", ":", "return", "metrics", "=", "QFontMetrics", "(", "self", ".", "font", "(", ")", ")", "width", "=", "metrics", ".", "width", "(", "self", ".", "tit...
Updates the minimum width for this menu based on the font metrics \ for its title (if its shown). This method is called automatically \ when the menu is shown.
[ "Updates", "the", "minimum", "width", "for", "this", "menu", "based", "on", "the", "font", "metrics", "\\", "for", "its", "title", "(", "if", "its", "shown", ")", ".", "This", "method", "is", "called", "automatically", "\\", "when", "the", "menu", "is", ...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/menus/xmenu.py#L374-L387
train
Adjusts the minimum width for this item based on the font metrics of the menu s title.
bitesofcode/projexui
projexui/menus/xmenu.py
XMenu.clearAdvancedActions
def clearAdvancedActions( self ): """ Clears out the advanced action map. """ self._advancedMap.clear() margins = list(self.getContentsMargins()) margins[2] = 0 self.setContentsMargins(*margins)
python
def clearAdvancedActions( self ): """ Clears out the advanced action map. """ self._advancedMap.clear() margins = list(self.getContentsMargins()) margins[2] = 0 self.setContentsMargins(*margins)
[ "def", "clearAdvancedActions", "(", "self", ")", ":", "self", ".", "_advancedMap", ".", "clear", "(", ")", "margins", "=", "list", "(", "self", ".", "getContentsMargins", "(", ")", ")", "margins", "[", "2", "]", "=", "0", "self", ".", "setContentsMargins...
Clears out the advanced action map.
[ "Clears", "out", "the", "advanced", "action", "map", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/menus/xmenu.py#L389-L396
train
Clears out the advanced action map.
bitesofcode/projexui
projexui/menus/xmenu.py
XMenu.customData
def customData( self, key, default = None ): """ Returns data that has been stored on this menu. :param key | <str> default | <variant> :return <variant> """ key = nativestring(key) menu = self whil...
python
def customData( self, key, default = None ): """ Returns data that has been stored on this menu. :param key | <str> default | <variant> :return <variant> """ key = nativestring(key) menu = self whil...
[ "def", "customData", "(", "self", ",", "key", ",", "default", "=", "None", ")", ":", "key", "=", "nativestring", "(", "key", ")", "menu", "=", "self", "while", "(", "not", "key", "in", "menu", ".", "_customData", "and", "isinstance", "(", "menu", "."...
Returns data that has been stored on this menu. :param key | <str> default | <variant> :return <variant>
[ "Returns", "data", "that", "has", "been", "stored", "on", "this", "menu", ".", ":", "param", "key", "|", "<str", ">", "default", "|", "<variant", ">", ":", "return", "<variant", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/menus/xmenu.py#L401-L416
train
Returns the custom data for the given key.
bitesofcode/projexui
projexui/menus/xmenu.py
XMenu.paintEvent
def paintEvent( self, event ): """ Overloads the paint event for this menu to draw its title based on its \ show title property. :param event | <QPaintEvent> """ super(XMenu, self).paintEvent(event) if self.showTitle(): with XPai...
python
def paintEvent( self, event ): """ Overloads the paint event for this menu to draw its title based on its \ show title property. :param event | <QPaintEvent> """ super(XMenu, self).paintEvent(event) if self.showTitle(): with XPai...
[ "def", "paintEvent", "(", "self", ",", "event", ")", ":", "super", "(", "XMenu", ",", "self", ")", ".", "paintEvent", "(", "event", ")", "if", "self", ".", "showTitle", "(", ")", ":", "with", "XPainter", "(", "self", ")", "as", "painter", ":", "pal...
Overloads the paint event for this menu to draw its title based on its \ show title property. :param event | <QPaintEvent>
[ "Overloads", "the", "paint", "event", "for", "this", "menu", "to", "draw", "its", "title", "based", "on", "its", "\\", "show", "title", "property", ".", ":", "param", "event", "|", "<QPaintEvent", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/menus/xmenu.py#L418-L438
train
Overloads the paint event for this menu based on its show title property.
bitesofcode/projexui
projexui/menus/xmenu.py
XMenu.rebuildButtons
def rebuildButtons(self): """ Rebuilds the buttons for the advanced actions. """ for btn in self.findChildren(XAdvancedButton): btn.close() btn.setParent(None) btn.deleteLater() for standard, advanced in self._advancedMap.items(): ...
python
def rebuildButtons(self): """ Rebuilds the buttons for the advanced actions. """ for btn in self.findChildren(XAdvancedButton): btn.close() btn.setParent(None) btn.deleteLater() for standard, advanced in self._advancedMap.items(): ...
[ "def", "rebuildButtons", "(", "self", ")", ":", "for", "btn", "in", "self", ".", "findChildren", "(", "XAdvancedButton", ")", ":", "btn", ".", "close", "(", ")", "btn", ".", "setParent", "(", "None", ")", "btn", ".", "deleteLater", "(", ")", "for", "...
Rebuilds the buttons for the advanced actions.
[ "Rebuilds", "the", "buttons", "for", "the", "advanced", "actions", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/menus/xmenu.py#L440-L462
train
Rebuilds the buttons for the advanced actions.
bitesofcode/projexui
projexui/menus/xmenu.py
XMenu.setAdvancedAction
def setAdvancedAction(self, standardAction, advancedAction): """ Links an advanced action with the inputed standard action. This will \ create a tool button alongside the inputed standard action when the \ menu is displayed. If the user selects the advanced action, then the \ a...
python
def setAdvancedAction(self, standardAction, advancedAction): """ Links an advanced action with the inputed standard action. This will \ create a tool button alongside the inputed standard action when the \ menu is displayed. If the user selects the advanced action, then the \ a...
[ "def", "setAdvancedAction", "(", "self", ",", "standardAction", ",", "advancedAction", ")", ":", "if", "advancedAction", ":", "self", ".", "_advancedMap", "[", "standardAction", "]", "=", "advancedAction", "margins", "=", "list", "(", "self", ".", "getContentsMa...
Links an advanced action with the inputed standard action. This will \ create a tool button alongside the inputed standard action when the \ menu is displayed. If the user selects the advanced action, then the \ advancedAction.triggered signal will be emitted. :param stan...
[ "Links", "an", "advanced", "action", "with", "the", "inputed", "standard", "action", ".", "This", "will", "\\", "create", "a", "tool", "button", "alongside", "the", "inputed", "standard", "action", "when", "the", "\\", "menu", "is", "displayed", ".", "If", ...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/menus/xmenu.py#L464-L485
train
Sets the advanced action for the inputed standard action.
bitesofcode/projexui
projexui/menus/xmenu.py
XMenu.setShowTitle
def setShowTitle( self, state ): """ Sets whether or not the title for this menu should be displayed in the \ popup. :param state | <bool> """ self._showTitle = state margins = list(self.getContentsMargins()) if state: ma...
python
def setShowTitle( self, state ): """ Sets whether or not the title for this menu should be displayed in the \ popup. :param state | <bool> """ self._showTitle = state margins = list(self.getContentsMargins()) if state: ma...
[ "def", "setShowTitle", "(", "self", ",", "state", ")", ":", "self", ".", "_showTitle", "=", "state", "margins", "=", "list", "(", "self", ".", "getContentsMargins", "(", ")", ")", "if", "state", ":", "margins", "[", "1", "]", "=", "self", ".", "title...
Sets whether or not the title for this menu should be displayed in the \ popup. :param state | <bool>
[ "Sets", "whether", "or", "not", "the", "title", "for", "this", "menu", "should", "be", "displayed", "in", "the", "\\", "popup", ".", ":", "param", "state", "|", "<bool", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/menus/xmenu.py#L496-L511
train
Sets whether or not the title for this popup should be displayed in the \ jsMenu \ s main.
bitesofcode/projexui
projexui/menus/xmenu.py
XMenu.showEvent
def showEvent(self, event): """ Overloads the set visible method to update the advanced action buttons \ to match their corresponding standard action location. :param state | <bool> """ super(XMenu, self).showEvent(event) self.adjustSize()...
python
def showEvent(self, event): """ Overloads the set visible method to update the advanced action buttons \ to match their corresponding standard action location. :param state | <bool> """ super(XMenu, self).showEvent(event) self.adjustSize()...
[ "def", "showEvent", "(", "self", ",", "event", ")", ":", "super", "(", "XMenu", ",", "self", ")", ".", "showEvent", "(", "event", ")", "self", ".", "adjustSize", "(", ")", "self", ".", "adjustMinimumWidth", "(", ")", "self", ".", "rebuildButtons", "(",...
Overloads the set visible method to update the advanced action buttons \ to match their corresponding standard action location. :param state | <bool>
[ "Overloads", "the", "set", "visible", "method", "to", "update", "the", "advanced", "action", "buttons", "\\", "to", "match", "their", "corresponding", "standard", "action", "location", ".", ":", "param", "state", "|", "<bool", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/menus/xmenu.py#L513-L524
train
Overloads the showEvent method to update the advanced action buttons to match their corresponding standard action location.
bitesofcode/projexui
projexui/menus/xmenu.py
XMenu.showActionToolTip
def showActionToolTip(self): """ Shows the tool tip of the action that is currently being hovered over. :param action | <QAction> """ if ( not self.isVisible() ): return geom = self.actionGeometry(self._toolTipAction) pos ...
python
def showActionToolTip(self): """ Shows the tool tip of the action that is currently being hovered over. :param action | <QAction> """ if ( not self.isVisible() ): return geom = self.actionGeometry(self._toolTipAction) pos ...
[ "def", "showActionToolTip", "(", "self", ")", ":", "if", "(", "not", "self", ".", "isVisible", "(", ")", ")", ":", "return", "geom", "=", "self", ".", "actionGeometry", "(", "self", ".", "_toolTipAction", ")", "pos", "=", "self", ".", "mapToGlobal", "(...
Shows the tool tip of the action that is currently being hovered over. :param action | <QAction>
[ "Shows", "the", "tool", "tip", "of", "the", "action", "that", "is", "currently", "being", "hovered", "over", ".", ":", "param", "action", "|", "<QAction", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/menus/xmenu.py#L534-L554
train
Shows the tool tip of the action that is currently being hovered over.
bitesofcode/projexui
projexui/menus/xmenu.py
XMenu.startActionToolTip
def startActionToolTip( self, action ): """ Starts the timer to hover over an action for the current tool tip. :param action | <QAction> """ self._toolTipTimer.stop() QToolTip.hideText() if not action.toolTip(): return ...
python
def startActionToolTip( self, action ): """ Starts the timer to hover over an action for the current tool tip. :param action | <QAction> """ self._toolTipTimer.stop() QToolTip.hideText() if not action.toolTip(): return ...
[ "def", "startActionToolTip", "(", "self", ",", "action", ")", ":", "self", ".", "_toolTipTimer", ".", "stop", "(", ")", "QToolTip", ".", "hideText", "(", ")", "if", "not", "action", ".", "toolTip", "(", ")", ":", "return", "self", ".", "_toolTipAction", ...
Starts the timer to hover over an action for the current tool tip. :param action | <QAction>
[ "Starts", "the", "timer", "to", "hover", "over", "an", "action", "for", "the", "current", "tool", "tip", ".", ":", "param", "action", "|", "<QAction", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/menus/xmenu.py#L564-L577
train
Starts the timer to hover over an action for the current tool tip.
bitesofcode/projexui
projexui/menus/xmenu.py
XMenu.fromString
def fromString( parent, xmlstring, actions = None ): """ Loads the xml string as xml data and then calls the fromXml method. :param parent | <QWidget> xmlstring | <str> actions | {<str> name: <QAction>, .. } || None :retu...
python
def fromString( parent, xmlstring, actions = None ): """ Loads the xml string as xml data and then calls the fromXml method. :param parent | <QWidget> xmlstring | <str> actions | {<str> name: <QAction>, .. } || None :retu...
[ "def", "fromString", "(", "parent", ",", "xmlstring", ",", "actions", "=", "None", ")", ":", "try", ":", "xdata", "=", "ElementTree", ".", "fromstring", "(", "xmlstring", ")", "except", "ExpatError", ",", "e", ":", "logger", ".", "exception", "(", "e", ...
Loads the xml string as xml data and then calls the fromXml method. :param parent | <QWidget> xmlstring | <str> actions | {<str> name: <QAction>, .. } || None :return <XMenu> || None
[ "Loads", "the", "xml", "string", "as", "xml", "data", "and", "then", "calls", "the", "fromXml", "method", ".", ":", "param", "parent", "|", "<QWidget", ">", "xmlstring", "|", "<str", ">", "actions", "|", "{", "<str", ">", "name", ":", "<QAction", ">", ...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/menus/xmenu.py#L599-L616
train
Loads the xml string as xml data and calls the fromXml method.
bitesofcode/projexui
projexui/menus/xmenu.py
XMenu.fromXml
def fromXml( parent, xml, actions = None ): """ Generates an XMenu from the inputed xml data and returns the resulting \ menu. If no action dictionary is supplied, it will be generated based \ on the parents actions. :param parent | <QWidget> ...
python
def fromXml( parent, xml, actions = None ): """ Generates an XMenu from the inputed xml data and returns the resulting \ menu. If no action dictionary is supplied, it will be generated based \ on the parents actions. :param parent | <QWidget> ...
[ "def", "fromXml", "(", "parent", ",", "xml", ",", "actions", "=", "None", ")", ":", "# generate the actions off the parent", "if", "(", "actions", "is", "None", ")", ":", "actions", "=", "{", "}", "for", "action", "in", "parent", ".", "actions", "(", ")"...
Generates an XMenu from the inputed xml data and returns the resulting \ menu. If no action dictionary is supplied, it will be generated based \ on the parents actions. :param parent | <QWidget> xml | <xml.etree.ElementTree.Element> ...
[ "Generates", "an", "XMenu", "from", "the", "inputed", "xml", "data", "and", "returns", "the", "resulting", "\\", "menu", ".", "If", "no", "action", "dictionary", "is", "supplied", "it", "will", "be", "generated", "based", "\\", "on", "the", "parents", "act...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/menus/xmenu.py#L619-L659
train
Generates an XMenu from the inputed xml data and returns the resulting XMenu.
bitesofcode/projexui
projexui/widgets/xcalendarwidget/xcalendarscene.py
XCalendarScene.addItem
def addItem( self, item ): """ Adds the item to the scene and redraws the item. :param item | <QGraphicsItem> """ result = super(XCalendarScene, self).addItem(item) if ( isinstance(item, XCalendarItem) ): item.rebuild() ...
python
def addItem( self, item ): """ Adds the item to the scene and redraws the item. :param item | <QGraphicsItem> """ result = super(XCalendarScene, self).addItem(item) if ( isinstance(item, XCalendarItem) ): item.rebuild() ...
[ "def", "addItem", "(", "self", ",", "item", ")", ":", "result", "=", "super", "(", "XCalendarScene", ",", "self", ")", ".", "addItem", "(", "item", ")", "if", "(", "isinstance", "(", "item", ",", "XCalendarItem", ")", ")", ":", "item", ".", "rebuild"...
Adds the item to the scene and redraws the item. :param item | <QGraphicsItem>
[ "Adds", "the", "item", "to", "the", "scene", "and", "redraws", "the", "item", ".", ":", "param", "item", "|", "<QGraphicsItem", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcalendarwidget/xcalendarscene.py#L70-L81
train
Adds the item to the scene and redraws the item if necessary.
bitesofcode/projexui
projexui/widgets/xcalendarwidget/xcalendarscene.py
XCalendarScene.dateAt
def dateAt( self, point ): """ Returns the date at the given point. :param point | <QPoint> """ for date, data in self._dateGrid.items(): if ( data[1].contains(point) ): return QDate.fromJulianDay(date) return QDate()
python
def dateAt( self, point ): """ Returns the date at the given point. :param point | <QPoint> """ for date, data in self._dateGrid.items(): if ( data[1].contains(point) ): return QDate.fromJulianDay(date) return QDate()
[ "def", "dateAt", "(", "self", ",", "point", ")", ":", "for", "date", ",", "data", "in", "self", ".", "_dateGrid", ".", "items", "(", ")", ":", "if", "(", "data", "[", "1", "]", ".", "contains", "(", "point", ")", ")", ":", "return", "QDate", "....
Returns the date at the given point. :param point | <QPoint>
[ "Returns", "the", "date", "at", "the", "given", "point", ".", ":", "param", "point", "|", "<QPoint", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcalendarwidget/xcalendarscene.py#L99-L108
train
Returns the date at the given point.
bitesofcode/projexui
projexui/widgets/xcalendarwidget/xcalendarscene.py
XCalendarScene.dateTimeAt
def dateTimeAt( self, point ): """ Returns the date time at the inputed point. :param point | <QPoint> """ for dtime, data in self._dateTimeGrid.items(): if ( data[1].contains(point) ): return QDateTime.fromTime_t(dtime) ...
python
def dateTimeAt( self, point ): """ Returns the date time at the inputed point. :param point | <QPoint> """ for dtime, data in self._dateTimeGrid.items(): if ( data[1].contains(point) ): return QDateTime.fromTime_t(dtime) ...
[ "def", "dateTimeAt", "(", "self", ",", "point", ")", ":", "for", "dtime", ",", "data", "in", "self", ".", "_dateTimeGrid", ".", "items", "(", ")", ":", "if", "(", "data", "[", "1", "]", ".", "contains", "(", "point", ")", ")", ":", "return", "QDa...
Returns the date time at the inputed point. :param point | <QPoint>
[ "Returns", "the", "date", "time", "at", "the", "inputed", "point", ".", ":", "param", "point", "|", "<QPoint", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcalendarwidget/xcalendarscene.py#L110-L119
train
Returns the date time at the inputed point.
bitesofcode/projexui
projexui/widgets/xcalendarwidget/xcalendarscene.py
XCalendarScene.dateRect
def dateRect( self, date ): """ Returns the rect that is defined by the inputed date. :return <QRectF> """ data = self._dateGrid.get(date.toJulianDay()) if ( data ): return QRectF(data[1]) return QRectF()
python
def dateRect( self, date ): """ Returns the rect that is defined by the inputed date. :return <QRectF> """ data = self._dateGrid.get(date.toJulianDay()) if ( data ): return QRectF(data[1]) return QRectF()
[ "def", "dateRect", "(", "self", ",", "date", ")", ":", "data", "=", "self", ".", "_dateGrid", ".", "get", "(", "date", ".", "toJulianDay", "(", ")", ")", "if", "(", "data", ")", ":", "return", "QRectF", "(", "data", "[", "1", "]", ")", "return", ...
Returns the rect that is defined by the inputed date. :return <QRectF>
[ "Returns", "the", "rect", "that", "is", "defined", "by", "the", "inputed", "date", ".", ":", "return", "<QRectF", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcalendarwidget/xcalendarscene.py#L121-L130
train
Returns the rect that is defined by the inputed date.
bitesofcode/projexui
projexui/widgets/xcalendarwidget/xcalendarscene.py
XCalendarScene.dateTimeRect
def dateTimeRect( self, dateTime ): """ Returns the rect that is defined by the inputed date time. :return <QRectF> """ data = self._dateTimeGrid.get(dateTime.toTime_t()) if ( data ): return QRectF(data[1]) return QRectF()
python
def dateTimeRect( self, dateTime ): """ Returns the rect that is defined by the inputed date time. :return <QRectF> """ data = self._dateTimeGrid.get(dateTime.toTime_t()) if ( data ): return QRectF(data[1]) return QRectF()
[ "def", "dateTimeRect", "(", "self", ",", "dateTime", ")", ":", "data", "=", "self", ".", "_dateTimeGrid", ".", "get", "(", "dateTime", ".", "toTime_t", "(", ")", ")", "if", "(", "data", ")", ":", "return", "QRectF", "(", "data", "[", "1", "]", ")",...
Returns the rect that is defined by the inputed date time. :return <QRectF>
[ "Returns", "the", "rect", "that", "is", "defined", "by", "the", "inputed", "date", "time", ".", ":", "return", "<QRectF", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcalendarwidget/xcalendarscene.py#L132-L141
train
Returns the rect that is defined by the inputed date time.
bitesofcode/projexui
projexui/widgets/xcalendarwidget/xcalendarscene.py
XCalendarScene.drawBackground
def drawBackground( self, painter, rect ): """ Draws the background of the scene using painter. :param painter | <QPainter> rect | <QRectF> """ if ( self._rebuildRequired ): self.rebuild() super(XCalendarScene, ...
python
def drawBackground( self, painter, rect ): """ Draws the background of the scene using painter. :param painter | <QPainter> rect | <QRectF> """ if ( self._rebuildRequired ): self.rebuild() super(XCalendarScene, ...
[ "def", "drawBackground", "(", "self", ",", "painter", ",", "rect", ")", ":", "if", "(", "self", ".", "_rebuildRequired", ")", ":", "self", ".", "rebuild", "(", ")", "super", "(", "XCalendarScene", ",", "self", ")", ".", "drawBackground", "(", "painter", ...
Draws the background of the scene using painter. :param painter | <QPainter> rect | <QRectF>
[ "Draws", "the", "background", "of", "the", "scene", "using", "painter", ".", ":", "param", "painter", "|", "<QPainter", ">", "rect", "|", "<QRectF", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcalendarwidget/xcalendarscene.py#L143-L186
train
Draws the background of the calendar.
bitesofcode/projexui
projexui/widgets/xcalendarwidget/xcalendarscene.py
XCalendarScene.helpEvent
def helpEvent( self, event ): """ Displays a tool tip for the given help event. :param event | <QHelpEvent> """ item = self.itemAt(event.scenePos()) if ( item and item and item.toolTip() ): parent = self.parent() rect = it...
python
def helpEvent( self, event ): """ Displays a tool tip for the given help event. :param event | <QHelpEvent> """ item = self.itemAt(event.scenePos()) if ( item and item and item.toolTip() ): parent = self.parent() rect = it...
[ "def", "helpEvent", "(", "self", ",", "event", ")", ":", "item", "=", "self", ".", "itemAt", "(", "event", ".", "scenePos", "(", ")", ")", "if", "(", "item", "and", "item", "and", "item", ".", "toolTip", "(", ")", ")", ":", "parent", "=", "self",...
Displays a tool tip for the given help event. :param event | <QHelpEvent>
[ "Displays", "a", "tool", "tip", "for", "the", "given", "help", "event", ".", ":", "param", "event", "|", "<QHelpEvent", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcalendarwidget/xcalendarscene.py#L188-L209
train
Displays a tool tip for the given event.
bitesofcode/projexui
projexui/widgets/xcalendarwidget/xcalendarscene.py
XCalendarScene.mousePressEvent
def mousePressEvent( self, event ): """ Changes the current date to the clicked on date. :param event | <QMousePressEvent> """ XPopupWidget.hideToolTip() # update the current date self.setCurrentDate(self.dateAt(event.scenePos())) ...
python
def mousePressEvent( self, event ): """ Changes the current date to the clicked on date. :param event | <QMousePressEvent> """ XPopupWidget.hideToolTip() # update the current date self.setCurrentDate(self.dateAt(event.scenePos())) ...
[ "def", "mousePressEvent", "(", "self", ",", "event", ")", ":", "XPopupWidget", ".", "hideToolTip", "(", ")", "# update the current date\r", "self", ".", "setCurrentDate", "(", "self", ".", "dateAt", "(", "event", ".", "scenePos", "(", ")", ")", ")", "super",...
Changes the current date to the clicked on date. :param event | <QMousePressEvent>
[ "Changes", "the", "current", "date", "to", "the", "clicked", "on", "date", ".", ":", "param", "event", "|", "<QMousePressEvent", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcalendarwidget/xcalendarscene.py#L230-L241
train
Updates the current date to the clicked on date.
bitesofcode/projexui
projexui/widgets/xcalendarwidget/xcalendarscene.py
XCalendarScene.rebuild
def rebuild( self ): """ Rebuilds the information for this scene. """ self._buildData.clear() self._dateGrid.clear() self._dateTimeGrid.clear() curr_min = self._minimumDate curr_max = self._maximumDate self._maximumDate...
python
def rebuild( self ): """ Rebuilds the information for this scene. """ self._buildData.clear() self._dateGrid.clear() self._dateTimeGrid.clear() curr_min = self._minimumDate curr_max = self._maximumDate self._maximumDate...
[ "def", "rebuild", "(", "self", ")", ":", "self", ".", "_buildData", ".", "clear", "(", ")", "self", ".", "_dateGrid", ".", "clear", "(", ")", "self", ".", "_dateTimeGrid", ".", "clear", "(", ")", "curr_min", "=", "self", ".", "_minimumDate", "curr_max"...
Rebuilds the information for this scene.
[ "Rebuilds", "the", "information", "for", "this", "scene", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcalendarwidget/xcalendarscene.py#L253-L290
train
Rebuilds the information for this scene.
bitesofcode/projexui
projexui/widgets/xcalendarwidget/xcalendarscene.py
XCalendarScene.rebuildMonth
def rebuildMonth( self ): """ Rebuilds the month for this scene. """ # make sure we start at 0 for sunday vs. 7 for sunday day_map = dict([(i+1, i+1) for i in range(7)]) day_map[7] = 0 today = QDate.currentDate() curr = self.cur...
python
def rebuildMonth( self ): """ Rebuilds the month for this scene. """ # make sure we start at 0 for sunday vs. 7 for sunday day_map = dict([(i+1, i+1) for i in range(7)]) day_map[7] = 0 today = QDate.currentDate() curr = self.cur...
[ "def", "rebuildMonth", "(", "self", ")", ":", "# make sure we start at 0 for sunday vs. 7 for sunday\r", "day_map", "=", "dict", "(", "[", "(", "i", "+", "1", ",", "i", "+", "1", ")", "for", "i", "in", "range", "(", "7", ")", "]", ")", "day_map", "[", ...
Rebuilds the month for this scene.
[ "Rebuilds", "the", "month", "for", "this", "scene", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcalendarwidget/xcalendarscene.py#L292-L406
train
Rebuilds the month for this scene.
bitesofcode/projexui
projexui/widgets/xcalendarwidget/xcalendarscene.py
XCalendarScene.rebuildDays
def rebuildDays( self ): """ Rebuilds the interface as a week display. """ time = QTime(0, 0, 0) hour = True x = 6 y = 6 + 24 w = self.width() - 12 - 25 dh = 48 indent = 58 text_d...
python
def rebuildDays( self ): """ Rebuilds the interface as a week display. """ time = QTime(0, 0, 0) hour = True x = 6 y = 6 + 24 w = self.width() - 12 - 25 dh = 48 indent = 58 text_d...
[ "def", "rebuildDays", "(", "self", ")", ":", "time", "=", "QTime", "(", "0", ",", "0", ",", "0", ")", "hour", "=", "True", "x", "=", "6", "y", "=", "6", "+", "24", "w", "=", "self", ".", "width", "(", ")", "-", "12", "-", "25", "dh", "=",...
Rebuilds the interface as a week display.
[ "Rebuilds", "the", "interface", "as", "a", "week", "display", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcalendarwidget/xcalendarscene.py#L408-L536
train
Rebuilds the interface as a week display.
bitesofcode/projexui
projexui/widgets/xcalendarwidget/xcalendarscene.py
XCalendarScene.setCurrentDate
def setCurrentDate( self, date ): """ Sets the current date displayed by this calendar widget. :return <QDate> """ if ( date == self._currentDate or not date.isValid() ): return self._currentDate = date self.markForRebuild() ...
python
def setCurrentDate( self, date ): """ Sets the current date displayed by this calendar widget. :return <QDate> """ if ( date == self._currentDate or not date.isValid() ): return self._currentDate = date self.markForRebuild() ...
[ "def", "setCurrentDate", "(", "self", ",", "date", ")", ":", "if", "(", "date", "==", "self", ".", "_currentDate", "or", "not", "date", ".", "isValid", "(", ")", ")", ":", "return", "self", ".", "_currentDate", "=", "date", "self", ".", "markForRebuild...
Sets the current date displayed by this calendar widget. :return <QDate>
[ "Sets", "the", "current", "date", "displayed", "by", "this", "calendar", "widget", ".", ":", "return", "<QDate", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcalendarwidget/xcalendarscene.py#L538-L553
train
Sets the current date displayed by this calendar widget.
bitesofcode/projexui
projexui/widgets/xcalendarwidget/xcalendarscene.py
XCalendarScene.setSceneRect
def setSceneRect( self, *args ): """ Updates the scene rect for this item. :param *args """ h = self.height() super(XCalendarScene, self).setSceneRect(*args) if ( self.currentMode() != XCalendarScene.Mode.Month ): rect = self.sce...
python
def setSceneRect( self, *args ): """ Updates the scene rect for this item. :param *args """ h = self.height() super(XCalendarScene, self).setSceneRect(*args) if ( self.currentMode() != XCalendarScene.Mode.Month ): rect = self.sce...
[ "def", "setSceneRect", "(", "self", ",", "*", "args", ")", ":", "h", "=", "self", ".", "height", "(", ")", "super", "(", "XCalendarScene", ",", "self", ")", ".", "setSceneRect", "(", "*", "args", ")", "if", "(", "self", ".", "currentMode", "(", ")"...
Updates the scene rect for this item. :param *args
[ "Updates", "the", "scene", "rect", "for", "this", "item", ".", ":", "param", "*", "args" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcalendarwidget/xcalendarscene.py#L564-L577
train
Updates the scene rect for this item.
bitesofcode/projexui
projexui/widgets/xcalendarwidget/xcalendarscene.py
XCalendarScene.title
def title( self ): """ Returns the title for this scene based on its information. :return <str> """ if ( self.currentMode() == XCalendarScene.Mode.Day ): return self.currentDate().toString('dddd, MMMM dd, yyyy') elif ( self.curre...
python
def title( self ): """ Returns the title for this scene based on its information. :return <str> """ if ( self.currentMode() == XCalendarScene.Mode.Day ): return self.currentDate().toString('dddd, MMMM dd, yyyy') elif ( self.curre...
[ "def", "title", "(", "self", ")", ":", "if", "(", "self", ".", "currentMode", "(", ")", "==", "XCalendarScene", ".", "Mode", ".", "Day", ")", ":", "return", "self", ".", "currentDate", "(", ")", ".", "toString", "(", "'dddd, MMMM dd, yyyy'", ")", "elif...
Returns the title for this scene based on its information. :return <str>
[ "Returns", "the", "title", "for", "this", "scene", "based", "on", "its", "information", ".", ":", "return", "<str", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcalendarwidget/xcalendarscene.py#L588-L607
train
Returns the title for this scene based on its information.
intelsdi-x/snap-plugin-lib-py
snap_plugin/v1/timestamp.py
Timestamp.set
def set(self, time): """Sets time in seconds since Epoch Args: time (:obj:`float`): time in seconds since Epoch (see time.time()) Returns: None """ self._time = time self._pb.sec = int(self._time) self._pb.nsec = int((self._time - self._p...
python
def set(self, time): """Sets time in seconds since Epoch Args: time (:obj:`float`): time in seconds since Epoch (see time.time()) Returns: None """ self._time = time self._pb.sec = int(self._time) self._pb.nsec = int((self._time - self._p...
[ "def", "set", "(", "self", ",", "time", ")", ":", "self", ".", "_time", "=", "time", "self", ".", "_pb", ".", "sec", "=", "int", "(", "self", ".", "_time", ")", "self", ".", "_pb", ".", "nsec", "=", "int", "(", "(", "self", ".", "_time", "-",...
Sets time in seconds since Epoch Args: time (:obj:`float`): time in seconds since Epoch (see time.time()) Returns: None
[ "Sets", "time", "in", "seconds", "since", "Epoch" ]
8da5d00ac5f9d2b48a7239563ac7788209891ca4
https://github.com/intelsdi-x/snap-plugin-lib-py/blob/8da5d00ac5f9d2b48a7239563ac7788209891ca4/snap_plugin/v1/timestamp.py#L56-L67
train
Sets the time in seconds since Epoch.
whiteclover/dbpy
db/query/expr.py
Expr.compile
def compile(self, db): """Building the sql expression :param db: the database instance """ sql = self.expression if self.alias: sql += (' AS ' + db.quote_column(self.alias)) return sql
python
def compile(self, db): """Building the sql expression :param db: the database instance """ sql = self.expression if self.alias: sql += (' AS ' + db.quote_column(self.alias)) return sql
[ "def", "compile", "(", "self", ",", "db", ")", ":", "sql", "=", "self", ".", "expression", "if", "self", ".", "alias", ":", "sql", "+=", "(", "' AS '", "+", "db", ".", "quote_column", "(", "self", ".", "alias", ")", ")", "return", "sql" ]
Building the sql expression :param db: the database instance
[ "Building", "the", "sql", "expression" ]
3d9ce85f55cfb39cced22081e525f79581b26b3a
https://github.com/whiteclover/dbpy/blob/3d9ce85f55cfb39cced22081e525f79581b26b3a/db/query/expr.py#L26-L34
train
Builds the sql expression for the record set
johnnoone/aioconsul
aioconsul/client/checks_endpoint.py
ChecksEndpoint.register
async def register(self, check, *, token=None): """Registers a new local check Parameters: check (Object): Check definition token (ObjectID): Token ID Returns: bool: ``True`` on success The register endpoint is used to add a new check to the local ag...
python
async def register(self, check, *, token=None): """Registers a new local check Parameters: check (Object): Check definition token (ObjectID): Token ID Returns: bool: ``True`` on success The register endpoint is used to add a new check to the local ag...
[ "async", "def", "register", "(", "self", ",", "check", ",", "*", ",", "token", "=", "None", ")", ":", "token_id", "=", "extract_attr", "(", "token", ",", "keys", "=", "[", "\"ID\"", "]", ")", "params", "=", "{", "\"token\"", ":", "token_id", "}", "...
Registers a new local check Parameters: check (Object): Check definition token (ObjectID): Token ID Returns: bool: ``True`` on success The register endpoint is used to add a new check to the local agent. Checks may be of script, HTTP, TCP, or TTL typ...
[ "Registers", "a", "new", "local", "check" ]
02f7a529d7dc2e49bed942111067aa5faf320e90
https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/checks_endpoint.py#L34-L123
train
Registers a new local check in Consul.
johnnoone/aioconsul
aioconsul/client/checks_endpoint.py
ChecksEndpoint.deregister
async def deregister(self, check): """Deregisters a local check Parameters: check (ObjectID): Check ID Returns: bool: ``True`` on success The agent will take care of deregistering the check from the Catalog. """ check_id = extract_attr(check, key...
python
async def deregister(self, check): """Deregisters a local check Parameters: check (ObjectID): Check ID Returns: bool: ``True`` on success The agent will take care of deregistering the check from the Catalog. """ check_id = extract_attr(check, key...
[ "async", "def", "deregister", "(", "self", ",", "check", ")", ":", "check_id", "=", "extract_attr", "(", "check", ",", "keys", "=", "[", "\"CheckID\"", ",", "\"ID\"", "]", ")", "response", "=", "await", "self", ".", "_api", ".", "get", "(", "\"/v1/agen...
Deregisters a local check Parameters: check (ObjectID): Check ID Returns: bool: ``True`` on success The agent will take care of deregistering the check from the Catalog.
[ "Deregisters", "a", "local", "check" ]
02f7a529d7dc2e49bed942111067aa5faf320e90
https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/checks_endpoint.py#L125-L137
train
Deregisters a local check from the catalog.
johnnoone/aioconsul
aioconsul/client/checks_endpoint.py
ChecksEndpoint.mark
async def mark(self, check, status, *, note=None): """Marks a local check as passing, warning or critical """ check_id = extract_attr(check, keys=["CheckID", "ID"]) data = { "Status": status, "Output": note } response = await self._api.put("/v1/age...
python
async def mark(self, check, status, *, note=None): """Marks a local check as passing, warning or critical """ check_id = extract_attr(check, keys=["CheckID", "ID"]) data = { "Status": status, "Output": note } response = await self._api.put("/v1/age...
[ "async", "def", "mark", "(", "self", ",", "check", ",", "status", ",", "*", ",", "note", "=", "None", ")", ":", "check_id", "=", "extract_attr", "(", "check", ",", "keys", "=", "[", "\"CheckID\"", ",", "\"ID\"", "]", ")", "data", "=", "{", "\"Statu...
Marks a local check as passing, warning or critical
[ "Marks", "a", "local", "check", "as", "passing", "warning", "or", "critical" ]
02f7a529d7dc2e49bed942111067aa5faf320e90
https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/checks_endpoint.py#L172-L182
train
Marks a local check as passing warning or critical
whiteclover/dbpy
samples/orm.py
UserMapper.find
def find(self, uid): """Find and load the user from database by uid(user id)""" data = (db.select(self.table).select('username', 'email', 'real_name', 'password', 'bio', 'status', 'role', 'uid'). condition('uid', uid).execute() ...
python
def find(self, uid): """Find and load the user from database by uid(user id)""" data = (db.select(self.table).select('username', 'email', 'real_name', 'password', 'bio', 'status', 'role', 'uid'). condition('uid', uid).execute() ...
[ "def", "find", "(", "self", ",", "uid", ")", ":", "data", "=", "(", "db", ".", "select", "(", "self", ".", "table", ")", ".", "select", "(", "'username'", ",", "'email'", ",", "'real_name'", ",", "'password'", ",", "'bio'", ",", "'status'", ",", "'...
Find and load the user from database by uid(user id)
[ "Find", "and", "load", "the", "user", "from", "database", "by", "uid", "(", "user", "id", ")" ]
3d9ce85f55cfb39cced22081e525f79581b26b3a
https://github.com/whiteclover/dbpy/blob/3d9ce85f55cfb39cced22081e525f79581b26b3a/samples/orm.py#L46-L54
train
Find and load the user from database by uid
whiteclover/dbpy
samples/orm.py
UserMapper.find_by_username
def find_by_username(self, username): """Return user by username if find in database otherwise None""" data = (db.select(self.table).select('username', 'email', 'real_name', 'password', 'bio', 'status', 'role', 'uid'). condition('username', us...
python
def find_by_username(self, username): """Return user by username if find in database otherwise None""" data = (db.select(self.table).select('username', 'email', 'real_name', 'password', 'bio', 'status', 'role', 'uid'). condition('username', us...
[ "def", "find_by_username", "(", "self", ",", "username", ")", ":", "data", "=", "(", "db", ".", "select", "(", "self", ".", "table", ")", ".", "select", "(", "'username'", ",", "'email'", ",", "'real_name'", ",", "'password'", ",", "'bio'", ",", "'stat...
Return user by username if find in database otherwise None
[ "Return", "user", "by", "username", "if", "find", "in", "database", "otherwise", "None" ]
3d9ce85f55cfb39cced22081e525f79581b26b3a
https://github.com/whiteclover/dbpy/blob/3d9ce85f55cfb39cced22081e525f79581b26b3a/samples/orm.py#L56-L63
train
Return user by username if find in database otherwise None
whiteclover/dbpy
samples/orm.py
UserMapper.search
def search(self, **kw): """Find the users match the condition in kw""" q = db.select(self.table).condition('status', 'active') for k, v in kw: q.condition(k, v) data = q.execute() users = [] for user in data: users.append(self.load(user, self.model...
python
def search(self, **kw): """Find the users match the condition in kw""" q = db.select(self.table).condition('status', 'active') for k, v in kw: q.condition(k, v) data = q.execute() users = [] for user in data: users.append(self.load(user, self.model...
[ "def", "search", "(", "self", ",", "*", "*", "kw", ")", ":", "q", "=", "db", ".", "select", "(", "self", ".", "table", ")", ".", "condition", "(", "'status'", ",", "'active'", ")", "for", "k", ",", "v", "in", "kw", ":", "q", ".", "condition", ...
Find the users match the condition in kw
[ "Find", "the", "users", "match", "the", "condition", "in", "kw" ]
3d9ce85f55cfb39cced22081e525f79581b26b3a
https://github.com/whiteclover/dbpy/blob/3d9ce85f55cfb39cced22081e525f79581b26b3a/samples/orm.py#L70-L79
train
Search the users table for the users matching the condition in kw
whiteclover/dbpy
samples/orm.py
PostMapper.paginate
def paginate(self, page=1, perpage=10, category=None): """Paginate the posts""" q = db.select(self.table).fields('title', 'slug', 'description', 'html', 'css', 'js', 'category', 'status', 'comments', 'author', 'created', 'pid') if category: q....
python
def paginate(self, page=1, perpage=10, category=None): """Paginate the posts""" q = db.select(self.table).fields('title', 'slug', 'description', 'html', 'css', 'js', 'category', 'status', 'comments', 'author', 'created', 'pid') if category: q....
[ "def", "paginate", "(", "self", ",", "page", "=", "1", ",", "perpage", "=", "10", ",", "category", "=", "None", ")", ":", "q", "=", "db", ".", "select", "(", "self", ".", "table", ")", ".", "fields", "(", "'title'", ",", "'slug'", ",", "'descript...
Paginate the posts
[ "Paginate", "the", "posts" ]
3d9ce85f55cfb39cced22081e525f79581b26b3a
https://github.com/whiteclover/dbpy/blob/3d9ce85f55cfb39cced22081e525f79581b26b3a/samples/orm.py#L124-L132
train
Paginate the posts
bitesofcode/projexui
projexui/widgets/xnodewidget/xnodescene.py
XNodeScene.addConnection
def addConnection( self, cls = None ): """ Creates a new connection instance in the scene. If the optional cls \ parameter is not supplied, then the default connection class will \ be used when creating the connection. :param cls subclass of <XNodeConnection> ...
python
def addConnection( self, cls = None ): """ Creates a new connection instance in the scene. If the optional cls \ parameter is not supplied, then the default connection class will \ be used when creating the connection. :param cls subclass of <XNodeConnection> ...
[ "def", "addConnection", "(", "self", ",", "cls", "=", "None", ")", ":", "# make sure we have a valid class", "if", "(", "not", "cls", ")", ":", "cls", "=", "self", ".", "defaultConnectionClass", "(", ")", "if", "(", "not", "cls", ")", ":", "return", "Non...
Creates a new connection instance in the scene. If the optional cls \ parameter is not supplied, then the default connection class will \ be used when creating the connection. :param cls subclass of <XNodeConnection> :return <XNodeConnection> || None
[ "Creates", "a", "new", "connection", "instance", "in", "the", "scene", ".", "If", "the", "optional", "cls", "\\", "parameter", "is", "not", "supplied", "then", "the", "default", "connection", "class", "will", "\\", "be", "used", "when", "creating", "the", ...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnodescene.py#L227-L247
train
Adds a new connection to the scene.
bitesofcode/projexui
projexui/widgets/xnodewidget/xnodescene.py
XNodeScene.addLayer
def addLayer(self, cls=None): """ Creates a new layer instance for this scene. If the optional cls \ parameter is not supplied, then the default layer class will be \ used when creating the layer. :param cls <subclass of XNodeLayer> :return ...
python
def addLayer(self, cls=None): """ Creates a new layer instance for this scene. If the optional cls \ parameter is not supplied, then the default layer class will be \ used when creating the layer. :param cls <subclass of XNodeLayer> :return ...
[ "def", "addLayer", "(", "self", ",", "cls", "=", "None", ")", ":", "if", "(", "not", "cls", ")", ":", "cls", "=", "self", ".", "defaultLayerClass", "(", ")", "if", "(", "not", "cls", ")", ":", "return", "None", "# create the new layer", "layer", "=",...
Creates a new layer instance for this scene. If the optional cls \ parameter is not supplied, then the default layer class will be \ used when creating the layer. :param cls <subclass of XNodeLayer> :return <XNodeLayer> || None
[ "Creates", "a", "new", "layer", "instance", "for", "this", "scene", ".", "If", "the", "optional", "cls", "\\", "parameter", "is", "not", "supplied", "then", "the", "default", "layer", "class", "will", "be", "\\", "used", "when", "creating", "the", "layer",...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnodescene.py#L249-L271
train
Adds a new layer to the scene.
bitesofcode/projexui
projexui/widgets/xnodewidget/xnodescene.py
XNodeScene.addItem
def addItem( self, item ): """ Overloaded from the base QGraphicsScene class to set the modified \ state for this scene to being modified. :param item <QGraphicsItem> :return <bool> success """ result = super(XNodeScen...
python
def addItem( self, item ): """ Overloaded from the base QGraphicsScene class to set the modified \ state for this scene to being modified. :param item <QGraphicsItem> :return <bool> success """ result = super(XNodeScen...
[ "def", "addItem", "(", "self", ",", "item", ")", ":", "result", "=", "super", "(", "XNodeScene", ",", "self", ")", ".", "addItem", "(", "item", ")", "self", ".", "setModified", "(", ")", "self", ".", "_cache", ".", "add", "(", "item", ")", "return"...
Overloaded from the base QGraphicsScene class to set the modified \ state for this scene to being modified. :param item <QGraphicsItem> :return <bool> success
[ "Overloaded", "from", "the", "base", "QGraphicsScene", "class", "to", "set", "the", "modified", "\\", "state", "for", "this", "scene", "to", "being", "modified", ".", ":", "param", "item", "<QGraphicsItem", ">", ":", "return", "<bool", ">", "success" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnodescene.py#L273-L286
train
Add an item to the cache and set modified flag.
bitesofcode/projexui
projexui/widgets/xnodewidget/xnodescene.py
XNodeScene.addNode
def addNode(self, cls=None, point=None): """ Creates a new node instance in the scene. If the optional \ cls parameter is not supplied, then the default node class \ will be used when creating the node. If a point is \ supplied, then the node will be created at that position, \...
python
def addNode(self, cls=None, point=None): """ Creates a new node instance in the scene. If the optional \ cls parameter is not supplied, then the default node class \ will be used when creating the node. If a point is \ supplied, then the node will be created at that position, \...
[ "def", "addNode", "(", "self", ",", "cls", "=", "None", ",", "point", "=", "None", ")", ":", "# make sure we have a valid class", "if", "not", "cls", ":", "cls", "=", "self", ".", "defaultNodeClass", "(", ")", "if", "not", "cls", ":", "return", "None", ...
Creates a new node instance in the scene. If the optional \ cls parameter is not supplied, then the default node class \ will be used when creating the node. If a point is \ supplied, then the node will be created at that position, \ otherwise the node will be created under the cursor....
[ "Creates", "a", "new", "node", "instance", "in", "the", "scene", ".", "If", "the", "optional", "\\", "cls", "parameter", "is", "not", "supplied", "then", "the", "default", "node", "class", "\\", "will", "be", "used", "when", "creating", "the", "node", "....
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnodescene.py#L288-L335
train
Creates a new node in the scene.
bitesofcode/projexui
projexui/widgets/xnodewidget/xnodescene.py
XNodeScene.autoLayout
def autoLayout( self, padX = None, padY = None, direction = Qt.Horizontal, layout = 'Layered', animate = 0, centerOn = None, center = None, debug=False ): ...
python
def autoLayout( self, padX = None, padY = None, direction = Qt.Horizontal, layout = 'Layered', animate = 0, centerOn = None, center = None, debug=False ): ...
[ "def", "autoLayout", "(", "self", ",", "padX", "=", "None", ",", "padY", "=", "None", ",", "direction", "=", "Qt", ".", "Horizontal", ",", "layout", "=", "'Layered'", ",", "animate", "=", "0", ",", "centerOn", "=", "None", ",", "center", "=", "None",...
Automatically lays out all the nodes in the scene using the \ autoLayoutNodes method. :param padX | <int> || None | default is 2 * cell width padY | <int> || None | default is 2 * cell height direction | <Qt.Direction> layout | <s...
[ "Automatically", "lays", "out", "all", "the", "nodes", "in", "the", "scene", "using", "the", "\\", "autoLayoutNodes", "method", ".", ":", "param", "padX", "|", "<int", ">", "||", "None", "|", "default", "is", "2", "*", "cell", "width", "padY", "|", "<i...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnodescene.py#L346-L375
train
Auto - layout all the nodes in the scene.
bitesofcode/projexui
projexui/widgets/xnodewidget/xnodescene.py
XNodeScene.autoLayoutNodes
def autoLayoutNodes( self, nodes, padX = None, padY = None, direction = Qt.Horizontal, layout = 'Layered', animate = 0, centerOn = None, ...
python
def autoLayoutNodes( self, nodes, padX = None, padY = None, direction = Qt.Horizontal, layout = 'Layered', animate = 0, centerOn = None, ...
[ "def", "autoLayoutNodes", "(", "self", ",", "nodes", ",", "padX", "=", "None", ",", "padY", "=", "None", ",", "direction", "=", "Qt", ".", "Horizontal", ",", "layout", "=", "'Layered'", ",", "animate", "=", "0", ",", "centerOn", "=", "None", ",", "ce...
Automatically lays out all the nodes in the scene using the private \ autoLayoutNodes method. :param nodes | [<XNode>, ..] padX | <int> || None | default is 2 * cell width padY | <int> || None | default is 2 * cell height directio...
[ "Automatically", "lays", "out", "all", "the", "nodes", "in", "the", "scene", "using", "the", "private", "\\", "autoLayoutNodes", "method", ".", ":", "param", "nodes", "|", "[", "<XNode", ">", "..", "]", "padX", "|", "<int", ">", "||", "None", "|", "def...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnodescene.py#L377-L438
train
Auto - layout the nodes in the scene.
bitesofcode/projexui
projexui/widgets/xnodewidget/xnodescene.py
XNodeScene.autoLayoutSelected
def autoLayoutSelected( self, padX = None, padY = None, direction = Qt.Horizontal, layout = 'Layered', animate = 0, centerOn = None, ...
python
def autoLayoutSelected( self, padX = None, padY = None, direction = Qt.Horizontal, layout = 'Layered', animate = 0, centerOn = None, ...
[ "def", "autoLayoutSelected", "(", "self", ",", "padX", "=", "None", ",", "padY", "=", "None", ",", "direction", "=", "Qt", ".", "Horizontal", ",", "layout", "=", "'Layered'", ",", "animate", "=", "0", ",", "centerOn", "=", "None", ",", "center", "=", ...
Automatically lays out all the selected nodes in the scene using the \ autoLayoutNodes method. :param padX | <int> || None | default is 2 * cell width padY | <int> || None | default is 2 * cell height direction | <Qt.Direction> la...
[ "Automatically", "lays", "out", "all", "the", "selected", "nodes", "in", "the", "scene", "using", "the", "\\", "autoLayoutNodes", "method", ".", ":", "param", "padX", "|", "<int", ">", "||", "None", "|", "default", "is", "2", "*", "cell", "width", "padY"...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnodescene.py#L440-L468
train
Auto layout selected nodes in the scene.
bitesofcode/projexui
projexui/widgets/xnodewidget/xnodescene.py
XNodeScene.blockSelectionSignals
def blockSelectionSignals( self, state ): """ Sets the state for the seleciton finished signal. When it \ is set to True, it will emit the signal. This is used \ internally to control selection signal propogation, so \ should not really be called unless you know why you are \ ...
python
def blockSelectionSignals( self, state ): """ Sets the state for the seleciton finished signal. When it \ is set to True, it will emit the signal. This is used \ internally to control selection signal propogation, so \ should not really be called unless you know why you are \ ...
[ "def", "blockSelectionSignals", "(", "self", ",", "state", ")", ":", "if", "(", "self", ".", "_selectionSignalsBlocked", "==", "state", ")", ":", "return", "self", ".", "_selectionSignalsBlocked", "=", "state", "if", "(", "not", "state", ")", ":", "self", ...
Sets the state for the seleciton finished signal. When it \ is set to True, it will emit the signal. This is used \ internally to control selection signal propogation, so \ should not really be called unless you know why you are \ calling it. :param s...
[ "Sets", "the", "state", "for", "the", "seleciton", "finished", "signal", ".", "When", "it", "\\", "is", "set", "to", "True", "it", "will", "emit", "the", "signal", ".", "This", "is", "used", "\\", "internally", "to", "control", "selection", "signal", "pr...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnodescene.py#L470-L485
train
Sets the state for the seleciton finished signal.
bitesofcode/projexui
projexui/widgets/xnodewidget/xnodescene.py
XNodeScene.calculateBoundingRect
def calculateBoundingRect(self, nodes): """ Returns the bounding rectangle for the inputed nodes. :param nodes | [<XNode>, ..] """ out = QRectF() for node in nodes: rect = node.rect() pos = node.pos() bounding...
python
def calculateBoundingRect(self, nodes): """ Returns the bounding rectangle for the inputed nodes. :param nodes | [<XNode>, ..] """ out = QRectF() for node in nodes: rect = node.rect() pos = node.pos() bounding...
[ "def", "calculateBoundingRect", "(", "self", ",", "nodes", ")", ":", "out", "=", "QRectF", "(", ")", "for", "node", "in", "nodes", ":", "rect", "=", "node", ".", "rect", "(", ")", "pos", "=", "node", ".", "pos", "(", ")", "bounding", "=", "QRectF",...
Returns the bounding rectangle for the inputed nodes. :param nodes | [<XNode>, ..]
[ "Returns", "the", "bounding", "rectangle", "for", "the", "inputed", "nodes", ".", ":", "param", "nodes", "|", "[", "<XNode", ">", "..", "]" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnodescene.py#L487-L501
train
Calculates the bounding rectangle for the inputed nodes.
bitesofcode/projexui
projexui/widgets/xnodewidget/xnodescene.py
XNodeScene.clear
def clear( self ): """ Clears the current scene of all the items and layers. """ self.setCurrentLayer(None) self._layers = [] self._cache.clear() super(XNodeScene, self).clear()
python
def clear( self ): """ Clears the current scene of all the items and layers. """ self.setCurrentLayer(None) self._layers = [] self._cache.clear() super(XNodeScene, self).clear()
[ "def", "clear", "(", "self", ")", ":", "self", ".", "setCurrentLayer", "(", "None", ")", "self", ".", "_layers", "=", "[", "]", "self", ".", "_cache", ".", "clear", "(", ")", "super", "(", "XNodeScene", ",", "self", ")", ".", "clear", "(", ")" ]
Clears the current scene of all the items and layers.
[ "Clears", "the", "current", "scene", "of", "all", "the", "items", "and", "layers", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnodescene.py#L535-L544
train
Clears the current scene.
bitesofcode/projexui
projexui/widgets/xnodewidget/xnodescene.py
XNodeScene.connectSelection
def connectSelection( self, cls = None ): """ Creates a connection between the currently selected \ nodes, provided there are only 2 nodes selected. If \ the cls parameter is supplied then that will be the \ class instance used when creating the connection. \ Otherwise, ...
python
def connectSelection( self, cls = None ): """ Creates a connection between the currently selected \ nodes, provided there are only 2 nodes selected. If \ the cls parameter is supplied then that will be the \ class instance used when creating the connection. \ Otherwise, ...
[ "def", "connectSelection", "(", "self", ",", "cls", "=", "None", ")", ":", "# collect the selected nodes", "nodes", "=", "self", ".", "selectedNodes", "(", ")", "if", "(", "len", "(", "nodes", ")", "!=", "2", ")", ":", "return", "None", "# create the conne...
Creates a connection between the currently selected \ nodes, provided there are only 2 nodes selected. If \ the cls parameter is supplied then that will be the \ class instance used when creating the connection. \ Otherwise, the default connection class will be used. :p...
[ "Creates", "a", "connection", "between", "the", "currently", "selected", "\\", "nodes", "provided", "there", "are", "only", "2", "nodes", "selected", ".", "If", "\\", "the", "cls", "parameter", "is", "supplied", "then", "that", "will", "be", "the", "\\", "...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnodescene.py#L546-L569
train
Creates a connection between the currently selected nodes and the specified class instance.
bitesofcode/projexui
projexui/widgets/xnodewidget/xnodescene.py
XNodeScene.connections
def connections(self, hotspot=None): """ Returns a list of all the connection instances that are in this scene. :return <list> [ <XNodeConnection>, .. ] """ cons = self.findItems(XNodeConnection) if hotspot is not None: filt = lambda ...
python
def connections(self, hotspot=None): """ Returns a list of all the connection instances that are in this scene. :return <list> [ <XNodeConnection>, .. ] """ cons = self.findItems(XNodeConnection) if hotspot is not None: filt = lambda ...
[ "def", "connections", "(", "self", ",", "hotspot", "=", "None", ")", ":", "cons", "=", "self", ".", "findItems", "(", "XNodeConnection", ")", "if", "hotspot", "is", "not", "None", ":", "filt", "=", "lambda", "x", ":", "hotspot", "in", "(", "x", ".", ...
Returns a list of all the connection instances that are in this scene. :return <list> [ <XNodeConnection>, .. ]
[ "Returns", "a", "list", "of", "all", "the", "connection", "instances", "that", "are", "in", "this", "scene", ".", ":", "return", "<list", ">", "[", "<XNodeConnection", ">", "..", "]" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnodescene.py#L571-L581
train
Returns a list of all the connection instances that are in this scene.
bitesofcode/projexui
projexui/widgets/xnodewidget/xnodescene.py
XNodeScene.drawBackground
def drawBackground(self, painter, rect): """ Overloads the base QGraphicsScene method to handle \ drawing the grid for the node scene. This method should \ not be called manually but is called internally as part \ of the painting mechanism for the QGraphicsScene object. ...
python
def drawBackground(self, painter, rect): """ Overloads the base QGraphicsScene method to handle \ drawing the grid for the node scene. This method should \ not be called manually but is called internally as part \ of the painting mechanism for the QGraphicsScene object. ...
[ "def", "drawBackground", "(", "self", ",", "painter", ",", "rect", ")", ":", "painter", ".", "save", "(", ")", "palette", "=", "self", ".", "palette", "(", ")", "if", "not", "(", "self", ".", "_mainView", "and", "self", ".", "_mainView", ".", "isEnab...
Overloads the base QGraphicsScene method to handle \ drawing the grid for the node scene. This method should \ not be called manually but is called internally as part \ of the painting mechanism for the QGraphicsScene object. :param painter <QPainter> :param ...
[ "Overloads", "the", "base", "QGraphicsScene", "method", "to", "handle", "\\", "drawing", "the", "grid", "for", "the", "node", "scene", ".", "This", "method", "should", "\\", "not", "be", "called", "manually", "but", "is", "called", "internally", "as", "part"...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnodescene.py#L641-L696
train
This method draws the background for the node scene.
bitesofcode/projexui
projexui/widgets/xnodewidget/xnodescene.py
XNodeScene.findItems
def findItems( self, cls ): """ Looks up the items in the scene that inherit from the inputed class. :param cls | <type> """ return filter(lambda x: isinstance(x, cls), self.items())
python
def findItems( self, cls ): """ Looks up the items in the scene that inherit from the inputed class. :param cls | <type> """ return filter(lambda x: isinstance(x, cls), self.items())
[ "def", "findItems", "(", "self", ",", "cls", ")", ":", "return", "filter", "(", "lambda", "x", ":", "isinstance", "(", "x", ",", "cls", ")", ",", "self", ".", "items", "(", ")", ")" ]
Looks up the items in the scene that inherit from the inputed class. :param cls | <type>
[ "Looks", "up", "the", "items", "in", "the", "scene", "that", "inherit", "from", "the", "inputed", "class", ".", ":", "param", "cls", "|", "<type", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnodescene.py#L760-L766
train
Returns a list of items that inherit from cls.
bitesofcode/projexui
projexui/widgets/xnodewidget/xnodescene.py
XNodeScene.findLayer
def findLayer( self, layerName ): """ Looks up the layer for this node based on the inputed layer name. :param layerName | <str> :return <XNodeLayer> """ for layer in self._layers: if ( layer.name() == layerName ): ...
python
def findLayer( self, layerName ): """ Looks up the layer for this node based on the inputed layer name. :param layerName | <str> :return <XNodeLayer> """ for layer in self._layers: if ( layer.name() == layerName ): ...
[ "def", "findLayer", "(", "self", ",", "layerName", ")", ":", "for", "layer", "in", "self", ".", "_layers", ":", "if", "(", "layer", ".", "name", "(", ")", "==", "layerName", ")", ":", "return", "layer", "return", "None" ]
Looks up the layer for this node based on the inputed layer name. :param layerName | <str> :return <XNodeLayer>
[ "Looks", "up", "the", "layer", "for", "this", "node", "based", "on", "the", "inputed", "layer", "name", ".", ":", "param", "layerName", "|", "<str", ">", ":", "return", "<XNodeLayer", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnodescene.py#L768-L779
train
Searches the layer for this node based on the inputed layer name.
bitesofcode/projexui
projexui/widgets/xnodewidget/xnodescene.py
XNodeScene.findNode
def findNode( self, objectName ): """ Looks up the node based on the inputed node name. :param objectName | <str> """ for item in self.items(): if ( isinstance(item, XNode) and item.objectName() == objectName ): retu...
python
def findNode( self, objectName ): """ Looks up the node based on the inputed node name. :param objectName | <str> """ for item in self.items(): if ( isinstance(item, XNode) and item.objectName() == objectName ): retu...
[ "def", "findNode", "(", "self", ",", "objectName", ")", ":", "for", "item", "in", "self", ".", "items", "(", ")", ":", "if", "(", "isinstance", "(", "item", ",", "XNode", ")", "and", "item", ".", "objectName", "(", ")", "==", "objectName", ")", ":"...
Looks up the node based on the inputed node name. :param objectName | <str>
[ "Looks", "up", "the", "node", "based", "on", "the", "inputed", "node", "name", ".", ":", "param", "objectName", "|", "<str", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnodescene.py#L781-L791
train
Searches up the node based on the inputed object name.
bitesofcode/projexui
projexui/widgets/xnodewidget/xnodescene.py
XNodeScene.findNodeByRegex
def findNodeByRegex( self, objectRegex ): """ Looks up the first instance of the node who matches the inputed regex expression. :param objectRegex | <str> :return <XNode> || None """ expr = re.compile(nativestring(objectRegex)) f...
python
def findNodeByRegex( self, objectRegex ): """ Looks up the first instance of the node who matches the inputed regex expression. :param objectRegex | <str> :return <XNode> || None """ expr = re.compile(nativestring(objectRegex)) f...
[ "def", "findNodeByRegex", "(", "self", ",", "objectRegex", ")", ":", "expr", "=", "re", ".", "compile", "(", "nativestring", "(", "objectRegex", ")", ")", "for", "item", "in", "self", ".", "items", "(", ")", ":", "if", "(", "isinstance", "(", "item", ...
Looks up the first instance of the node who matches the inputed regex expression. :param objectRegex | <str> :return <XNode> || None
[ "Looks", "up", "the", "first", "instance", "of", "the", "node", "who", "matches", "the", "inputed", "regex", "expression", ".", ":", "param", "objectRegex", "|", "<str", ">", ":", "return", "<XNode", ">", "||", "None" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnodescene.py#L793-L807
train
Searches up the first instance of the node whose display name matches the inputed regex.
bitesofcode/projexui
projexui/widgets/xnodewidget/xnodescene.py
XNodeScene.findNodeById
def findNodeById( self, objectId ): """ Looks up the node based on the unique node identifier. :param nodeId """ for item in self.items(): if ( isinstance(item, XNode) and item.objectId() == objectId): return item return None
python
def findNodeById( self, objectId ): """ Looks up the node based on the unique node identifier. :param nodeId """ for item in self.items(): if ( isinstance(item, XNode) and item.objectId() == objectId): return item return None
[ "def", "findNodeById", "(", "self", ",", "objectId", ")", ":", "for", "item", "in", "self", ".", "items", "(", ")", ":", "if", "(", "isinstance", "(", "item", ",", "XNode", ")", "and", "item", ".", "objectId", "(", ")", "==", "objectId", ")", ":", ...
Looks up the node based on the unique node identifier. :param nodeId
[ "Looks", "up", "the", "node", "based", "on", "the", "unique", "node", "identifier", ".", ":", "param", "nodeId" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnodescene.py#L809-L818
train
Searches the node based on the unique node identifier.
bitesofcode/projexui
projexui/widgets/xnodewidget/xnodescene.py
XNodeScene.finishConnection
def finishConnection(self, accept=True): """ Finishes the active connection. If the accept value is \ true, then the connection requested signal will be emited, \ otherwise, it will simply clear the active connection \ data. :param accept <bool> ...
python
def finishConnection(self, accept=True): """ Finishes the active connection. If the accept value is \ true, then the connection requested signal will be emited, \ otherwise, it will simply clear the active connection \ data. :param accept <bool> ...
[ "def", "finishConnection", "(", "self", ",", "accept", "=", "True", ")", ":", "if", "not", "self", ".", "_activeConnection", ":", "return", "# when accepting, emit the connection requested signal", "if", "accept", ":", "self", ".", "emitConnectionRequested", "(", "s...
Finishes the active connection. If the accept value is \ true, then the connection requested signal will be emited, \ otherwise, it will simply clear the active connection \ data. :param accept <bool>
[ "Finishes", "the", "active", "connection", ".", "If", "the", "accept", "value", "is", "\\", "true", "then", "the", "connection", "requested", "signal", "will", "be", "emited", "\\", "otherwise", "it", "will", "simply", "clear", "the", "active", "connection", ...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnodescene.py#L830-L860
train
Finishes the active connection.
bitesofcode/projexui
projexui/widgets/xnodewidget/xnodescene.py
XNodeScene.keyPressEvent
def keyPressEvent( self, event ): """ Overloads the base QGraphicsScene method to handle individual \ key overrides. :param event <QKeyPressEvent> """ # otherwise, eat all other key press events until the # view mode is released ...
python
def keyPressEvent( self, event ): """ Overloads the base QGraphicsScene method to handle individual \ key overrides. :param event <QKeyPressEvent> """ # otherwise, eat all other key press events until the # view mode is released ...
[ "def", "keyPressEvent", "(", "self", ",", "event", ")", ":", "# otherwise, eat all other key press events until the ", "# view mode is released", "if", "(", "self", ".", "inViewMode", "(", ")", ")", ":", "event", ".", "accept", "(", ")", "# when the user presses the s...
Overloads the base QGraphicsScene method to handle individual \ key overrides. :param event <QKeyPressEvent>
[ "Overloads", "the", "base", "QGraphicsScene", "method", "to", "handle", "individual", "\\", "key", "overrides", ".", ":", "param", "event", "<QKeyPressEvent", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnodescene.py#L927-L952
train
Handles the key press event.
bitesofcode/projexui
projexui/widgets/xnodewidget/xnodescene.py
XNodeScene.keyReleaseEvent
def keyReleaseEvent( self, event ): """ Intercepts the Qt key released event to look for built-in overrides. :param event <QKeyReleaseEvent> """ # when the user releases the space bar, remove # the scene view edit override if ( event.key() == Q...
python
def keyReleaseEvent( self, event ): """ Intercepts the Qt key released event to look for built-in overrides. :param event <QKeyReleaseEvent> """ # when the user releases the space bar, remove # the scene view edit override if ( event.key() == Q...
[ "def", "keyReleaseEvent", "(", "self", ",", "event", ")", ":", "# when the user releases the space bar, remove", "# the scene view edit override", "if", "(", "event", ".", "key", "(", ")", "==", "Qt", ".", "Key_Space", ")", ":", "self", ".", "setViewMode", "(", ...
Intercepts the Qt key released event to look for built-in overrides. :param event <QKeyReleaseEvent>
[ "Intercepts", "the", "Qt", "key", "released", "event", "to", "look", "for", "built", "-", "in", "overrides", ".", ":", "param", "event", "<QKeyReleaseEvent", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnodescene.py#L954-L973
train
Handles the key release event.
bitesofcode/projexui
projexui/widgets/xnodewidget/xnodescene.py
XNodeScene.mouseDoubleClickEvent
def mouseDoubleClickEvent(self, event): """ Emits the node double clicked event when a node is double clicked. :param event | <QMouseDoubleClickEvent> """ super(XNodeScene, self).mouseDoubleClickEvent(event) # emit the node double clicked signal ...
python
def mouseDoubleClickEvent(self, event): """ Emits the node double clicked event when a node is double clicked. :param event | <QMouseDoubleClickEvent> """ super(XNodeScene, self).mouseDoubleClickEvent(event) # emit the node double clicked signal ...
[ "def", "mouseDoubleClickEvent", "(", "self", ",", "event", ")", ":", "super", "(", "XNodeScene", ",", "self", ")", ".", "mouseDoubleClickEvent", "(", "event", ")", "# emit the node double clicked signal", "if", "event", ".", "button", "(", ")", "==", "Qt", "."...
Emits the node double clicked event when a node is double clicked. :param event | <QMouseDoubleClickEvent>
[ "Emits", "the", "node", "double", "clicked", "event", "when", "a", "node", "is", "double", "clicked", ".", ":", "param", "event", "|", "<QMouseDoubleClickEvent", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnodescene.py#L1007-L1034
train
Emits the node double clicked event when a node is double clicked.
bitesofcode/projexui
projexui/widgets/xnodewidget/xnodescene.py
XNodeScene.mousePressEvent
def mousePressEvent( self, event ): """ Overloads the base QGraphicsScene method to block the \ selection signals, otherwise, each time an object is \ bulk selected the selection changed signal will be \ emitted. :param event <QMousePressEvent>...
python
def mousePressEvent( self, event ): """ Overloads the base QGraphicsScene method to block the \ selection signals, otherwise, each time an object is \ bulk selected the selection changed signal will be \ emitted. :param event <QMousePressEvent>...
[ "def", "mousePressEvent", "(", "self", ",", "event", ")", ":", "if", "event", ".", "button", "(", ")", "==", "Qt", ".", "MidButton", ":", "self", ".", "setViewMode", "(", "True", ")", "event", ".", "accept", "(", ")", "elif", "event", ".", "button", ...
Overloads the base QGraphicsScene method to block the \ selection signals, otherwise, each time an object is \ bulk selected the selection changed signal will be \ emitted. :param event <QMousePressEvent>
[ "Overloads", "the", "base", "QGraphicsScene", "method", "to", "block", "the", "\\", "selection", "signals", "otherwise", "each", "time", "an", "object", "is", "\\", "bulk", "selected", "the", "selection", "changed", "signal", "will", "be", "\\", "emitted", "."...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnodescene.py#L1036-L1052
train
Overloads the base QGraphicsScene method to block the selection signals if the object is selected.
bitesofcode/projexui
projexui/widgets/xnodewidget/xnodescene.py
XNodeScene.mouseMoveEvent
def mouseMoveEvent( self, event ): """ Overloads the base QGraphicsScene method to update the active \ connection if there is one going on. :param event <QMouseMoveEvent> """ if ( self._activeConnection ): if self._activeConnection....
python
def mouseMoveEvent( self, event ): """ Overloads the base QGraphicsScene method to update the active \ connection if there is one going on. :param event <QMouseMoveEvent> """ if ( self._activeConnection ): if self._activeConnection....
[ "def", "mouseMoveEvent", "(", "self", ",", "event", ")", ":", "if", "(", "self", ".", "_activeConnection", ")", ":", "if", "self", ".", "_activeConnection", ".", "customData", "(", "'__output__'", ")", ":", "self", ".", "_activeConnection", ".", "setInputPoi...
Overloads the base QGraphicsScene method to update the active \ connection if there is one going on. :param event <QMouseMoveEvent>
[ "Overloads", "the", "base", "QGraphicsScene", "method", "to", "update", "the", "active", "\\", "connection", "if", "there", "is", "one", "going", "on", ".", ":", "param", "event", "<QMouseMoveEvent", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnodescene.py#L1054-L1067
train
Overloads the base QGraphicsScene method to update the active connection if there is one.