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/xcommands.py
setup
def setup(applicationName, applicationType=None, style='plastique', splash='', splashType=None, splashTextColor='white', splashTextAlign=None, theme=''): """ Wrapper system for the QApplication creation process to handle all proper ...
python
def setup(applicationName, applicationType=None, style='plastique', splash='', splashType=None, splashTextColor='white', splashTextAlign=None, theme=''): """ Wrapper system for the QApplication creation process to handle all proper ...
[ "def", "setup", "(", "applicationName", ",", "applicationType", "=", "None", ",", "style", "=", "'plastique'", ",", "splash", "=", "''", ",", "splashType", "=", "None", ",", "splashTextColor", "=", "'white'", ",", "splashTextAlign", "=", "None", ",", "theme"...
Wrapper system for the QApplication creation process to handle all proper pre-application setup. This method will verify that there is no application running, creating one if necessary. If no application is created, a None value is returned - signaling that there is already an app running. If you ...
[ "Wrapper", "system", "for", "the", "QApplication", "creation", "process", "to", "handle", "all", "proper", "pre", "-", "application", "setup", ".", "This", "method", "will", "verify", "that", "there", "is", "no", "application", "running", "creating", "one", "i...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xcommands.py#L472-L553
train
Create a new application with the given parameters.
bitesofcode/projexui
projexui/xcommands.py
stylize
def stylize(obj, style='plastique', theme='projexui'): """ Styles the inputed object with the given options. :param obj | <QtGui.QWidget> || <QtGui.QApplication> style | <str> base | <str> """ obj.setStyle(style) if theme: shee...
python
def stylize(obj, style='plastique', theme='projexui'): """ Styles the inputed object with the given options. :param obj | <QtGui.QWidget> || <QtGui.QApplication> style | <str> base | <str> """ obj.setStyle(style) if theme: shee...
[ "def", "stylize", "(", "obj", ",", "style", "=", "'plastique'", ",", "theme", "=", "'projexui'", ")", ":", "obj", ".", "setStyle", "(", "style", ")", "if", "theme", ":", "sheet", "=", "resources", ".", "read", "(", "'styles/{0}/style.css'", ".", "format"...
Styles the inputed object with the given options. :param obj | <QtGui.QWidget> || <QtGui.QApplication> style | <str> base | <str>
[ "Styles", "the", "inputed", "object", "with", "the", "given", "options", ".", ":", "param", "obj", "|", "<QtGui", ".", "QWidget", ">", "||", "<QtGui", ".", "QApplication", ">", "style", "|", "<str", ">", "base", "|", "<str", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xcommands.py#L567-L579
train
Stylizes the inputed object with the given options.
bitesofcode/projexui
projexui/xcommands.py
topWindow
def topWindow(): """ Returns the very top window for all Qt purposes. :return <QWidget> || None """ import_qt(globals()) window = QtGui.QApplication.instance().activeWindow() if not window: return None parent = window.parent() while paren...
python
def topWindow(): """ Returns the very top window for all Qt purposes. :return <QWidget> || None """ import_qt(globals()) window = QtGui.QApplication.instance().activeWindow() if not window: return None parent = window.parent() while paren...
[ "def", "topWindow", "(", ")", ":", "import_qt", "(", "globals", "(", ")", ")", "window", "=", "QtGui", ".", "QApplication", ".", "instance", "(", ")", ".", "activeWindow", "(", ")", "if", "not", "window", ":", "return", "None", "parent", "=", "window",...
Returns the very top window for all Qt purposes. :return <QWidget> || None
[ "Returns", "the", "very", "top", "window", "for", "all", "Qt", "purposes", ".", ":", "return", "<QWidget", ">", "||", "None" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xcommands.py#L581-L599
train
Returns the very top window for all Qt purposes.
bitesofcode/projexui
projexui/xcommands.py
uiFile
def uiFile(modulefile, inst, theme='', className=None): """ Returns the ui file for the given instance and module file. :param moduleFile | <str> inst | <QWidget> :return <str> """ if className is None: className = inst.__class__.__name_...
python
def uiFile(modulefile, inst, theme='', className=None): """ Returns the ui file for the given instance and module file. :param moduleFile | <str> inst | <QWidget> :return <str> """ if className is None: className = inst.__class__.__name_...
[ "def", "uiFile", "(", "modulefile", ",", "inst", ",", "theme", "=", "''", ",", "className", "=", "None", ")", ":", "if", "className", "is", "None", ":", "className", "=", "inst", ".", "__class__", ".", "__name__", "# use a module's name vs. filepath\r", "if"...
Returns the ui file for the given instance and module file. :param moduleFile | <str> inst | <QWidget> :return <str>
[ "Returns", "the", "ui", "file", "for", "the", "given", "instance", "and", "module", "file", ".", ":", "param", "moduleFile", "|", "<str", ">", "inst", "|", "<QWidget", ">", ":", "return", "<str", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xcommands.py#L617-L648
train
Returns the ui file for the given modulefile and inst.
johnnoone/aioconsul
aioconsul/encoders/__init__.py
encode_value
def encode_value(value, flags=None, base64=False): """Mostly used by payloads """ if flags: # still a no-operation logger.debug("Flag %s encoding not implemented yet" % flags) if not isinstance(value, bytes): raise ValueError("value must be bytes") return b64encode(value) if ...
python
def encode_value(value, flags=None, base64=False): """Mostly used by payloads """ if flags: # still a no-operation logger.debug("Flag %s encoding not implemented yet" % flags) if not isinstance(value, bytes): raise ValueError("value must be bytes") return b64encode(value) if ...
[ "def", "encode_value", "(", "value", ",", "flags", "=", "None", ",", "base64", "=", "False", ")", ":", "if", "flags", ":", "# still a no-operation", "logger", ".", "debug", "(", "\"Flag %s encoding not implemented yet\"", "%", "flags", ")", "if", "not", "isins...
Mostly used by payloads
[ "Mostly", "used", "by", "payloads" ]
02f7a529d7dc2e49bed942111067aa5faf320e90
https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/encoders/__init__.py#L8-L16
train
Encode a value for the current node.
bitesofcode/projexui
projexui/widgets/xchart/renderers/xdonutrenderer.py
XDonutRenderer.drawForeground
def drawForeground(self, painter, rect, showGrid, showColumns, showRows): """ Draws the grid on the inputed painter :param painter | <QPainter> rect | <QRect> showGrid | <bool> showColumns | <bool> ...
python
def drawForeground(self, painter, rect, showGrid, showColumns, showRows): """ Draws the grid on the inputed painter :param painter | <QPainter> rect | <QRect> showGrid | <bool> showColumns | <bool> ...
[ "def", "drawForeground", "(", "self", ",", "painter", ",", "rect", ",", "showGrid", ",", "showColumns", ",", "showRows", ")", ":", "painter", ".", "save", "(", ")", "center", "=", "self", ".", "buildData", "(", "'center'", ")", "radius", "=", "self", "...
Draws the grid on the inputed painter :param painter | <QPainter> rect | <QRect> showGrid | <bool> showColumns | <bool> showRows | <bool>
[ "Draws", "the", "grid", "on", "the", "inputed", "painter", ":", "param", "painter", "|", "<QPainter", ">", "rect", "|", "<QRect", ">", "showGrid", "|", "<bool", ">", "showColumns", "|", "<bool", ">", "showRows", "|", "<bool", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/renderers/xdonutrenderer.py#L25-L45
train
Draws the foreground of the current time - item.
bitesofcode/projexui
projexui/widgets/xstackedwidget.py
XStackedWidget._finishAnimation
def _finishAnimation(self): """ Cleans up post-animation. """ self.setCurrentIndex(self._nextIndex) self.widget(self._lastIndex).hide() self.widget(self._lastIndex).move(self._lastPoint) self._active = False if not self.signalsBlocked(): ...
python
def _finishAnimation(self): """ Cleans up post-animation. """ self.setCurrentIndex(self._nextIndex) self.widget(self._lastIndex).hide() self.widget(self._lastIndex).move(self._lastPoint) self._active = False if not self.signalsBlocked(): ...
[ "def", "_finishAnimation", "(", "self", ")", ":", "self", ".", "setCurrentIndex", "(", "self", ".", "_nextIndex", ")", "self", ".", "widget", "(", "self", ".", "_lastIndex", ")", ".", "hide", "(", ")", "self", ".", "widget", "(", "self", ".", "_lastInd...
Cleans up post-animation.
[ "Cleans", "up", "post", "-", "animation", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xstackedwidget.py#L66-L76
train
Ends the animation.
bitesofcode/projexui
projexui/widgets/xstackedwidget.py
XStackedWidget.clear
def clear(self): """ Clears out the widgets from this stack. """ for i in range(self.count() - 1, -1, -1): w = self.widget(i) if w: self.removeWidget(w) w.close() w.deleteLater()
python
def clear(self): """ Clears out the widgets from this stack. """ for i in range(self.count() - 1, -1, -1): w = self.widget(i) if w: self.removeWidget(w) w.close() w.deleteLater()
[ "def", "clear", "(", "self", ")", ":", "for", "i", "in", "range", "(", "self", ".", "count", "(", ")", "-", "1", ",", "-", "1", ",", "-", "1", ")", ":", "w", "=", "self", ".", "widget", "(", "i", ")", "if", "w", ":", "self", ".", "removeW...
Clears out the widgets from this stack.
[ "Clears", "out", "the", "widgets", "from", "this", "stack", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xstackedwidget.py#L86-L95
train
Clears out the widgets from this stack.
bitesofcode/projexui
projexui/widgets/xstackedwidget.py
XStackedWidget.slideIn
def slideIn(self, index, direction=Direction.Automatic): """ Slides in the panel at the inputed index in the given direction for this widget. :param index | <int> direction | <XStackedWidget.Direction> :return <bool> | succes...
python
def slideIn(self, index, direction=Direction.Automatic): """ Slides in the panel at the inputed index in the given direction for this widget. :param index | <int> direction | <XStackedWidget.Direction> :return <bool> | succes...
[ "def", "slideIn", "(", "self", ",", "index", ",", "direction", "=", "Direction", ".", "Automatic", ")", ":", "# do not allow multiple slides while it is active\r", "if", "self", ".", "_active", ":", "return", "False", "# determine the proper index to calculate\r", "inve...
Slides in the panel at the inputed index in the given direction for this widget. :param index | <int> direction | <XStackedWidget.Direction> :return <bool> | success
[ "Slides", "in", "the", "panel", "at", "the", "inputed", "index", "in", "the", "given", "direction", "for", "this", "widget", ".", ":", "param", "index", "|", "<int", ">", "direction", "|", "<XStackedWidget", ".", "Direction", ">", ":", "return", "<bool", ...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xstackedwidget.py#L142-L249
train
Returns a new list of items in the panel at the given index in the given direction.
talkincode/txradius
txradius/openvpn/statusdb.py
list
def list(conf): """ OpenVPN status list method """ try: config = init_config(conf) conn = get_conn(config.get('DEFAULT','statusdb')) cur = conn.cursor() sqlstr = '''select * from client_status order by ctime desc ''' cur.execute(sqlstr) result = cur.fetchall()...
python
def list(conf): """ OpenVPN status list method """ try: config = init_config(conf) conn = get_conn(config.get('DEFAULT','statusdb')) cur = conn.cursor() sqlstr = '''select * from client_status order by ctime desc ''' cur.execute(sqlstr) result = cur.fetchall()...
[ "def", "list", "(", "conf", ")", ":", "try", ":", "config", "=", "init_config", "(", "conf", ")", "conn", "=", "get_conn", "(", "config", ".", "get", "(", "'DEFAULT'", ",", "'statusdb'", ")", ")", "cur", "=", "conn", ".", "cursor", "(", ")", "sqlst...
OpenVPN status list method
[ "OpenVPN", "status", "list", "method" ]
b86fdbc9be41183680b82b07d3a8e8ea10926e01
https://github.com/talkincode/txradius/blob/b86fdbc9be41183680b82b07d3a8e8ea10926e01/txradius/openvpn/statusdb.py#L130-L145
train
List all OpenVPN status items
talkincode/txradius
txradius/openvpn/statusdb.py
cli
def cli(conf): """ OpenVPN status initdb method """ try: config = init_config(conf) debug = config.getboolean('DEFAULT', 'debug') conn = get_conn(config.get('DEFAULT','statusdb')) cur = conn.cursor() sqlstr = '''create table client_status (session_id text PRIM...
python
def cli(conf): """ OpenVPN status initdb method """ try: config = init_config(conf) debug = config.getboolean('DEFAULT', 'debug') conn = get_conn(config.get('DEFAULT','statusdb')) cur = conn.cursor() sqlstr = '''create table client_status (session_id text PRIM...
[ "def", "cli", "(", "conf", ")", ":", "try", ":", "config", "=", "init_config", "(", "conf", ")", "debug", "=", "config", ".", "getboolean", "(", "'DEFAULT'", ",", "'debug'", ")", "conn", "=", "get_conn", "(", "config", ".", "get", "(", "'DEFAULT'", "...
OpenVPN status initdb method
[ "OpenVPN", "status", "initdb", "method" ]
b86fdbc9be41183680b82b07d3a8e8ea10926e01
https://github.com/talkincode/txradius/blob/b86fdbc9be41183680b82b07d3a8e8ea10926e01/txradius/openvpn/statusdb.py#L150-L173
train
OpenVPN status initdb method
bitesofcode/projexui
projexui/widgets/xorbbrowserwidget/xcardwidget.py
XAbstractCardWidget.browserWidget
def browserWidget( self ): """ Returns the browser widget this card is linked to. :return <XOrbBrowserWidget> || None """ from projexui.widgets.xorbbrowserwidget import XOrbBrowserWidget return projexui.ancestor(self, XOrbBrowserWidget)
python
def browserWidget( self ): """ Returns the browser widget this card is linked to. :return <XOrbBrowserWidget> || None """ from projexui.widgets.xorbbrowserwidget import XOrbBrowserWidget return projexui.ancestor(self, XOrbBrowserWidget)
[ "def", "browserWidget", "(", "self", ")", ":", "from", "projexui", ".", "widgets", ".", "xorbbrowserwidget", "import", "XOrbBrowserWidget", "return", "projexui", ".", "ancestor", "(", "self", ",", "XOrbBrowserWidget", ")" ]
Returns the browser widget this card is linked to. :return <XOrbBrowserWidget> || None
[ "Returns", "the", "browser", "widget", "this", "card", "is", "linked", "to", ".", ":", "return", "<XOrbBrowserWidget", ">", "||", "None" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbbrowserwidget/xcardwidget.py#L33-L40
train
Returns the browser widget this card is linked to.
bitesofcode/projexui
projexui/widgets/xorbbrowserwidget/xcardwidget.py
XBasicCardWidget.setRecord
def setRecord( self, record ): """ Sets the record that is linked with this widget. :param record | <orb.Table> """ super(XBasicCardWidget, self).setRecord(record) browser = self.browserWidget() if ( not browser ): retu...
python
def setRecord( self, record ): """ Sets the record that is linked with this widget. :param record | <orb.Table> """ super(XBasicCardWidget, self).setRecord(record) browser = self.browserWidget() if ( not browser ): retu...
[ "def", "setRecord", "(", "self", ",", "record", ")", ":", "super", "(", "XBasicCardWidget", ",", "self", ")", ".", "setRecord", "(", "record", ")", "browser", "=", "self", ".", "browserWidget", "(", ")", "if", "(", "not", "browser", ")", ":", "return",...
Sets the record that is linked with this widget. :param record | <orb.Table>
[ "Sets", "the", "record", "that", "is", "linked", "with", "this", "widget", ".", ":", "param", "record", "|", "<orb", ".", "Table", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbbrowserwidget/xcardwidget.py#L75-L92
train
Sets the record that is linked with this widget.
bitesofcode/projexui
projexui/widgets/xorbquerywidget/xorbqueryplugin.py
XOrbQueryPlugin.createEditor
def createEditor(self, parent, column, op, value): """ Creates a new editor for the parent based on the plugin parameters. :param parent | <QWidget> :return <QWidget> || None """ try: cls = self._operatorMap[nativestring(op)...
python
def createEditor(self, parent, column, op, value): """ Creates a new editor for the parent based on the plugin parameters. :param parent | <QWidget> :return <QWidget> || None """ try: cls = self._operatorMap[nativestring(op)...
[ "def", "createEditor", "(", "self", ",", "parent", ",", "column", ",", "op", ",", "value", ")", ":", "try", ":", "cls", "=", "self", ".", "_operatorMap", "[", "nativestring", "(", "op", ")", "]", ".", "cls", "except", "KeyError", ",", "AttributeError",...
Creates a new editor for the parent based on the plugin parameters. :param parent | <QWidget> :return <QWidget> || None
[ "Creates", "a", "new", "editor", "for", "the", "parent", "based", "on", "the", "plugin", "parameters", ".", ":", "param", "parent", "|", "<QWidget", ">", ":", "return", "<QWidget", ">", "||", "None" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbquerywidget/xorbqueryplugin.py#L35-L55
train
Creates a new editor for the given parent based on the plugin parameters.
bitesofcode/projexui
projexui/widgets/xorbquerywidget/xorbqueryplugin.py
XOrbQueryPlugin.editorValue
def editorValue(self, editor): """ Returns the value from the editor for this widget. :param editor | <QWidget> || None :return <variant> value """ value, success = projexui.widgetValue(editor) if not success: retur...
python
def editorValue(self, editor): """ Returns the value from the editor for this widget. :param editor | <QWidget> || None :return <variant> value """ value, success = projexui.widgetValue(editor) if not success: retur...
[ "def", "editorValue", "(", "self", ",", "editor", ")", ":", "value", ",", "success", "=", "projexui", ".", "widgetValue", "(", "editor", ")", "if", "not", "success", ":", "return", "None", "return", "value" ]
Returns the value from the editor for this widget. :param editor | <QWidget> || None :return <variant> value
[ "Returns", "the", "value", "from", "the", "editor", "for", "this", "widget", ".", ":", "param", "editor", "|", "<QWidget", ">", "||", "None", ":", "return", "<variant", ">", "value" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbquerywidget/xorbqueryplugin.py#L57-L68
train
Returns the value of the given editor for this widget.
bitesofcode/projexui
projexui/widgets/xorbquerywidget/xorbqueryplugin.py
XOrbQueryPlugin.operator
def operator(self, operatorType, value): """ Returns the operator that best matches the type and value. :param operatorType | <Query.Op> value | <variant> :return <str> """ if value is None: if 'i...
python
def operator(self, operatorType, value): """ Returns the operator that best matches the type and value. :param operatorType | <Query.Op> value | <variant> :return <str> """ if value is None: if 'i...
[ "def", "operator", "(", "self", ",", "operatorType", ",", "value", ")", ":", "if", "value", "is", "None", ":", "if", "'is none'", "in", "self", ".", "_operatorMap", "and", "operatorType", "==", "Query", ".", "Op", ".", "Is", ":", "return", "'is none'", ...
Returns the operator that best matches the type and value. :param operatorType | <Query.Op> value | <variant> :return <str>
[ "Returns", "the", "operator", "that", "best", "matches", "the", "type", "and", "value", ".", ":", "param", "operatorType", "|", "<Query", ".", "Op", ">", "value", "|", "<variant", ">", ":", "return", "<str", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbquerywidget/xorbqueryplugin.py#L70-L88
train
Returns the name of the first available operator that best matches the type and value.
bitesofcode/projexui
projexui/widgets/xorbquerywidget/xorbqueryplugin.py
XOrbQueryPlugin.operators
def operators(self, ignore=0): """ Returns a list of operators for this plugin. :return <str> """ return [k for k, v in self._operatorMap.items() if not v.flags & ignore]
python
def operators(self, ignore=0): """ Returns a list of operators for this plugin. :return <str> """ return [k for k, v in self._operatorMap.items() if not v.flags & ignore]
[ "def", "operators", "(", "self", ",", "ignore", "=", "0", ")", ":", "return", "[", "k", "for", "k", ",", "v", "in", "self", ".", "_operatorMap", ".", "items", "(", ")", "if", "not", "v", ".", "flags", "&", "ignore", "]" ]
Returns a list of operators for this plugin. :return <str>
[ "Returns", "a", "list", "of", "operators", "for", "this", "plugin", ".", ":", "return", "<str", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbquerywidget/xorbqueryplugin.py#L90-L96
train
Returns a list of operators for this plugin.
bitesofcode/projexui
projexui/widgets/xorbquerywidget/xorbqueryplugin.py
XOrbQueryPlugin.registerEditor
def registerEditor(self, name, op, cls=None, defaultValue=None, flags=0): """ Registers an editor for the given operator as the given name. If no editor class is supplied, ...
python
def registerEditor(self, name, op, cls=None, defaultValue=None, flags=0): """ Registers an editor for the given operator as the given name. If no editor class is supplied, ...
[ "def", "registerEditor", "(", "self", ",", "name", ",", "op", ",", "cls", "=", "None", ",", "defaultValue", "=", "None", ",", "flags", "=", "0", ")", ":", "registry", "=", "XEditorRegistry", "(", "op", "=", "op", ",", "cls", "=", "cls", ",", "defau...
Registers an editor for the given operator as the given name. If no editor class is supplied, no editor widget will be created for the operator unless you overload the createEditor method and create your own :param name | <str> op | <Quer...
[ "Registers", "an", "editor", "for", "the", "given", "operator", "as", "the", "given", "name", ".", "If", "no", "editor", "class", "is", "supplied", "no", "editor", "widget", "will", "be", "created", "for", "the", "operator", "unless", "you", "overload", "t...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbquerywidget/xorbqueryplugin.py#L98-L119
train
Registers an editor for the given operator as the given name.
bitesofcode/projexui
projexui/widgets/xorbquerywidget/xorbqueryplugin.py
XOrbQueryPlugin.setupQuery
def setupQuery(self, query, op, editor): """ Returns the value from the editor. :param op | <str> editor | <QWidget> || None :return <bool> | success """ try: registry = self._operatorMap[natives...
python
def setupQuery(self, query, op, editor): """ Returns the value from the editor. :param op | <str> editor | <QWidget> || None :return <bool> | success """ try: registry = self._operatorMap[natives...
[ "def", "setupQuery", "(", "self", ",", "query", ",", "op", ",", "editor", ")", ":", "try", ":", "registry", "=", "self", ".", "_operatorMap", "[", "nativestring", "(", "op", ")", "]", "except", "KeyError", ":", "return", "False", "op", "=", "registry",...
Returns the value from the editor. :param op | <str> editor | <QWidget> || None :return <bool> | success
[ "Returns", "the", "value", "from", "the", "editor", ".", ":", "param", "op", "|", "<str", ">", "editor", "|", "<QWidget", ">", "||", "None", ":", "return", "<bool", ">", "|", "success" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbquerywidget/xorbqueryplugin.py#L121-L146
train
Sets up the query object according to the operator type and value.
bitesofcode/projexui
projexui/widgets/xorbquerywidget/xorbqueryplugin.py
XOrbQueryPluginFactory.plugin
def plugin(self, column): """ Looks up the plugin for the given column. :param column | <orb.Column> :return <XOrbQueryPlugin> || None """ base = ColumnType.base(column.columnType()) a = (column.columnType(), column.na...
python
def plugin(self, column): """ Looks up the plugin for the given column. :param column | <orb.Column> :return <XOrbQueryPlugin> || None """ base = ColumnType.base(column.columnType()) a = (column.columnType(), column.na...
[ "def", "plugin", "(", "self", ",", "column", ")", ":", "base", "=", "ColumnType", ".", "base", "(", "column", ".", "columnType", "(", ")", ")", "a", "=", "(", "column", ".", "columnType", "(", ")", ",", "column", ".", "name", "(", ")", ")", "b", ...
Looks up the plugin for the given column. :param column | <orb.Column> :return <XOrbQueryPlugin> || None
[ "Looks", "up", "the", "plugin", "for", "the", "given", "column", ".", ":", "param", "column", "|", "<orb", ".", "Column", ">", ":", "return", "<XOrbQueryPlugin", ">", "||", "None" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbquerywidget/xorbqueryplugin.py#L161-L184
train
Returns the first plugin that matches the given column.
bitesofcode/projexui
projexui/widgets/xorbquerywidget/xorbqueryplugin.py
XOrbQueryPluginFactory.register
def register(self, plugin, columnType=None, columnName=None): """ Registers a plugin to handle particular column types and column names based on user selection. :param plugin | <XOrbQueryPlugin> columnType | <orb.ColumnType> || None ...
python
def register(self, plugin, columnType=None, columnName=None): """ Registers a plugin to handle particular column types and column names based on user selection. :param plugin | <XOrbQueryPlugin> columnType | <orb.ColumnType> || None ...
[ "def", "register", "(", "self", ",", "plugin", ",", "columnType", "=", "None", ",", "columnName", "=", "None", ")", ":", "self", ".", "_plugins", "[", "(", "columnType", ",", "columnName", ")", "]", "=", "plugin" ]
Registers a plugin to handle particular column types and column names based on user selection. :param plugin | <XOrbQueryPlugin> columnType | <orb.ColumnType> || None columnName | <str> || None
[ "Registers", "a", "plugin", "to", "handle", "particular", "column", "types", "and", "column", "names", "based", "on", "user", "selection", ".", ":", "param", "plugin", "|", "<XOrbQueryPlugin", ">", "columnType", "|", "<orb", ".", "ColumnType", ">", "||", "No...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbquerywidget/xorbqueryplugin.py#L186-L195
train
Registers a new plugin to handle particular column types and column names based on user selection.
johnnoone/aioconsul
aioconsul/client/services_endpoint.py
ServicesEndpoint.register
async def register(self, service): """Registers a new local service. Returns: bool: ``True`` on success The register endpoint is used to add a new service, with an optional health check, to the local agent. The request body must look like:: { ...
python
async def register(self, service): """Registers a new local service. Returns: bool: ``True`` on success The register endpoint is used to add a new service, with an optional health check, to the local agent. The request body must look like:: { ...
[ "async", "def", "register", "(", "self", ",", "service", ")", ":", "response", "=", "await", "self", ".", "_api", ".", "put", "(", "\"/v1/agent/service/register\"", ",", "data", "=", "service", ")", "return", "response", ".", "status", "==", "200" ]
Registers a new local service. Returns: bool: ``True`` on success The register endpoint is used to add a new service, with an optional health check, to the local agent. The request body must look like:: { "ID": "redis1", "Name":...
[ "Registers", "a", "new", "local", "service", "." ]
02f7a529d7dc2e49bed942111067aa5faf320e90
https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/services_endpoint.py#L31-L116
train
Registers a new local service with the local agent.
johnnoone/aioconsul
aioconsul/client/services_endpoint.py
ServicesEndpoint.deregister
async def deregister(self, service): """Deregisters a local service Parameters: service (ObjectID): Service ID Returns: bool: ``True`` on success The deregister endpoint is used to remove a service from the local agent. The agent will take care of deregi...
python
async def deregister(self, service): """Deregisters a local service Parameters: service (ObjectID): Service ID Returns: bool: ``True`` on success The deregister endpoint is used to remove a service from the local agent. The agent will take care of deregi...
[ "async", "def", "deregister", "(", "self", ",", "service", ")", ":", "service_id", "=", "extract_attr", "(", "service", ",", "keys", "=", "[", "\"ServiceID\"", ",", "\"ID\"", "]", ")", "response", "=", "await", "self", ".", "_api", ".", "get", "(", "\"...
Deregisters a local service Parameters: service (ObjectID): Service ID Returns: bool: ``True`` on success The deregister endpoint is used to remove a service from the local agent. The agent will take care of deregistering the service with the Catalog. If...
[ "Deregisters", "a", "local", "service" ]
02f7a529d7dc2e49bed942111067aa5faf320e90
https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/services_endpoint.py#L118-L133
train
Deregisters a local service with the local nacacacore catalog.
johnnoone/aioconsul
aioconsul/client/services_endpoint.py
ServicesEndpoint.disable
async def disable(self, service, *, reason=None): """Enters maintenance mode for service Parameters: service (ObjectID): Service ID reason (str): Text string explaining the reason for placing the service into maintenance mode. Returns: ...
python
async def disable(self, service, *, reason=None): """Enters maintenance mode for service Parameters: service (ObjectID): Service ID reason (str): Text string explaining the reason for placing the service into maintenance mode. Returns: ...
[ "async", "def", "disable", "(", "self", ",", "service", ",", "*", ",", "reason", "=", "None", ")", ":", "return", "await", "self", ".", "maintenance", "(", "service", ",", "False", ",", "reason", "=", "reason", ")" ]
Enters maintenance mode for service Parameters: service (ObjectID): Service ID reason (str): Text string explaining the reason for placing the service into maintenance mode. Returns: bool: ``True`` on success Places a given service ...
[ "Enters", "maintenance", "mode", "for", "service" ]
02f7a529d7dc2e49bed942111067aa5faf320e90
https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/services_endpoint.py#L135-L152
train
Enables maintenance mode for a given service.
johnnoone/aioconsul
aioconsul/client/services_endpoint.py
ServicesEndpoint.enable
async def enable(self, service, *, reason=None): """Resumes normal operation for service Parameters: service (ObjectID): Service ID reason (str): Text string explaining the reason for placing the service into normal mode. Returns: bo...
python
async def enable(self, service, *, reason=None): """Resumes normal operation for service Parameters: service (ObjectID): Service ID reason (str): Text string explaining the reason for placing the service into normal mode. Returns: bo...
[ "async", "def", "enable", "(", "self", ",", "service", ",", "*", ",", "reason", "=", "None", ")", ":", "return", "await", "self", ".", "maintenance", "(", "service", ",", "False", ",", "reason", "=", "reason", ")" ]
Resumes normal operation for service Parameters: service (ObjectID): Service ID reason (str): Text string explaining the reason for placing the service into normal mode. Returns: bool: ``True`` on success
[ "Resumes", "normal", "operation", "for", "service" ]
02f7a529d7dc2e49bed942111067aa5faf320e90
https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/services_endpoint.py#L154-L164
train
Resumes normal operation for the specified service.
johnnoone/aioconsul
aioconsul/client/services_endpoint.py
ServicesEndpoint.maintenance
async def maintenance(self, service, enable, *, reason=None): """Enters maintenance mode / Resumes normal operation for service Parameters: service (ObjectID): Service ID enable (bool): Enter or exit maintenance mode reason (str): Text string explaining the reason fo...
python
async def maintenance(self, service, enable, *, reason=None): """Enters maintenance mode / Resumes normal operation for service Parameters: service (ObjectID): Service ID enable (bool): Enter or exit maintenance mode reason (str): Text string explaining the reason fo...
[ "async", "def", "maintenance", "(", "self", ",", "service", ",", "enable", ",", "*", ",", "reason", "=", "None", ")", ":", "service_id", "=", "extract_attr", "(", "service", ",", "keys", "=", "[", "\"ServiceID\"", ",", "\"ID\"", "]", ")", "response", "...
Enters maintenance mode / Resumes normal operation for service Parameters: service (ObjectID): Service ID enable (bool): Enter or exit maintenance mode reason (str): Text string explaining the reason for placing the service into normal mode. ...
[ "Enters", "maintenance", "mode", "/", "Resumes", "normal", "operation", "for", "service" ]
02f7a529d7dc2e49bed942111067aa5faf320e90
https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/services_endpoint.py#L166-L181
train
Enters or resumes maintenance mode for a specific service.
talkincode/txradius
txradius/mschap/mppe.py
mppe_chap2_gen_keys
def mppe_chap2_gen_keys(password, nt_response): """ 3.3. Generating 128-bit Session Keys When used in conjunction with MS-CHAP-2 authentication, the initial MPPE session keys are derived from the peer's Windows NT password. The first step is to obfuscate the peer's password using NtPasswordHash() fun...
python
def mppe_chap2_gen_keys(password, nt_response): """ 3.3. Generating 128-bit Session Keys When used in conjunction with MS-CHAP-2 authentication, the initial MPPE session keys are derived from the peer's Windows NT password. The first step is to obfuscate the peer's password using NtPasswordHash() fun...
[ "def", "mppe_chap2_gen_keys", "(", "password", ",", "nt_response", ")", ":", "password_hash", "=", "mschap", ".", "nt_password_hash", "(", "password", ")", "password_hash_hash", "=", "mschap", ".", "hash_nt_password_hash", "(", "password_hash", ")", "master_key", "=...
3.3. Generating 128-bit Session Keys When used in conjunction with MS-CHAP-2 authentication, the initial MPPE session keys are derived from the peer's Windows NT password. The first step is to obfuscate the peer's password using NtPasswordHash() function as described in [8]. NtPasswordHash(Passwor...
[ "3", ".", "3", ".", "Generating", "128", "-", "bit", "Session", "Keys" ]
b86fdbc9be41183680b82b07d3a8e8ea10926e01
https://github.com/talkincode/txradius/blob/b86fdbc9be41183680b82b07d3a8e8ea10926e01/txradius/mschap/mppe.py#L45-L93
train
This function generates 128 - bit session keys for the given NT - Response.
talkincode/txradius
txradius/mschap/mppe.py
get_master_key
def get_master_key(password_hash_hash, nt_response): """ GetMasterKey( IN 16-octet PasswordHashHash, IN 24-octet NTResponse, OUT 16-octet MasterKey ) { 20-octet Digest ZeroMemory(Digest, sizeof(Digest)); /* * SHSInit(), SHSUpdate() and SHSFinal() * are an implem...
python
def get_master_key(password_hash_hash, nt_response): """ GetMasterKey( IN 16-octet PasswordHashHash, IN 24-octet NTResponse, OUT 16-octet MasterKey ) { 20-octet Digest ZeroMemory(Digest, sizeof(Digest)); /* * SHSInit(), SHSUpdate() and SHSFinal() * are an implem...
[ "def", "get_master_key", "(", "password_hash_hash", ",", "nt_response", ")", ":", "sha_hash", "=", "hashlib", ".", "sha1", "(", ")", "sha_hash", ".", "update", "(", "password_hash_hash", ")", "sha_hash", ".", "update", "(", "nt_response", ")", "sha_hash", ".",...
GetMasterKey( IN 16-octet PasswordHashHash, IN 24-octet NTResponse, OUT 16-octet MasterKey ) { 20-octet Digest ZeroMemory(Digest, sizeof(Digest)); /* * SHSInit(), SHSUpdate() and SHSFinal() * are an implementation of the Secure Hash Standard [7]. */ SHSIn...
[ "GetMasterKey", "(", "IN", "16", "-", "octet", "PasswordHashHash", "IN", "24", "-", "octet", "NTResponse", "OUT", "16", "-", "octet", "MasterKey", ")", "{", "20", "-", "octet", "Digest" ]
b86fdbc9be41183680b82b07d3a8e8ea10926e01
https://github.com/talkincode/txradius/blob/b86fdbc9be41183680b82b07d3a8e8ea10926e01/txradius/mschap/mppe.py#L96-L126
train
This function returns the master key for the NT response.
talkincode/txradius
txradius/mschap/mppe.py
radius_encrypt_keys
def radius_encrypt_keys(plain_text, secret, request_authenticator, salt): """ Construct a plaintext version of the String field by concate- nating the Key-Length and Key sub-fields. If necessary, pad the resulting string until its length (in octets) is an even multiple of 16. It is re...
python
def radius_encrypt_keys(plain_text, secret, request_authenticator, salt): """ Construct a plaintext version of the String field by concate- nating the Key-Length and Key sub-fields. If necessary, pad the resulting string until its length (in octets) is an even multiple of 16. It is re...
[ "def", "radius_encrypt_keys", "(", "plain_text", ",", "secret", ",", "request_authenticator", ",", "salt", ")", ":", "i", "=", "len", "(", "plain_text", ")", "/", "16", "b", "=", "hashlib", ".", "new", "(", "\"md5\"", ",", "secret", "+", "request_authentic...
Construct a plaintext version of the String field by concate- nating the Key-Length and Key sub-fields. If necessary, pad the resulting string until its length (in octets) is an even multiple of 16. It is recommended that zero octets (0x00) be used for padding. Call this plaintext...
[ "Construct", "a", "plaintext", "version", "of", "the", "String", "field", "by", "concate", "-", "nating", "the", "Key", "-", "Length", "and", "Key", "sub", "-", "fields", ".", "If", "necessary", "pad", "the", "resulting", "string", "until", "its", "length"...
b86fdbc9be41183680b82b07d3a8e8ea10926e01
https://github.com/talkincode/txradius/blob/b86fdbc9be41183680b82b07d3a8e8ea10926e01/txradius/mschap/mppe.py#L227-L262
train
This function is used to encrypt a string field with a shared secret request_authenticator and salt.
whiteclover/dbpy
db/_db.py
DB.query
def query(self, sql, args=None, many=None, as_dict=False): """The connection raw sql query, when select table, show table to fetch records, it is compatible the dbi execute method. :param sql string: the sql stamtement like 'select * from %s' :param args list: Wen set None, will...
python
def query(self, sql, args=None, many=None, as_dict=False): """The connection raw sql query, when select table, show table to fetch records, it is compatible the dbi execute method. :param sql string: the sql stamtement like 'select * from %s' :param args list: Wen set None, will...
[ "def", "query", "(", "self", ",", "sql", ",", "args", "=", "None", ",", "many", "=", "None", ",", "as_dict", "=", "False", ")", ":", "con", "=", "self", ".", "pool", ".", "pop", "(", ")", "c", "=", "None", "try", ":", "c", "=", "con", ".", ...
The connection raw sql query, when select table, show table to fetch records, it is compatible the dbi execute method. :param sql string: the sql stamtement like 'select * from %s' :param args list: Wen set None, will use dbi execute(sql), else dbi execute(sql, args), the ar...
[ "The", "connection", "raw", "sql", "query", "when", "select", "table", "show", "table", "to", "fetch", "records", "it", "is", "compatible", "the", "dbi", "execute", "method", "." ]
3d9ce85f55cfb39cced22081e525f79581b26b3a
https://github.com/whiteclover/dbpy/blob/3d9ce85f55cfb39cced22081e525f79581b26b3a/db/_db.py#L85-L112
train
The connection raw sql query method.
whiteclover/dbpy
db/_db.py
DB.execute
def execute(self, sql, args=None): """It is used for update, delete records. :param sql string: the sql stamtement like 'select * from %s' :param args list: Wen set None, will use dbi execute(sql), else dbi execute(sql, args), the args keep the original rules, it shuld be tuple or ...
python
def execute(self, sql, args=None): """It is used for update, delete records. :param sql string: the sql stamtement like 'select * from %s' :param args list: Wen set None, will use dbi execute(sql), else dbi execute(sql, args), the args keep the original rules, it shuld be tuple or ...
[ "def", "execute", "(", "self", ",", "sql", ",", "args", "=", "None", ")", ":", "con", "=", "self", ".", "pool", ".", "pop", "(", ")", "c", "=", "None", "try", ":", "c", "=", "con", ".", "cursor", "(", ")", "LOGGER", ".", "debug", "(", "\"Exec...
It is used for update, delete records. :param sql string: the sql stamtement like 'select * from %s' :param args list: Wen set None, will use dbi execute(sql), else dbi execute(sql, args), the args keep the original rules, it shuld be tuple or list of list eg:: execut...
[ "It", "is", "used", "for", "update", "delete", "records", "." ]
3d9ce85f55cfb39cced22081e525f79581b26b3a
https://github.com/whiteclover/dbpy/blob/3d9ce85f55cfb39cced22081e525f79581b26b3a/db/_db.py#L125-L159
train
This function is used for update delete records. It is used for update delete records.
whiteclover/dbpy
db/_db.py
DB.connection_class
def connection_class(self, adapter): """Get connection class by adapter""" if self.adapters.get(adapter): return self.adapters[adapter] try: class_prefix = getattr( __import__('db.' + adapter, globals(), locals(), ['__class_prefi...
python
def connection_class(self, adapter): """Get connection class by adapter""" if self.adapters.get(adapter): return self.adapters[adapter] try: class_prefix = getattr( __import__('db.' + adapter, globals(), locals(), ['__class_prefi...
[ "def", "connection_class", "(", "self", ",", "adapter", ")", ":", "if", "self", ".", "adapters", ".", "get", "(", "adapter", ")", ":", "return", "self", ".", "adapters", "[", "adapter", "]", "try", ":", "class_prefix", "=", "getattr", "(", "__import__", ...
Get connection class by adapter
[ "Get", "connection", "class", "by", "adapter" ]
3d9ce85f55cfb39cced22081e525f79581b26b3a
https://github.com/whiteclover/dbpy/blob/3d9ce85f55cfb39cced22081e525f79581b26b3a/db/_db.py#L164-L179
train
Get connection class by adapter
whiteclover/dbpy
db/_db.py
DB.dialect_class
def dialect_class(self, adapter): """Get dialect sql class by adapter""" if self.dialects.get(adapter): return self.dialects[adapter] try: class_prefix = getattr( __import__('db.' + adapter, globals(), locals(), ['__class_prefix_...
python
def dialect_class(self, adapter): """Get dialect sql class by adapter""" if self.dialects.get(adapter): return self.dialects[adapter] try: class_prefix = getattr( __import__('db.' + adapter, globals(), locals(), ['__class_prefix_...
[ "def", "dialect_class", "(", "self", ",", "adapter", ")", ":", "if", "self", ".", "dialects", ".", "get", "(", "adapter", ")", ":", "return", "self", ".", "dialects", "[", "adapter", "]", "try", ":", "class_prefix", "=", "getattr", "(", "__import__", "...
Get dialect sql class by adapter
[ "Get", "dialect", "sql", "class", "by", "adapter" ]
3d9ce85f55cfb39cced22081e525f79581b26b3a
https://github.com/whiteclover/dbpy/blob/3d9ce85f55cfb39cced22081e525f79581b26b3a/db/_db.py#L181-L196
train
Get dialect sql class by adapter
whiteclover/dbpy
db/_db.py
DB._import_class
def _import_class(self, module2cls): """Import class by module dot split string""" d = module2cls.rfind(".") classname = module2cls[d + 1: len(module2cls)] m = __import__(module2cls[0:d], globals(), locals(), [classname]) return getattr(m, classname)
python
def _import_class(self, module2cls): """Import class by module dot split string""" d = module2cls.rfind(".") classname = module2cls[d + 1: len(module2cls)] m = __import__(module2cls[0:d], globals(), locals(), [classname]) return getattr(m, classname)
[ "def", "_import_class", "(", "self", ",", "module2cls", ")", ":", "d", "=", "module2cls", ".", "rfind", "(", "\".\"", ")", "classname", "=", "module2cls", "[", "d", "+", "1", ":", "len", "(", "module2cls", ")", "]", "m", "=", "__import__", "(", "modu...
Import class by module dot split string
[ "Import", "class", "by", "module", "dot", "split", "string" ]
3d9ce85f55cfb39cced22081e525f79581b26b3a
https://github.com/whiteclover/dbpy/blob/3d9ce85f55cfb39cced22081e525f79581b26b3a/db/_db.py#L198-L203
train
Import class by module dot split string
whiteclover/dbpy
db/_db.py
Transaction.commit
def commit(self): """Commits transaction""" try: self._con.commit() self._con.autocommit(True) except Exception as e: try: self._con.rollback() except Exception as e_: LOGGER.error('When transaction happend error: %s...
python
def commit(self): """Commits transaction""" try: self._con.commit() self._con.autocommit(True) except Exception as e: try: self._con.rollback() except Exception as e_: LOGGER.error('When transaction happend error: %s...
[ "def", "commit", "(", "self", ")", ":", "try", ":", "self", ".", "_con", ".", "commit", "(", ")", "self", ".", "_con", ".", "autocommit", "(", "True", ")", "except", "Exception", "as", "e", ":", "try", ":", "self", ".", "_con", ".", "rollback", "...
Commits transaction
[ "Commits", "transaction" ]
3d9ce85f55cfb39cced22081e525f79581b26b3a
https://github.com/whiteclover/dbpy/blob/3d9ce85f55cfb39cced22081e525f79581b26b3a/db/_db.py#L261-L275
train
Commits transaction.
whiteclover/dbpy
db/_db.py
Transaction.execute
def execute(self, sql, args): """Execute sql :param sql string: the sql stamtement like 'select * from %s' :param args list: Wen set None, will use dbi execute(sql), else db execute(sql, args), the args keep the original rules, it shuld be tuple or list of list """ ...
python
def execute(self, sql, args): """Execute sql :param sql string: the sql stamtement like 'select * from %s' :param args list: Wen set None, will use dbi execute(sql), else db execute(sql, args), the args keep the original rules, it shuld be tuple or list of list """ ...
[ "def", "execute", "(", "self", ",", "sql", ",", "args", ")", ":", "c", "=", "None", "try", ":", "c", "=", "self", ".", "_con", ".", "cursor", "(", ")", "LOGGER", ".", "debug", "(", "\"execute sql: \"", "+", "sql", "+", "\" args:\"", "+", "str", "...
Execute sql :param sql string: the sql stamtement like 'select * from %s' :param args list: Wen set None, will use dbi execute(sql), else db execute(sql, args), the args keep the original rules, it shuld be tuple or list of list
[ "Execute", "sql" ]
3d9ce85f55cfb39cced22081e525f79581b26b3a
https://github.com/whiteclover/dbpy/blob/3d9ce85f55cfb39cced22081e525f79581b26b3a/db/_db.py#L277-L301
train
Execute sql with args
bitesofcode/projexui
projexui/widgets/xchartwidget/xcharttrackeritem.py
XChartTrackerItem.paint
def paint( self, painter, option, widget ): """ Paints this item. :param painter | <QPainter> option | <QGraphicsOption> widget | <QWidget> """ painter.save() pen = QPen(self.color()) pen.setWidth(2...
python
def paint( self, painter, option, widget ): """ Paints this item. :param painter | <QPainter> option | <QGraphicsOption> widget | <QWidget> """ painter.save() pen = QPen(self.color()) pen.setWidth(2...
[ "def", "paint", "(", "self", ",", "painter", ",", "option", ",", "widget", ")", ":", "painter", ".", "save", "(", ")", "pen", "=", "QPen", "(", "self", ".", "color", "(", ")", ")", "pen", ".", "setWidth", "(", "2", ")", "painter", ".", "setPen", ...
Paints this item. :param painter | <QPainter> option | <QGraphicsOption> widget | <QWidget>
[ "Paints", "this", "item", ".", ":", "param", "painter", "|", "<QPainter", ">", "option", "|", "<QGraphicsOption", ">", "widget", "|", "<QWidget", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchartwidget/xcharttrackeritem.py#L41-L63
train
Paints this item.
bitesofcode/projexui
projexui/widgets/xchartwidget/xcharttrackeritem.py
XChartTrackerItem.rebuild
def rebuild( self, gridRect ): """ Rebuilds the tracker item. """ scene = self.scene() if ( not scene ): return self.setVisible(gridRect.contains(self.pos())) self.setZValue(100) path = QPainterPath() path....
python
def rebuild( self, gridRect ): """ Rebuilds the tracker item. """ scene = self.scene() if ( not scene ): return self.setVisible(gridRect.contains(self.pos())) self.setZValue(100) path = QPainterPath() path....
[ "def", "rebuild", "(", "self", ",", "gridRect", ")", ":", "scene", "=", "self", ".", "scene", "(", ")", "if", "(", "not", "scene", ")", ":", "return", "self", ".", "setVisible", "(", "gridRect", ".", "contains", "(", "self", ".", "pos", "(", ")", ...
Rebuilds the tracker item.
[ "Rebuilds", "the", "tracker", "item", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchartwidget/xcharttrackeritem.py#L65-L124
train
Rebuilds the tracker item.
bitesofcode/projexui
projexui/widgets/xchartwidget/xcharttrackeritem.py
XChartTrackerItem.setValue
def setValue( self, value ): """ Moves the line to the given value and rebuilds it :param value | <variant> """ scene = self.scene() point = scene.mapFromChart(value, None) self.setPos(point.x(), self.pos().y()) self.rebuil...
python
def setValue( self, value ): """ Moves the line to the given value and rebuilds it :param value | <variant> """ scene = self.scene() point = scene.mapFromChart(value, None) self.setPos(point.x(), self.pos().y()) self.rebuil...
[ "def", "setValue", "(", "self", ",", "value", ")", ":", "scene", "=", "self", ".", "scene", "(", ")", "point", "=", "scene", ".", "mapFromChart", "(", "value", ",", "None", ")", "self", ".", "setPos", "(", "point", ".", "x", "(", ")", ",", "self"...
Moves the line to the given value and rebuilds it :param value | <variant>
[ "Moves", "the", "line", "to", "the", "given", "value", "and", "rebuilds", "it", ":", "param", "value", "|", "<variant", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchartwidget/xcharttrackeritem.py#L134-L144
train
Sets the line to the given value and rebuilds it
ReneNulschDE/mercedesmejsonpy
mercedesmejsonpy/oauth.py
MercedesMeClientCredentials.get_access_token
def get_access_token(self): """ If a valid access token is in memory, returns it Else feches a new token and returns it """ if self.token_info and not self.is_token_expired(self.token_info): return self.token_info['access_token'] token_info = self._request_ac...
python
def get_access_token(self): """ If a valid access token is in memory, returns it Else feches a new token and returns it """ if self.token_info and not self.is_token_expired(self.token_info): return self.token_info['access_token'] token_info = self._request_ac...
[ "def", "get_access_token", "(", "self", ")", ":", "if", "self", ".", "token_info", "and", "not", "self", ".", "is_token_expired", "(", "self", ".", "token_info", ")", ":", "return", "self", ".", "token_info", "[", "'access_token'", "]", "token_info", "=", ...
If a valid access token is in memory, returns it Else feches a new token and returns it
[ "If", "a", "valid", "access", "token", "is", "in", "memory", "returns", "it", "Else", "feches", "a", "new", "token", "and", "returns", "it" ]
0618a0b49d6bb46599d11a8f66dc8d08d112ceec
https://github.com/ReneNulschDE/mercedesmejsonpy/blob/0618a0b49d6bb46599d11a8f66dc8d08d112ceec/mercedesmejsonpy/oauth.py#L56-L67
train
Get the access token from the server
ReneNulschDE/mercedesmejsonpy
mercedesmejsonpy/oauth.py
MercedesMeClientCredentials._request_access_token
def _request_access_token(self): """Gets client credentials access token """ payload = {'grant_type': 'authorization_code', 'code': code, 'redirect_uri': self.redirect_uri} headers = _make_authorization_headers(self.client_id, ...
python
def _request_access_token(self): """Gets client credentials access token """ payload = {'grant_type': 'authorization_code', 'code': code, 'redirect_uri': self.redirect_uri} headers = _make_authorization_headers(self.client_id, ...
[ "def", "_request_access_token", "(", "self", ")", ":", "payload", "=", "{", "'grant_type'", ":", "'authorization_code'", ",", "'code'", ":", "code", ",", "'redirect_uri'", ":", "self", ".", "redirect_uri", "}", "headers", "=", "_make_authorization_headers", "(", ...
Gets client credentials access token
[ "Gets", "client", "credentials", "access", "token" ]
0618a0b49d6bb46599d11a8f66dc8d08d112ceec
https://github.com/ReneNulschDE/mercedesmejsonpy/blob/0618a0b49d6bb46599d11a8f66dc8d08d112ceec/mercedesmejsonpy/oauth.py#L69-L85
train
Request an access token from the client
ReneNulschDE/mercedesmejsonpy
mercedesmejsonpy/oauth.py
MercedesMeOAuth.get_cached_token
def get_cached_token(self): ''' Gets a cached auth token ''' token_info = None if self.cache_path: try: f = open(self.cache_path) token_info_string = f.read() f.close() token_info = json.loads(token_info_string) ...
python
def get_cached_token(self): ''' Gets a cached auth token ''' token_info = None if self.cache_path: try: f = open(self.cache_path) token_info_string = f.read() f.close() token_info = json.loads(token_info_string) ...
[ "def", "get_cached_token", "(", "self", ")", ":", "token_info", "=", "None", "if", "self", ".", "cache_path", ":", "try", ":", "f", "=", "open", "(", "self", ".", "cache_path", ")", "token_info_string", "=", "f", ".", "read", "(", ")", "f", ".", "clo...
Gets a cached auth token
[ "Gets", "a", "cached", "auth", "token" ]
0618a0b49d6bb46599d11a8f66dc8d08d112ceec
https://github.com/ReneNulschDE/mercedesmejsonpy/blob/0618a0b49d6bb46599d11a8f66dc8d08d112ceec/mercedesmejsonpy/oauth.py#L126-L142
train
Gets a cached auth token
ReneNulschDE/mercedesmejsonpy
mercedesmejsonpy/oauth.py
MercedesMeOAuth.get_authorize_url
def get_authorize_url(self, state=None): """ Gets the URL to use to authorize this app """ payload = {'client_id': self.client_id, 'response_type': 'code', 'redirect_uri': self.redirect_uri, 'scope': self.scope} urlparams = urllib...
python
def get_authorize_url(self, state=None): """ Gets the URL to use to authorize this app """ payload = {'client_id': self.client_id, 'response_type': 'code', 'redirect_uri': self.redirect_uri, 'scope': self.scope} urlparams = urllib...
[ "def", "get_authorize_url", "(", "self", ",", "state", "=", "None", ")", ":", "payload", "=", "{", "'client_id'", ":", "self", ".", "client_id", ",", "'response_type'", ":", "'code'", ",", "'redirect_uri'", ":", "self", ".", "redirect_uri", ",", "'scope'", ...
Gets the URL to use to authorize this app
[ "Gets", "the", "URL", "to", "use", "to", "authorize", "this", "app" ]
0618a0b49d6bb46599d11a8f66dc8d08d112ceec
https://github.com/ReneNulschDE/mercedesmejsonpy/blob/0618a0b49d6bb46599d11a8f66dc8d08d112ceec/mercedesmejsonpy/oauth.py#L156-L166
train
Gets the URL to use to authorize this app
ReneNulschDE/mercedesmejsonpy
mercedesmejsonpy/oauth.py
MercedesMeOAuth.get_access_token
def get_access_token(self, code): """ Gets the access token for the app given the code Parameters: - code - the response code """ payload = {'redirect_uri': self.redirect_uri, 'code': code, 'grant_type': 'authorization_code'} ...
python
def get_access_token(self, code): """ Gets the access token for the app given the code Parameters: - code - the response code """ payload = {'redirect_uri': self.redirect_uri, 'code': code, 'grant_type': 'authorization_code'} ...
[ "def", "get_access_token", "(", "self", ",", "code", ")", ":", "payload", "=", "{", "'redirect_uri'", ":", "self", ".", "redirect_uri", ",", "'code'", ":", "code", ",", "'grant_type'", ":", "'authorization_code'", "}", "headers", "=", "self", ".", "_make_aut...
Gets the access token for the app given the code Parameters: - code - the response code
[ "Gets", "the", "access", "token", "for", "the", "app", "given", "the", "code" ]
0618a0b49d6bb46599d11a8f66dc8d08d112ceec
https://github.com/ReneNulschDE/mercedesmejsonpy/blob/0618a0b49d6bb46599d11a8f66dc8d08d112ceec/mercedesmejsonpy/oauth.py#L183-L203
train
Gets the access token for the app given the code
ReneNulschDE/mercedesmejsonpy
mercedesmejsonpy/oauth.py
MercedesMeOAuth._add_custom_values_to_token_info
def _add_custom_values_to_token_info(self, token_info): ''' Store some values that aren't directly provided by a Web API response. ''' token_info['expires_at'] = int(time.time()) + token_info['expires_in'] token_info['scope'] = self.scope return token_info
python
def _add_custom_values_to_token_info(self, token_info): ''' Store some values that aren't directly provided by a Web API response. ''' token_info['expires_at'] = int(time.time()) + token_info['expires_in'] token_info['scope'] = self.scope return token_info
[ "def", "_add_custom_values_to_token_info", "(", "self", ",", "token_info", ")", ":", "token_info", "[", "'expires_at'", "]", "=", "int", "(", "time", ".", "time", "(", ")", ")", "+", "token_info", "[", "'expires_in'", "]", "token_info", "[", "'scope'", "]", ...
Store some values that aren't directly provided by a Web API response.
[ "Store", "some", "values", "that", "aren", "t", "directly", "provided", "by", "a", "Web", "API", "response", "." ]
0618a0b49d6bb46599d11a8f66dc8d08d112ceec
https://github.com/ReneNulschDE/mercedesmejsonpy/blob/0618a0b49d6bb46599d11a8f66dc8d08d112ceec/mercedesmejsonpy/oauth.py#L226-L233
train
Add custom values to the token info dict.
bitesofcode/projexui
projexui/widgets/xsplitbutton.py
XSplitButton.addAction
def addAction(self, action, checked=None, autoBuild=True): """ Adds the inputed action to this widget's action group. This will auto-\ create a new group if no group is already defined. :param action | <QAction> || <str> :return <QAction> ...
python
def addAction(self, action, checked=None, autoBuild=True): """ Adds the inputed action to this widget's action group. This will auto-\ create a new group if no group is already defined. :param action | <QAction> || <str> :return <QAction> ...
[ "def", "addAction", "(", "self", ",", "action", ",", "checked", "=", "None", ",", "autoBuild", "=", "True", ")", ":", "# clear the holder\r", "actions", "=", "self", ".", "_actionGroup", ".", "actions", "(", ")", "if", "actions", "and", "actions", "[", "...
Adds the inputed action to this widget's action group. This will auto-\ create a new group if no group is already defined. :param action | <QAction> || <str> :return <QAction>
[ "Adds", "the", "inputed", "action", "to", "this", "widget", "s", "action", "group", ".", "This", "will", "auto", "-", "\\", "create", "a", "new", "group", "if", "no", "group", "is", "already", "defined", ".", ":", "param", "action", "|", "<QAction", ">...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xsplitbutton.py#L149-L185
train
Adds the inputed action to this widget s action group.
bitesofcode/projexui
projexui/widgets/xsplitbutton.py
XSplitButton.clear
def clear(self, autoBuild=True): """ Clears the actions for this widget. """ for action in self._actionGroup.actions(): self._actionGroup.removeAction(action) action = QAction('', self) action.setObjectName('place_holder') self._actio...
python
def clear(self, autoBuild=True): """ Clears the actions for this widget. """ for action in self._actionGroup.actions(): self._actionGroup.removeAction(action) action = QAction('', self) action.setObjectName('place_holder') self._actio...
[ "def", "clear", "(", "self", ",", "autoBuild", "=", "True", ")", ":", "for", "action", "in", "self", ".", "_actionGroup", ".", "actions", "(", ")", ":", "self", ".", "_actionGroup", ".", "removeAction", "(", "action", ")", "action", "=", "QAction", "("...
Clears the actions for this widget.
[ "Clears", "the", "actions", "for", "this", "widget", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xsplitbutton.py#L187-L198
train
Clears the actions for this widget.
bitesofcode/projexui
projexui/widgets/xsplitbutton.py
XSplitButton.count
def count(self): """ Returns the number of actions associated with this button. :return <int> """ actions = self._actionGroup.actions() if len(actions) == 1 and actions[0].objectName() == 'place_holder': return 0 return ...
python
def count(self): """ Returns the number of actions associated with this button. :return <int> """ actions = self._actionGroup.actions() if len(actions) == 1 and actions[0].objectName() == 'place_holder': return 0 return ...
[ "def", "count", "(", "self", ")", ":", "actions", "=", "self", ".", "_actionGroup", ".", "actions", "(", ")", "if", "len", "(", "actions", ")", "==", "1", "and", "actions", "[", "0", "]", ".", "objectName", "(", ")", "==", "'place_holder'", ":", "r...
Returns the number of actions associated with this button. :return <int>
[ "Returns", "the", "number", "of", "actions", "associated", "with", "this", "button", ".", ":", "return", "<int", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xsplitbutton.py#L208-L218
train
Returns the number of actions associated with this button.
bitesofcode/projexui
projexui/widgets/xsplitbutton.py
XSplitButton.emitTriggered
def emitTriggered(self, action): """ Emits the triggered action for this widget. :param action | <QAction> """ self.currentActionChanged.emit(action) self.currentIndexChanged.emit(self.indexOf(action)) if not self.signalsBlocked(): ...
python
def emitTriggered(self, action): """ Emits the triggered action for this widget. :param action | <QAction> """ self.currentActionChanged.emit(action) self.currentIndexChanged.emit(self.indexOf(action)) if not self.signalsBlocked(): ...
[ "def", "emitTriggered", "(", "self", ",", "action", ")", ":", "self", ".", "currentActionChanged", ".", "emit", "(", "action", ")", "self", ".", "currentIndexChanged", ".", "emit", "(", "self", ".", "indexOf", "(", "action", ")", ")", "if", "not", "self"...
Emits the triggered action for this widget. :param action | <QAction>
[ "Emits", "the", "triggered", "action", "for", "this", "widget", ".", ":", "param", "action", "|", "<QAction", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xsplitbutton.py#L252-L262
train
Emits the triggered action for this widget.
bitesofcode/projexui
projexui/widgets/xsplitbutton.py
XSplitButton.indexOf
def indexOf(self, action): """ Returns the index of the inputed action. :param action | <QAction> || None :return <int> """ for i, act in enumerate(self.actionGroup().actions()): if action in (act, act.objectName(), act.text...
python
def indexOf(self, action): """ Returns the index of the inputed action. :param action | <QAction> || None :return <int> """ for i, act in enumerate(self.actionGroup().actions()): if action in (act, act.objectName(), act.text...
[ "def", "indexOf", "(", "self", ",", "action", ")", ":", "for", "i", ",", "act", "in", "enumerate", "(", "self", ".", "actionGroup", "(", ")", ".", "actions", "(", ")", ")", ":", "if", "action", "in", "(", "act", ",", "act", ".", "objectName", "("...
Returns the index of the inputed action. :param action | <QAction> || None :return <int>
[ "Returns", "the", "index", "of", "the", "inputed", "action", ".", ":", "param", "action", "|", "<QAction", ">", "||", "None", ":", "return", "<int", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xsplitbutton.py#L275-L286
train
Returns the index of the inputed action in the action group.
bitesofcode/projexui
projexui/widgets/xsplitbutton.py
XSplitButton.rebuild
def rebuild( self ): """ Rebuilds the user interface buttons for this widget. """ self.setUpdatesEnabled(False) # sync up the toolbuttons with our actions actions = self._actionGroup.actions() btns = self.findChildren(QToolButton) hori...
python
def rebuild( self ): """ Rebuilds the user interface buttons for this widget. """ self.setUpdatesEnabled(False) # sync up the toolbuttons with our actions actions = self._actionGroup.actions() btns = self.findChildren(QToolButton) hori...
[ "def", "rebuild", "(", "self", ")", ":", "self", ".", "setUpdatesEnabled", "(", "False", ")", "# sync up the toolbuttons with our actions\r", "actions", "=", "self", ".", "_actionGroup", ".", "actions", "(", ")", "btns", "=", "self", ".", "findChildren", "(", ...
Rebuilds the user interface buttons for this widget.
[ "Rebuilds", "the", "user", "interface", "buttons", "for", "this", "widget", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xsplitbutton.py#L305-L430
train
Rebuilds the user interface buttons for this widget.
bitesofcode/projexui
projexui/widgets/xsplitbutton.py
XSplitButton.setActions
def setActions(self, actions): """ Sets the actions for this widget to th inputed list of actions. :param [<QAction>, ..] """ self.clear(autoBuild=False) for action in actions: self.addAction(action, autoBuild=False) self.rebuild...
python
def setActions(self, actions): """ Sets the actions for this widget to th inputed list of actions. :param [<QAction>, ..] """ self.clear(autoBuild=False) for action in actions: self.addAction(action, autoBuild=False) self.rebuild...
[ "def", "setActions", "(", "self", ",", "actions", ")", ":", "self", ".", "clear", "(", "autoBuild", "=", "False", ")", "for", "action", "in", "actions", ":", "self", ".", "addAction", "(", "action", ",", "autoBuild", "=", "False", ")", "self", ".", "...
Sets the actions for this widget to th inputed list of actions. :param [<QAction>, ..]
[ "Sets", "the", "actions", "for", "this", "widget", "to", "th", "inputed", "list", "of", "actions", ".", ":", "param", "[", "<QAction", ">", "..", "]" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xsplitbutton.py#L432-L441
train
Sets the actions for this widget to the inputed list of actions.
bitesofcode/projexui
projexui/widgets/xsplitbutton.py
XSplitButton.setCheckable
def setCheckable(self, state): """ Sets whether or not the actions within this button should be checkable. :param state | <bool> """ self._checkable = state for act in self._actionGroup.actions(): act.setCheckable(state)
python
def setCheckable(self, state): """ Sets whether or not the actions within this button should be checkable. :param state | <bool> """ self._checkable = state for act in self._actionGroup.actions(): act.setCheckable(state)
[ "def", "setCheckable", "(", "self", ",", "state", ")", ":", "self", ".", "_checkable", "=", "state", "for", "act", "in", "self", ".", "_actionGroup", ".", "actions", "(", ")", ":", "act", ".", "setCheckable", "(", "state", ")" ]
Sets whether or not the actions within this button should be checkable. :param state | <bool>
[ "Sets", "whether", "or", "not", "the", "actions", "within", "this", "button", "should", "be", "checkable", ".", ":", "param", "state", "|", "<bool", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xsplitbutton.py#L461-L469
train
Sets whether or not the actions within this button should be checkable.
bitesofcode/projexui
projexui/widgets/xsplitbutton.py
XSplitButton.setCurrentAction
def setCurrentAction(self, action): """ Sets the current action for this button to the inputed action. :param action | <QAction> || <str> """ self._actionGroup.blockSignals(True) for act in self._actionGroup.actions(): act.setChecked(act ...
python
def setCurrentAction(self, action): """ Sets the current action for this button to the inputed action. :param action | <QAction> || <str> """ self._actionGroup.blockSignals(True) for act in self._actionGroup.actions(): act.setChecked(act ...
[ "def", "setCurrentAction", "(", "self", ",", "action", ")", ":", "self", ".", "_actionGroup", ".", "blockSignals", "(", "True", ")", "for", "act", "in", "self", ".", "_actionGroup", ".", "actions", "(", ")", ":", "act", ".", "setChecked", "(", "act", "...
Sets the current action for this button to the inputed action. :param action | <QAction> || <str>
[ "Sets", "the", "current", "action", "for", "this", "button", "to", "the", "inputed", "action", ".", ":", "param", "action", "|", "<QAction", ">", "||", "<str", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xsplitbutton.py#L479-L488
train
Sets the current action for this button to the inputed action.
bitesofcode/projexui
projexui/widgets/xsplitbutton.py
XSplitButton.setFont
def setFont(self, font): """ Sets the font for this widget and propogates down to the buttons. :param font | <QFont> """ super(XSplitButton, self).setFont(font) self.rebuild()
python
def setFont(self, font): """ Sets the font for this widget and propogates down to the buttons. :param font | <QFont> """ super(XSplitButton, self).setFont(font) self.rebuild()
[ "def", "setFont", "(", "self", ",", "font", ")", ":", "super", "(", "XSplitButton", ",", "self", ")", ".", "setFont", "(", "font", ")", "self", ".", "rebuild", "(", ")" ]
Sets the font for this widget and propogates down to the buttons. :param font | <QFont>
[ "Sets", "the", "font", "for", "this", "widget", "and", "propogates", "down", "to", "the", "buttons", ".", ":", "param", "font", "|", "<QFont", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xsplitbutton.py#L499-L506
train
Sets the font for this widget and propogates down to the buttons.
bitesofcode/projexui
projexui/widgets/xsplitbutton.py
XSplitButton.setPalette
def setPalette(self, palette): """ Rebuilds the buttons for this widget since they use specific palette options. :param palette | <QPalette> """ super(XSplitButton, self).setPalette(palette) self.rebuild()
python
def setPalette(self, palette): """ Rebuilds the buttons for this widget since they use specific palette options. :param palette | <QPalette> """ super(XSplitButton, self).setPalette(palette) self.rebuild()
[ "def", "setPalette", "(", "self", ",", "palette", ")", ":", "super", "(", "XSplitButton", ",", "self", ")", ".", "setPalette", "(", "palette", ")", "self", ".", "rebuild", "(", ")" ]
Rebuilds the buttons for this widget since they use specific palette options. :param palette | <QPalette>
[ "Rebuilds", "the", "buttons", "for", "this", "widget", "since", "they", "use", "specific", "palette", "options", ".", ":", "param", "palette", "|", "<QPalette", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xsplitbutton.py#L517-L525
train
Sets the palette for this widget.
philadams/dimensions
dimensions/core.py
get_dimensions
def get_dimensions(filenames): """given a sequence of filenames, compute dimensions return sequence of tuples (x, y, content-type, filename)""" dims = [] for filename in filenames: implemented = False with open(filename, 'rb') as fp: img_types = (PNGFile, GIFFile, JPEGFile)...
python
def get_dimensions(filenames): """given a sequence of filenames, compute dimensions return sequence of tuples (x, y, content-type, filename)""" dims = [] for filename in filenames: implemented = False with open(filename, 'rb') as fp: img_types = (PNGFile, GIFFile, JPEGFile)...
[ "def", "get_dimensions", "(", "filenames", ")", ":", "dims", "=", "[", "]", "for", "filename", "in", "filenames", ":", "implemented", "=", "False", "with", "open", "(", "filename", ",", "'rb'", ")", "as", "fp", ":", "img_types", "=", "(", "PNGFile", ",...
given a sequence of filenames, compute dimensions return sequence of tuples (x, y, content-type, filename)
[ "given", "a", "sequence", "of", "filenames", "compute", "dimensions", "return", "sequence", "of", "tuples", "(", "x", "y", "content", "-", "type", "filename", ")" ]
b7334f5ec55bed51aff5062dc960bbd7a82c5113
https://github.com/philadams/dimensions/blob/b7334f5ec55bed51aff5062dc960bbd7a82c5113/dimensions/core.py#L20-L45
train
given a sequence of filenames compute dimensions return sequence of tuples x y content - type filename
philadams/dimensions
dimensions/core.py
dimensions
def dimensions(filenames): """given a filename or list of filenames, return a tuple or sequence of tuples (x, y, filename)""" single = type(filenames) is str if single: filenames = [filenames] dims = get_dimensions(filenames) if single: dims = dims[0] return dims
python
def dimensions(filenames): """given a filename or list of filenames, return a tuple or sequence of tuples (x, y, filename)""" single = type(filenames) is str if single: filenames = [filenames] dims = get_dimensions(filenames) if single: dims = dims[0] return dims
[ "def", "dimensions", "(", "filenames", ")", ":", "single", "=", "type", "(", "filenames", ")", "is", "str", "if", "single", ":", "filenames", "=", "[", "filenames", "]", "dims", "=", "get_dimensions", "(", "filenames", ")", "if", "single", ":", "dims", ...
given a filename or list of filenames, return a tuple or sequence of tuples (x, y, filename)
[ "given", "a", "filename", "or", "list", "of", "filenames", "return", "a", "tuple", "or", "sequence", "of", "tuples", "(", "x", "y", "filename", ")" ]
b7334f5ec55bed51aff5062dc960bbd7a82c5113
https://github.com/philadams/dimensions/blob/b7334f5ec55bed51aff5062dc960bbd7a82c5113/dimensions/core.py#L48-L58
train
given a filename or list of filenames return a tuple or sequence of tuples x y filename
bitesofcode/projexui
projexui/widgets/xfilepathedit.py
XFilepathEdit.copyFilepath
def copyFilepath( self ): """ Copies the current filepath contents to the current clipboard. """ clipboard = QApplication.instance().clipboard() clipboard.setText(self.filepath()) clipboard.setText(self.filepath(), clipboard.Selection)
python
def copyFilepath( self ): """ Copies the current filepath contents to the current clipboard. """ clipboard = QApplication.instance().clipboard() clipboard.setText(self.filepath()) clipboard.setText(self.filepath(), clipboard.Selection)
[ "def", "copyFilepath", "(", "self", ")", ":", "clipboard", "=", "QApplication", ".", "instance", "(", ")", ".", "clipboard", "(", ")", "clipboard", ".", "setText", "(", "self", ".", "filepath", "(", ")", ")", "clipboard", ".", "setText", "(", "self", "...
Copies the current filepath contents to the current clipboard.
[ "Copies", "the", "current", "filepath", "contents", "to", "the", "current", "clipboard", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xfilepathedit.py#L136-L142
train
Copies the current filepath contents to the current clipboard.
bitesofcode/projexui
projexui/widgets/xfilepathedit.py
XFilepathEdit.dropEvent
def dropEvent( self, event ): """ Processes drop event. :param event | <QDropEvent> """ if event.mimeData().hasUrls(): url = event.mimeData().urls()[0] filepath = url.toLocalFile() if filepath: self....
python
def dropEvent( self, event ): """ Processes drop event. :param event | <QDropEvent> """ if event.mimeData().hasUrls(): url = event.mimeData().urls()[0] filepath = url.toLocalFile() if filepath: self....
[ "def", "dropEvent", "(", "self", ",", "event", ")", ":", "if", "event", ".", "mimeData", "(", ")", ".", "hasUrls", "(", ")", ":", "url", "=", "event", ".", "mimeData", "(", ")", ".", "urls", "(", ")", "[", "0", "]", "filepath", "=", "url", ".",...
Processes drop event. :param event | <QDropEvent>
[ "Processes", "drop", "event", ".", ":", "param", "event", "|", "<QDropEvent", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xfilepathedit.py#L162-L172
train
Updates the filepath attribute of the object based on the event.
bitesofcode/projexui
projexui/widgets/xfilepathedit.py
XFilepathEdit.eventFilter
def eventFilter( self, object, event ): """ Overloads the eventFilter to look for click events on the line edit. :param object | <QObject> event | <QEvent> """ if ( object == self._filepathEdit and \ self._filepathEdit.isReadOnly() ...
python
def eventFilter( self, object, event ): """ Overloads the eventFilter to look for click events on the line edit. :param object | <QObject> event | <QEvent> """ if ( object == self._filepathEdit and \ self._filepathEdit.isReadOnly() ...
[ "def", "eventFilter", "(", "self", ",", "object", ",", "event", ")", ":", "if", "(", "object", "==", "self", ".", "_filepathEdit", "and", "self", ".", "_filepathEdit", ".", "isReadOnly", "(", ")", "and", "event", ".", "type", "(", ")", "==", "event", ...
Overloads the eventFilter to look for click events on the line edit. :param object | <QObject> event | <QEvent>
[ "Overloads", "the", "eventFilter", "to", "look", "for", "click", "events", "on", "the", "line", "edit", ".", ":", "param", "object", "|", "<QObject", ">", "event", "|", "<QEvent", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xfilepathedit.py#L182-L195
train
This method is used to filter out click events on the line edit.
bitesofcode/projexui
projexui/widgets/xfilepathedit.py
XFilepathEdit.filepath
def filepath( self, validated = False ): """ Returns the filepath for this widget. If the validated flag is set \ then this method will only return if the file or folder actually \ exists for this path. In the case of a SaveFile, only the base folder \ needs to exist on the sys...
python
def filepath( self, validated = False ): """ Returns the filepath for this widget. If the validated flag is set \ then this method will only return if the file or folder actually \ exists for this path. In the case of a SaveFile, only the base folder \ needs to exist on the sys...
[ "def", "filepath", "(", "self", ",", "validated", "=", "False", ")", ":", "paths", "=", "self", ".", "filepaths", "(", ")", "if", "not", "paths", ":", "return", "''", "if", "not", "validated", "or", "self", ".", "isValid", "(", ")", ":", "return", ...
Returns the filepath for this widget. If the validated flag is set \ then this method will only return if the file or folder actually \ exists for this path. In the case of a SaveFile, only the base folder \ needs to exist on the system, in other modes the actual filepath must \ exist....
[ "Returns", "the", "filepath", "for", "this", "widget", ".", "If", "the", "validated", "flag", "is", "set", "\\", "then", "this", "method", "will", "only", "return", "if", "the", "file", "or", "folder", "actually", "\\", "exists", "for", "this", "path", "...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xfilepathedit.py#L197-L214
train
Returns the filepath for this widget.
bitesofcode/projexui
projexui/widgets/xfilepathedit.py
XFilepathEdit.filepaths
def filepaths(self): """ Returns a list of the filepaths for this edit. :return [<str>, ..] """ return nativestring(self._filepathEdit.text()).split(os.path.pathsep)
python
def filepaths(self): """ Returns a list of the filepaths for this edit. :return [<str>, ..] """ return nativestring(self._filepathEdit.text()).split(os.path.pathsep)
[ "def", "filepaths", "(", "self", ")", ":", "return", "nativestring", "(", "self", ".", "_filepathEdit", ".", "text", "(", ")", ")", ".", "split", "(", "os", ".", "path", ".", "pathsep", ")" ]
Returns a list of the filepaths for this edit. :return [<str>, ..]
[ "Returns", "a", "list", "of", "the", "filepaths", "for", "this", "edit", ".", ":", "return", "[", "<str", ">", "..", "]" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xfilepathedit.py#L216-L222
train
Returns a list of the filepaths for this edit.
bitesofcode/projexui
projexui/widgets/xfilepathedit.py
XFilepathEdit.isValid
def isValid( self ): """ Returns whether or not the filepath exists on the system. \ In the case of a SaveFile, only the base folder \ needs to exist on the system, in other modes the actual filepath must \ exist. :return <bool> """ check = na...
python
def isValid( self ): """ Returns whether or not the filepath exists on the system. \ In the case of a SaveFile, only the base folder \ needs to exist on the system, in other modes the actual filepath must \ exist. :return <bool> """ check = na...
[ "def", "isValid", "(", "self", ")", ":", "check", "=", "nativestring", "(", "self", ".", "_filepathEdit", ".", "text", "(", ")", ")", ".", "split", "(", "os", ".", "path", ".", "pathsep", ")", "[", "0", "]", "if", "(", "self", ".", "filepathMode", ...
Returns whether or not the filepath exists on the system. \ In the case of a SaveFile, only the base folder \ needs to exist on the system, in other modes the actual filepath must \ exist. :return <bool>
[ "Returns", "whether", "or", "not", "the", "filepath", "exists", "on", "the", "system", ".", "\\", "In", "the", "case", "of", "a", "SaveFile", "only", "the", "base", "folder", "\\", "needs", "to", "exist", "on", "the", "system", "in", "other", "modes", ...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xfilepathedit.py#L280-L293
train
Returns whether or not the filepath exists on the system.
bitesofcode/projexui
projexui/widgets/xfilepathedit.py
XFilepathEdit.pickFilepath
def pickFilepath( self ): """ Prompts the user to select a filepath from the system based on the \ current filepath mode. """ mode = self.filepathMode() filepath = '' filepaths = [] curr_dir = nativestring(self._filepathEdit.text()) if (...
python
def pickFilepath( self ): """ Prompts the user to select a filepath from the system based on the \ current filepath mode. """ mode = self.filepathMode() filepath = '' filepaths = [] curr_dir = nativestring(self._filepathEdit.text()) if (...
[ "def", "pickFilepath", "(", "self", ")", ":", "mode", "=", "self", ".", "filepathMode", "(", ")", "filepath", "=", "''", "filepaths", "=", "[", "]", "curr_dir", "=", "nativestring", "(", "self", ".", "_filepathEdit", ".", "text", "(", ")", ")", "if", ...
Prompts the user to select a filepath from the system based on the \ current filepath mode.
[ "Prompts", "the", "user", "to", "select", "a", "filepath", "from", "the", "system", "based", "on", "the", "\\", "current", "filepath", "mode", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xfilepathedit.py#L322-L363
train
Prompts the user to select a filepath from the system based on the current filepath mode.
bitesofcode/projexui
projexui/widgets/xfilepathedit.py
XFilepathEdit.setFilepathModeText
def setFilepathModeText( self, text ): """ Sets the filepath mode for this widget based on the inputed text. :param text | <str> :return <bool> | success """ try: self.setFilepathMode(XFilepathEdit.Mode[nativestring(text)]) ...
python
def setFilepathModeText( self, text ): """ Sets the filepath mode for this widget based on the inputed text. :param text | <str> :return <bool> | success """ try: self.setFilepathMode(XFilepathEdit.Mode[nativestring(text)]) ...
[ "def", "setFilepathModeText", "(", "self", ",", "text", ")", ":", "try", ":", "self", ".", "setFilepathMode", "(", "XFilepathEdit", ".", "Mode", "[", "nativestring", "(", "text", ")", "]", ")", "return", "True", "except", "KeyError", ":", "return", "False"...
Sets the filepath mode for this widget based on the inputed text. :param text | <str> :return <bool> | success
[ "Sets", "the", "filepath", "mode", "for", "this", "widget", "based", "on", "the", "inputed", "text", ".", ":", "param", "text", "|", "<str", ">", ":", "return", "<bool", ">", "|", "success" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xfilepathedit.py#L383-L395
train
Sets the filepath mode for this widget based on the inputed text.
bitesofcode/projexui
projexui/widgets/xfilepathedit.py
XFilepathEdit.setFilepath
def setFilepath(self, filepath): """ Sets the filepath text for this widget to the inputed path. :param filepath | <str> """ if not filepath: self._filepathEdit.setText('') return if self.normalizePath(): fi...
python
def setFilepath(self, filepath): """ Sets the filepath text for this widget to the inputed path. :param filepath | <str> """ if not filepath: self._filepathEdit.setText('') return if self.normalizePath(): fi...
[ "def", "setFilepath", "(", "self", ",", "filepath", ")", ":", "if", "not", "filepath", ":", "self", ".", "_filepathEdit", ".", "setText", "(", "''", ")", "return", "if", "self", ".", "normalizePath", "(", ")", ":", "filepath", "=", "os", ".", "path", ...
Sets the filepath text for this widget to the inputed path. :param filepath | <str>
[ "Sets", "the", "filepath", "text", "for", "this", "widget", "to", "the", "inputed", "path", ".", ":", "param", "filepath", "|", "<str", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xfilepathedit.py#L408-L423
train
Sets the filepath text for this widget to the inputed path.
bitesofcode/projexui
projexui/widgets/xfilepathedit.py
XFilepathEdit.setFilepaths
def setFilepaths(self, filepaths): """ Sets the list of the filepaths for this widget to the inputed paths. :param filepaths | [<str>, ..] """ self.setFilepath(os.path.pathsep.join(filepaths))
python
def setFilepaths(self, filepaths): """ Sets the list of the filepaths for this widget to the inputed paths. :param filepaths | [<str>, ..] """ self.setFilepath(os.path.pathsep.join(filepaths))
[ "def", "setFilepaths", "(", "self", ",", "filepaths", ")", ":", "self", ".", "setFilepath", "(", "os", ".", "path", ".", "pathsep", ".", "join", "(", "filepaths", ")", ")" ]
Sets the list of the filepaths for this widget to the inputed paths. :param filepaths | [<str>, ..]
[ "Sets", "the", "list", "of", "the", "filepaths", "for", "this", "widget", "to", "the", "inputed", "paths", ".", ":", "param", "filepaths", "|", "[", "<str", ">", "..", "]" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xfilepathedit.py#L425-L431
train
Sets the list of filepaths for this widget to the inputed paths.
bitesofcode/projexui
projexui/widgets/xfilepathedit.py
XFilepathEdit.setHint
def setHint(self, hint): """ Sets the hint for this filepath. :param hint | <str> """ if self.normalizePath(): filepath = os.path.normpath(nativestring(hint)) else: filepath = os.path.normpath(nativestring(hint)).replace('\\', '/'...
python
def setHint(self, hint): """ Sets the hint for this filepath. :param hint | <str> """ if self.normalizePath(): filepath = os.path.normpath(nativestring(hint)) else: filepath = os.path.normpath(nativestring(hint)).replace('\\', '/'...
[ "def", "setHint", "(", "self", ",", "hint", ")", ":", "if", "self", ".", "normalizePath", "(", ")", ":", "filepath", "=", "os", ".", "path", ".", "normpath", "(", "nativestring", "(", "hint", ")", ")", "else", ":", "filepath", "=", "os", ".", "path...
Sets the hint for this filepath. :param hint | <str>
[ "Sets", "the", "hint", "for", "this", "filepath", ".", ":", "param", "hint", "|", "<str", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xfilepathedit.py#L433-L444
train
Sets the hint for this filepath.
bitesofcode/projexui
projexui/widgets/xfilepathedit.py
XFilepathEdit.setValidated
def setValidated( self, state ): """ Set whether or not to validate the path as the user edits it. :param state | <bool> """ self._validated = state palette = self.palette() # reset the palette to default, revalidate self._filepathEd...
python
def setValidated( self, state ): """ Set whether or not to validate the path as the user edits it. :param state | <bool> """ self._validated = state palette = self.palette() # reset the palette to default, revalidate self._filepathEd...
[ "def", "setValidated", "(", "self", ",", "state", ")", ":", "self", ".", "_validated", "=", "state", "palette", "=", "self", ".", "palette", "(", ")", "# reset the palette to default, revalidate", "self", ".", "_filepathEdit", ".", "setPalette", "(", "palette", ...
Set whether or not to validate the path as the user edits it. :param state | <bool>
[ "Set", "whether", "or", "not", "to", "validate", "the", "path", "as", "the", "user", "edits", "it", ".", ":", "param", "state", "|", "<bool", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xfilepathedit.py#L490-L501
train
Sets whether or not the path is valid.
bitesofcode/projexui
projexui/widgets/xfilepathedit.py
XFilepathEdit.showMenu
def showMenu( self, pos ): """ Popups a menu for this widget. """ menu = QMenu(self) menu.setAttribute(Qt.WA_DeleteOnClose) menu.addAction('Clear').triggered.connect(self.clearFilepath) menu.addSeparator() menu.addAction('Copy Filepath').triggered.connect(...
python
def showMenu( self, pos ): """ Popups a menu for this widget. """ menu = QMenu(self) menu.setAttribute(Qt.WA_DeleteOnClose) menu.addAction('Clear').triggered.connect(self.clearFilepath) menu.addSeparator() menu.addAction('Copy Filepath').triggered.connect(...
[ "def", "showMenu", "(", "self", ",", "pos", ")", ":", "menu", "=", "QMenu", "(", "self", ")", "menu", ".", "setAttribute", "(", "Qt", ".", "WA_DeleteOnClose", ")", "menu", ".", "addAction", "(", "'Clear'", ")", ".", "triggered", ".", "connect", "(", ...
Popups a menu for this widget.
[ "Popups", "a", "menu", "for", "this", "widget", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xfilepathedit.py#L519-L529
train
Show the menu at the given position.
bitesofcode/projexui
projexui/widgets/xfilepathedit.py
XFilepathEdit.validateFilepath
def validateFilepath( self ): """ Alters the color scheme based on the validation settings. """ if ( not self.isValidated() ): return valid = self.isValid() if ( not valid ): fg = self.invalidForeground() bg = self.invalidBackg...
python
def validateFilepath( self ): """ Alters the color scheme based on the validation settings. """ if ( not self.isValidated() ): return valid = self.isValid() if ( not valid ): fg = self.invalidForeground() bg = self.invalidBackg...
[ "def", "validateFilepath", "(", "self", ")", ":", "if", "(", "not", "self", ".", "isValidated", "(", ")", ")", ":", "return", "valid", "=", "self", ".", "isValid", "(", ")", "if", "(", "not", "valid", ")", ":", "fg", "=", "self", ".", "invalidForeg...
Alters the color scheme based on the validation settings.
[ "Alters", "the", "color", "scheme", "based", "on", "the", "validation", "settings", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xfilepathedit.py#L547-L565
train
Updates the color scheme based on the validation settings.
bitesofcode/projexui
projexui/widgets/xorbrecordsetedit/xorbrecordsetedit.py
XQueryItem.query
def query( self ): """ Returns the query for this item by joining together its children, or building its data. :return <Query> || <QueryCompound> """ if ( self.childCount() ): q = Q() for i in range(self.childCount()): ...
python
def query( self ): """ Returns the query for this item by joining together its children, or building its data. :return <Query> || <QueryCompound> """ if ( self.childCount() ): q = Q() for i in range(self.childCount()): ...
[ "def", "query", "(", "self", ")", ":", "if", "(", "self", ".", "childCount", "(", ")", ")", ":", "q", "=", "Q", "(", ")", "for", "i", "in", "range", "(", "self", ".", "childCount", "(", ")", ")", ":", "q", "&=", "self", ".", "child", "(", "...
Returns the query for this item by joining together its children, or building its data. :return <Query> || <QueryCompound>
[ "Returns", "the", "query", "for", "this", "item", "by", "joining", "together", "its", "children", "or", "building", "its", "data", ".", ":", "return", "<Query", ">", "||", "<QueryCompound", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbrecordsetedit/xorbrecordsetedit.py#L121-L138
train
Returns the query for this item by joining together its children and building its data.
bitesofcode/projexui
projexui/widgets/xorbrecordsetedit/xorbrecordsetedit.py
XOrbRecordSetEdit.applyQuery
def applyQuery( self ): """ Sets the query for this widget from the quick query text builder. """ query = Q.fromString(nativestring(self.uiQueryTXT.text())) self.setQuery(query) self.uiQueryTXT.setText('')
python
def applyQuery( self ): """ Sets the query for this widget from the quick query text builder. """ query = Q.fromString(nativestring(self.uiQueryTXT.text())) self.setQuery(query) self.uiQueryTXT.setText('')
[ "def", "applyQuery", "(", "self", ")", ":", "query", "=", "Q", ".", "fromString", "(", "nativestring", "(", "self", ".", "uiQueryTXT", ".", "text", "(", ")", ")", ")", "self", ".", "setQuery", "(", "query", ")", "self", ".", "uiQueryTXT", ".", "setTe...
Sets the query for this widget from the quick query text builder.
[ "Sets", "the", "query", "for", "this", "widget", "from", "the", "quick", "query", "text", "builder", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbrecordsetedit/xorbrecordsetedit.py#L208-L214
train
Applies the query for this widget to the quick query text builder.
bitesofcode/projexui
projexui/widgets/xorbrecordsetedit/xorbrecordsetedit.py
XOrbRecordSetEdit.clear
def clear( self ): """ Clears the information for this edit. """ self.uiQueryTXT.setText('') self.uiQueryTREE.clear() self.uiGroupingTXT.setText('') self.uiSortingTXT.setText('')
python
def clear( self ): """ Clears the information for this edit. """ self.uiQueryTXT.setText('') self.uiQueryTREE.clear() self.uiGroupingTXT.setText('') self.uiSortingTXT.setText('')
[ "def", "clear", "(", "self", ")", ":", "self", ".", "uiQueryTXT", ".", "setText", "(", "''", ")", "self", ".", "uiQueryTREE", ".", "clear", "(", ")", "self", ".", "uiGroupingTXT", ".", "setText", "(", "''", ")", "self", ".", "uiSortingTXT", ".", "set...
Clears the information for this edit.
[ "Clears", "the", "information", "for", "this", "edit", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbrecordsetedit/xorbrecordsetedit.py#L216-L223
train
Clears the information for this edit.
bitesofcode/projexui
projexui/widgets/xorbrecordsetedit/xorbrecordsetedit.py
XOrbRecordSetEdit.query
def query( self ): """ Returns the query this widget is representing from the tree widget. :return <Query> || <QueryCompound> || None """ if ( not self.uiQueryCHK.isChecked() ): return None # build a query if not searching all ...
python
def query( self ): """ Returns the query this widget is representing from the tree widget. :return <Query> || <QueryCompound> || None """ if ( not self.uiQueryCHK.isChecked() ): return None # build a query if not searching all ...
[ "def", "query", "(", "self", ")", ":", "if", "(", "not", "self", ".", "uiQueryCHK", ".", "isChecked", "(", ")", ")", ":", "return", "None", "# build a query if not searching all\r", "q", "=", "Q", "(", ")", "for", "i", "in", "range", "(", "self", ".", ...
Returns the query this widget is representing from the tree widget. :return <Query> || <QueryCompound> || None
[ "Returns", "the", "query", "this", "widget", "is", "representing", "from", "the", "tree", "widget", ".", ":", "return", "<Query", ">", "||", "<QueryCompound", ">", "||", "None" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbrecordsetedit/xorbrecordsetedit.py#L225-L239
train
Returns the query this widget is representing from the tree widget.
bitesofcode/projexui
projexui/widgets/xorbrecordsetedit/xorbrecordsetedit.py
XOrbRecordSetEdit.recordSet
def recordSet( self ): """ Returns the record set that is associated with this widget. :return <orb.RecordSet> || None """ if ( not self.table() ): return None recordSet = RecordSet(self.table()) recordSet.setQuery(self....
python
def recordSet( self ): """ Returns the record set that is associated with this widget. :return <orb.RecordSet> || None """ if ( not self.table() ): return None recordSet = RecordSet(self.table()) recordSet.setQuery(self....
[ "def", "recordSet", "(", "self", ")", ":", "if", "(", "not", "self", ".", "table", "(", ")", ")", ":", "return", "None", "recordSet", "=", "RecordSet", "(", "self", ".", "table", "(", ")", ")", "recordSet", ".", "setQuery", "(", "self", ".", "query...
Returns the record set that is associated with this widget. :return <orb.RecordSet> || None
[ "Returns", "the", "record", "set", "that", "is", "associated", "with", "this", "widget", ".", ":", "return", "<orb", ".", "RecordSet", ">", "||", "None" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbrecordsetedit/xorbrecordsetedit.py#L241-L271
train
Returns the record set that is associated with this widget.
bitesofcode/projexui
projexui/widgets/xorbrecordsetedit/xorbrecordsetedit.py
XOrbRecordSetEdit.setRecordSet
def setRecordSet( self, recordSet ): """ Sets the record set instance that this widget will use. :param recordSet | <orb.RecordSet> """ if ( recordSet ): self.setQuery( recordSet.query() ) self.setGroupBy( recordSet.groupBy() ...
python
def setRecordSet( self, recordSet ): """ Sets the record set instance that this widget will use. :param recordSet | <orb.RecordSet> """ if ( recordSet ): self.setQuery( recordSet.query() ) self.setGroupBy( recordSet.groupBy() ...
[ "def", "setRecordSet", "(", "self", ",", "recordSet", ")", ":", "if", "(", "recordSet", ")", ":", "self", ".", "setQuery", "(", "recordSet", ".", "query", "(", ")", ")", "self", ".", "setGroupBy", "(", "recordSet", ".", "groupBy", "(", ")", ")", "sel...
Sets the record set instance that this widget will use. :param recordSet | <orb.RecordSet>
[ "Sets", "the", "record", "set", "instance", "that", "this", "widget", "will", "use", ".", ":", "param", "recordSet", "|", "<orb", ".", "RecordSet", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbrecordsetedit/xorbrecordsetedit.py#L319-L338
train
Sets the record set that this widget will use.
bitesofcode/projexui
projexui/widgets/xorbrecordsetedit/xorbrecordsetedit.py
XOrbRecordSetEdit.setGroupBy
def setGroupBy( self, groupBy ): """ Sets the group by information for this widget to the inputed grouping options. This can be either a list of strings, or a comma deliminated string. :param groupBy | <str> || [<str>, ..] """ if ( type(grou...
python
def setGroupBy( self, groupBy ): """ Sets the group by information for this widget to the inputed grouping options. This can be either a list of strings, or a comma deliminated string. :param groupBy | <str> || [<str>, ..] """ if ( type(grou...
[ "def", "setGroupBy", "(", "self", ",", "groupBy", ")", ":", "if", "(", "type", "(", "groupBy", ")", "in", "(", "list", ",", "tuple", ")", ")", ":", "groupBy", "=", "','", ".", "join", "(", "map", "(", "str", ",", "groupBy", ")", ")", "self", "....
Sets the group by information for this widget to the inputed grouping options. This can be either a list of strings, or a comma deliminated string. :param groupBy | <str> || [<str>, ..]
[ "Sets", "the", "group", "by", "information", "for", "this", "widget", "to", "the", "inputed", "grouping", "options", ".", "This", "can", "be", "either", "a", "list", "of", "strings", "or", "a", "comma", "deliminated", "string", ".", ":", "param", "groupBy"...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbrecordsetedit/xorbrecordsetedit.py#L340-L351
train
Sets the group by information for this widget to the inputed groupingTXT options.
bitesofcode/projexui
projexui/widgets/xorbrecordsetedit/xorbrecordsetedit.py
XOrbRecordSetEdit.setSortedBy
def setSortedBy( self, sortedBy ): """ Sets the sorting information for this widget to the inputed sorting options. This can be either a list of terms, or a comma deliminated string. :param sortedBy | <str> || [(<str> column, <str> direction), ..] ""...
python
def setSortedBy( self, sortedBy ): """ Sets the sorting information for this widget to the inputed sorting options. This can be either a list of terms, or a comma deliminated string. :param sortedBy | <str> || [(<str> column, <str> direction), ..] ""...
[ "def", "setSortedBy", "(", "self", ",", "sortedBy", ")", ":", "if", "(", "type", "(", "groupBy", ")", "in", "(", "list", ",", "tuple", ")", ")", ":", "sortedBy", "=", "','", ".", "join", "(", "map", "(", "lambda", "x", ":", "'%s|%s'", "%", "x", ...
Sets the sorting information for this widget to the inputed sorting options. This can be either a list of terms, or a comma deliminated string. :param sortedBy | <str> || [(<str> column, <str> direction), ..]
[ "Sets", "the", "sorting", "information", "for", "this", "widget", "to", "the", "inputed", "sorting", "options", ".", "This", "can", "be", "either", "a", "list", "of", "terms", "or", "a", "comma", "deliminated", "string", ".", ":", "param", "sortedBy", "|",...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbrecordsetedit/xorbrecordsetedit.py#L361-L372
train
Sets the sorting information for this widget to the inputed sorting information.
bitesofcode/projexui
projexui/widgets/xorbrecordsetedit/xorbrecordsetedit.py
XOrbRecordSetEdit.setTable
def setTable( self, table ): """ Sets the table that is assigned to this widget to the inputed table. :param table | <subclass of orb.Table> """ self._table = table self.setEnabled(table is not None) self.clear()
python
def setTable( self, table ): """ Sets the table that is assigned to this widget to the inputed table. :param table | <subclass of orb.Table> """ self._table = table self.setEnabled(table is not None) self.clear()
[ "def", "setTable", "(", "self", ",", "table", ")", ":", "self", ".", "_table", "=", "table", "self", ".", "setEnabled", "(", "table", "is", "not", "None", ")", "self", ".", "clear", "(", ")" ]
Sets the table that is assigned to this widget to the inputed table. :param table | <subclass of orb.Table>
[ "Sets", "the", "table", "that", "is", "assigned", "to", "this", "widget", "to", "the", "inputed", "table", ".", ":", "param", "table", "|", "<subclass", "of", "orb", ".", "Table", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbrecordsetedit/xorbrecordsetedit.py#L374-L382
train
Sets the table that this widget is assigned to.
bitesofcode/projexui
projexui/widgets/xorbrecordwidget.py
XOrbRecordWidget.loadValues
def loadValues(self, values): """ Loads the values from the inputed dictionary to the widget. :param values | <dict> """ table = self.tableType() if table: schema = table.schema() else: schema = None ...
python
def loadValues(self, values): """ Loads the values from the inputed dictionary to the widget. :param values | <dict> """ table = self.tableType() if table: schema = table.schema() else: schema = None ...
[ "def", "loadValues", "(", "self", ",", "values", ")", ":", "table", "=", "self", ".", "tableType", "(", ")", "if", "table", ":", "schema", "=", "table", ".", "schema", "(", ")", "else", ":", "schema", "=", "None", "process", "=", "[", "]", "for", ...
Loads the values from the inputed dictionary to the widget. :param values | <dict>
[ "Loads", "the", "values", "from", "the", "inputed", "dictionary", "to", "the", "widget", ".", ":", "param", "values", "|", "<dict", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbrecordwidget.py#L82-L121
train
Load the values from the inputed dictionary to the widget.
bitesofcode/projexui
projexui/widgets/xorbrecordwidget.py
XOrbRecordWidget.reset
def reset(self): """ Resets this widget's data to a new class an reinitializes. This method needs to have a table type defined for this widget to work. :sa setTableType, tableType :return <bool> | success """ ttype = self.tableT...
python
def reset(self): """ Resets this widget's data to a new class an reinitializes. This method needs to have a table type defined for this widget to work. :sa setTableType, tableType :return <bool> | success """ ttype = self.tableT...
[ "def", "reset", "(", "self", ")", ":", "ttype", "=", "self", ".", "tableType", "(", ")", "if", "(", "not", "ttype", ")", ":", "return", "False", "values", "=", "self", ".", "saveValues", "(", ")", "self", ".", "setRecord", "(", "ttype", "(", ")", ...
Resets this widget's data to a new class an reinitializes. This method needs to have a table type defined for this widget to work. :sa setTableType, tableType :return <bool> | success
[ "Resets", "this", "widget", "s", "data", "to", "a", "new", "class", "an", "reinitializes", ".", "This", "method", "needs", "to", "have", "a", "table", "type", "defined", "for", "this", "widget", "to", "work", ".", ":", "sa", "setTableType", "tableType", ...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbrecordwidget.py#L140-L162
train
Resets this widget s data to a new class an reinitializes it.
bitesofcode/projexui
projexui/widgets/xorbrecordwidget.py
XOrbRecordWidget.saveValues
def saveValues(self): """ Generates a dictionary of values from the widgets in this editor that will be used to save the values on its record. :return {<str> columnName: <variant> value, ..} """ output = {} for widget in self.findChi...
python
def saveValues(self): """ Generates a dictionary of values from the widgets in this editor that will be used to save the values on its record. :return {<str> columnName: <variant> value, ..} """ output = {} for widget in self.findChi...
[ "def", "saveValues", "(", "self", ")", ":", "output", "=", "{", "}", "for", "widget", "in", "self", ".", "findChildren", "(", "QWidget", ")", ":", "prop", "=", "widget", ".", "property", "(", "'columnName'", ")", "if", "not", "prop", ":", "continue", ...
Generates a dictionary of values from the widgets in this editor that will be used to save the values on its record. :return {<str> columnName: <variant> value, ..}
[ "Generates", "a", "dictionary", "of", "values", "from", "the", "widgets", "in", "this", "editor", "that", "will", "be", "used", "to", "save", "the", "values", "on", "its", "record", ".", ":", "return", "{", "<str", ">", "columnName", ":", "<variant", ">"...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbrecordwidget.py#L164-L199
train
Returns a dictionary of values that can be saved on the record.
bitesofcode/projexui
projexui/widgets/xorbrecordwidget.py
XOrbRecordWidget.save
def save(self): """ Saves the changes from the ui to this widgets record instance. """ record = self.record() if not record: logger.warning('No record has been defined for %s.' % self) return False if not self.signalsBlocked(): ...
python
def save(self): """ Saves the changes from the ui to this widgets record instance. """ record = self.record() if not record: logger.warning('No record has been defined for %s.' % self) return False if not self.signalsBlocked(): ...
[ "def", "save", "(", "self", ")", ":", "record", "=", "self", ".", "record", "(", ")", "if", "not", "record", ":", "logger", ".", "warning", "(", "'No record has been defined for %s.'", "%", "self", ")", "return", "False", "if", "not", "self", ".", "signa...
Saves the changes from the ui to this widgets record instance.
[ "Saves", "the", "changes", "from", "the", "ui", "to", "this", "widgets", "record", "instance", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbrecordwidget.py#L201-L275
train
Saves the changes from the ui to this widgets record instance.
bitesofcode/projexui
projexui/widgets/xorbrecordwidget.py
XOrbRecordWidget.saveSilent
def saveSilent(self): """ Saves the record, but does not emit the saved signal. This method is useful when chaining together multiple saves. Check the saveSignalBlocked value to know if it was muted to know if any saves occurred. :return <bool> ...
python
def saveSilent(self): """ Saves the record, but does not emit the saved signal. This method is useful when chaining together multiple saves. Check the saveSignalBlocked value to know if it was muted to know if any saves occurred. :return <bool> ...
[ "def", "saveSilent", "(", "self", ")", ":", "self", ".", "blockSignals", "(", "True", ")", "success", "=", "self", ".", "save", "(", ")", "self", ".", "blockSignals", "(", "False", ")", "return", "success" ]
Saves the record, but does not emit the saved signal. This method is useful when chaining together multiple saves. Check the saveSignalBlocked value to know if it was muted to know if any saves occurred. :return <bool>
[ "Saves", "the", "record", "but", "does", "not", "emit", "the", "saved", "signal", ".", "This", "method", "is", "useful", "when", "chaining", "together", "multiple", "saves", ".", "Check", "the", "saveSignalBlocked", "value", "to", "know", "if", "it", "was", ...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbrecordwidget.py#L286-L298
train
Saves the record but does not emit the saved signal.
bitesofcode/projexui
projexui/widgets/xorbrecordwidget.py
XOrbRecordWidget.setRecord
def setRecord(self, record): """ Sets the record instance linked with this widget. :param record | <orb.Table> """ self._record = record if record is not None: self.loadValues(record.recordValues(autoInflate=True)) else: ...
python
def setRecord(self, record): """ Sets the record instance linked with this widget. :param record | <orb.Table> """ self._record = record if record is not None: self.loadValues(record.recordValues(autoInflate=True)) else: ...
[ "def", "setRecord", "(", "self", ",", "record", ")", ":", "self", ".", "_record", "=", "record", "if", "record", "is", "not", "None", ":", "self", ".", "loadValues", "(", "record", ".", "recordValues", "(", "autoInflate", "=", "True", ")", ")", "else",...
Sets the record instance linked with this widget. :param record | <orb.Table>
[ "Sets", "the", "record", "instance", "linked", "with", "this", "widget", ".", ":", "param", "record", "|", "<orb", ".", "Table", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbrecordwidget.py#L326-L336
train
Sets the record instance linked with this widget.
bitesofcode/projexui
projexui/widgets/xorbrecordwidget.py
XOrbRecordWidget.getDialog
def getDialog(cls, name, parent=None): """ Generates a dialog for this class widget and returns it. :param parent | <QtGui.QWidget> || None :return <QtGui.QDialog> """ key = '_{0}__{1}_dialog'.format(cls.__name__, name) dlgref =...
python
def getDialog(cls, name, parent=None): """ Generates a dialog for this class widget and returns it. :param parent | <QtGui.QWidget> || None :return <QtGui.QDialog> """ key = '_{0}__{1}_dialog'.format(cls.__name__, name) dlgref =...
[ "def", "getDialog", "(", "cls", ",", "name", ",", "parent", "=", "None", ")", ":", "key", "=", "'_{0}__{1}_dialog'", ".", "format", "(", "cls", ".", "__name__", ",", "name", ")", "dlgref", "=", "getattr", "(", "cls", ",", "key", ",", "None", ")", "...
Generates a dialog for this class widget and returns it. :param parent | <QtGui.QWidget> || None :return <QtGui.QDialog>
[ "Generates", "a", "dialog", "for", "this", "class", "widget", "and", "returns", "it", ".", ":", "param", "parent", "|", "<QtGui", ".", "QWidget", ">", "||", "None", ":", "return", "<QtGui", ".", "QDialog", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbrecordwidget.py#L348-L399
train
Returns a new dialog with the given name and parent.
bitesofcode/projexui
projexui/widgets/xorbrecordwidget.py
XOrbRecordWidget.edit
def edit(cls, record, parent=None, autoCommit=True, title=''): """ Prompts the user to edit the inputed record. :param record | <orb.Table> parent | <QWidget> :return <bool> | accepted """ dlg = cls.getDialog('edit',...
python
def edit(cls, record, parent=None, autoCommit=True, title=''): """ Prompts the user to edit the inputed record. :param record | <orb.Table> parent | <QWidget> :return <bool> | accepted """ dlg = cls.getDialog('edit',...
[ "def", "edit", "(", "cls", ",", "record", ",", "parent", "=", "None", ",", "autoCommit", "=", "True", ",", "title", "=", "''", ")", ":", "dlg", "=", "cls", ".", "getDialog", "(", "'edit'", ",", "parent", ")", "# update the title\r", "try", ":", "name...
Prompts the user to edit the inputed record. :param record | <orb.Table> parent | <QWidget> :return <bool> | accepted
[ "Prompts", "the", "user", "to", "edit", "the", "inputed", "record", ".", ":", "param", "record", "|", "<orb", ".", "Table", ">", "parent", "|", "<QWidget", ">", ":", "return", "<bool", ">", "|", "accepted" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbrecordwidget.py#L402-L429
train
Prompts the user to edit the inputed record.
bitesofcode/projexui
projexui/widgets/xorbrecordwidget.py
XOrbRecordWidget.create
def create(cls, model=None, parent=None, autoCommit=True, defaults=None, title=''): """ Prompts the user to create a new record. :param model | <subclass of orb.Table> parent |...
python
def create(cls, model=None, parent=None, autoCommit=True, defaults=None, title=''): """ Prompts the user to create a new record. :param model | <subclass of orb.Table> parent |...
[ "def", "create", "(", "cls", ",", "model", "=", "None", ",", "parent", "=", "None", ",", "autoCommit", "=", "True", ",", "defaults", "=", "None", ",", "title", "=", "''", ")", ":", "if", "model", "is", "None", ":", "model", "=", "cls", ".", "tabl...
Prompts the user to create a new record. :param model | <subclass of orb.Table> parent | <QWidget> autoCommit | <bool> defaults | <dict> || None :return <orb.Table> || None
[ "Prompts", "the", "user", "to", "create", "a", "new", "record", ".", ":", "param", "model", "|", "<subclass", "of", "orb", ".", "Table", ">", "parent", "|", "<QWidget", ">", "autoCommit", "|", "<bool", ">", "defaults", "|", "<dict", ">", "||", "None", ...
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbrecordwidget.py#L432-L475
train
Prompts the user to create a new record.
intelsdi-x/snap-plugin-lib-py
snap_plugin/v1/namespace.py
Namespace.add_dynamic_element
def add_dynamic_element(self, name, description): """Adds a dynamic namespace element to the end of the Namespace. A dynamic namespace element is defined by an element that contains a non-static data relative to the metric being collected. For instance, when collecting metrics for a gi...
python
def add_dynamic_element(self, name, description): """Adds a dynamic namespace element to the end of the Namespace. A dynamic namespace element is defined by an element that contains a non-static data relative to the metric being collected. For instance, when collecting metrics for a gi...
[ "def", "add_dynamic_element", "(", "self", ",", "name", ",", "description", ")", ":", "self", ".", "_pb", ".", "add", "(", "Name", "=", "name", ",", "Description", "=", "description", ",", "Value", "=", "\"*\"", ")", "return", "self" ]
Adds a dynamic namespace element to the end of the Namespace. A dynamic namespace element is defined by an element that contains a non-static data relative to the metric being collected. For instance, when collecting metrics for a given virtual machine the namespace element that contai...
[ "Adds", "a", "dynamic", "namespace", "element", "to", "the", "end", "of", "the", "Namespace", "." ]
8da5d00ac5f9d2b48a7239563ac7788209891ca4
https://github.com/intelsdi-x/snap-plugin-lib-py/blob/8da5d00ac5f9d2b48a7239563ac7788209891ca4/snap_plugin/v1/namespace.py#L71-L90
train
Adds a dynamic namespace element to the end of the Namespace.
SkullTech/webdriver-start
wdstart/webdriver.py
Chrome
def Chrome(headless=False, user_agent=None, profile_path=None): """ Starts and returns a Selenium webdriver object for Chrome. Starts a Selenium webdriver according to the given specifications, and returns the corresponding `selenium.webdriver.Chrome` object. Parameters ---------- headles...
python
def Chrome(headless=False, user_agent=None, profile_path=None): """ Starts and returns a Selenium webdriver object for Chrome. Starts a Selenium webdriver according to the given specifications, and returns the corresponding `selenium.webdriver.Chrome` object. Parameters ---------- headles...
[ "def", "Chrome", "(", "headless", "=", "False", ",", "user_agent", "=", "None", ",", "profile_path", "=", "None", ")", ":", "chromedriver", "=", "drivers", ".", "ChromeDriver", "(", "headless", ",", "user_agent", ",", "profile_path", ")", "return", "chromedr...
Starts and returns a Selenium webdriver object for Chrome. Starts a Selenium webdriver according to the given specifications, and returns the corresponding `selenium.webdriver.Chrome` object. Parameters ---------- headless : bool Whether to start the browser in headless mode. user_age...
[ "Starts", "and", "returns", "a", "Selenium", "webdriver", "object", "for", "Chrome", "." ]
26285fd84c4deaf8906828e0ec0758a650b7ba49
https://github.com/SkullTech/webdriver-start/blob/26285fd84c4deaf8906828e0ec0758a650b7ba49/wdstart/webdriver.py#L9-L31
train
Starts and returns a Selenium webdriver object for Chrome.
SkullTech/webdriver-start
wdstart/webdriver.py
Firefox
def Firefox(headless=False, user_agent=None, profile_path=None): """ Starts and returns a Selenium webdriver object for Firefox. Starts a Selenium webdriver according to the given specifications, and returns the corresponding `selenium.webdriver.Chrome` object. Parameters ---------- headl...
python
def Firefox(headless=False, user_agent=None, profile_path=None): """ Starts and returns a Selenium webdriver object for Firefox. Starts a Selenium webdriver according to the given specifications, and returns the corresponding `selenium.webdriver.Chrome` object. Parameters ---------- headl...
[ "def", "Firefox", "(", "headless", "=", "False", ",", "user_agent", "=", "None", ",", "profile_path", "=", "None", ")", ":", "firefoxdriver", "=", "drivers", ".", "FirefoxDriver", "(", "headless", ",", "user_agent", ",", "profile_path", ")", "return", "firef...
Starts and returns a Selenium webdriver object for Firefox. Starts a Selenium webdriver according to the given specifications, and returns the corresponding `selenium.webdriver.Chrome` object. Parameters ---------- headless : bool Whether to start the browser in headless mode. user_ag...
[ "Starts", "and", "returns", "a", "Selenium", "webdriver", "object", "for", "Firefox", "." ]
26285fd84c4deaf8906828e0ec0758a650b7ba49
https://github.com/SkullTech/webdriver-start/blob/26285fd84c4deaf8906828e0ec0758a650b7ba49/wdstart/webdriver.py#L34-L56
train
Starts and returns a Selenium webdriver object for Firefox.
bitesofcode/projexui
projexui/xcoloricon.py
XColorIcon.generatePixmap
def generatePixmap(color, style=Style.Plain, size=None): """ Generates a new pixmap for the inputed color and style. If no size is provided, then the default 32x32 will be used. :return <QPixmap> """ if size is None: size = QSize(32, 32) ...
python
def generatePixmap(color, style=Style.Plain, size=None): """ Generates a new pixmap for the inputed color and style. If no size is provided, then the default 32x32 will be used. :return <QPixmap> """ if size is None: size = QSize(32, 32) ...
[ "def", "generatePixmap", "(", "color", ",", "style", "=", "Style", ".", "Plain", ",", "size", "=", "None", ")", ":", "if", "size", "is", "None", ":", "size", "=", "QSize", "(", "32", ",", "32", ")", "pixmap", "=", "QPixmap", "(", "size", ")", "# ...
Generates a new pixmap for the inputed color and style. If no size is provided, then the default 32x32 will be used. :return <QPixmap>
[ "Generates", "a", "new", "pixmap", "for", "the", "inputed", "color", "and", "style", ".", "If", "no", "size", "is", "provided", "then", "the", "default", "32x32", "will", "be", "used", ".", ":", "return", "<QPixmap", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xcoloricon.py#L22-L38
train
Returns a new pixmap for the inputed color and style.
bitesofcode/projexui
projexui/xorblookupworker.py
XOrbLookupWorker.cancel
def cancel(self): """ Cancels the current lookup. """ if self._running: self.interrupt() self._running = False self._cancelled = True self.loadingFinished.emit()
python
def cancel(self): """ Cancels the current lookup. """ if self._running: self.interrupt() self._running = False self._cancelled = True self.loadingFinished.emit()
[ "def", "cancel", "(", "self", ")", ":", "if", "self", ".", "_running", ":", "self", ".", "interrupt", "(", ")", "self", ".", "_running", "=", "False", "self", ".", "_cancelled", "=", "True", "self", ".", "loadingFinished", ".", "emit", "(", ")" ]
Cancels the current lookup.
[ "Cancels", "the", "current", "lookup", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xorblookupworker.py#L56-L64
train
Cancels the current lookup.
bitesofcode/projexui
projexui/xorblookupworker.py
XOrbLookupWorker.loadColumns
def loadColumns(self, records, columnName): """ Loads the column information per record for the given records. :param records | [<orb.Table>, ..] columnName | <str> """ try: for record in records: col = r...
python
def loadColumns(self, records, columnName): """ Loads the column information per record for the given records. :param records | [<orb.Table>, ..] columnName | <str> """ try: for record in records: col = r...
[ "def", "loadColumns", "(", "self", ",", "records", ",", "columnName", ")", ":", "try", ":", "for", "record", "in", "records", ":", "col", "=", "record", ".", "schema", "(", ")", ".", "column", "(", "columnName", ")", "if", "not", "col", ":", "continu...
Loads the column information per record for the given records. :param records | [<orb.Table>, ..] columnName | <str>
[ "Loads", "the", "column", "information", "per", "record", "for", "the", "given", "records", ".", ":", "param", "records", "|", "[", "<orb", ".", "Table", ">", "..", "]", "columnName", "|", "<str", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xorblookupworker.py#L82-L102
train
Loads the column information for the given records.
bitesofcode/projexui
projexui/xorblookupworker.py
XOrbLookupWorker.loadBatch
def loadBatch(self, records): """ Loads the records for this instance in a batched mode. """ try: curr_batch = records[:self.batchSize()] next_batch = records[self.batchSize():] curr_records = list(curr_batch) if self....
python
def loadBatch(self, records): """ Loads the records for this instance in a batched mode. """ try: curr_batch = records[:self.batchSize()] next_batch = records[self.batchSize():] curr_records = list(curr_batch) if self....
[ "def", "loadBatch", "(", "self", ",", "records", ")", ":", "try", ":", "curr_batch", "=", "records", "[", ":", "self", ".", "batchSize", "(", ")", "]", "next_batch", "=", "records", "[", "self", ".", "batchSize", "(", ")", ":", "]", "curr_records", "...
Loads the records for this instance in a batched mode.
[ "Loads", "the", "records", "for", "this", "instance", "in", "a", "batched", "mode", "." ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xorblookupworker.py#L104-L127
train
Loads the records for this instance in a batched mode.
bitesofcode/projexui
projexui/xorblookupworker.py
XOrbLookupWorker.loadRecords
def loadRecords(self, records): """ Loads the record set for this instance. :param records | <orb.RecordSet> || <list> """ try: if self._running: return self._cancelled = False self._running...
python
def loadRecords(self, records): """ Loads the record set for this instance. :param records | <orb.RecordSet> || <list> """ try: if self._running: return self._cancelled = False self._running...
[ "def", "loadRecords", "(", "self", ",", "records", ")", ":", "try", ":", "if", "self", ".", "_running", ":", "return", "self", ".", "_cancelled", "=", "False", "self", ".", "_running", "=", "True", "try", ":", "self", ".", "setDatabase", "(", "records"...
Loads the record set for this instance. :param records | <orb.RecordSet> || <list>
[ "Loads", "the", "record", "set", "for", "this", "instance", ".", ":", "param", "records", "|", "<orb", ".", "RecordSet", ">", "||", "<list", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xorblookupworker.py#L129-L190
train
Loads the records into the appropriate record sets.
bitesofcode/projexui
projexui/dialogs/xmessagebox.py
XMessageBox.setVisible
def setVisible( self, state ): """ Updates the visible state for this message box. :param state | <bool> """ super(XMessageBox, self).setVisible(state) if ( state ): self.startTimer(100) self.layout().setSizeConstraint(QLayou...
python
def setVisible( self, state ): """ Updates the visible state for this message box. :param state | <bool> """ super(XMessageBox, self).setVisible(state) if ( state ): self.startTimer(100) self.layout().setSizeConstraint(QLayou...
[ "def", "setVisible", "(", "self", ",", "state", ")", ":", "super", "(", "XMessageBox", ",", "self", ")", ".", "setVisible", "(", "state", ")", "if", "(", "state", ")", ":", "self", ".", "startTimer", "(", "100", ")", "self", ".", "layout", "(", ")"...
Updates the visible state for this message box. :param state | <bool>
[ "Updates", "the", "visible", "state", "for", "this", "message", "box", ".", ":", "param", "state", "|", "<bool", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/dialogs/xmessagebox.py#L25-L36
train
Updates the visible state for this message box.
bitesofcode/projexui
projexui/dialogs/xmessagebox.py
XMessageBox.setDetailedText
def setDetailedText( self, text ): """ Sets the details text for this message box to the inputed text. \ Overloading the default method to support HTML details. :param text | <str> """ super(XMessageBox, self).setDetailedText(text) if ( tex...
python
def setDetailedText( self, text ): """ Sets the details text for this message box to the inputed text. \ Overloading the default method to support HTML details. :param text | <str> """ super(XMessageBox, self).setDetailedText(text) if ( tex...
[ "def", "setDetailedText", "(", "self", ",", "text", ")", ":", "super", "(", "XMessageBox", ",", "self", ")", ".", "setDetailedText", "(", "text", ")", "if", "(", "text", ")", ":", "# update the text edit", "widgets", "=", "self", ".", "findChildren", "(", ...
Sets the details text for this message box to the inputed text. \ Overloading the default method to support HTML details. :param text | <str>
[ "Sets", "the", "details", "text", "for", "this", "message", "box", "to", "the", "inputed", "text", ".", "\\", "Overloading", "the", "default", "method", "to", "support", "HTML", "details", ".", ":", "param", "text", "|", "<str", ">" ]
f18a73bec84df90b034ca69b9deea118dbedfc4d
https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/dialogs/xmessagebox.py#L38-L61
train
Sets the detailed text for this message box to the inputed text.