repo stringlengths 7 55 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 19 28.4k | docstring stringlengths 1 46.9k | docstring_tokens listlengths 1 1.97k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 3
values | summary stringlengths 4 350 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
bitesofcode/projexui | projexui/widgets/xchartwidget/xchartwidgetitem.py | XChartWidgetItem.setDragData | def setDragData(self, data, x=None, y=None):
"""
Sets the drag data for this chart item to the inputed data.
:param data | <QMimeData> || None
"""
self._dragData[(x, y)] = data | python | def setDragData(self, data, x=None, y=None):
"""
Sets the drag data for this chart item to the inputed data.
:param data | <QMimeData> || None
"""
self._dragData[(x, y)] = data | [
"def",
"setDragData",
"(",
"self",
",",
"data",
",",
"x",
"=",
"None",
",",
"y",
"=",
"None",
")",
":",
"self",
".",
"_dragData",
"[",
"(",
"x",
",",
"y",
")",
"]",
"=",
"data"
] | Sets the drag data for this chart item to the inputed data.
:param data | <QMimeData> || None | [
"Sets",
"the",
"drag",
"data",
"for",
"this",
"chart",
"item",
"to",
"the",
"inputed",
"data",
".",
":",
"param",
"data",
"|",
"<QMimeData",
">",
"||",
"None"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchartwidget/xchartwidgetitem.py#L632-L638 | train | Sets the drag data for this chart item. |
bitesofcode/projexui | projexui/widgets/xchartwidget/xchartwidgetitem.py | XChartWidgetItem.setKeyColor | def setKeyColor( self, key, color ):
"""
Sets the color used when rendering pie charts.
:param key | <str>
color | <QColor>
"""
self._keyColors[nativestring(key)] = QColor(color) | python | def setKeyColor( self, key, color ):
"""
Sets the color used when rendering pie charts.
:param key | <str>
color | <QColor>
"""
self._keyColors[nativestring(key)] = QColor(color) | [
"def",
"setKeyColor",
"(",
"self",
",",
"key",
",",
"color",
")",
":",
"self",
".",
"_keyColors",
"[",
"nativestring",
"(",
"key",
")",
"]",
"=",
"QColor",
"(",
"color",
")"
] | Sets the color used when rendering pie charts.
:param key | <str>
color | <QColor> | [
"Sets",
"the",
"color",
"used",
"when",
"rendering",
"pie",
"charts",
".",
":",
"param",
"key",
"|",
"<str",
">",
"color",
"|",
"<QColor",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchartwidget/xchartwidgetitem.py#L640-L647 | train | Sets the color used when rendering pie charts. |
bitesofcode/projexui | projexui/widgets/xchartwidget/xchartwidgetitem.py | XChartWidgetItem.startDrag | def startDrag(self, data):
"""
Starts dragging information from this chart widget based on the
dragData associated with this item.
"""
if not data:
return
widget = self.scene().chartWidget()
drag = QDrag(widget)
drag.setMimeD... | python | def startDrag(self, data):
"""
Starts dragging information from this chart widget based on the
dragData associated with this item.
"""
if not data:
return
widget = self.scene().chartWidget()
drag = QDrag(widget)
drag.setMimeD... | [
"def",
"startDrag",
"(",
"self",
",",
"data",
")",
":",
"if",
"not",
"data",
":",
"return",
"widget",
"=",
"self",
".",
"scene",
"(",
")",
".",
"chartWidget",
"(",
")",
"drag",
"=",
"QDrag",
"(",
"widget",
")",
"drag",
".",
"setMimeData",
"(",
"dat... | Starts dragging information from this chart widget based on the
dragData associated with this item. | [
"Starts",
"dragging",
"information",
"from",
"this",
"chart",
"widget",
"based",
"on",
"the",
"dragData",
"associated",
"with",
"this",
"item",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchartwidget/xchartwidgetitem.py#L740-L751 | train | Starts dragging information from this item based on the mime data provided. |
bitesofcode/projexui | projexui/widgets/xoverlaywizard.py | XOverlayWizardPage.adjustMargins | def adjustMargins(self):
"""
Adjusts the margins to incorporate enough room for the widget's title and sub-title.
"""
y = 0
height = 0
if self._titleLabel.text():
height += self._titleLabel.height() + 3
y += height
if self._subTitleLabel.t... | python | def adjustMargins(self):
"""
Adjusts the margins to incorporate enough room for the widget's title and sub-title.
"""
y = 0
height = 0
if self._titleLabel.text():
height += self._titleLabel.height() + 3
y += height
if self._subTitleLabel.t... | [
"def",
"adjustMargins",
"(",
"self",
")",
":",
"y",
"=",
"0",
"height",
"=",
"0",
"if",
"self",
".",
"_titleLabel",
".",
"text",
"(",
")",
":",
"height",
"+=",
"self",
".",
"_titleLabel",
".",
"height",
"(",
")",
"+",
"3",
"y",
"+=",
"height",
"i... | Adjusts the margins to incorporate enough room for the widget's title and sub-title. | [
"Adjusts",
"the",
"margins",
"to",
"incorporate",
"enough",
"room",
"for",
"the",
"widget",
"s",
"title",
"and",
"sub",
"-",
"title",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xoverlaywizard.py#L45-L59 | train | Adjusts the margins to incorporate enough room for the title and sub - title. |
bitesofcode/projexui | projexui/widgets/xoverlaywizard.py | XOverlayWizardPage.nextId | def nextId(self):
"""
Returns the next id for this page. By default, it will provide the next id from the wizard, but
this method can be overloaded to create a custom path. If -1 is returned, then it will be considered
the final page.
:return <int>
"""
if s... | python | def nextId(self):
"""
Returns the next id for this page. By default, it will provide the next id from the wizard, but
this method can be overloaded to create a custom path. If -1 is returned, then it will be considered
the final page.
:return <int>
"""
if s... | [
"def",
"nextId",
"(",
"self",
")",
":",
"if",
"self",
".",
"_nextId",
"is",
"not",
"None",
":",
"return",
"self",
".",
"_nextId",
"wizard",
"=",
"self",
".",
"wizard",
"(",
")",
"curr_id",
"=",
"wizard",
".",
"currentId",
"(",
")",
"all_ids",
"=",
... | Returns the next id for this page. By default, it will provide the next id from the wizard, but
this method can be overloaded to create a custom path. If -1 is returned, then it will be considered
the final page.
:return <int> | [
"Returns",
"the",
"next",
"id",
"for",
"this",
"page",
".",
"By",
"default",
"it",
"will",
"provide",
"the",
"next",
"id",
"from",
"the",
"wizard",
"but",
"this",
"method",
"can",
"be",
"overloaded",
"to",
"create",
"a",
"custom",
"path",
".",
"If",
"-... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xoverlaywizard.py#L121-L138 | train | Returns the next id for this page. |
bitesofcode/projexui | projexui/widgets/xoverlaywizard.py | XOverlayWizardPage.setSubTitle | def setSubTitle(self, title):
"""
Sets the sub-title for this page to the inputed title.
:param title | <str>
"""
self._subTitleLabel.setText(title)
self._subTitleLabel.adjustSize()
self.adjustMargins() | python | def setSubTitle(self, title):
"""
Sets the sub-title for this page to the inputed title.
:param title | <str>
"""
self._subTitleLabel.setText(title)
self._subTitleLabel.adjustSize()
self.adjustMargins() | [
"def",
"setSubTitle",
"(",
"self",
",",
"title",
")",
":",
"self",
".",
"_subTitleLabel",
".",
"setText",
"(",
"title",
")",
"self",
".",
"_subTitleLabel",
".",
"adjustSize",
"(",
")",
"self",
".",
"adjustMargins",
"(",
")"
] | Sets the sub-title for this page to the inputed title.
:param title | <str> | [
"Sets",
"the",
"sub",
"-",
"title",
"for",
"this",
"page",
"to",
"the",
"inputed",
"title",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xoverlaywizard.py#L174-L182 | train | Sets the sub - title for this page to the inputed title. |
bitesofcode/projexui | projexui/widgets/xoverlaywizard.py | XOverlayWizardPage.setTitle | def setTitle(self, title):
"""
Sets the title for this page to the inputed title.
:param title | <str>
"""
self._titleLabel.setText(title)
self._titleLabel.adjustSize()
self.adjustMargins() | python | def setTitle(self, title):
"""
Sets the title for this page to the inputed title.
:param title | <str>
"""
self._titleLabel.setText(title)
self._titleLabel.adjustSize()
self.adjustMargins() | [
"def",
"setTitle",
"(",
"self",
",",
"title",
")",
":",
"self",
".",
"_titleLabel",
".",
"setText",
"(",
"title",
")",
"self",
".",
"_titleLabel",
".",
"adjustSize",
"(",
")",
"self",
".",
"adjustMargins",
"(",
")"
] | Sets the title for this page to the inputed title.
:param title | <str> | [
"Sets",
"the",
"title",
"for",
"this",
"page",
"to",
"the",
"inputed",
"title",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xoverlaywizard.py#L192-L200 | train | Sets the title for this page to the inputed title. |
bitesofcode/projexui | projexui/widgets/xoverlaywizard.py | XOverlayWizard.adjustSize | def adjustSize(self):
"""
Adjusts the size of this wizard and its page contents to the inputed size.
:param size | <QtCore.QSize>
"""
super(XOverlayWizard, self).adjustSize()
# adjust the page size
page_size = self.pageSize()
# resize the current p... | python | def adjustSize(self):
"""
Adjusts the size of this wizard and its page contents to the inputed size.
:param size | <QtCore.QSize>
"""
super(XOverlayWizard, self).adjustSize()
# adjust the page size
page_size = self.pageSize()
# resize the current p... | [
"def",
"adjustSize",
"(",
"self",
")",
":",
"super",
"(",
"XOverlayWizard",
",",
"self",
")",
".",
"adjustSize",
"(",
")",
"# adjust the page size",
"page_size",
"=",
"self",
".",
"pageSize",
"(",
")",
"# resize the current page to the inputed size",
"x",
"=",
"... | Adjusts the size of this wizard and its page contents to the inputed size.
:param size | <QtCore.QSize> | [
"Adjusts",
"the",
"size",
"of",
"this",
"wizard",
"and",
"its",
"page",
"contents",
"to",
"the",
"inputed",
"size",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xoverlaywizard.py#L319-L361 | train | Adjusts the size of this wizard and its page contents to the inputed size. |
bitesofcode/projexui | projexui/widgets/xoverlaywizard.py | XOverlayWizard.back | def back(self):
"""
Goes to the previous page for this wizard.
"""
try:
pageId = self._navigation[-2]
last_page = self.page(pageId)
except IndexError:
return
curr_page = self.page(self._navigation.pop())
if not (last_page and c... | python | def back(self):
"""
Goes to the previous page for this wizard.
"""
try:
pageId = self._navigation[-2]
last_page = self.page(pageId)
except IndexError:
return
curr_page = self.page(self._navigation.pop())
if not (last_page and c... | [
"def",
"back",
"(",
"self",
")",
":",
"try",
":",
"pageId",
"=",
"self",
".",
"_navigation",
"[",
"-",
"2",
"]",
"last_page",
"=",
"self",
".",
"page",
"(",
"pageId",
")",
"except",
"IndexError",
":",
"return",
"curr_page",
"=",
"self",
".",
"page",
... | Goes to the previous page for this wizard. | [
"Goes",
"to",
"the",
"previous",
"page",
"for",
"this",
"wizard",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xoverlaywizard.py#L371-L425 | train | Goes to the previous page for this wizard. |
bitesofcode/projexui | projexui/widgets/xoverlaywizard.py | XOverlayWizard.canGoBack | def canGoBack(self):
"""
Returns whether or not this wizard can move forward.
:return <bool>
"""
try:
backId = self._navigation.index(self.currentId())-1
if backId >= 0:
self._navigation[backId]
else:
return... | python | def canGoBack(self):
"""
Returns whether or not this wizard can move forward.
:return <bool>
"""
try:
backId = self._navigation.index(self.currentId())-1
if backId >= 0:
self._navigation[backId]
else:
return... | [
"def",
"canGoBack",
"(",
"self",
")",
":",
"try",
":",
"backId",
"=",
"self",
".",
"_navigation",
".",
"index",
"(",
"self",
".",
"currentId",
"(",
")",
")",
"-",
"1",
"if",
"backId",
">=",
"0",
":",
"self",
".",
"_navigation",
"[",
"backId",
"]",
... | Returns whether or not this wizard can move forward.
:return <bool> | [
"Returns",
"whether",
"or",
"not",
"this",
"wizard",
"can",
"move",
"forward",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xoverlaywizard.py#L448-L463 | train | Returns whether or not this wizard can move forward. |
bitesofcode/projexui | projexui/widgets/xoverlaywizard.py | XOverlayWizard.next | def next(self):
"""
Goes to the previous page for this wizard.
"""
curr_page = self.currentPage()
if not curr_page:
return
elif not curr_page.validatePage():
return
pageId = curr_page.nextId()
try:
next_page = self._pag... | python | def next(self):
"""
Goes to the previous page for this wizard.
"""
curr_page = self.currentPage()
if not curr_page:
return
elif not curr_page.validatePage():
return
pageId = curr_page.nextId()
try:
next_page = self._pag... | [
"def",
"next",
"(",
"self",
")",
":",
"curr_page",
"=",
"self",
".",
"currentPage",
"(",
")",
"if",
"not",
"curr_page",
":",
"return",
"elif",
"not",
"curr_page",
".",
"validatePage",
"(",
")",
":",
"return",
"pageId",
"=",
"curr_page",
".",
"nextId",
... | Goes to the previous page for this wizard. | [
"Goes",
"to",
"the",
"previous",
"page",
"for",
"this",
"wizard",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xoverlaywizard.py#L558-L618 | train | Goes to the next page for this wizard. |
bitesofcode/projexui | projexui/widgets/xoverlaywizard.py | XOverlayWizard.pageSize | def pageSize(self):
"""
Returns the current page size for this wizard.
:return <QtCore.QSize>
"""
# update the size based on the new size
page_size = self.fixedPageSize()
if page_size.isEmpty():
w = self.width() - 80
h = self.height()... | python | def pageSize(self):
"""
Returns the current page size for this wizard.
:return <QtCore.QSize>
"""
# update the size based on the new size
page_size = self.fixedPageSize()
if page_size.isEmpty():
w = self.width() - 80
h = self.height()... | [
"def",
"pageSize",
"(",
"self",
")",
":",
"# update the size based on the new size",
"page_size",
"=",
"self",
".",
"fixedPageSize",
"(",
")",
"if",
"page_size",
".",
"isEmpty",
"(",
")",
":",
"w",
"=",
"self",
".",
"width",
"(",
")",
"-",
"80",
"h",
"="... | Returns the current page size for this wizard.
:return <QtCore.QSize> | [
"Returns",
"the",
"current",
"page",
"size",
"for",
"this",
"wizard",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xoverlaywizard.py#L644-L663 | train | Returns the current page size for this wizard. |
bitesofcode/projexui | projexui/widgets/xoverlaywizard.py | XOverlayWizard.restart | def restart(self):
"""
Restarts the whole wizard from the beginning.
"""
# hide all of the pages
for page in self._pages.values():
page.hide()
pageId = self.startId()
try:
first_page = self._pages[pageId]
except KeyError:
... | python | def restart(self):
"""
Restarts the whole wizard from the beginning.
"""
# hide all of the pages
for page in self._pages.values():
page.hide()
pageId = self.startId()
try:
first_page = self._pages[pageId]
except KeyError:
... | [
"def",
"restart",
"(",
"self",
")",
":",
"# hide all of the pages",
"for",
"page",
"in",
"self",
".",
"_pages",
".",
"values",
"(",
")",
":",
"page",
".",
"hide",
"(",
")",
"pageId",
"=",
"self",
".",
"startId",
"(",
")",
"try",
":",
"first_page",
"=... | Restarts the whole wizard from the beginning. | [
"Restarts",
"the",
"whole",
"wizard",
"from",
"the",
"beginning",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xoverlaywizard.py#L673-L716 | train | Restarts the whole wizard from the beginning. |
bitesofcode/projexui | projexui/widgets/xoverlaywizard.py | XOverlayWizard.removePage | def removePage(self, pageId):
"""
Removes the inputed page from this wizard.
:param pageId | <int>
"""
try:
self._pages[pageId].deleteLater()
del self._pages[pageId]
except KeyError:
pass | python | def removePage(self, pageId):
"""
Removes the inputed page from this wizard.
:param pageId | <int>
"""
try:
self._pages[pageId].deleteLater()
del self._pages[pageId]
except KeyError:
pass | [
"def",
"removePage",
"(",
"self",
",",
"pageId",
")",
":",
"try",
":",
"self",
".",
"_pages",
"[",
"pageId",
"]",
".",
"deleteLater",
"(",
")",
"del",
"self",
".",
"_pages",
"[",
"pageId",
"]",
"except",
"KeyError",
":",
"pass"
] | Removes the inputed page from this wizard.
:param pageId | <int> | [
"Removes",
"the",
"inputed",
"page",
"from",
"this",
"wizard",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xoverlaywizard.py#L718-L728 | train | Removes the inputed page from this wizard. |
bitesofcode/projexui | projexui/widgets/xoverlaywizard.py | XOverlayWizard.setButton | def setButton(self, which, button):
"""
Sets the button for this wizard for the inputed type.
:param which | <XOverlayWizard.WizardButton>
button | <QtGui.QPushButton>
"""
try:
self._buttons[which].deleteLater()
except KeyError:
... | python | def setButton(self, which, button):
"""
Sets the button for this wizard for the inputed type.
:param which | <XOverlayWizard.WizardButton>
button | <QtGui.QPushButton>
"""
try:
self._buttons[which].deleteLater()
except KeyError:
... | [
"def",
"setButton",
"(",
"self",
",",
"which",
",",
"button",
")",
":",
"try",
":",
"self",
".",
"_buttons",
"[",
"which",
"]",
".",
"deleteLater",
"(",
")",
"except",
"KeyError",
":",
"pass",
"button",
".",
"setParent",
"(",
"self",
")",
"self",
"."... | Sets the button for this wizard for the inputed type.
:param which | <XOverlayWizard.WizardButton>
button | <QtGui.QPushButton> | [
"Sets",
"the",
"button",
"for",
"this",
"wizard",
"for",
"the",
"inputed",
"type",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xoverlaywizard.py#L747-L760 | train | Sets the button for this wizard for the inputed type. |
bitesofcode/projexui | projexui/widgets/xoverlaywizard.py | XOverlayWizard.setButtonText | def setButtonText(self, which, text):
"""
Sets the display text for the inputed button to the given text.
:param which | <XOverlayWizard.WizardButton>
text | <str>
"""
try:
self._buttons[which].setText(text)
except KeyError:
... | python | def setButtonText(self, which, text):
"""
Sets the display text for the inputed button to the given text.
:param which | <XOverlayWizard.WizardButton>
text | <str>
"""
try:
self._buttons[which].setText(text)
except KeyError:
... | [
"def",
"setButtonText",
"(",
"self",
",",
"which",
",",
"text",
")",
":",
"try",
":",
"self",
".",
"_buttons",
"[",
"which",
"]",
".",
"setText",
"(",
"text",
")",
"except",
"KeyError",
":",
"pass"
] | Sets the display text for the inputed button to the given text.
:param which | <XOverlayWizard.WizardButton>
text | <str> | [
"Sets",
"the",
"display",
"text",
"for",
"the",
"inputed",
"button",
"to",
"the",
"given",
"text",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xoverlaywizard.py#L762-L772 | train | Sets the display text for the inputed button to the given text. |
bitesofcode/projexui | projexui/widgets/xoverlaywizard.py | XOverlayWizard.setPage | def setPage(self, pageId, page):
"""
Sets the page and id for the given page vs. auto-constructing it. This will allow the
developer to create a custom order for IDs.
:param pageId | <int>
page | <projexui.widgets.xoverlaywizard.XOverlayWizardPage>
""... | python | def setPage(self, pageId, page):
"""
Sets the page and id for the given page vs. auto-constructing it. This will allow the
developer to create a custom order for IDs.
:param pageId | <int>
page | <projexui.widgets.xoverlaywizard.XOverlayWizardPage>
""... | [
"def",
"setPage",
"(",
"self",
",",
"pageId",
",",
"page",
")",
":",
"page",
".",
"setParent",
"(",
"self",
")",
"if",
"self",
".",
"property",
"(",
"\"useShadow\"",
")",
"is",
"not",
"False",
":",
"# create the drop shadow effect",
"effect",
"=",
"QtGui",... | Sets the page and id for the given page vs. auto-constructing it. This will allow the
developer to create a custom order for IDs.
:param pageId | <int>
page | <projexui.widgets.xoverlaywizard.XOverlayWizardPage> | [
"Sets",
"the",
"page",
"and",
"id",
"for",
"the",
"given",
"page",
"vs",
".",
"auto",
"-",
"constructing",
"it",
".",
"This",
"will",
"allow",
"the",
"developer",
"to",
"create",
"a",
"custom",
"order",
"for",
"IDs",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xoverlaywizard.py#L816-L837 | train | Sets the page and id for the given page. |
pmuller/versions | versions/packages.py | Package.build_options | def build_options(self):
"""The package build options.
:returns: :func:`set` of build options strings.
"""
if self.version.build_metadata:
return set(self.version.build_metadata.split('.'))
else:
return set() | python | def build_options(self):
"""The package build options.
:returns: :func:`set` of build options strings.
"""
if self.version.build_metadata:
return set(self.version.build_metadata.split('.'))
else:
return set() | [
"def",
"build_options",
"(",
"self",
")",
":",
"if",
"self",
".",
"version",
".",
"build_metadata",
":",
"return",
"set",
"(",
"self",
".",
"version",
".",
"build_metadata",
".",
"split",
"(",
"'.'",
")",
")",
"else",
":",
"return",
"set",
"(",
")"
] | The package build options.
:returns: :func:`set` of build options strings. | [
"The",
"package",
"build",
"options",
"."
] | 951bc3fd99b6a675190f11ee0752af1d7ff5b440 | https://github.com/pmuller/versions/blob/951bc3fd99b6a675190f11ee0752af1d7ff5b440/versions/packages.py#L84-L93 | train | The package build options. |
pmuller/versions | versions/packages.py | Package.parse | def parse(self, package_expression):
"""Parse a ``package_expression`` into a :class:`Package` object.
"""
parts = re.split(r'\s*;\s*', package_expression)
name_ver_str = parts[0]
infos = parts[1:]
dependencies = set()
name_ver_match = RE.match(name_ver_str)
... | python | def parse(self, package_expression):
"""Parse a ``package_expression`` into a :class:`Package` object.
"""
parts = re.split(r'\s*;\s*', package_expression)
name_ver_str = parts[0]
infos = parts[1:]
dependencies = set()
name_ver_match = RE.match(name_ver_str)
... | [
"def",
"parse",
"(",
"self",
",",
"package_expression",
")",
":",
"parts",
"=",
"re",
".",
"split",
"(",
"r'\\s*;\\s*'",
",",
"package_expression",
")",
"name_ver_str",
"=",
"parts",
"[",
"0",
"]",
"infos",
"=",
"parts",
"[",
"1",
":",
"]",
"dependencies... | Parse a ``package_expression`` into a :class:`Package` object. | [
"Parse",
"a",
"package_expression",
"into",
"a",
":",
"class",
":",
"Package",
"object",
"."
] | 951bc3fd99b6a675190f11ee0752af1d7ff5b440 | https://github.com/pmuller/versions/blob/951bc3fd99b6a675190f11ee0752af1d7ff5b440/versions/packages.py#L139-L162 | train | Parse a package_expression into a : class : Package object. |
mikhaildubov/AST-text-analysis | east/asts/ast.py | AnnotatedSuffixTree.score | def score(self, query, normalized=True, synonimizer=None, return_suffix_scores=False):
"""
Matches the string against the GAST using
the algorithm described in [Chernyak, sections 1.3 & 1.4].
Expects the input string to consist of
alphabet letters only (no whitespaces et... | python | def score(self, query, normalized=True, synonimizer=None, return_suffix_scores=False):
"""
Matches the string against the GAST using
the algorithm described in [Chernyak, sections 1.3 & 1.4].
Expects the input string to consist of
alphabet letters only (no whitespaces et... | [
"def",
"score",
"(",
"self",
",",
"query",
",",
"normalized",
"=",
"True",
",",
"synonimizer",
"=",
"None",
",",
"return_suffix_scores",
"=",
"False",
")",
":",
"query",
"=",
"query",
".",
"replace",
"(",
"\" \"",
",",
"\"\"",
")",
"result",
"=",
"0",
... | Matches the string against the GAST using
the algorithm described in [Chernyak, sections 1.3 & 1.4].
Expects the input string to consist of
alphabet letters only (no whitespaces etc.)
Returns the score (a float in [0, 1]).
query -- Unicode | [
"Matches",
"the",
"string",
"against",
"the",
"GAST",
"using",
"the",
"algorithm",
"described",
"in",
"[",
"Chernyak",
"sections",
"1",
".",
"3",
"&",
"1",
".",
"4",
"]",
".",
"Expects",
"the",
"input",
"string",
"to",
"consist",
"of",
"alphabet",
"lette... | 055ad8d2492c100bbbaa25309ec1074bdf1dfaa5 | https://github.com/mikhaildubov/AST-text-analysis/blob/055ad8d2492c100bbbaa25309ec1074bdf1dfaa5/east/asts/ast.py#L19-L73 | train | Returns the score of the string using the GAST using the Chernyak algorithm described in Section 1. 3 & 1. 4. |
bitesofcode/projexui | projexui/widgets/xserialedit.py | XSerialEdit.clearSelection | def clearSelection(self):
"""
Clears the selected text for this edit.
"""
first = None
editors = self.editors()
for editor in editors:
if not editor.selectedText():
continue
first = first or editor
... | python | def clearSelection(self):
"""
Clears the selected text for this edit.
"""
first = None
editors = self.editors()
for editor in editors:
if not editor.selectedText():
continue
first = first or editor
... | [
"def",
"clearSelection",
"(",
"self",
")",
":",
"first",
"=",
"None",
"editors",
"=",
"self",
".",
"editors",
"(",
")",
"for",
"editor",
"in",
"editors",
":",
"if",
"not",
"editor",
".",
"selectedText",
"(",
")",
":",
"continue",
"first",
"=",
"first",... | Clears the selected text for this edit. | [
"Clears",
"the",
"selected",
"text",
"for",
"this",
"edit",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xserialedit.py#L48-L65 | train | Clears the selected text for this edit. |
bitesofcode/projexui | projexui/widgets/xserialedit.py | XSerialEdit.cut | def cut(self):
"""
Cuts the text from the serial to the clipboard.
"""
text = self.selectedText()
for editor in self.editors():
editor.cut()
QtGui.QApplication.clipboard().setText(text) | python | def cut(self):
"""
Cuts the text from the serial to the clipboard.
"""
text = self.selectedText()
for editor in self.editors():
editor.cut()
QtGui.QApplication.clipboard().setText(text) | [
"def",
"cut",
"(",
"self",
")",
":",
"text",
"=",
"self",
".",
"selectedText",
"(",
")",
"for",
"editor",
"in",
"self",
".",
"editors",
"(",
")",
":",
"editor",
".",
"cut",
"(",
")",
"QtGui",
".",
"QApplication",
".",
"clipboard",
"(",
")",
".",
... | Cuts the text from the serial to the clipboard. | [
"Cuts",
"the",
"text",
"from",
"the",
"serial",
"to",
"the",
"clipboard",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xserialedit.py#L82-L90 | train | Cuts the text from the serial to the clipboard. |
bitesofcode/projexui | projexui/widgets/xserialedit.py | XSerialEdit.editors | def editors(self):
"""
Returns the editors that are associated with this edit.
:return [<XLineEdit>, ..]
"""
lay = self.layout()
return [lay.itemAt(i).widget() for i in range(lay.count())] | python | def editors(self):
"""
Returns the editors that are associated with this edit.
:return [<XLineEdit>, ..]
"""
lay = self.layout()
return [lay.itemAt(i).widget() for i in range(lay.count())] | [
"def",
"editors",
"(",
"self",
")",
":",
"lay",
"=",
"self",
".",
"layout",
"(",
")",
"return",
"[",
"lay",
".",
"itemAt",
"(",
"i",
")",
".",
"widget",
"(",
")",
"for",
"i",
"in",
"range",
"(",
"lay",
".",
"count",
"(",
")",
")",
"]"
] | Returns the editors that are associated with this edit.
:return [<XLineEdit>, ..] | [
"Returns",
"the",
"editors",
"that",
"are",
"associated",
"with",
"this",
"edit",
".",
":",
"return",
"[",
"<XLineEdit",
">",
"..",
"]"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xserialedit.py#L103-L110 | train | Returns the list of editors that are associated with this edit. |
bitesofcode/projexui | projexui/widgets/xserialedit.py | XSerialEdit.eventFilter | def eventFilter(self, object, event):
"""
Filters the events for the editors to control how the cursor
flows between them.
:param object | <QtCore.QObject>
event | <QtCore.QEvent>
:return <bool> | consumed
"""
inde... | python | def eventFilter(self, object, event):
"""
Filters the events for the editors to control how the cursor
flows between them.
:param object | <QtCore.QObject>
event | <QtCore.QEvent>
:return <bool> | consumed
"""
inde... | [
"def",
"eventFilter",
"(",
"self",
",",
"object",
",",
"event",
")",
":",
"index",
"=",
"self",
".",
"indexOf",
"(",
"object",
")",
"pressed",
"=",
"event",
".",
"type",
"(",
")",
"==",
"event",
".",
"KeyPress",
"released",
"=",
"event",
".",
"type",... | Filters the events for the editors to control how the cursor
flows between them.
:param object | <QtCore.QObject>
event | <QtCore.QEvent>
:return <bool> | consumed | [
"Filters",
"the",
"events",
"for",
"the",
"editors",
"to",
"control",
"how",
"the",
"cursor",
"flows",
"between",
"them",
".",
":",
"param",
"object",
"|",
"<QtCore",
".",
"QObject",
">",
"event",
"|",
"<QtCore",
".",
"QEvent",
">",
":",
"return",
"<bool... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xserialedit.py#L125-L204 | train | Returns true if the object is in the list and False otherwise. |
bitesofcode/projexui | projexui/widgets/xserialedit.py | XSerialEdit.goBack | def goBack(self):
"""
Moves the cursor to the end of the previous editor
"""
index = self.indexOf(self.currentEditor())
if index == -1:
return
previous = self.editorAt(index - 1)
if previous:
previous.setFocus()
... | python | def goBack(self):
"""
Moves the cursor to the end of the previous editor
"""
index = self.indexOf(self.currentEditor())
if index == -1:
return
previous = self.editorAt(index - 1)
if previous:
previous.setFocus()
... | [
"def",
"goBack",
"(",
"self",
")",
":",
"index",
"=",
"self",
".",
"indexOf",
"(",
"self",
".",
"currentEditor",
"(",
")",
")",
"if",
"index",
"==",
"-",
"1",
":",
"return",
"previous",
"=",
"self",
".",
"editorAt",
"(",
"index",
"-",
"1",
")",
"... | Moves the cursor to the end of the previous editor | [
"Moves",
"the",
"cursor",
"to",
"the",
"end",
"of",
"the",
"previous",
"editor"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xserialedit.py#L206-L217 | train | Moves the cursor to the end of the previous editor |
bitesofcode/projexui | projexui/widgets/xserialedit.py | XSerialEdit.goForward | def goForward(self):
"""
Moves the cursor to the beginning of the next editor.
"""
index = self.indexOf(self.currentEditor())
if index == -1:
return
next = self.editorAt(index + 1)
if next:
next.setFocus()
ne... | python | def goForward(self):
"""
Moves the cursor to the beginning of the next editor.
"""
index = self.indexOf(self.currentEditor())
if index == -1:
return
next = self.editorAt(index + 1)
if next:
next.setFocus()
ne... | [
"def",
"goForward",
"(",
"self",
")",
":",
"index",
"=",
"self",
".",
"indexOf",
"(",
"self",
".",
"currentEditor",
"(",
")",
")",
"if",
"index",
"==",
"-",
"1",
":",
"return",
"next",
"=",
"self",
".",
"editorAt",
"(",
"index",
"+",
"1",
")",
"i... | Moves the cursor to the beginning of the next editor. | [
"Moves",
"the",
"cursor",
"to",
"the",
"beginning",
"of",
"the",
"next",
"editor",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xserialedit.py#L219-L230 | train | Moves the cursor to the beginning of the next editor. |
bitesofcode/projexui | projexui/widgets/xserialedit.py | XSerialEdit.indexOf | def indexOf(self, editor):
"""
Returns the index of the inputed editor, or -1 if not found.
:param editor | <QtGui.QWidget>
:return <int>
"""
lay = self.layout()
for i in range(lay.count()):
if lay.itemAt(i).widget(... | python | def indexOf(self, editor):
"""
Returns the index of the inputed editor, or -1 if not found.
:param editor | <QtGui.QWidget>
:return <int>
"""
lay = self.layout()
for i in range(lay.count()):
if lay.itemAt(i).widget(... | [
"def",
"indexOf",
"(",
"self",
",",
"editor",
")",
":",
"lay",
"=",
"self",
".",
"layout",
"(",
")",
"for",
"i",
"in",
"range",
"(",
"lay",
".",
"count",
"(",
")",
")",
":",
"if",
"lay",
".",
"itemAt",
"(",
"i",
")",
".",
"widget",
"(",
")",
... | Returns the index of the inputed editor, or -1 if not found.
:param editor | <QtGui.QWidget>
:return <int> | [
"Returns",
"the",
"index",
"of",
"the",
"inputed",
"editor",
"or",
"-",
"1",
"if",
"not",
"found",
".",
":",
"param",
"editor",
"|",
"<QtGui",
".",
"QWidget",
">",
":",
"return",
"<int",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xserialedit.py#L246-L258 | train | Returns the index of the inputed editor in the list of items in the current tree. |
bitesofcode/projexui | projexui/widgets/xserialedit.py | XSerialEdit.selectedText | def selectedText(self):
"""
Returns the selected text from the editors.
:return <str>
"""
texts = []
for editor in self.editors():
text = editor.selectedText()
if text:
texts.append(nativestring(text))
... | python | def selectedText(self):
"""
Returns the selected text from the editors.
:return <str>
"""
texts = []
for editor in self.editors():
text = editor.selectedText()
if text:
texts.append(nativestring(text))
... | [
"def",
"selectedText",
"(",
"self",
")",
":",
"texts",
"=",
"[",
"]",
"for",
"editor",
"in",
"self",
".",
"editors",
"(",
")",
":",
"text",
"=",
"editor",
".",
"selectedText",
"(",
")",
"if",
"text",
":",
"texts",
".",
"append",
"(",
"nativestring",
... | Returns the selected text from the editors.
:return <str> | [
"Returns",
"the",
"selected",
"text",
"from",
"the",
"editors",
".",
":",
"return",
"<str",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xserialedit.py#L300-L312 | train | Returns the selected text from the editors. |
bitesofcode/projexui | projexui/widgets/xserialedit.py | XSerialEdit.selectAll | def selectAll(self):
"""
Selects the text within all the editors.
"""
self.blockEditorHandling(True)
for editor in self.editors():
editor.selectAll()
self.blockEditorHandling(False) | python | def selectAll(self):
"""
Selects the text within all the editors.
"""
self.blockEditorHandling(True)
for editor in self.editors():
editor.selectAll()
self.blockEditorHandling(False) | [
"def",
"selectAll",
"(",
"self",
")",
":",
"self",
".",
"blockEditorHandling",
"(",
"True",
")",
"for",
"editor",
"in",
"self",
".",
"editors",
"(",
")",
":",
"editor",
".",
"selectAll",
"(",
")",
"self",
".",
"blockEditorHandling",
"(",
"False",
")"
] | Selects the text within all the editors. | [
"Selects",
"the",
"text",
"within",
"all",
"the",
"editors",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xserialedit.py#L315-L322 | train | Selects the text within all the editors. |
bitesofcode/projexui | projexui/widgets/xserialedit.py | XSerialEdit.setHint | def setHint(self, text):
"""
Sets the hint to the inputed text. The same hint will be used for
all editors in this widget.
:param text | <str>
"""
texts = nativestring(text).split(' ')
for i, text in enumerate(texts):
... | python | def setHint(self, text):
"""
Sets the hint to the inputed text. The same hint will be used for
all editors in this widget.
:param text | <str>
"""
texts = nativestring(text).split(' ')
for i, text in enumerate(texts):
... | [
"def",
"setHint",
"(",
"self",
",",
"text",
")",
":",
"texts",
"=",
"nativestring",
"(",
"text",
")",
".",
"split",
"(",
"' '",
")",
"for",
"i",
",",
"text",
"in",
"enumerate",
"(",
"texts",
")",
":",
"editor",
"=",
"self",
".",
"editorAt",
"(",
... | Sets the hint to the inputed text. The same hint will be used for
all editors in this widget.
:param text | <str> | [
"Sets",
"the",
"hint",
"to",
"the",
"inputed",
"text",
".",
"The",
"same",
"hint",
"will",
"be",
"used",
"for",
"all",
"editors",
"in",
"this",
"widget",
".",
":",
"param",
"text",
"|",
"<str",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xserialedit.py#L324-L338 | train | Sets the hint to the inputed text. The same hint will be used for all editors in this widget. |
bitesofcode/projexui | projexui/widgets/xserialedit.py | XSerialEdit.setReadOnly | def setReadOnly(self, state):
"""
Sets whether or not this edit is read only.
:param state | <bool>
"""
self._readOnly = state
for editor in self.editors():
editor.setReadOnly(state) | python | def setReadOnly(self, state):
"""
Sets whether or not this edit is read only.
:param state | <bool>
"""
self._readOnly = state
for editor in self.editors():
editor.setReadOnly(state) | [
"def",
"setReadOnly",
"(",
"self",
",",
"state",
")",
":",
"self",
".",
"_readOnly",
"=",
"state",
"for",
"editor",
"in",
"self",
".",
"editors",
"(",
")",
":",
"editor",
".",
"setReadOnly",
"(",
"state",
")"
] | Sets whether or not this edit is read only.
:param state | <bool> | [
"Sets",
"whether",
"or",
"not",
"this",
"edit",
"is",
"read",
"only",
".",
":",
"param",
"state",
"|",
"<bool",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xserialedit.py#L340-L349 | train | Sets whether or not this edit is read only. |
bitesofcode/projexui | projexui/widgets/xserialedit.py | XSerialEdit.setSectionCount | def setSectionCount(self, count):
"""
Sets the number of editors that the serial widget should have.
:param count | <int>
"""
# cap the sections at 10
count = max(1, min(count, 10))
# create additional editors
while self.la... | python | def setSectionCount(self, count):
"""
Sets the number of editors that the serial widget should have.
:param count | <int>
"""
# cap the sections at 10
count = max(1, min(count, 10))
# create additional editors
while self.la... | [
"def",
"setSectionCount",
"(",
"self",
",",
"count",
")",
":",
"# cap the sections at 10\r",
"count",
"=",
"max",
"(",
"1",
",",
"min",
"(",
"count",
",",
"10",
")",
")",
"# create additional editors\r",
"while",
"self",
".",
"layout",
"(",
")",
".",
"coun... | Sets the number of editors that the serial widget should have.
:param count | <int> | [
"Sets",
"the",
"number",
"of",
"editors",
"that",
"the",
"serial",
"widget",
"should",
"have",
".",
":",
"param",
"count",
"|",
"<int",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xserialedit.py#L351-L379 | train | Sets the number of editors that the serial widget should have at least count lines. |
bitesofcode/projexui | projexui/widgets/xserialedit.py | XSerialEdit.setSectionLength | def setSectionLength(self, length):
"""
Sets the number of characters per section that are allowed.
:param length | <int>
"""
self._sectionLength = length
for editor in self.editors():
editor.setMaxLength(length) | python | def setSectionLength(self, length):
"""
Sets the number of characters per section that are allowed.
:param length | <int>
"""
self._sectionLength = length
for editor in self.editors():
editor.setMaxLength(length) | [
"def",
"setSectionLength",
"(",
"self",
",",
"length",
")",
":",
"self",
".",
"_sectionLength",
"=",
"length",
"for",
"editor",
"in",
"self",
".",
"editors",
"(",
")",
":",
"editor",
".",
"setMaxLength",
"(",
"length",
")"
] | Sets the number of characters per section that are allowed.
:param length | <int> | [
"Sets",
"the",
"number",
"of",
"characters",
"per",
"section",
"that",
"are",
"allowed",
".",
":",
"param",
"length",
"|",
"<int",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xserialedit.py#L381-L389 | train | Sets the number of characters per section that are allowed. |
johnnoone/aioconsul | aioconsul/client/agent_endpoint.py | AgentEndpoint.disable | async def disable(self, reason=None):
"""Enters maintenance mode
Parameters:
reason (str): Reason of disabling
Returns:
bool: ``True`` on success
"""
params = {"enable": True, "reason": reason}
response = await self._api.put("/v1/agent/maintenance... | python | async def disable(self, reason=None):
"""Enters maintenance mode
Parameters:
reason (str): Reason of disabling
Returns:
bool: ``True`` on success
"""
params = {"enable": True, "reason": reason}
response = await self._api.put("/v1/agent/maintenance... | [
"async",
"def",
"disable",
"(",
"self",
",",
"reason",
"=",
"None",
")",
":",
"params",
"=",
"{",
"\"enable\"",
":",
"True",
",",
"\"reason\"",
":",
"reason",
"}",
"response",
"=",
"await",
"self",
".",
"_api",
".",
"put",
"(",
"\"/v1/agent/maintenance\"... | Enters maintenance mode
Parameters:
reason (str): Reason of disabling
Returns:
bool: ``True`` on success | [
"Enters",
"maintenance",
"mode"
] | 02f7a529d7dc2e49bed942111067aa5faf320e90 | https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/agent_endpoint.py#L86-L96 | train | Enters maintenance mode for a specific user. |
johnnoone/aioconsul | aioconsul/client/agent_endpoint.py | AgentEndpoint.enable | async def enable(self, reason=None):
"""Resumes normal operation
Parameters:
reason (str): Reason of enabling
Returns:
bool: ``True`` on success
"""
params = {"enable": False, "reason": reason}
response = await self._api.put("/v1/agent/maintenance... | python | async def enable(self, reason=None):
"""Resumes normal operation
Parameters:
reason (str): Reason of enabling
Returns:
bool: ``True`` on success
"""
params = {"enable": False, "reason": reason}
response = await self._api.put("/v1/agent/maintenance... | [
"async",
"def",
"enable",
"(",
"self",
",",
"reason",
"=",
"None",
")",
":",
"params",
"=",
"{",
"\"enable\"",
":",
"False",
",",
"\"reason\"",
":",
"reason",
"}",
"response",
"=",
"await",
"self",
".",
"_api",
".",
"put",
"(",
"\"/v1/agent/maintenance\"... | Resumes normal operation
Parameters:
reason (str): Reason of enabling
Returns:
bool: ``True`` on success | [
"Resumes",
"normal",
"operation"
] | 02f7a529d7dc2e49bed942111067aa5faf320e90 | https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/agent_endpoint.py#L98-L108 | train | Resumes normal operation on the current resource. |
fitnr/buoyant | buoyant/timezone.py | parse_datetime | def parse_datetime(dt):
'''Parse an ISO datetime, which Python does buggily.'''
d = datetime.strptime(dt[:-1], ISOFORMAT)
if dt[-1:] == 'Z':
return timezone('utc').localize(d)
else:
return d | python | def parse_datetime(dt):
'''Parse an ISO datetime, which Python does buggily.'''
d = datetime.strptime(dt[:-1], ISOFORMAT)
if dt[-1:] == 'Z':
return timezone('utc').localize(d)
else:
return d | [
"def",
"parse_datetime",
"(",
"dt",
")",
":",
"d",
"=",
"datetime",
".",
"strptime",
"(",
"dt",
"[",
":",
"-",
"1",
"]",
",",
"ISOFORMAT",
")",
"if",
"dt",
"[",
"-",
"1",
":",
"]",
"==",
"'Z'",
":",
"return",
"timezone",
"(",
"'utc'",
")",
".",... | Parse an ISO datetime, which Python does buggily. | [
"Parse",
"an",
"ISO",
"datetime",
"which",
"Python",
"does",
"buggily",
"."
] | ef7a74f9ebd4774629508ccf2c9abb43aa0235c9 | https://github.com/fitnr/buoyant/blob/ef7a74f9ebd4774629508ccf2c9abb43aa0235c9/buoyant/timezone.py#L21-L28 | train | Parse an ISO datetime which Python does buggily. |
bitesofcode/projexui | projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py | XOrbBrowserWidget.currentGrouping | def currentGrouping( self ):
"""
Returns the current grouping for this widget.
:return [<str> group level, ..]
"""
groupBy = self.groupBy()
if ( groupBy == XOrbBrowserWidget.GroupByAdvancedKey ):
return self.advancedGrouping()
els... | python | def currentGrouping( self ):
"""
Returns the current grouping for this widget.
:return [<str> group level, ..]
"""
groupBy = self.groupBy()
if ( groupBy == XOrbBrowserWidget.GroupByAdvancedKey ):
return self.advancedGrouping()
els... | [
"def",
"currentGrouping",
"(",
"self",
")",
":",
"groupBy",
"=",
"self",
".",
"groupBy",
"(",
")",
"if",
"(",
"groupBy",
"==",
"XOrbBrowserWidget",
".",
"GroupByAdvancedKey",
")",
":",
"return",
"self",
".",
"advancedGrouping",
"(",
")",
"else",
":",
"tabl... | Returns the current grouping for this widget.
:return [<str> group level, ..] | [
"Returns",
"the",
"current",
"grouping",
"for",
"this",
"widget",
".",
":",
"return",
"[",
"<str",
">",
"group",
"level",
"..",
"]"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py#L240-L258 | train | Returns the current grouping for this widget. |
bitesofcode/projexui | projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py | XOrbBrowserWidget.currentRecord | def currentRecord( self ):
"""
Returns the current record from this browser.
:return <orb.Table> || None
"""
if ( self.currentMode() == XOrbBrowserWidget.Mode.Detail ):
return self.detailWidget().currentRecord()
elif ( self.curre... | python | def currentRecord( self ):
"""
Returns the current record from this browser.
:return <orb.Table> || None
"""
if ( self.currentMode() == XOrbBrowserWidget.Mode.Detail ):
return self.detailWidget().currentRecord()
elif ( self.curre... | [
"def",
"currentRecord",
"(",
"self",
")",
":",
"if",
"(",
"self",
".",
"currentMode",
"(",
")",
"==",
"XOrbBrowserWidget",
".",
"Mode",
".",
"Detail",
")",
":",
"return",
"self",
".",
"detailWidget",
"(",
")",
".",
"currentRecord",
"(",
")",
"elif",
"(... | Returns the current record from this browser.
:return <orb.Table> || None | [
"Returns",
"the",
"current",
"record",
"from",
"this",
"browser",
".",
":",
"return",
"<orb",
".",
"Table",
">",
"||",
"None"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py#L260-L281 | train | Returns the current record from this browser. |
bitesofcode/projexui | projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py | XOrbBrowserWidget.currentMode | def currentMode( self ):
"""
Returns the current mode for this widget.
:return <XOrbBrowserWidget.Mode>
"""
if ( self.uiCardACT.isChecked() ):
return XOrbBrowserWidget.Mode.Card
elif ( self.uiDetailsACT.isChecked() ):
return X... | python | def currentMode( self ):
"""
Returns the current mode for this widget.
:return <XOrbBrowserWidget.Mode>
"""
if ( self.uiCardACT.isChecked() ):
return XOrbBrowserWidget.Mode.Card
elif ( self.uiDetailsACT.isChecked() ):
return X... | [
"def",
"currentMode",
"(",
"self",
")",
":",
"if",
"(",
"self",
".",
"uiCardACT",
".",
"isChecked",
"(",
")",
")",
":",
"return",
"XOrbBrowserWidget",
".",
"Mode",
".",
"Card",
"elif",
"(",
"self",
".",
"uiDetailsACT",
".",
"isChecked",
"(",
")",
")",
... | Returns the current mode for this widget.
:return <XOrbBrowserWidget.Mode> | [
"Returns",
"the",
"current",
"mode",
"for",
"this",
"widget",
".",
":",
"return",
"<XOrbBrowserWidget",
".",
"Mode",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py#L283-L294 | train | Returns the current mode for this widget. |
bitesofcode/projexui | projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py | XOrbBrowserWidget.enabledModes | def enabledModes( self ):
"""
Returns the binary value of the enabled modes.
:return <XOrbBrowserWidget.Mode>
"""
output = 0
for i, action in enumerate((self.uiDetailsACT,
self.uiCardACT,
... | python | def enabledModes( self ):
"""
Returns the binary value of the enabled modes.
:return <XOrbBrowserWidget.Mode>
"""
output = 0
for i, action in enumerate((self.uiDetailsACT,
self.uiCardACT,
... | [
"def",
"enabledModes",
"(",
"self",
")",
":",
"output",
"=",
"0",
"for",
"i",
",",
"action",
"in",
"enumerate",
"(",
"(",
"self",
".",
"uiDetailsACT",
",",
"self",
".",
"uiCardACT",
",",
"self",
".",
"uiThumbnailACT",
")",
")",
":",
"if",
"(",
"actio... | Returns the binary value of the enabled modes.
:return <XOrbBrowserWidget.Mode> | [
"Returns",
"the",
"binary",
"value",
"of",
"the",
"enabled",
"modes",
".",
":",
"return",
"<XOrbBrowserWidget",
".",
"Mode",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py#L320-L332 | train | Returns the binary value of the enabled modes. |
bitesofcode/projexui | projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py | XOrbBrowserWidget.eventFilter | def eventFilter( self, object, event ):
"""
Processes resize events on the thumbnail widget to update the group
items to force a proper sizing.
:param object | <QObject>
event | <QEvent>
:return <bool> | consumed
""... | python | def eventFilter( self, object, event ):
"""
Processes resize events on the thumbnail widget to update the group
items to force a proper sizing.
:param object | <QObject>
event | <QEvent>
:return <bool> | consumed
""... | [
"def",
"eventFilter",
"(",
"self",
",",
"object",
",",
"event",
")",
":",
"if",
"(",
"event",
".",
"type",
"(",
")",
"==",
"event",
".",
"Resize",
"and",
"self",
".",
"currentMode",
"(",
")",
"==",
"XOrbBrowserWidget",
".",
"Mode",
".",
"Thumbnail",
... | Processes resize events on the thumbnail widget to update the group
items to force a proper sizing.
:param object | <QObject>
event | <QEvent>
:return <bool> | consumed | [
"Processes",
"resize",
"events",
"on",
"the",
"thumbnail",
"widget",
"to",
"update",
"the",
"group",
"items",
"to",
"force",
"a",
"proper",
"sizing",
".",
":",
"param",
"object",
"|",
"<QObject",
">",
"event",
"|",
"<QEvent",
">",
":",
"return",
"<bool",
... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py#L334-L352 | train | Updates the size of the items in the group list widget based on the event type. |
bitesofcode/projexui | projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py | XOrbBrowserWidget.handleCardDblClick | def handleCardDblClick( self, item ):
"""
Handles when a card item is double clicked on.
:param item | <QTreeWidgetItem>
"""
widget = self.uiCardTREE.itemWidget(item, 0)
if ( isinstance(widget, XAbstractCardWidget) ):
self.emitRecordDoubl... | python | def handleCardDblClick( self, item ):
"""
Handles when a card item is double clicked on.
:param item | <QTreeWidgetItem>
"""
widget = self.uiCardTREE.itemWidget(item, 0)
if ( isinstance(widget, XAbstractCardWidget) ):
self.emitRecordDoubl... | [
"def",
"handleCardDblClick",
"(",
"self",
",",
"item",
")",
":",
"widget",
"=",
"self",
".",
"uiCardTREE",
".",
"itemWidget",
"(",
"item",
",",
"0",
")",
"if",
"(",
"isinstance",
"(",
"widget",
",",
"XAbstractCardWidget",
")",
")",
":",
"self",
".",
"e... | Handles when a card item is double clicked on.
:param item | <QTreeWidgetItem> | [
"Handles",
"when",
"a",
"card",
"item",
"is",
"double",
"clicked",
"on",
".",
":",
"param",
"item",
"|",
"<QTreeWidgetItem",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py#L373-L381 | train | Handles when a card item is double clicked on. |
bitesofcode/projexui | projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py | XOrbBrowserWidget.handleDetailDblClick | def handleDetailDblClick( self, item ):
"""
Handles when a detail item is double clicked on.
:param item | <QTreeWidgetItem>
"""
if ( isinstance(item, XOrbRecordItem) ):
self.emitRecordDoubleClicked(item.record()) | python | def handleDetailDblClick( self, item ):
"""
Handles when a detail item is double clicked on.
:param item | <QTreeWidgetItem>
"""
if ( isinstance(item, XOrbRecordItem) ):
self.emitRecordDoubleClicked(item.record()) | [
"def",
"handleDetailDblClick",
"(",
"self",
",",
"item",
")",
":",
"if",
"(",
"isinstance",
"(",
"item",
",",
"XOrbRecordItem",
")",
")",
":",
"self",
".",
"emitRecordDoubleClicked",
"(",
"item",
".",
"record",
"(",
")",
")"
] | Handles when a detail item is double clicked on.
:param item | <QTreeWidgetItem> | [
"Handles",
"when",
"a",
"detail",
"item",
"is",
"double",
"clicked",
"on",
".",
":",
"param",
"item",
"|",
"<QTreeWidgetItem",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py#L383-L390 | train | Handles when a detail item is double clicked on. |
bitesofcode/projexui | projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py | XOrbBrowserWidget.handleThumbDblClick | def handleThumbDblClick( self, item ):
"""
Handles when a thumbnail item is double clicked on.
:param item | <QListWidgetItem>
"""
if ( isinstance(item, RecordListWidgetItem) ):
self.emitRecordDoubleClicked(item.record()) | python | def handleThumbDblClick( self, item ):
"""
Handles when a thumbnail item is double clicked on.
:param item | <QListWidgetItem>
"""
if ( isinstance(item, RecordListWidgetItem) ):
self.emitRecordDoubleClicked(item.record()) | [
"def",
"handleThumbDblClick",
"(",
"self",
",",
"item",
")",
":",
"if",
"(",
"isinstance",
"(",
"item",
",",
"RecordListWidgetItem",
")",
")",
":",
"self",
".",
"emitRecordDoubleClicked",
"(",
"item",
".",
"record",
"(",
")",
")"
] | Handles when a thumbnail item is double clicked on.
:param item | <QListWidgetItem> | [
"Handles",
"when",
"a",
"thumbnail",
"item",
"is",
"double",
"clicked",
"on",
".",
":",
"param",
"item",
"|",
"<QListWidgetItem",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py#L392-L399 | train | Handles when a thumbnail item is double clicked on. |
bitesofcode/projexui | projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py | XOrbBrowserWidget.records | def records( self ):
"""
Returns the record set for the current settings of this browser.
:return <orb.RecordSet>
"""
if ( self.isGroupingActive() ):
self._records.setGroupBy(self.currentGrouping())
else:
self._records.setGrou... | python | def records( self ):
"""
Returns the record set for the current settings of this browser.
:return <orb.RecordSet>
"""
if ( self.isGroupingActive() ):
self._records.setGroupBy(self.currentGrouping())
else:
self._records.setGrou... | [
"def",
"records",
"(",
"self",
")",
":",
"if",
"(",
"self",
".",
"isGroupingActive",
"(",
")",
")",
":",
"self",
".",
"_records",
".",
"setGroupBy",
"(",
"self",
".",
"currentGrouping",
"(",
")",
")",
"else",
":",
"self",
".",
"_records",
".",
"setGr... | Returns the record set for the current settings of this browser.
:return <orb.RecordSet> | [
"Returns",
"the",
"record",
"set",
"for",
"the",
"current",
"settings",
"of",
"this",
"browser",
".",
":",
"return",
"<orb",
".",
"RecordSet",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py#L457-L467 | train | Returns the list of records for this browser. |
bitesofcode/projexui | projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py | XOrbBrowserWidget.refreshRecords | def refreshRecords( self ):
"""
Refreshes the records being loaded by this browser.
"""
table_type = self.tableType()
if ( not table_type ):
self._records = RecordSet()
return False
search = nativestring(self.uiSearchTXT.text())
... | python | def refreshRecords( self ):
"""
Refreshes the records being loaded by this browser.
"""
table_type = self.tableType()
if ( not table_type ):
self._records = RecordSet()
return False
search = nativestring(self.uiSearchTXT.text())
... | [
"def",
"refreshRecords",
"(",
"self",
")",
":",
"table_type",
"=",
"self",
".",
"tableType",
"(",
")",
"if",
"(",
"not",
"table_type",
")",
":",
"self",
".",
"_records",
"=",
"RecordSet",
"(",
")",
"return",
"False",
"search",
"=",
"nativestring",
"(",
... | Refreshes the records being loaded by this browser. | [
"Refreshes",
"the",
"records",
"being",
"loaded",
"by",
"this",
"browser",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py#L476-L494 | train | Refreshes the records being loaded by this browser. |
bitesofcode/projexui | projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py | XOrbBrowserWidget.refreshResults | def refreshResults( self ):
"""
Joins together the queries from the fixed system, the search, and the
query builder to generate a query for the browser to display.
"""
if ( self.currentMode() == XOrbBrowserWidget.Mode.Detail ):
self.refreshDetails()
eli... | python | def refreshResults( self ):
"""
Joins together the queries from the fixed system, the search, and the
query builder to generate a query for the browser to display.
"""
if ( self.currentMode() == XOrbBrowserWidget.Mode.Detail ):
self.refreshDetails()
eli... | [
"def",
"refreshResults",
"(",
"self",
")",
":",
"if",
"(",
"self",
".",
"currentMode",
"(",
")",
"==",
"XOrbBrowserWidget",
".",
"Mode",
".",
"Detail",
")",
":",
"self",
".",
"refreshDetails",
"(",
")",
"elif",
"(",
"self",
".",
"currentMode",
"(",
")"... | Joins together the queries from the fixed system, the search, and the
query builder to generate a query for the browser to display. | [
"Joins",
"together",
"the",
"queries",
"from",
"the",
"fixed",
"system",
"the",
"search",
"and",
"the",
"query",
"builder",
"to",
"generate",
"a",
"query",
"for",
"the",
"browser",
"to",
"display",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py#L496-L506 | train | Refreshes the results of the current browser. |
bitesofcode/projexui | projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py | XOrbBrowserWidget.refreshCards | def refreshCards( self ):
"""
Refreshes the results for the cards view of the browser.
"""
cards = self.cardWidget()
factory = self.factory()
self.setUpdatesEnabled(False)
self.blockSignals(True)
cards.setUpdatesEnabled(False)
... | python | def refreshCards( self ):
"""
Refreshes the results for the cards view of the browser.
"""
cards = self.cardWidget()
factory = self.factory()
self.setUpdatesEnabled(False)
self.blockSignals(True)
cards.setUpdatesEnabled(False)
... | [
"def",
"refreshCards",
"(",
"self",
")",
":",
"cards",
"=",
"self",
".",
"cardWidget",
"(",
")",
"factory",
"=",
"self",
".",
"factory",
"(",
")",
"self",
".",
"setUpdatesEnabled",
"(",
"False",
")",
"self",
".",
"blockSignals",
"(",
"True",
")",
"card... | Refreshes the results for the cards view of the browser. | [
"Refreshes",
"the",
"results",
"for",
"the",
"cards",
"view",
"of",
"the",
"browser",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py#L508-L546 | train | Refreshes the card view of the browser. |
bitesofcode/projexui | projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py | XOrbBrowserWidget.refreshDetails | def refreshDetails( self ):
"""
Refreshes the results for the details view of the browser.
"""
# start off by filtering based on the group selection
tree = self.uiRecordsTREE
tree.blockSignals(True)
tree.setRecordSet(self.records())
tree.blockSigna... | python | def refreshDetails( self ):
"""
Refreshes the results for the details view of the browser.
"""
# start off by filtering based on the group selection
tree = self.uiRecordsTREE
tree.blockSignals(True)
tree.setRecordSet(self.records())
tree.blockSigna... | [
"def",
"refreshDetails",
"(",
"self",
")",
":",
"# start off by filtering based on the group selection\r",
"tree",
"=",
"self",
".",
"uiRecordsTREE",
"tree",
".",
"blockSignals",
"(",
"True",
")",
"tree",
".",
"setRecordSet",
"(",
"self",
".",
"records",
"(",
")",... | Refreshes the results for the details view of the browser. | [
"Refreshes",
"the",
"results",
"for",
"the",
"details",
"view",
"of",
"the",
"browser",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py#L548-L556 | train | Refreshes the details view of the browser |
bitesofcode/projexui | projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py | XOrbBrowserWidget.refreshThumbnails | def refreshThumbnails( self ):
"""
Refreshes the thumbnails view of the browser.
"""
# clear existing items
widget = self.thumbnailWidget()
widget.setUpdatesEnabled(False)
widget.blockSignals(True)
widget.clear()
widget.setIconSi... | python | def refreshThumbnails( self ):
"""
Refreshes the thumbnails view of the browser.
"""
# clear existing items
widget = self.thumbnailWidget()
widget.setUpdatesEnabled(False)
widget.blockSignals(True)
widget.clear()
widget.setIconSi... | [
"def",
"refreshThumbnails",
"(",
"self",
")",
":",
"# clear existing items\r",
"widget",
"=",
"self",
".",
"thumbnailWidget",
"(",
")",
"widget",
".",
"setUpdatesEnabled",
"(",
"False",
")",
"widget",
".",
"blockSignals",
"(",
"True",
")",
"widget",
".",
"clea... | Refreshes the thumbnails view of the browser. | [
"Refreshes",
"the",
"thumbnails",
"view",
"of",
"the",
"browser",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py#L558-L587 | train | Refreshes the thumbnails of the browser. |
bitesofcode/projexui | projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py | XOrbBrowserWidget.setCurrentMode | def setCurrentMode( self, mode ):
"""
Sets the current mode for this widget to the inputed mode. This will
check against the valid modes for this browser and return success.
:param mode | <XOrbBrowserWidget.Mode>
:return <bool> | success
... | python | def setCurrentMode( self, mode ):
"""
Sets the current mode for this widget to the inputed mode. This will
check against the valid modes for this browser and return success.
:param mode | <XOrbBrowserWidget.Mode>
:return <bool> | success
... | [
"def",
"setCurrentMode",
"(",
"self",
",",
"mode",
")",
":",
"if",
"(",
"not",
"self",
".",
"isModeEnabled",
"(",
"mode",
")",
")",
":",
"return",
"False",
"if",
"(",
"mode",
"==",
"XOrbBrowserWidget",
".",
"Mode",
".",
"Detail",
")",
":",
"self",
".... | Sets the current mode for this widget to the inputed mode. This will
check against the valid modes for this browser and return success.
:param mode | <XOrbBrowserWidget.Mode>
:return <bool> | success | [
"Sets",
"the",
"current",
"mode",
"for",
"this",
"widget",
"to",
"the",
"inputed",
"mode",
".",
"This",
"will",
"check",
"against",
"the",
"valid",
"modes",
"for",
"this",
"browser",
"and",
"return",
"success",
".",
":",
"param",
"mode",
"|",
"<XOrbBrowser... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py#L601-L625 | train | Sets the current mode for this browser widget. |
bitesofcode/projexui | projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py | XOrbBrowserWidget.setCurrentRecord | def setCurrentRecord( self, record ):
"""
Sets the current record for this browser to the inputed record.
:param record | <orb.Table> || None
"""
mode = self.currentMode()
if ( mode == XOrbBrowserWidget.Mode.Detail ):
self.detailWidget().... | python | def setCurrentRecord( self, record ):
"""
Sets the current record for this browser to the inputed record.
:param record | <orb.Table> || None
"""
mode = self.currentMode()
if ( mode == XOrbBrowserWidget.Mode.Detail ):
self.detailWidget().... | [
"def",
"setCurrentRecord",
"(",
"self",
",",
"record",
")",
":",
"mode",
"=",
"self",
".",
"currentMode",
"(",
")",
"if",
"(",
"mode",
"==",
"XOrbBrowserWidget",
".",
"Mode",
".",
"Detail",
")",
":",
"self",
".",
"detailWidget",
"(",
")",
".",
"setCurr... | Sets the current record for this browser to the inputed record.
:param record | <orb.Table> || None | [
"Sets",
"the",
"current",
"record",
"for",
"this",
"browser",
"to",
"the",
"inputed",
"record",
".",
":",
"param",
"record",
"|",
"<orb",
".",
"Table",
">",
"||",
"None"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py#L627-L644 | train | Sets the current record for this browser to the inputed record. |
bitesofcode/projexui | projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py | XOrbBrowserWidget.setFactory | def setFactory( self, factory ):
"""
Sets the factory assigned to this browser for generating card and
thumbnail information for records.
:param factory | <XOrbBrowserFactory>
"""
self._factory = factory
self._queryWidget.setFactory(factory) | python | def setFactory( self, factory ):
"""
Sets the factory assigned to this browser for generating card and
thumbnail information for records.
:param factory | <XOrbBrowserFactory>
"""
self._factory = factory
self._queryWidget.setFactory(factory) | [
"def",
"setFactory",
"(",
"self",
",",
"factory",
")",
":",
"self",
".",
"_factory",
"=",
"factory",
"self",
".",
"_queryWidget",
".",
"setFactory",
"(",
"factory",
")"
] | Sets the factory assigned to this browser for generating card and
thumbnail information for records.
:param factory | <XOrbBrowserFactory> | [
"Sets",
"the",
"factory",
"assigned",
"to",
"this",
"browser",
"for",
"generating",
"card",
"and",
"thumbnail",
"information",
"for",
"records",
".",
":",
"param",
"factory",
"|",
"<XOrbBrowserFactory",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py#L652-L660 | train | Sets the factory for this query widget. |
bitesofcode/projexui | projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py | XOrbBrowserWidget.setHint | def setHint( self, hint ):
"""
Sets the hint for this widget.
:param hint | <str>
"""
self._hint = hint
self.detailWidget().setHint(hint) | python | def setHint( self, hint ):
"""
Sets the hint for this widget.
:param hint | <str>
"""
self._hint = hint
self.detailWidget().setHint(hint) | [
"def",
"setHint",
"(",
"self",
",",
"hint",
")",
":",
"self",
".",
"_hint",
"=",
"hint",
"self",
".",
"detailWidget",
"(",
")",
".",
"setHint",
"(",
"hint",
")"
] | Sets the hint for this widget.
:param hint | <str> | [
"Sets",
"the",
"hint",
"for",
"this",
"widget",
".",
":",
"param",
"hint",
"|",
"<str",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py#L687-L694 | train | Sets the hint for this widget. |
bitesofcode/projexui | projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py | XOrbBrowserWidget.setModeEnabled | def setModeEnabled( self, mode, state ):
"""
Sets whether or not the mode should be enabled.
:param mode | <XOrbBrowserWidget.Mode>
state | <bool>
"""
if ( mode == XOrbBrowserWidget.Mode.Detail ):
self.uiDetailsACT.setEnabled... | python | def setModeEnabled( self, mode, state ):
"""
Sets whether or not the mode should be enabled.
:param mode | <XOrbBrowserWidget.Mode>
state | <bool>
"""
if ( mode == XOrbBrowserWidget.Mode.Detail ):
self.uiDetailsACT.setEnabled... | [
"def",
"setModeEnabled",
"(",
"self",
",",
"mode",
",",
"state",
")",
":",
"if",
"(",
"mode",
"==",
"XOrbBrowserWidget",
".",
"Mode",
".",
"Detail",
")",
":",
"self",
".",
"uiDetailsACT",
".",
"setEnabled",
"(",
"state",
")",
"elif",
"(",
"mode",
"==",... | Sets whether or not the mode should be enabled.
:param mode | <XOrbBrowserWidget.Mode>
state | <bool> | [
"Sets",
"whether",
"or",
"not",
"the",
"mode",
"should",
"be",
"enabled",
".",
":",
"param",
"mode",
"|",
"<XOrbBrowserWidget",
".",
"Mode",
">",
"state",
"|",
"<bool",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py#L696-L708 | train | Sets whether or not the mode should be enabled. |
bitesofcode/projexui | projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py | XOrbBrowserWidget.setQuery | def setQuery( self, query ):
"""
Sets the fixed lookup query for this widget to the inputed query.
:param query | <orb.Query>
"""
self._query = query
if ( not self.signalsBlocked() ):
self.queryChanged.emit(query) | python | def setQuery( self, query ):
"""
Sets the fixed lookup query for this widget to the inputed query.
:param query | <orb.Query>
"""
self._query = query
if ( not self.signalsBlocked() ):
self.queryChanged.emit(query) | [
"def",
"setQuery",
"(",
"self",
",",
"query",
")",
":",
"self",
".",
"_query",
"=",
"query",
"if",
"(",
"not",
"self",
".",
"signalsBlocked",
"(",
")",
")",
":",
"self",
".",
"queryChanged",
".",
"emit",
"(",
"query",
")"
] | Sets the fixed lookup query for this widget to the inputed query.
:param query | <orb.Query> | [
"Sets",
"the",
"fixed",
"lookup",
"query",
"for",
"this",
"widget",
"to",
"the",
"inputed",
"query",
".",
":",
"param",
"query",
"|",
"<orb",
".",
"Query",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py#L710-L718 | train | Sets the fixed lookup query for this widget. |
bitesofcode/projexui | projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py | XOrbBrowserWidget.setTableType | def setTableType( self, tableType ):
"""
Sets the table type for this widget to the inputed type.
:param tableType | <orb.Table>
"""
self.detailWidget().setTableType(tableType)
self.queryWidget().setTableType(tableType) | python | def setTableType( self, tableType ):
"""
Sets the table type for this widget to the inputed type.
:param tableType | <orb.Table>
"""
self.detailWidget().setTableType(tableType)
self.queryWidget().setTableType(tableType) | [
"def",
"setTableType",
"(",
"self",
",",
"tableType",
")",
":",
"self",
".",
"detailWidget",
"(",
")",
".",
"setTableType",
"(",
"tableType",
")",
"self",
".",
"queryWidget",
"(",
")",
".",
"setTableType",
"(",
"tableType",
")"
] | Sets the table type for this widget to the inputed type.
:param tableType | <orb.Table> | [
"Sets",
"the",
"table",
"type",
"for",
"this",
"widget",
"to",
"the",
"inputed",
"type",
".",
":",
"param",
"tableType",
"|",
"<orb",
".",
"Table",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py#L720-L727 | train | Sets the table type for this widget to the inputed type. |
bitesofcode/projexui | projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py | XOrbBrowserWidget.showGroupMenu | def showGroupMenu( self ):
"""
Displays the group menu to the user for modification.
"""
group_active = self.isGroupingActive()
group_by = self.groupBy()
menu = XMenu(self)
menu.setTitle('Grouping Options')
menu.setShowTitle(True)
... | python | def showGroupMenu( self ):
"""
Displays the group menu to the user for modification.
"""
group_active = self.isGroupingActive()
group_by = self.groupBy()
menu = XMenu(self)
menu.setTitle('Grouping Options')
menu.setShowTitle(True)
... | [
"def",
"showGroupMenu",
"(",
"self",
")",
":",
"group_active",
"=",
"self",
".",
"isGroupingActive",
"(",
")",
"group_by",
"=",
"self",
".",
"groupBy",
"(",
")",
"menu",
"=",
"XMenu",
"(",
"self",
")",
"menu",
".",
"setTitle",
"(",
"'Grouping Options'",
... | Displays the group menu to the user for modification. | [
"Displays",
"the",
"group",
"menu",
"to",
"the",
"user",
"for",
"modification",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbbrowserwidget/xorbbrowserwidget.py#L743-L811 | train | Shows the group menu for modification. |
musashiXXX/django-clamav-upload | clamav_upload/__init__.py | get_settings | def get_settings():
"""
This function returns a dict containing default settings
"""
s = getattr(settings, 'CLAMAV_UPLOAD', {})
s = {
'CONTENT_TYPE_CHECK_ENABLED': s.get('CONTENT_TYPE_CHECK_ENABLED', False),
# LAST_HANDLER is not a user configurable option; we return
... | python | def get_settings():
"""
This function returns a dict containing default settings
"""
s = getattr(settings, 'CLAMAV_UPLOAD', {})
s = {
'CONTENT_TYPE_CHECK_ENABLED': s.get('CONTENT_TYPE_CHECK_ENABLED', False),
# LAST_HANDLER is not a user configurable option; we return
... | [
"def",
"get_settings",
"(",
")",
":",
"s",
"=",
"getattr",
"(",
"settings",
",",
"'CLAMAV_UPLOAD'",
",",
"{",
"}",
")",
"s",
"=",
"{",
"'CONTENT_TYPE_CHECK_ENABLED'",
":",
"s",
".",
"get",
"(",
"'CONTENT_TYPE_CHECK_ENABLED'",
",",
"False",
")",
",",
"# LAS... | This function returns a dict containing default settings | [
"This",
"function",
"returns",
"a",
"dict",
"containing",
"default",
"settings"
] | 00ea8baaa127d98ffb0919aaa2c3aeec9bb58fd5 | https://github.com/musashiXXX/django-clamav-upload/blob/00ea8baaa127d98ffb0919aaa2c3aeec9bb58fd5/clamav_upload/__init__.py#L21-L32 | train | This function returns a dict containing default settings |
bitesofcode/projexui | projexui/xsettings.py | XmlFormat.beginGroup | def beginGroup(self, prefix):
"""
Starts a new group for the given prefix.
:param prefix | <str>
"""
curr = self._xstack[-1]
next = curr.find(prefix)
if next is None:
next = ElementTree.SubElement(curr, prefix)
self._xst... | python | def beginGroup(self, prefix):
"""
Starts a new group for the given prefix.
:param prefix | <str>
"""
curr = self._xstack[-1]
next = curr.find(prefix)
if next is None:
next = ElementTree.SubElement(curr, prefix)
self._xst... | [
"def",
"beginGroup",
"(",
"self",
",",
"prefix",
")",
":",
"curr",
"=",
"self",
".",
"_xstack",
"[",
"-",
"1",
"]",
"next",
"=",
"curr",
".",
"find",
"(",
"prefix",
")",
"if",
"next",
"is",
"None",
":",
"next",
"=",
"ElementTree",
".",
"SubElement"... | Starts a new group for the given prefix.
:param prefix | <str> | [
"Starts",
"a",
"new",
"group",
"for",
"the",
"given",
"prefix",
".",
":",
"param",
"prefix",
"|",
"<str",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xsettings.py#L107-L117 | train | Starts a new group for the given prefix. |
bitesofcode/projexui | projexui/xsettings.py | XmlFormat.clear | def clear(self):
"""
Clears the settings for this XML format.
"""
self._xroot = ElementTree.Element('settings')
self._xroot.set('version', '1.0')
self._xstack = [self._xroot] | python | def clear(self):
"""
Clears the settings for this XML format.
"""
self._xroot = ElementTree.Element('settings')
self._xroot.set('version', '1.0')
self._xstack = [self._xroot] | [
"def",
"clear",
"(",
"self",
")",
":",
"self",
".",
"_xroot",
"=",
"ElementTree",
".",
"Element",
"(",
"'settings'",
")",
"self",
".",
"_xroot",
".",
"set",
"(",
"'version'",
",",
"'1.0'",
")",
"self",
".",
"_xstack",
"=",
"[",
"self",
".",
"_xroot",... | Clears the settings for this XML format. | [
"Clears",
"the",
"settings",
"for",
"this",
"XML",
"format",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xsettings.py#L119-L125 | train | Clears the XML format settings. |
bitesofcode/projexui | projexui/xsettings.py | XmlFormat.load | def load(self, filename):
"""
Loads the settings from the inputed filename.
:param filename | <str>
"""
try:
self._xroot = ElementTree.parse(filename).getroot()
self._xstack = [self._xroot]
except ExpatError:
sel... | python | def load(self, filename):
"""
Loads the settings from the inputed filename.
:param filename | <str>
"""
try:
self._xroot = ElementTree.parse(filename).getroot()
self._xstack = [self._xroot]
except ExpatError:
sel... | [
"def",
"load",
"(",
"self",
",",
"filename",
")",
":",
"try",
":",
"self",
".",
"_xroot",
"=",
"ElementTree",
".",
"parse",
"(",
"filename",
")",
".",
"getroot",
"(",
")",
"self",
".",
"_xstack",
"=",
"[",
"self",
".",
"_xroot",
"]",
"except",
"Exp... | Loads the settings from the inputed filename.
:param filename | <str> | [
"Loads",
"the",
"settings",
"from",
"the",
"inputed",
"filename",
".",
":",
"param",
"filename",
"|",
"<str",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xsettings.py#L135-L147 | train | Loads the settings from the inputed file. |
bitesofcode/projexui | projexui/xsettings.py | XmlFormat.restoreValue | def restoreValue(self, xelem):
"""
Stores the value for the inptued instance to the given xml element.
:param xelem | <xml.etree.Element>
:return <variant>
"""
typ = xelem.get('type')
if typ == 'color':
re... | python | def restoreValue(self, xelem):
"""
Stores the value for the inptued instance to the given xml element.
:param xelem | <xml.etree.Element>
:return <variant>
"""
typ = xelem.get('type')
if typ == 'color':
re... | [
"def",
"restoreValue",
"(",
"self",
",",
"xelem",
")",
":",
"typ",
"=",
"xelem",
".",
"get",
"(",
"'type'",
")",
"if",
"typ",
"==",
"'color'",
":",
"return",
"QtGui",
".",
"QColor",
"(",
"xelem",
".",
"text",
")",
"elif",
"typ",
"==",
"'point'",
":... | Stores the value for the inptued instance to the given xml element.
:param xelem | <xml.etree.Element>
:return <variant> | [
"Stores",
"the",
"value",
"for",
"the",
"inptued",
"instance",
"to",
"the",
"given",
"xml",
"element",
".",
":",
"param",
"xelem",
"|",
"<xml",
".",
"etree",
".",
"Element",
">",
":",
"return",
"<variant",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xsettings.py#L156-L197 | train | Restore the value of the inptued instance to the given xml element. |
bitesofcode/projexui | projexui/xsettings.py | XmlFormat.save | def save(self, filename):
"""
Saves the settings to the inputed filename.
:param filename | <str>
"""
dirname = os.path.dirname(filename)
if not os.path.exists(dirname):
os.makedirs(dirname)
projex.text.xmlindent(self._... | python | def save(self, filename):
"""
Saves the settings to the inputed filename.
:param filename | <str>
"""
dirname = os.path.dirname(filename)
if not os.path.exists(dirname):
os.makedirs(dirname)
projex.text.xmlindent(self._... | [
"def",
"save",
"(",
"self",
",",
"filename",
")",
":",
"dirname",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"filename",
")",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"dirname",
")",
":",
"os",
".",
"makedirs",
"(",
"dirname",
")",
"... | Saves the settings to the inputed filename.
:param filename | <str> | [
"Saves",
"the",
"settings",
"to",
"the",
"inputed",
"filename",
".",
":",
"param",
"filename",
"|",
"<str",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xsettings.py#L216-L229 | train | Saves the current settings to the inputed filename. |
bitesofcode/projexui | projexui/xsettings.py | XmlFormat.setValue | def setValue(self, key, value):
"""
Saves the inputed key to the inputed value.
:param key | <str>
value | <variant>
"""
parts = nativestring(key).split('/')
curr = self._xstack[-1]
for part in parts[:-1]:
ne... | python | def setValue(self, key, value):
"""
Saves the inputed key to the inputed value.
:param key | <str>
value | <variant>
"""
parts = nativestring(key).split('/')
curr = self._xstack[-1]
for part in parts[:-1]:
ne... | [
"def",
"setValue",
"(",
"self",
",",
"key",
",",
"value",
")",
":",
"parts",
"=",
"nativestring",
"(",
"key",
")",
".",
"split",
"(",
"'/'",
")",
"curr",
"=",
"self",
".",
"_xstack",
"[",
"-",
"1",
"]",
"for",
"part",
"in",
"parts",
"[",
":",
"... | Saves the inputed key to the inputed value.
:param key | <str>
value | <variant> | [
"Saves",
"the",
"inputed",
"key",
"to",
"the",
"inputed",
"value",
".",
":",
"param",
"key",
"|",
"<str",
">",
"value",
"|",
"<variant",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xsettings.py#L231-L250 | train | Saves the inputed key to the inputed value. |
bitesofcode/projexui | projexui/xsettings.py | XmlFormat.storeValue | def storeValue(self, xelem, value):
"""
Stores the value for the inptued instance to the given xml element.
:param xelem | <xml.etree.Element>
value | <variant>
"""
typ = type(value)
if typ == QtGui.QColor:
... | python | def storeValue(self, xelem, value):
"""
Stores the value for the inptued instance to the given xml element.
:param xelem | <xml.etree.Element>
value | <variant>
"""
typ = type(value)
if typ == QtGui.QColor:
... | [
"def",
"storeValue",
"(",
"self",
",",
"xelem",
",",
"value",
")",
":",
"typ",
"=",
"type",
"(",
"value",
")",
"if",
"typ",
"==",
"QtGui",
".",
"QColor",
":",
"xelem",
".",
"set",
"(",
"'type'",
",",
"'color'",
")",
"xelem",
".",
"text",
"=",
"na... | Stores the value for the inptued instance to the given xml element.
:param xelem | <xml.etree.Element>
value | <variant> | [
"Stores",
"the",
"value",
"for",
"the",
"inptued",
"instance",
"to",
"the",
"given",
"xml",
"element",
".",
":",
"param",
"xelem",
"|",
"<xml",
".",
"etree",
".",
"Element",
">",
"value",
"|",
"<variant",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xsettings.py#L260-L314 | train | Stores the value for the inptued instance to the given xml element. |
bitesofcode/projexui | projexui/xsettings.py | XmlFormat.value | def value(self, key, default=None):
"""
Returns the inputed key to the inputed value.
:param key | <str>
:return <variant>
"""
parts = nativestring(key).split('/')
curr = self._xstack[-1]
for part in parts[:-1]:
... | python | def value(self, key, default=None):
"""
Returns the inputed key to the inputed value.
:param key | <str>
:return <variant>
"""
parts = nativestring(key).split('/')
curr = self._xstack[-1]
for part in parts[:-1]:
... | [
"def",
"value",
"(",
"self",
",",
"key",
",",
"default",
"=",
"None",
")",
":",
"parts",
"=",
"nativestring",
"(",
"key",
")",
".",
"split",
"(",
"'/'",
")",
"curr",
"=",
"self",
".",
"_xstack",
"[",
"-",
"1",
"]",
"for",
"part",
"in",
"parts",
... | Returns the inputed key to the inputed value.
:param key | <str>
:return <variant> | [
"Returns",
"the",
"inputed",
"key",
"to",
"the",
"inputed",
"value",
".",
":",
"param",
"key",
"|",
"<str",
">",
":",
"return",
"<variant",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xsettings.py#L316-L336 | train | Returns the value of the inputed key. |
bitesofcode/projexui | projexui/xsettings.py | YamlFormat.beginGroup | def beginGroup(self, prefix):
"""
Starts a new group for the given prefix.
:param prefix | <str>
"""
curr = self._stack[-1]
next = curr.get(prefix, {})
curr.setdefault(prefix, next)
self._stack.append(next) | python | def beginGroup(self, prefix):
"""
Starts a new group for the given prefix.
:param prefix | <str>
"""
curr = self._stack[-1]
next = curr.get(prefix, {})
curr.setdefault(prefix, next)
self._stack.append(next) | [
"def",
"beginGroup",
"(",
"self",
",",
"prefix",
")",
":",
"curr",
"=",
"self",
".",
"_stack",
"[",
"-",
"1",
"]",
"next",
"=",
"curr",
".",
"get",
"(",
"prefix",
",",
"{",
"}",
")",
"curr",
".",
"setdefault",
"(",
"prefix",
",",
"next",
")",
"... | Starts a new group for the given prefix.
:param prefix | <str> | [
"Starts",
"a",
"new",
"group",
"for",
"the",
"given",
"prefix",
".",
":",
"param",
"prefix",
"|",
"<str",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xsettings.py#L364-L373 | train | Starts a new group for the given prefix. |
bitesofcode/projexui | projexui/xsettings.py | YamlFormat.load | def load(self, filename):
"""
Loads the settings from the inputed filename.
:param filename | <str>
:return <bool> | success
"""
if not os.path.exists(filename):
return False
data = None
with open... | python | def load(self, filename):
"""
Loads the settings from the inputed filename.
:param filename | <str>
:return <bool> | success
"""
if not os.path.exists(filename):
return False
data = None
with open... | [
"def",
"load",
"(",
"self",
",",
"filename",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"filename",
")",
":",
"return",
"False",
"data",
"=",
"None",
"with",
"open",
"(",
"filename",
",",
"'r'",
")",
"as",
"f",
":",
"data",
"="... | Loads the settings from the inputed filename.
:param filename | <str>
:return <bool> | success | [
"Loads",
"the",
"settings",
"from",
"the",
"inputed",
"filename",
".",
":",
"param",
"filename",
"|",
"<str",
">",
":",
"return",
"<bool",
">",
"|",
"success"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xsettings.py#L382-L408 | train | Loads the settings from the inputed file. |
bitesofcode/projexui | projexui/xsettings.py | YamlFormat.setValue | def setValue(self, key, value):
"""
Sets the value for this settings key to the inputed value.
:param key | <str>
value | <variant>
"""
curr = self._stack[-1]
curr[key] = value | python | def setValue(self, key, value):
"""
Sets the value for this settings key to the inputed value.
:param key | <str>
value | <variant>
"""
curr = self._stack[-1]
curr[key] = value | [
"def",
"setValue",
"(",
"self",
",",
"key",
",",
"value",
")",
":",
"curr",
"=",
"self",
".",
"_stack",
"[",
"-",
"1",
"]",
"curr",
"[",
"key",
"]",
"=",
"value"
] | Sets the value for this settings key to the inputed value.
:param key | <str>
value | <variant> | [
"Sets",
"the",
"value",
"for",
"this",
"settings",
"key",
"to",
"the",
"inputed",
"value",
".",
":",
"param",
"key",
"|",
"<str",
">",
"value",
"|",
"<variant",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xsettings.py#L424-L432 | train | Sets the value for the specified key to the inputed value. |
bitesofcode/projexui | projexui/xsettings.py | YamlFormat.save | def save(self, filename):
"""
Saves the data for this settings instance to the given filename.
:param filename | <str>
"""
dirname = os.path.dirname(filename)
if not os.path.exists(dirname):
os.makedirs(dirname)
try:
... | python | def save(self, filename):
"""
Saves the data for this settings instance to the given filename.
:param filename | <str>
"""
dirname = os.path.dirname(filename)
if not os.path.exists(dirname):
os.makedirs(dirname)
try:
... | [
"def",
"save",
"(",
"self",
",",
"filename",
")",
":",
"dirname",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"filename",
")",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"dirname",
")",
":",
"os",
".",
"makedirs",
"(",
"dirname",
")",
"... | Saves the data for this settings instance to the given filename.
:param filename | <str> | [
"Saves",
"the",
"data",
"for",
"this",
"settings",
"instance",
"to",
"the",
"given",
"filename",
".",
":",
"param",
"filename",
"|",
"<str",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xsettings.py#L434-L458 | train | Saves the settings instance to a file. |
bitesofcode/projexui | projexui/xsettings.py | YamlFormat.value | def value(self, key, default=None):
"""
Returns the value from the current settings.
:param key | <str>
default | <variant>
:return <variant>
"""
curr = self._stack[-1]
return curr.get(key, default) | python | def value(self, key, default=None):
"""
Returns the value from the current settings.
:param key | <str>
default | <variant>
:return <variant>
"""
curr = self._stack[-1]
return curr.get(key, default) | [
"def",
"value",
"(",
"self",
",",
"key",
",",
"default",
"=",
"None",
")",
":",
"curr",
"=",
"self",
".",
"_stack",
"[",
"-",
"1",
"]",
"return",
"curr",
".",
"get",
"(",
"key",
",",
"default",
")"
] | Returns the value from the current settings.
:param key | <str>
default | <variant>
:return <variant> | [
"Returns",
"the",
"value",
"from",
"the",
"current",
"settings",
".",
":",
"param",
"key",
"|",
"<str",
">",
"default",
"|",
"<variant",
">",
":",
"return",
"<variant",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xsettings.py#L460-L470 | train | Returns the value of the given key from the current settings. |
bitesofcode/projexui | projexui/xsettings.py | XSettings.allKeys | def allKeys(self):
"""
Returns a list of all the keys for this settings instance.
:return [<str>, ..]
"""
if self._customFormat:
return self._customFormat.allKeys()
else:
return super(XSettings, self).allKeys() | python | def allKeys(self):
"""
Returns a list of all the keys for this settings instance.
:return [<str>, ..]
"""
if self._customFormat:
return self._customFormat.allKeys()
else:
return super(XSettings, self).allKeys() | [
"def",
"allKeys",
"(",
"self",
")",
":",
"if",
"self",
".",
"_customFormat",
":",
"return",
"self",
".",
"_customFormat",
".",
"allKeys",
"(",
")",
"else",
":",
"return",
"super",
"(",
"XSettings",
",",
"self",
")",
".",
"allKeys",
"(",
")"
] | Returns a list of all the keys for this settings instance.
:return [<str>, ..] | [
"Returns",
"a",
"list",
"of",
"all",
"the",
"keys",
"for",
"this",
"settings",
"instance",
".",
":",
"return",
"[",
"<str",
">",
"..",
"]"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xsettings.py#L497-L506 | train | Returns a list of all the keys for this settings instance. |
bitesofcode/projexui | projexui/xsettings.py | XSettings.childKeys | def childKeys(self):
"""
Returns the list of child keys for this settings instance.
:return [<str>, ..]
"""
if self._customFormat:
return self._customFormat.childKeys()
else:
return super(XSettings, self).childKeys() | python | def childKeys(self):
"""
Returns the list of child keys for this settings instance.
:return [<str>, ..]
"""
if self._customFormat:
return self._customFormat.childKeys()
else:
return super(XSettings, self).childKeys() | [
"def",
"childKeys",
"(",
"self",
")",
":",
"if",
"self",
".",
"_customFormat",
":",
"return",
"self",
".",
"_customFormat",
".",
"childKeys",
"(",
")",
"else",
":",
"return",
"super",
"(",
"XSettings",
",",
"self",
")",
".",
"childKeys",
"(",
")"
] | Returns the list of child keys for this settings instance.
:return [<str>, ..] | [
"Returns",
"the",
"list",
"of",
"child",
"keys",
"for",
"this",
"settings",
"instance",
".",
":",
"return",
"[",
"<str",
">",
"..",
"]"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xsettings.py#L508-L517 | train | Returns the list of child keys for this settings instance. |
bitesofcode/projexui | projexui/xsettings.py | XSettings.clear | def clear(self):
"""
Clears out all the settings for this instance.
"""
if self._customFormat:
self._customFormat.clear()
else:
super(XSettings, self).clear() | python | def clear(self):
"""
Clears out all the settings for this instance.
"""
if self._customFormat:
self._customFormat.clear()
else:
super(XSettings, self).clear() | [
"def",
"clear",
"(",
"self",
")",
":",
"if",
"self",
".",
"_customFormat",
":",
"self",
".",
"_customFormat",
".",
"clear",
"(",
")",
"else",
":",
"super",
"(",
"XSettings",
",",
"self",
")",
".",
"clear",
"(",
")"
] | Clears out all the settings for this instance. | [
"Clears",
"out",
"all",
"the",
"settings",
"for",
"this",
"instance",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xsettings.py#L519-L526 | train | Clears out all the settings for this instance. |
bitesofcode/projexui | projexui/xsettings.py | XSettings.beginGroup | def beginGroup(self, prefix):
"""
Begins a new group for this settings instance for the given
settings.
:param prefix | <str>
"""
if self._customFormat:
self._customFormat.beginGroup(prefix)
else:
super(XSettings, se... | python | def beginGroup(self, prefix):
"""
Begins a new group for this settings instance for the given
settings.
:param prefix | <str>
"""
if self._customFormat:
self._customFormat.beginGroup(prefix)
else:
super(XSettings, se... | [
"def",
"beginGroup",
"(",
"self",
",",
"prefix",
")",
":",
"if",
"self",
".",
"_customFormat",
":",
"self",
".",
"_customFormat",
".",
"beginGroup",
"(",
"prefix",
")",
"else",
":",
"super",
"(",
"XSettings",
",",
"self",
")",
".",
"beginGroup",
"(",
"... | Begins a new group for this settings instance for the given
settings.
:param prefix | <str> | [
"Begins",
"a",
"new",
"group",
"for",
"this",
"settings",
"instance",
"for",
"the",
"given",
"settings",
".",
":",
"param",
"prefix",
"|",
"<str",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xsettings.py#L536-L546 | train | Begins a new group for the given prefix. |
bitesofcode/projexui | projexui/xsettings.py | XSettings.endGroup | def endGroup(self):
"""
Ends the current group of xml data.
"""
if self._customFormat:
self._customFormat.endGroup()
else:
super(XSettings, self).endGroup() | python | def endGroup(self):
"""
Ends the current group of xml data.
"""
if self._customFormat:
self._customFormat.endGroup()
else:
super(XSettings, self).endGroup() | [
"def",
"endGroup",
"(",
"self",
")",
":",
"if",
"self",
".",
"_customFormat",
":",
"self",
".",
"_customFormat",
".",
"endGroup",
"(",
")",
"else",
":",
"super",
"(",
"XSettings",
",",
"self",
")",
".",
"endGroup",
"(",
")"
] | Ends the current group of xml data. | [
"Ends",
"the",
"current",
"group",
"of",
"xml",
"data",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xsettings.py#L548-L555 | train | Ends the current group of xml data. |
bitesofcode/projexui | projexui/xsettings.py | XSettings.load | def load(self):
"""
Loads the settings from disk for this XSettings object, if it is a custom format.
"""
# load the custom format
if self._customFormat and os.path.exists(self.fileName()):
self._customFormat.load(self.fileName()) | python | def load(self):
"""
Loads the settings from disk for this XSettings object, if it is a custom format.
"""
# load the custom format
if self._customFormat and os.path.exists(self.fileName()):
self._customFormat.load(self.fileName()) | [
"def",
"load",
"(",
"self",
")",
":",
"# load the custom format\r",
"if",
"self",
".",
"_customFormat",
"and",
"os",
".",
"path",
".",
"exists",
"(",
"self",
".",
"fileName",
"(",
")",
")",
":",
"self",
".",
"_customFormat",
".",
"load",
"(",
"self",
"... | Loads the settings from disk for this XSettings object, if it is a custom format. | [
"Loads",
"the",
"settings",
"from",
"disk",
"for",
"this",
"XSettings",
"object",
"if",
"it",
"is",
"a",
"custom",
"format",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xsettings.py#L557-L563 | train | Loads the settings from disk for this object. |
bitesofcode/projexui | projexui/xsettings.py | XSettings.fileName | def fileName(self):
"""
Returns the filename.
:return <str>
"""
if self._filename:
return self._filename
filename = nativestring(super(XSettings, self).fileName())
if self._customFormat:
filename, ext = os.p... | python | def fileName(self):
"""
Returns the filename.
:return <str>
"""
if self._filename:
return self._filename
filename = nativestring(super(XSettings, self).fileName())
if self._customFormat:
filename, ext = os.p... | [
"def",
"fileName",
"(",
"self",
")",
":",
"if",
"self",
".",
"_filename",
":",
"return",
"self",
".",
"_filename",
"filename",
"=",
"nativestring",
"(",
"super",
"(",
"XSettings",
",",
"self",
")",
".",
"fileName",
"(",
")",
")",
"if",
"self",
".",
"... | Returns the filename.
:return <str> | [
"Returns",
"the",
"filename",
".",
":",
"return",
"<str",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xsettings.py#L565-L578 | train | Returns the filename of the current object. |
bitesofcode/projexui | projexui/xsettings.py | XSettings.setValue | def setValue(self, key, value):
"""
Sets the value for the given key to the inputed value.
:param key | <str>
value | <variant>
"""
if self._customFormat:
self._customFormat.setValue(key, value)
else:
sup... | python | def setValue(self, key, value):
"""
Sets the value for the given key to the inputed value.
:param key | <str>
value | <variant>
"""
if self._customFormat:
self._customFormat.setValue(key, value)
else:
sup... | [
"def",
"setValue",
"(",
"self",
",",
"key",
",",
"value",
")",
":",
"if",
"self",
".",
"_customFormat",
":",
"self",
".",
"_customFormat",
".",
"setValue",
"(",
"key",
",",
"value",
")",
"else",
":",
"super",
"(",
"XSettings",
",",
"self",
")",
".",
... | Sets the value for the given key to the inputed value.
:param key | <str>
value | <variant> | [
"Sets",
"the",
"value",
"for",
"the",
"given",
"key",
"to",
"the",
"inputed",
"value",
".",
":",
"param",
"key",
"|",
"<str",
">",
"value",
"|",
"<variant",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xsettings.py#L596-L606 | train | Sets the value for the given key to the inputed value. |
bitesofcode/projexui | projexui/xsettings.py | XSettings.sync | def sync(self):
"""
Syncs the information for this settings out to the file system.
"""
if self._customFormat:
self._customFormat.save(self.fileName())
else:
super(XSettings, self).sync() | python | def sync(self):
"""
Syncs the information for this settings out to the file system.
"""
if self._customFormat:
self._customFormat.save(self.fileName())
else:
super(XSettings, self).sync() | [
"def",
"sync",
"(",
"self",
")",
":",
"if",
"self",
".",
"_customFormat",
":",
"self",
".",
"_customFormat",
".",
"save",
"(",
"self",
".",
"fileName",
"(",
")",
")",
"else",
":",
"super",
"(",
"XSettings",
",",
"self",
")",
".",
"sync",
"(",
")"
] | Syncs the information for this settings out to the file system. | [
"Syncs",
"the",
"information",
"for",
"this",
"settings",
"out",
"to",
"the",
"file",
"system",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xsettings.py#L608-L615 | train | Syncs the information for this settings out to the file system. |
bitesofcode/projexui | projexui/xsettings.py | XSettings.value | def value(self, key, default=None):
"""
Returns the value for the given key for this settings instance.
:return <variant>
"""
if self._customFormat:
return self._customFormat.value(key, default)
else:
return unwrapVariant(supe... | python | def value(self, key, default=None):
"""
Returns the value for the given key for this settings instance.
:return <variant>
"""
if self._customFormat:
return self._customFormat.value(key, default)
else:
return unwrapVariant(supe... | [
"def",
"value",
"(",
"self",
",",
"key",
",",
"default",
"=",
"None",
")",
":",
"if",
"self",
".",
"_customFormat",
":",
"return",
"self",
".",
"_customFormat",
".",
"value",
"(",
"key",
",",
"default",
")",
"else",
":",
"return",
"unwrapVariant",
"(",... | Returns the value for the given key for this settings instance.
:return <variant> | [
"Returns",
"the",
"value",
"for",
"the",
"given",
"key",
"for",
"this",
"settings",
"instance",
".",
":",
"return",
"<variant",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xsettings.py#L617-L626 | train | Returns the value for the given key. |
bitesofcode/projexui | projexui/widgets/xorbquerywidget/xorbquerycontainer.py | XOrbQueryContainer.clear | def clear(self):
"""
Clears out the widgets for this query builder.
"""
layout = self._entryWidget.layout()
for i in range(layout.count() - 1):
widget = layout.itemAt(i).widget()
widget.close() | python | def clear(self):
"""
Clears out the widgets for this query builder.
"""
layout = self._entryWidget.layout()
for i in range(layout.count() - 1):
widget = layout.itemAt(i).widget()
widget.close() | [
"def",
"clear",
"(",
"self",
")",
":",
"layout",
"=",
"self",
".",
"_entryWidget",
".",
"layout",
"(",
")",
"for",
"i",
"in",
"range",
"(",
"layout",
".",
"count",
"(",
")",
"-",
"1",
")",
":",
"widget",
"=",
"layout",
".",
"itemAt",
"(",
"i",
... | Clears out the widgets for this query builder. | [
"Clears",
"out",
"the",
"widgets",
"for",
"this",
"query",
"builder",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbquerywidget/xorbquerycontainer.py#L83-L90 | train | Clears out the widgets for this query builder. |
bitesofcode/projexui | projexui/widgets/xorbquerywidget/xorbquerycontainer.py | XOrbQueryContainer.createCompoundFromChecked | def createCompoundFromChecked(self):
"""
Creates a new compound query from the checked entry list.
:return <orb.QueryCompound>
"""
checked_entries = self.checkedEntries()
if len(checked_entries) <= 1:
return QueryCompound()
... | python | def createCompoundFromChecked(self):
"""
Creates a new compound query from the checked entry list.
:return <orb.QueryCompound>
"""
checked_entries = self.checkedEntries()
if len(checked_entries) <= 1:
return QueryCompound()
... | [
"def",
"createCompoundFromChecked",
"(",
"self",
")",
":",
"checked_entries",
"=",
"self",
".",
"checkedEntries",
"(",
")",
"if",
"len",
"(",
"checked_entries",
")",
"<=",
"1",
":",
"return",
"QueryCompound",
"(",
")",
"self",
".",
"setUpdatesEnabled",
"(",
... | Creates a new compound query from the checked entry list.
:return <orb.QueryCompound> | [
"Creates",
"a",
"new",
"compound",
"query",
"from",
"the",
"checked",
"entry",
"list",
".",
":",
"return",
"<orb",
".",
"QueryCompound",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbquerywidget/xorbquerycontainer.py#L92-L127 | train | Creates a new compound query from the checked entries. |
bitesofcode/projexui | projexui/widgets/xorbquerywidget/xorbquerycontainer.py | XOrbQueryContainer.entries | def entries(self):
"""
Returns the entry widgets for this widget.
:return [<XOrbQueryEntryWidget>, ..]
"""
layout = self._entryWidget.layout()
output = []
for i in range(layout.count() - 1):
widget = layout.itemAt(i).widget()
... | python | def entries(self):
"""
Returns the entry widgets for this widget.
:return [<XOrbQueryEntryWidget>, ..]
"""
layout = self._entryWidget.layout()
output = []
for i in range(layout.count() - 1):
widget = layout.itemAt(i).widget()
... | [
"def",
"entries",
"(",
"self",
")",
":",
"layout",
"=",
"self",
".",
"_entryWidget",
".",
"layout",
"(",
")",
"output",
"=",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
"layout",
".",
"count",
"(",
")",
"-",
"1",
")",
":",
"widget",
"=",
"layout",
... | Returns the entry widgets for this widget.
:return [<XOrbQueryEntryWidget>, ..] | [
"Returns",
"the",
"entry",
"widgets",
"for",
"this",
"widget",
".",
":",
"return",
"[",
"<XOrbQueryEntryWidget",
">",
"..",
"]"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbquerywidget/xorbquerycontainer.py#L141-L154 | train | Returns the entries for this widget. |
bitesofcode/projexui | projexui/widgets/xorbquerywidget/xorbquerycontainer.py | XOrbQueryContainer.moveDown | def moveDown(self, entry):
"""
Moves the current query down one entry.
"""
if not entry:
return
entries = self.entries()
next = entries[entries.index(entry) + 1]
entry_q = entry.query()
next_q = next.query()
... | python | def moveDown(self, entry):
"""
Moves the current query down one entry.
"""
if not entry:
return
entries = self.entries()
next = entries[entries.index(entry) + 1]
entry_q = entry.query()
next_q = next.query()
... | [
"def",
"moveDown",
"(",
"self",
",",
"entry",
")",
":",
"if",
"not",
"entry",
":",
"return",
"entries",
"=",
"self",
".",
"entries",
"(",
")",
"next",
"=",
"entries",
"[",
"entries",
".",
"index",
"(",
"entry",
")",
"+",
"1",
"]",
"entry_q",
"=",
... | Moves the current query down one entry. | [
"Moves",
"the",
"current",
"query",
"down",
"one",
"entry",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbquerywidget/xorbquerycontainer.py#L168-L182 | train | Moves the current query down one entry. |
bitesofcode/projexui | projexui/widgets/xorbquerywidget/xorbquerycontainer.py | XOrbQueryContainer.query | def query(self):
"""
Returns the query that is defined by this current panel.
:return <orb.Query>
"""
joiner = self.currentJoiner()
query = Query()
for entry in self.entries():
if joiner == QueryCompound.Op.And:
... | python | def query(self):
"""
Returns the query that is defined by this current panel.
:return <orb.Query>
"""
joiner = self.currentJoiner()
query = Query()
for entry in self.entries():
if joiner == QueryCompound.Op.And:
... | [
"def",
"query",
"(",
"self",
")",
":",
"joiner",
"=",
"self",
".",
"currentJoiner",
"(",
")",
"query",
"=",
"Query",
"(",
")",
"for",
"entry",
"in",
"self",
".",
"entries",
"(",
")",
":",
"if",
"joiner",
"==",
"QueryCompound",
".",
"Op",
".",
"And"... | Returns the query that is defined by this current panel.
:return <orb.Query> | [
"Returns",
"the",
"query",
"that",
"is",
"defined",
"by",
"this",
"current",
"panel",
".",
":",
"return",
"<orb",
".",
"Query",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbquerywidget/xorbquerycontainer.py#L210-L226 | train | Returns the query that is defined by this current panel. |
bitesofcode/projexui | projexui/widgets/xorbquerywidget/xorbquerycontainer.py | XOrbQueryContainer.setQuery | def setQuery(self, query):
"""
Sets the query for this wigdet to the inputed query instance.
:param query | <orb.Query> || <orb.QueryCompound>
"""
if not self.isNull() and hash(query) == hash(self.query()):
return
# add entries
... | python | def setQuery(self, query):
"""
Sets the query for this wigdet to the inputed query instance.
:param query | <orb.Query> || <orb.QueryCompound>
"""
if not self.isNull() and hash(query) == hash(self.query()):
return
# add entries
... | [
"def",
"setQuery",
"(",
"self",
",",
"query",
")",
":",
"if",
"not",
"self",
".",
"isNull",
"(",
")",
"and",
"hash",
"(",
"query",
")",
"==",
"hash",
"(",
"self",
".",
"query",
"(",
")",
")",
":",
"return",
"# add entries\r",
"table",
"=",
"self",
... | Sets the query for this wigdet to the inputed query instance.
:param query | <orb.Query> || <orb.QueryCompound> | [
"Sets",
"the",
"query",
"for",
"this",
"wigdet",
"to",
"the",
"inputed",
"query",
"instance",
".",
":",
"param",
"query",
"|",
"<orb",
".",
"Query",
">",
"||",
"<orb",
".",
"QueryCompound",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbquerywidget/xorbquerycontainer.py#L265-L306 | train | Sets the query for this item to the inputed query instance. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttwidget.py | XGanttWidget._scrollTree | def _scrollTree( self, value ):
"""
Updates the tree view scrolling to the inputed value.
:param value | <int>
"""
if self._scrolling:
return
tree_bar = self.uiGanttTREE.verticalScrollBar()
self._scrolling = True
... | python | def _scrollTree( self, value ):
"""
Updates the tree view scrolling to the inputed value.
:param value | <int>
"""
if self._scrolling:
return
tree_bar = self.uiGanttTREE.verticalScrollBar()
self._scrolling = True
... | [
"def",
"_scrollTree",
"(",
"self",
",",
"value",
")",
":",
"if",
"self",
".",
"_scrolling",
":",
"return",
"tree_bar",
"=",
"self",
".",
"uiGanttTREE",
".",
"verticalScrollBar",
"(",
")",
"self",
".",
"_scrolling",
"=",
"True",
"tree_bar",
".",
"setValue",... | Updates the tree view scrolling to the inputed value.
:param value | <int> | [
"Updates",
"the",
"tree",
"view",
"scrolling",
"to",
"the",
"inputed",
"value",
".",
":",
"param",
"value",
"|",
"<int",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidget.py#L130-L142 | train | Updates the tree view scrolling to the inputed value. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttwidget.py | XGanttWidget._scrollView | def _scrollView( self, value ):
"""
Updates the gantt view scrolling to the inputed value.
:param value | <int>
"""
if self._scrolling:
return
view_bar = self.uiGanttVIEW.verticalScrollBar()
self._scrolling = True
... | python | def _scrollView( self, value ):
"""
Updates the gantt view scrolling to the inputed value.
:param value | <int>
"""
if self._scrolling:
return
view_bar = self.uiGanttVIEW.verticalScrollBar()
self._scrolling = True
... | [
"def",
"_scrollView",
"(",
"self",
",",
"value",
")",
":",
"if",
"self",
".",
"_scrolling",
":",
"return",
"view_bar",
"=",
"self",
".",
"uiGanttVIEW",
".",
"verticalScrollBar",
"(",
")",
"self",
".",
"_scrolling",
"=",
"True",
"view_bar",
".",
"setValue",... | Updates the gantt view scrolling to the inputed value.
:param value | <int> | [
"Updates",
"the",
"gantt",
"view",
"scrolling",
"to",
"the",
"inputed",
"value",
".",
":",
"param",
"value",
"|",
"<int",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidget.py#L144-L156 | train | Updates the gantt view scrolling to the inputed value. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttwidget.py | XGanttWidget._selectTree | def _selectTree( self ):
"""
Matches the tree selection to the views selection.
"""
self.uiGanttTREE.blockSignals(True)
self.uiGanttTREE.clearSelection()
for item in self.uiGanttVIEW.scene().selectedItems():
item.treeItem().setSelected(True)
se... | python | def _selectTree( self ):
"""
Matches the tree selection to the views selection.
"""
self.uiGanttTREE.blockSignals(True)
self.uiGanttTREE.clearSelection()
for item in self.uiGanttVIEW.scene().selectedItems():
item.treeItem().setSelected(True)
se... | [
"def",
"_selectTree",
"(",
"self",
")",
":",
"self",
".",
"uiGanttTREE",
".",
"blockSignals",
"(",
"True",
")",
"self",
".",
"uiGanttTREE",
".",
"clearSelection",
"(",
")",
"for",
"item",
"in",
"self",
".",
"uiGanttVIEW",
".",
"scene",
"(",
")",
".",
"... | Matches the tree selection to the views selection. | [
"Matches",
"the",
"tree",
"selection",
"to",
"the",
"views",
"selection",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidget.py#L158-L166 | train | Select the tree items in the view. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttwidget.py | XGanttWidget._selectView | def _selectView( self ):
"""
Matches the view selection to the trees selection.
"""
scene = self.uiGanttVIEW.scene()
scene.blockSignals(True)
scene.clearSelection()
for item in self.uiGanttTREE.selectedItems():
item.viewItem().setSelected(True)... | python | def _selectView( self ):
"""
Matches the view selection to the trees selection.
"""
scene = self.uiGanttVIEW.scene()
scene.blockSignals(True)
scene.clearSelection()
for item in self.uiGanttTREE.selectedItems():
item.viewItem().setSelected(True)... | [
"def",
"_selectView",
"(",
"self",
")",
":",
"scene",
"=",
"self",
".",
"uiGanttVIEW",
".",
"scene",
"(",
")",
"scene",
".",
"blockSignals",
"(",
"True",
")",
"scene",
".",
"clearSelection",
"(",
")",
"for",
"item",
"in",
"self",
".",
"uiGanttTREE",
".... | Matches the view selection to the trees selection. | [
"Matches",
"the",
"view",
"selection",
"to",
"the",
"trees",
"selection",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidget.py#L168-L183 | train | Select the view from the tree. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttwidget.py | XGanttWidget._updateViewRect | def _updateViewRect( self ):
"""
Updates the view rect to match the current tree value.
"""
if not self.updatesEnabled():
return
header_h = self._cellHeight * 2
rect = self.uiGanttVIEW.scene().sceneRect()
sbar_max = self.... | python | def _updateViewRect( self ):
"""
Updates the view rect to match the current tree value.
"""
if not self.updatesEnabled():
return
header_h = self._cellHeight * 2
rect = self.uiGanttVIEW.scene().sceneRect()
sbar_max = self.... | [
"def",
"_updateViewRect",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"updatesEnabled",
"(",
")",
":",
"return",
"header_h",
"=",
"self",
".",
"_cellHeight",
"*",
"2",
"rect",
"=",
"self",
".",
"uiGanttVIEW",
".",
"scene",
"(",
")",
".",
"sceneRec... | Updates the view rect to match the current tree value. | [
"Updates",
"the",
"view",
"rect",
"to",
"match",
"the",
"current",
"tree",
"value",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidget.py#L185-L200 | train | Updates the view rect to match the current tree value. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttwidget.py | XGanttWidget.addTopLevelItem | def addTopLevelItem(self, item):
"""
Adds the inputed item to the gantt widget.
:param item | <XGanttWidgetItem>
"""
vitem = item.viewItem()
self.treeWidget().addTopLevelItem(item)
self.viewWidget().scene().addItem(vitem)
... | python | def addTopLevelItem(self, item):
"""
Adds the inputed item to the gantt widget.
:param item | <XGanttWidgetItem>
"""
vitem = item.viewItem()
self.treeWidget().addTopLevelItem(item)
self.viewWidget().scene().addItem(vitem)
... | [
"def",
"addTopLevelItem",
"(",
"self",
",",
"item",
")",
":",
"vitem",
"=",
"item",
".",
"viewItem",
"(",
")",
"self",
".",
"treeWidget",
"(",
")",
".",
"addTopLevelItem",
"(",
"item",
")",
"self",
".",
"viewWidget",
"(",
")",
".",
"scene",
"(",
")",... | Adds the inputed item to the gantt widget.
:param item | <XGanttWidgetItem> | [
"Adds",
"the",
"inputed",
"item",
"to",
"the",
"gantt",
"widget",
".",
":",
"param",
"item",
"|",
"<XGanttWidgetItem",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidget.py#L202-L219 | train | Adds the inputed item to the gantt widget. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttwidget.py | XGanttWidget.blockSignals | def blockSignals(self, state):
"""
Sets whether or not updates will be enabled.
:param state | <bool>
"""
super(XGanttWidget, self).blockSignals(state)
self.treeWidget().blockSignals(state)
self.viewWidget().blockSignals(state) | python | def blockSignals(self, state):
"""
Sets whether or not updates will be enabled.
:param state | <bool>
"""
super(XGanttWidget, self).blockSignals(state)
self.treeWidget().blockSignals(state)
self.viewWidget().blockSignals(state) | [
"def",
"blockSignals",
"(",
"self",
",",
"state",
")",
":",
"super",
"(",
"XGanttWidget",
",",
"self",
")",
".",
"blockSignals",
"(",
"state",
")",
"self",
".",
"treeWidget",
"(",
")",
".",
"blockSignals",
"(",
"state",
")",
"self",
".",
"viewWidget",
... | Sets whether or not updates will be enabled.
:param state | <bool> | [
"Sets",
"whether",
"or",
"not",
"updates",
"will",
"be",
"enabled",
".",
":",
"param",
"state",
"|",
"<bool",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidget.py#L237-L245 | train | Sets whether or not updates will be enabled. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttwidget.py | XGanttWidget.centerOnDateTime | def centerOnDateTime(self, dtime):
"""
Centers the view on a given datetime for the gantt widget.
:param dtime | <QDateTime>
"""
view = self.uiGanttVIEW
scene = view.scene()
point = view.mapToScene(0, 0)
x = scene.datetimeXPos(dtime)... | python | def centerOnDateTime(self, dtime):
"""
Centers the view on a given datetime for the gantt widget.
:param dtime | <QDateTime>
"""
view = self.uiGanttVIEW
scene = view.scene()
point = view.mapToScene(0, 0)
x = scene.datetimeXPos(dtime)... | [
"def",
"centerOnDateTime",
"(",
"self",
",",
"dtime",
")",
":",
"view",
"=",
"self",
".",
"uiGanttVIEW",
"scene",
"=",
"view",
".",
"scene",
"(",
")",
"point",
"=",
"view",
".",
"mapToScene",
"(",
"0",
",",
"0",
")",
"x",
"=",
"scene",
".",
"dateti... | Centers the view on a given datetime for the gantt widget.
:param dtime | <QDateTime> | [
"Centers",
"the",
"view",
"on",
"a",
"given",
"datetime",
"for",
"the",
"gantt",
"widget",
".",
":",
"param",
"dtime",
"|",
"<QDateTime",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidget.py#L255-L266 | train | Centers the view on a given datetime for the gantt widget. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttwidget.py | XGanttWidget.currentDateTime | def currentDateTime(self):
"""
Returns the current date time for this widget.
:return <datetime.datetime>
"""
view = self.uiGanttVIEW
scene = view.scene()
point = view.mapToScene(0, 0)
return scene.datetimeAt(point.x()) | python | def currentDateTime(self):
"""
Returns the current date time for this widget.
:return <datetime.datetime>
"""
view = self.uiGanttVIEW
scene = view.scene()
point = view.mapToScene(0, 0)
return scene.datetimeAt(point.x()) | [
"def",
"currentDateTime",
"(",
"self",
")",
":",
"view",
"=",
"self",
".",
"uiGanttVIEW",
"scene",
"=",
"view",
".",
"scene",
"(",
")",
"point",
"=",
"view",
".",
"mapToScene",
"(",
"0",
",",
"0",
")",
"return",
"scene",
".",
"datetimeAt",
"(",
"poin... | Returns the current date time for this widget.
:return <datetime.datetime> | [
"Returns",
"the",
"current",
"date",
"time",
"for",
"this",
"widget",
".",
":",
"return",
"<datetime",
".",
"datetime",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidget.py#L300-L309 | train | Returns the current date time for this widget. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttwidget.py | XGanttWidget.insertTopLevelItem | def insertTopLevelItem( self, index, item ):
"""
Inserts the inputed item at the given index in the tree.
:param index | <int>
item | <XGanttWidgetItem>
"""
self.treeWidget().insertTopLevelItem(index, item)
if self.... | python | def insertTopLevelItem( self, index, item ):
"""
Inserts the inputed item at the given index in the tree.
:param index | <int>
item | <XGanttWidgetItem>
"""
self.treeWidget().insertTopLevelItem(index, item)
if self.... | [
"def",
"insertTopLevelItem",
"(",
"self",
",",
"index",
",",
"item",
")",
":",
"self",
".",
"treeWidget",
"(",
")",
".",
"insertTopLevelItem",
"(",
"index",
",",
"item",
")",
"if",
"self",
".",
"updatesEnabled",
"(",
")",
":",
"try",
":",
"item",
".",
... | Inserts the inputed item at the given index in the tree.
:param index | <int>
item | <XGanttWidgetItem> | [
"Inserts",
"the",
"inputed",
"item",
"at",
"the",
"given",
"index",
"in",
"the",
"tree",
".",
":",
"param",
"index",
"|",
"<int",
">",
"item",
"|",
"<XGanttWidgetItem",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidget.py#L376-L389 | train | Adds the given item at the given index in the tree. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttwidget.py | XGanttWidget.requestTreeMenu | def requestTreeMenu(self, point):
"""
Emits the itemMenuRequested and treeMenuRequested signals
for the given item.
:param point | <QPoint>
"""
item = self.uiGanttTREE.itemAt(point)
if item:
glbl_pos = self.uiGanttTREE.viewport()... | python | def requestTreeMenu(self, point):
"""
Emits the itemMenuRequested and treeMenuRequested signals
for the given item.
:param point | <QPoint>
"""
item = self.uiGanttTREE.itemAt(point)
if item:
glbl_pos = self.uiGanttTREE.viewport()... | [
"def",
"requestTreeMenu",
"(",
"self",
",",
"point",
")",
":",
"item",
"=",
"self",
".",
"uiGanttTREE",
".",
"itemAt",
"(",
"point",
")",
"if",
"item",
":",
"glbl_pos",
"=",
"self",
".",
"uiGanttTREE",
".",
"viewport",
"(",
")",
".",
"mapToGlobal",
"("... | Emits the itemMenuRequested and treeMenuRequested signals
for the given item.
:param point | <QPoint> | [
"Emits",
"the",
"itemMenuRequested",
"and",
"treeMenuRequested",
"signals",
"for",
"the",
"given",
"item",
".",
":",
"param",
"point",
"|",
"<QPoint",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidget.py#L394-L405 | train | Emits the itemMenuRequested and treeMenuRequested signals for the given item. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttwidget.py | XGanttWidget.requestViewMenu | def requestViewMenu(self, point):
"""
Emits the itemMenuRequested and viewMenuRequested signals
for the given item.
:param point | <QPoint>
"""
vitem = self.uiGanttVIEW.itemAt(point)
if vitem:
glbl_pos = self.uiGanttVIEW.mapToGlo... | python | def requestViewMenu(self, point):
"""
Emits the itemMenuRequested and viewMenuRequested signals
for the given item.
:param point | <QPoint>
"""
vitem = self.uiGanttVIEW.itemAt(point)
if vitem:
glbl_pos = self.uiGanttVIEW.mapToGlo... | [
"def",
"requestViewMenu",
"(",
"self",
",",
"point",
")",
":",
"vitem",
"=",
"self",
".",
"uiGanttVIEW",
".",
"itemAt",
"(",
"point",
")",
"if",
"vitem",
":",
"glbl_pos",
"=",
"self",
".",
"uiGanttVIEW",
".",
"mapToGlobal",
"(",
"point",
")",
"item",
"... | Emits the itemMenuRequested and viewMenuRequested signals
for the given item.
:param point | <QPoint> | [
"Emits",
"the",
"itemMenuRequested",
"and",
"viewMenuRequested",
"signals",
"for",
"the",
"given",
"item",
".",
":",
"param",
"point",
"|",
"<QPoint",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidget.py#L407-L419 | train | Emits the itemMenuRequested and viewMenuRequested signals the given itemMenuRequested and viewMenuRequested signals the given itemMenuRequested and viewMenuRequested signals the given itemMenuRequested and viewMenuRequested signals the given point. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.