partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
test | bitmap_type | Get the type of an image from the file's extension ( .jpg, etc. ) | gui/graphic.py | def bitmap_type(filename):
"""
Get the type of an image from the file's extension ( .jpg, etc. )
"""
if filename == '':
return None
name, ext = os.path.splitext(filename)
ext = ext[1:].upper()
if ext == 'BMP':
return wx.BITMAP_TYPE_BMP
elif ext == 'GIF':
... | def bitmap_type(filename):
"""
Get the type of an image from the file's extension ( .jpg, etc. )
"""
if filename == '':
return None
name, ext = os.path.splitext(filename)
ext = ext[1:].upper()
if ext == 'BMP':
return wx.BITMAP_TYPE_BMP
elif ext == 'GIF':
... | [
"Get",
"the",
"type",
"of",
"an",
"image",
"from",
"the",
"file",
"s",
"extension",
"(",
".",
"jpg",
"etc",
".",
")"
] | reingart/gui2py | python | https://github.com/reingart/gui2py/blob/aca0a05f6fcde55c94ad7cc058671a06608b01a4/gui/graphic.py#L52-L86 | [
"def",
"bitmap_type",
"(",
"filename",
")",
":",
"if",
"filename",
"==",
"''",
":",
"return",
"None",
"name",
",",
"ext",
"=",
"os",
".",
"path",
".",
"splitext",
"(",
"filename",
")",
"ext",
"=",
"ext",
"[",
"1",
":",
"]",
".",
"upper",
"(",
")"... | aca0a05f6fcde55c94ad7cc058671a06608b01a4 |
test | Bitmap._getbitmap_type | Get the type of an image from the file's extension ( .jpg, etc. ) | gui/graphic.py | def _getbitmap_type( self, filename ) :
"""
Get the type of an image from the file's extension ( .jpg, etc. )
"""
# KEA 2001-07-27
# was
#name, ext = filename.split( '.' )
#ext = ext.upper()
if filename is None or filename == '':
retur... | def _getbitmap_type( self, filename ) :
"""
Get the type of an image from the file's extension ( .jpg, etc. )
"""
# KEA 2001-07-27
# was
#name, ext = filename.split( '.' )
#ext = ext.upper()
if filename is None or filename == '':
retur... | [
"Get",
"the",
"type",
"of",
"an",
"image",
"from",
"the",
"file",
"s",
"extension",
"(",
".",
"jpg",
"etc",
".",
")"
] | reingart/gui2py | python | https://github.com/reingart/gui2py/blob/aca0a05f6fcde55c94ad7cc058671a06608b01a4/gui/graphic.py#L153-L190 | [
"def",
"_getbitmap_type",
"(",
"self",
",",
"filename",
")",
":",
"# KEA 2001-07-27\r",
"# was\r",
"#name, ext = filename.split( '.' )\r",
"#ext = ext.upper()\r",
"if",
"filename",
"is",
"None",
"or",
"filename",
"==",
"''",
":",
"return",
"None",
"name",
",",
"ext"... | aca0a05f6fcde55c94ad7cc058671a06608b01a4 |
test | Window._set_icon | Set icon based on resource values | gui/windows/window.py | def _set_icon(self, icon=None):
"""Set icon based on resource values"""
if icon is not None:
try:
wx_icon = wx.Icon(icon, wx.BITMAP_TYPE_ICO)
self.wx_obj.SetIcon(wx_icon)
except:
pass | def _set_icon(self, icon=None):
"""Set icon based on resource values"""
if icon is not None:
try:
wx_icon = wx.Icon(icon, wx.BITMAP_TYPE_ICO)
self.wx_obj.SetIcon(wx_icon)
except:
pass | [
"Set",
"icon",
"based",
"on",
"resource",
"values"
] | reingart/gui2py | python | https://github.com/reingart/gui2py/blob/aca0a05f6fcde55c94ad7cc058671a06608b01a4/gui/windows/window.py#L78-L85 | [
"def",
"_set_icon",
"(",
"self",
",",
"icon",
"=",
"None",
")",
":",
"if",
"icon",
"is",
"not",
"None",
":",
"try",
":",
"wx_icon",
"=",
"wx",
".",
"Icon",
"(",
"icon",
",",
"wx",
".",
"BITMAP_TYPE_ICO",
")",
"self",
".",
"wx_obj",
".",
"SetIcon",
... | aca0a05f6fcde55c94ad7cc058671a06608b01a4 |
test | Window.show | Display or hide the window, optionally disabling all other windows | gui/windows/window.py | def show(self, value=True, modal=None):
"Display or hide the window, optionally disabling all other windows"
self.wx_obj.Show(value)
if modal:
# disable all top level windows of this application (MakeModal)
disabler = wx.WindowDisabler(self.wx_obj)
# cre... | def show(self, value=True, modal=None):
"Display or hide the window, optionally disabling all other windows"
self.wx_obj.Show(value)
if modal:
# disable all top level windows of this application (MakeModal)
disabler = wx.WindowDisabler(self.wx_obj)
# cre... | [
"Display",
"or",
"hide",
"the",
"window",
"optionally",
"disabling",
"all",
"other",
"windows"
] | reingart/gui2py | python | https://github.com/reingart/gui2py/blob/aca0a05f6fcde55c94ad7cc058671a06608b01a4/gui/windows/window.py#L124-L139 | [
"def",
"show",
"(",
"self",
",",
"value",
"=",
"True",
",",
"modal",
"=",
"None",
")",
":",
"self",
".",
"wx_obj",
".",
"Show",
"(",
"value",
")",
"if",
"modal",
":",
"# disable all top level windows of this application (MakeModal)\r",
"disabler",
"=",
"wx",
... | aca0a05f6fcde55c94ad7cc058671a06608b01a4 |
test | Canvas.draw_arc | Draws an arc of a circle, centered on (xc, yc), with starting
point (x1, y1) and ending at (x2, y2). The current pen is used
for the outline and the current brush for filling the shape.
The arc is drawn in an anticlockwise direction from the start
point to the end point. | gui/controls/canvas.py | def draw_arc(self, x1y1, x2y2, xcyc):
"""
Draws an arc of a circle, centered on (xc, yc), with starting
point (x1, y1) and ending at (x2, y2). The current pen is used
for the outline and the current brush for filling the shape.
The arc is drawn in an anticlockwise direction from... | def draw_arc(self, x1y1, x2y2, xcyc):
"""
Draws an arc of a circle, centered on (xc, yc), with starting
point (x1, y1) and ending at (x2, y2). The current pen is used
for the outline and the current brush for filling the shape.
The arc is drawn in an anticlockwise direction from... | [
"Draws",
"an",
"arc",
"of",
"a",
"circle",
"centered",
"on",
"(",
"xc",
"yc",
")",
"with",
"starting",
"point",
"(",
"x1",
"y1",
")",
"and",
"ending",
"at",
"(",
"x2",
"y2",
")",
".",
"The",
"current",
"pen",
"is",
"used",
"for",
"the",
"outline",
... | reingart/gui2py | python | https://github.com/reingart/gui2py/blob/aca0a05f6fcde55c94ad7cc058671a06608b01a4/gui/controls/canvas.py#L225-L238 | [
"def",
"draw_arc",
"(",
"self",
",",
"x1y1",
",",
"x2y2",
",",
"xcyc",
")",
":",
"self",
".",
"_buf_image",
".",
"DrawArcPoint",
"(",
"x1y1",
",",
"x2y2",
",",
"xcyc",
")",
"if",
"self",
".",
"auto_refresh",
":",
"dc",
"=",
"wx",
".",
"ClientDC",
"... | aca0a05f6fcde55c94ad7cc058671a06608b01a4 |
test | TabPanel.resize | automatically adjust relative pos and size of children controls | gui/controls/notebook.py | def resize(self, evt=None):
"automatically adjust relative pos and size of children controls"
for child in self:
if isinstance(child, Control):
child.resize(evt)
# call original handler (wx.HtmlWindow)
if evt:
evt.Skip() | def resize(self, evt=None):
"automatically adjust relative pos and size of children controls"
for child in self:
if isinstance(child, Control):
child.resize(evt)
# call original handler (wx.HtmlWindow)
if evt:
evt.Skip() | [
"automatically",
"adjust",
"relative",
"pos",
"and",
"size",
"of",
"children",
"controls"
] | reingart/gui2py | python | https://github.com/reingart/gui2py/blob/aca0a05f6fcde55c94ad7cc058671a06608b01a4/gui/controls/notebook.py#L104-L111 | [
"def",
"resize",
"(",
"self",
",",
"evt",
"=",
"None",
")",
":",
"for",
"child",
"in",
"self",
":",
"if",
"isinstance",
"(",
"child",
",",
"Control",
")",
":",
"child",
".",
"resize",
"(",
"evt",
")",
"# call original handler (wx.HtmlWindow)\r",
"if",
"e... | aca0a05f6fcde55c94ad7cc058671a06608b01a4 |
test | parse | Open, read and eval the resource from the source file | gui/resource.py | def parse(filename=""):
"Open, read and eval the resource from the source file"
# use the provided resource file:
s = open(filename).read()
##s.decode("latin1").encode("utf8")
import datetime, decimal
rsrc = eval(s)
return rsrc | def parse(filename=""):
"Open, read and eval the resource from the source file"
# use the provided resource file:
s = open(filename).read()
##s.decode("latin1").encode("utf8")
import datetime, decimal
rsrc = eval(s)
return rsrc | [
"Open",
"read",
"and",
"eval",
"the",
"resource",
"from",
"the",
"source",
"file"
] | reingart/gui2py | python | https://github.com/reingart/gui2py/blob/aca0a05f6fcde55c94ad7cc058671a06608b01a4/gui/resource.py#L24-L31 | [
"def",
"parse",
"(",
"filename",
"=",
"\"\"",
")",
":",
"# use the provided resource file:",
"s",
"=",
"open",
"(",
"filename",
")",
".",
"read",
"(",
")",
"##s.decode(\"latin1\").encode(\"utf8\")",
"import",
"datetime",
",",
"decimal",
"rsrc",
"=",
"eval",
"(",... | aca0a05f6fcde55c94ad7cc058671a06608b01a4 |
test | save | Save the resource to the source file | gui/resource.py | def save(filename, rsrc):
"Save the resource to the source file"
s = pprint.pformat(rsrc)
## s = s.encode("utf8")
open(filename, "w").write(s) | def save(filename, rsrc):
"Save the resource to the source file"
s = pprint.pformat(rsrc)
## s = s.encode("utf8")
open(filename, "w").write(s) | [
"Save",
"the",
"resource",
"to",
"the",
"source",
"file"
] | reingart/gui2py | python | https://github.com/reingart/gui2py/blob/aca0a05f6fcde55c94ad7cc058671a06608b01a4/gui/resource.py#L34-L38 | [
"def",
"save",
"(",
"filename",
",",
"rsrc",
")",
":",
"s",
"=",
"pprint",
".",
"pformat",
"(",
"rsrc",
")",
"## s = s.encode(\"utf8\")",
"open",
"(",
"filename",
",",
"\"w\"",
")",
".",
"write",
"(",
"s",
")"
] | aca0a05f6fcde55c94ad7cc058671a06608b01a4 |
test | load | Create the GUI objects defined in the resource (filename or python struct) | gui/resource.py | def load(controller=None, filename="", name=None, rsrc=None):
"Create the GUI objects defined in the resource (filename or python struct)"
# if no filename is given, search for the rsrc.py with the same module name:
if not filename and not rsrc:
if isinstance(controller, types.ClassType):
... | def load(controller=None, filename="", name=None, rsrc=None):
"Create the GUI objects defined in the resource (filename or python struct)"
# if no filename is given, search for the rsrc.py with the same module name:
if not filename and not rsrc:
if isinstance(controller, types.ClassType):
... | [
"Create",
"the",
"GUI",
"objects",
"defined",
"in",
"the",
"resource",
"(",
"filename",
"or",
"python",
"struct",
")"
] | reingart/gui2py | python | https://github.com/reingart/gui2py/blob/aca0a05f6fcde55c94ad7cc058671a06608b01a4/gui/resource.py#L41-L89 | [
"def",
"load",
"(",
"controller",
"=",
"None",
",",
"filename",
"=",
"\"\"",
",",
"name",
"=",
"None",
",",
"rsrc",
"=",
"None",
")",
":",
"# if no filename is given, search for the rsrc.py with the same module name:",
"if",
"not",
"filename",
"and",
"not",
"rsrc"... | aca0a05f6fcde55c94ad7cc058671a06608b01a4 |
test | build_window | Create a gui2py window based on the python resource | gui/resource.py | def build_window(res):
"Create a gui2py window based on the python resource"
# windows specs (parameters)
kwargs = dict(res.items())
wintype = kwargs.pop('type')
menubar = kwargs.pop('menubar', None)
components = kwargs.pop('components')
panel = kwargs.pop('panel', {})
from gui... | def build_window(res):
"Create a gui2py window based on the python resource"
# windows specs (parameters)
kwargs = dict(res.items())
wintype = kwargs.pop('type')
menubar = kwargs.pop('menubar', None)
components = kwargs.pop('components')
panel = kwargs.pop('panel', {})
from gui... | [
"Create",
"a",
"gui2py",
"window",
"based",
"on",
"the",
"python",
"resource"
] | reingart/gui2py | python | https://github.com/reingart/gui2py/blob/aca0a05f6fcde55c94ad7cc058671a06608b01a4/gui/resource.py#L92-L123 | [
"def",
"build_window",
"(",
"res",
")",
":",
"# windows specs (parameters)",
"kwargs",
"=",
"dict",
"(",
"res",
".",
"items",
"(",
")",
")",
"wintype",
"=",
"kwargs",
".",
"pop",
"(",
"'type'",
")",
"menubar",
"=",
"kwargs",
".",
"pop",
"(",
"'menubar'",... | aca0a05f6fcde55c94ad7cc058671a06608b01a4 |
test | build_component | Create a gui2py control based on the python resource | gui/resource.py | def build_component(res, parent=None):
"Create a gui2py control based on the python resource"
# control specs (parameters)
kwargs = dict(res.items())
comtype = kwargs.pop('type')
if 'components' in res:
components = kwargs.pop('components')
elif comtype == 'Menu' and 'items' in res:
... | def build_component(res, parent=None):
"Create a gui2py control based on the python resource"
# control specs (parameters)
kwargs = dict(res.items())
comtype = kwargs.pop('type')
if 'components' in res:
components = kwargs.pop('components')
elif comtype == 'Menu' and 'items' in res:
... | [
"Create",
"a",
"gui2py",
"control",
"based",
"on",
"the",
"python",
"resource"
] | reingart/gui2py | python | https://github.com/reingart/gui2py/blob/aca0a05f6fcde55c94ad7cc058671a06608b01a4/gui/resource.py#L126-L155 | [
"def",
"build_component",
"(",
"res",
",",
"parent",
"=",
"None",
")",
":",
"# control specs (parameters)",
"kwargs",
"=",
"dict",
"(",
"res",
".",
"items",
"(",
")",
")",
"comtype",
"=",
"kwargs",
".",
"pop",
"(",
"'type'",
")",
"if",
"'components'",
"i... | aca0a05f6fcde55c94ad7cc058671a06608b01a4 |
test | dump | Recursive convert a live GUI object to a resource list/dict | gui/resource.py | def dump(obj):
"Recursive convert a live GUI object to a resource list/dict"
from .spec import InitSpec, DimensionSpec, StyleSpec, InternalSpec
import decimal, datetime
from .font import Font
from .graphic import Bitmap, Color
from . import registry
ret = {'type': obj.__class__.__name_... | def dump(obj):
"Recursive convert a live GUI object to a resource list/dict"
from .spec import InitSpec, DimensionSpec, StyleSpec, InternalSpec
import decimal, datetime
from .font import Font
from .graphic import Bitmap, Color
from . import registry
ret = {'type': obj.__class__.__name_... | [
"Recursive",
"convert",
"a",
"live",
"GUI",
"object",
"to",
"a",
"resource",
"list",
"/",
"dict"
] | reingart/gui2py | python | https://github.com/reingart/gui2py/blob/aca0a05f6fcde55c94ad7cc058671a06608b01a4/gui/resource.py#L158-L196 | [
"def",
"dump",
"(",
"obj",
")",
":",
"from",
".",
"spec",
"import",
"InitSpec",
",",
"DimensionSpec",
",",
"StyleSpec",
",",
"InternalSpec",
"import",
"decimal",
",",
"datetime",
"from",
".",
"font",
"import",
"Font",
"from",
".",
"graphic",
"import",
"Bit... | aca0a05f6fcde55c94ad7cc058671a06608b01a4 |
test | connect | Associate event handlers | gui/resource.py | def connect(component, controller=None):
"Associate event handlers "
# get the controller functions and names (module or class)
if not controller or isinstance(controller, dict):
if not controller:
controller = util.get_caller_module_dict()
controller_name = controller['__na... | def connect(component, controller=None):
"Associate event handlers "
# get the controller functions and names (module or class)
if not controller or isinstance(controller, dict):
if not controller:
controller = util.get_caller_module_dict()
controller_name = controller['__na... | [
"Associate",
"event",
"handlers"
] | reingart/gui2py | python | https://github.com/reingart/gui2py/blob/aca0a05f6fcde55c94ad7cc058671a06608b01a4/gui/resource.py#L199-L243 | [
"def",
"connect",
"(",
"component",
",",
"controller",
"=",
"None",
")",
":",
"# get the controller functions and names (module or class)",
"if",
"not",
"controller",
"or",
"isinstance",
"(",
"controller",
",",
"dict",
")",
":",
"if",
"not",
"controller",
":",
"co... | aca0a05f6fcde55c94ad7cc058671a06608b01a4 |
test | PythonCardWrapper.convert | translate gui2py attribute name from pythoncard legacy code | gui/resource.py | def convert(self, name):
"translate gui2py attribute name from pythoncard legacy code"
new_name = PYTHONCARD_PROPERTY_MAP.get(name)
if new_name:
print "WARNING: property %s should be %s (%s)" % (name, new_name, self.obj.name)
return new_name
else:
retu... | def convert(self, name):
"translate gui2py attribute name from pythoncard legacy code"
new_name = PYTHONCARD_PROPERTY_MAP.get(name)
if new_name:
print "WARNING: property %s should be %s (%s)" % (name, new_name, self.obj.name)
return new_name
else:
retu... | [
"translate",
"gui2py",
"attribute",
"name",
"from",
"pythoncard",
"legacy",
"code"
] | reingart/gui2py | python | https://github.com/reingart/gui2py/blob/aca0a05f6fcde55c94ad7cc058671a06608b01a4/gui/resource.py#L252-L259 | [
"def",
"convert",
"(",
"self",
",",
"name",
")",
":",
"new_name",
"=",
"PYTHONCARD_PROPERTY_MAP",
".",
"get",
"(",
"name",
")",
"if",
"new_name",
":",
"print",
"\"WARNING: property %s should be %s (%s)\"",
"%",
"(",
"name",
",",
"new_name",
",",
"self",
".",
... | aca0a05f6fcde55c94ad7cc058671a06608b01a4 |
test | get_data | Read from the clipboard content, return a suitable object (string or bitmap) | gui/clipboard.py | def get_data():
"Read from the clipboard content, return a suitable object (string or bitmap)"
data = None
try:
if wx.TheClipboard.Open():
if wx.TheClipboard.IsSupported(wx.DataFormat(wx.DF_TEXT)):
do = wx.TextDataObject()
wx.TheClipboard.GetData(do)
... | def get_data():
"Read from the clipboard content, return a suitable object (string or bitmap)"
data = None
try:
if wx.TheClipboard.Open():
if wx.TheClipboard.IsSupported(wx.DataFormat(wx.DF_TEXT)):
do = wx.TextDataObject()
wx.TheClipboard.GetData(do)
... | [
"Read",
"from",
"the",
"clipboard",
"content",
"return",
"a",
"suitable",
"object",
"(",
"string",
"or",
"bitmap",
")"
] | reingart/gui2py | python | https://github.com/reingart/gui2py/blob/aca0a05f6fcde55c94ad7cc058671a06608b01a4/gui/clipboard.py#L8-L24 | [
"def",
"get_data",
"(",
")",
":",
"data",
"=",
"None",
"try",
":",
"if",
"wx",
".",
"TheClipboard",
".",
"Open",
"(",
")",
":",
"if",
"wx",
".",
"TheClipboard",
".",
"IsSupported",
"(",
"wx",
".",
"DataFormat",
"(",
"wx",
".",
"DF_TEXT",
")",
")",
... | aca0a05f6fcde55c94ad7cc058671a06608b01a4 |
test | set_data | Write content to the clipboard, data can be either a string or a bitmap | gui/clipboard.py | def set_data(data):
"Write content to the clipboard, data can be either a string or a bitmap"
try:
if wx.TheClipboard.Open():
if isinstance(data, (str, unicode)):
do = wx.TextDataObject()
do.SetText(data)
wx.TheClipboard.SetData(do)
... | def set_data(data):
"Write content to the clipboard, data can be either a string or a bitmap"
try:
if wx.TheClipboard.Open():
if isinstance(data, (str, unicode)):
do = wx.TextDataObject()
do.SetText(data)
wx.TheClipboard.SetData(do)
... | [
"Write",
"content",
"to",
"the",
"clipboard",
"data",
"can",
"be",
"either",
"a",
"string",
"or",
"a",
"bitmap"
] | reingart/gui2py | python | https://github.com/reingart/gui2py/blob/aca0a05f6fcde55c94ad7cc058671a06608b01a4/gui/clipboard.py#L27-L41 | [
"def",
"set_data",
"(",
"data",
")",
":",
"try",
":",
"if",
"wx",
".",
"TheClipboard",
".",
"Open",
"(",
")",
":",
"if",
"isinstance",
"(",
"data",
",",
"(",
"str",
",",
"unicode",
")",
")",
":",
"do",
"=",
"wx",
".",
"TextDataObject",
"(",
")",
... | aca0a05f6fcde55c94ad7cc058671a06608b01a4 |
test | find_autosummary_in_files | Find out what items are documented in source/*.rst.
See `find_autosummary_in_lines`. | gui/doc/ext/autosummary/generate.py | def find_autosummary_in_files(filenames):
"""Find out what items are documented in source/*.rst.
See `find_autosummary_in_lines`.
"""
documented = []
for filename in filenames:
f = open(filename, 'r')
lines = f.read().splitlines()
documented.extend(find_autosummary_in_lines(... | def find_autosummary_in_files(filenames):
"""Find out what items are documented in source/*.rst.
See `find_autosummary_in_lines`.
"""
documented = []
for filename in filenames:
f = open(filename, 'r')
lines = f.read().splitlines()
documented.extend(find_autosummary_in_lines(... | [
"Find",
"out",
"what",
"items",
"are",
"documented",
"in",
"source",
"/",
"*",
".",
"rst",
"."
] | reingart/gui2py | python | https://github.com/reingart/gui2py/blob/aca0a05f6fcde55c94ad7cc058671a06608b01a4/gui/doc/ext/autosummary/generate.py#L274-L285 | [
"def",
"find_autosummary_in_files",
"(",
"filenames",
")",
":",
"documented",
"=",
"[",
"]",
"for",
"filename",
"in",
"filenames",
":",
"f",
"=",
"open",
"(",
"filename",
",",
"'r'",
")",
"lines",
"=",
"f",
".",
"read",
"(",
")",
".",
"splitlines",
"("... | aca0a05f6fcde55c94ad7cc058671a06608b01a4 |
test | find_autosummary_in_docstring | Find out what items are documented in the given object's docstring.
See `find_autosummary_in_lines`. | gui/doc/ext/autosummary/generate.py | def find_autosummary_in_docstring(name, module=None, filename=None):
"""Find out what items are documented in the given object's docstring.
See `find_autosummary_in_lines`.
"""
try:
real_name, obj, parent = import_by_name(name)
lines = pydoc.getdoc(obj).splitlines()
return find_... | def find_autosummary_in_docstring(name, module=None, filename=None):
"""Find out what items are documented in the given object's docstring.
See `find_autosummary_in_lines`.
"""
try:
real_name, obj, parent = import_by_name(name)
lines = pydoc.getdoc(obj).splitlines()
return find_... | [
"Find",
"out",
"what",
"items",
"are",
"documented",
"in",
"the",
"given",
"object",
"s",
"docstring",
"."
] | reingart/gui2py | python | https://github.com/reingart/gui2py/blob/aca0a05f6fcde55c94ad7cc058671a06608b01a4/gui/doc/ext/autosummary/generate.py#L287-L300 | [
"def",
"find_autosummary_in_docstring",
"(",
"name",
",",
"module",
"=",
"None",
",",
"filename",
"=",
"None",
")",
":",
"try",
":",
"real_name",
",",
"obj",
",",
"parent",
"=",
"import_by_name",
"(",
"name",
")",
"lines",
"=",
"pydoc",
".",
"getdoc",
"(... | aca0a05f6fcde55c94ad7cc058671a06608b01a4 |
test | find_autosummary_in_lines | Find out what items appear in autosummary:: directives in the
given lines.
Returns a list of (name, toctree, template) where *name* is a name
of an object and *toctree* the :toctree: path of the corresponding
autosummary directive (relative to the root of the file name), and
*template* the value of... | gui/doc/ext/autosummary/generate.py | def find_autosummary_in_lines(lines, module=None, filename=None):
"""Find out what items appear in autosummary:: directives in the
given lines.
Returns a list of (name, toctree, template) where *name* is a name
of an object and *toctree* the :toctree: path of the corresponding
autosummary directive... | def find_autosummary_in_lines(lines, module=None, filename=None):
"""Find out what items appear in autosummary:: directives in the
given lines.
Returns a list of (name, toctree, template) where *name* is a name
of an object and *toctree* the :toctree: path of the corresponding
autosummary directive... | [
"Find",
"out",
"what",
"items",
"appear",
"in",
"autosummary",
"::",
"directives",
"in",
"the",
"given",
"lines",
"."
] | reingart/gui2py | python | https://github.com/reingart/gui2py/blob/aca0a05f6fcde55c94ad7cc058671a06608b01a4/gui/doc/ext/autosummary/generate.py#L302-L385 | [
"def",
"find_autosummary_in_lines",
"(",
"lines",
",",
"module",
"=",
"None",
",",
"filename",
"=",
"None",
")",
":",
"autosummary_re",
"=",
"re",
".",
"compile",
"(",
"r'^(\\s*)\\.\\.\\s+autosummary::\\s*'",
")",
"automodule_re",
"=",
"re",
".",
"compile",
"(",... | aca0a05f6fcde55c94ad7cc058671a06608b01a4 |
test | InspectorPanel.load_object | Add the object and all their childs | gui/tools/inspector.py | def load_object(self, obj=None):
"Add the object and all their childs"
# if not obj is given, do a full reload using the current root
if obj:
self.root_obj = obj
else:
obj = self.root_obj
self.tree.DeleteAllItems()
self.root = self.tree.AddRoot("ap... | def load_object(self, obj=None):
"Add the object and all their childs"
# if not obj is given, do a full reload using the current root
if obj:
self.root_obj = obj
else:
obj = self.root_obj
self.tree.DeleteAllItems()
self.root = self.tree.AddRoot("ap... | [
"Add",
"the",
"object",
"and",
"all",
"their",
"childs"
] | reingart/gui2py | python | https://github.com/reingart/gui2py/blob/aca0a05f6fcde55c94ad7cc058671a06608b01a4/gui/tools/inspector.py#L73-L88 | [
"def",
"load_object",
"(",
"self",
",",
"obj",
"=",
"None",
")",
":",
"# if not obj is given, do a full reload using the current root",
"if",
"obj",
":",
"self",
".",
"root_obj",
"=",
"obj",
"else",
":",
"obj",
"=",
"self",
".",
"root_obj",
"self",
".",
"tree"... | aca0a05f6fcde55c94ad7cc058671a06608b01a4 |
test | InspectorPanel.inspect | Select the object and show its properties | gui/tools/inspector.py | def inspect(self, obj, context_menu=False, edit_prop=False, mouse_pos=None):
"Select the object and show its properties"
child = self.tree.FindItem(self.root, obj.name)
if DEBUG: print "inspect child", child
if child:
self.tree.ScrollTo(child)
self.tree.SetCurrent... | def inspect(self, obj, context_menu=False, edit_prop=False, mouse_pos=None):
"Select the object and show its properties"
child = self.tree.FindItem(self.root, obj.name)
if DEBUG: print "inspect child", child
if child:
self.tree.ScrollTo(child)
self.tree.SetCurrent... | [
"Select",
"the",
"object",
"and",
"show",
"its",
"properties"
] | reingart/gui2py | python | https://github.com/reingart/gui2py/blob/aca0a05f6fcde55c94ad7cc058671a06608b01a4/gui/tools/inspector.py#L90-L101 | [
"def",
"inspect",
"(",
"self",
",",
"obj",
",",
"context_menu",
"=",
"False",
",",
"edit_prop",
"=",
"False",
",",
"mouse_pos",
"=",
"None",
")",
":",
"child",
"=",
"self",
".",
"tree",
".",
"FindItem",
"(",
"self",
".",
"root",
",",
"obj",
".",
"n... | aca0a05f6fcde55c94ad7cc058671a06608b01a4 |
test | InspectorPanel.activate_item | load the selected item in the property editor | gui/tools/inspector.py | def activate_item(self, child, edit_prop=False, select=False):
"load the selected item in the property editor"
d = self.tree.GetItemData(child)
if d:
o = d.GetData()
self.selected_obj = o
callback = lambda o=o, **kwargs: self.update(o, **kwargs)
se... | def activate_item(self, child, edit_prop=False, select=False):
"load the selected item in the property editor"
d = self.tree.GetItemData(child)
if d:
o = d.GetData()
self.selected_obj = o
callback = lambda o=o, **kwargs: self.update(o, **kwargs)
se... | [
"load",
"the",
"selected",
"item",
"in",
"the",
"property",
"editor"
] | reingart/gui2py | python | https://github.com/reingart/gui2py/blob/aca0a05f6fcde55c94ad7cc058671a06608b01a4/gui/tools/inspector.py#L121-L134 | [
"def",
"activate_item",
"(",
"self",
",",
"child",
",",
"edit_prop",
"=",
"False",
",",
"select",
"=",
"False",
")",
":",
"d",
"=",
"self",
".",
"tree",
".",
"GetItemData",
"(",
"child",
")",
"if",
"d",
":",
"o",
"=",
"d",
".",
"GetData",
"(",
")... | aca0a05f6fcde55c94ad7cc058671a06608b01a4 |
test | InspectorPanel.update | Update the tree item when the object name changes | gui/tools/inspector.py | def update(self, obj, **kwargs):
"Update the tree item when the object name changes"
# search for the old name:
child = self.tree.FindItem(self.root, kwargs['name'])
if DEBUG: print "update child", child, kwargs
if child:
self.tree.ScrollTo(child)
self.tre... | def update(self, obj, **kwargs):
"Update the tree item when the object name changes"
# search for the old name:
child = self.tree.FindItem(self.root, kwargs['name'])
if DEBUG: print "update child", child, kwargs
if child:
self.tree.ScrollTo(child)
self.tre... | [
"Update",
"the",
"tree",
"item",
"when",
"the",
"object",
"name",
"changes"
] | reingart/gui2py | python | https://github.com/reingart/gui2py/blob/aca0a05f6fcde55c94ad7cc058671a06608b01a4/gui/tools/inspector.py#L136-L147 | [
"def",
"update",
"(",
"self",
",",
"obj",
",",
"*",
"*",
"kwargs",
")",
":",
"# search for the old name:",
"child",
"=",
"self",
".",
"tree",
".",
"FindItem",
"(",
"self",
".",
"root",
",",
"kwargs",
"[",
"'name'",
"]",
")",
"if",
"DEBUG",
":",
"prin... | aca0a05f6fcde55c94ad7cc058671a06608b01a4 |
test | InspectorPanel.show_context_menu | Open a popup menu with options regarding the selected object | gui/tools/inspector.py | def show_context_menu(self, item, mouse_pos=None):
"Open a popup menu with options regarding the selected object"
if item:
d = self.tree.GetItemData(item)
if d:
obj = d.GetData()
if obj:
# highligh and store the selected object:... | def show_context_menu(self, item, mouse_pos=None):
"Open a popup menu with options regarding the selected object"
if item:
d = self.tree.GetItemData(item)
if d:
obj = d.GetData()
if obj:
# highligh and store the selected object:... | [
"Open",
"a",
"popup",
"menu",
"with",
"options",
"regarding",
"the",
"selected",
"object"
] | reingart/gui2py | python | https://github.com/reingart/gui2py/blob/aca0a05f6fcde55c94ad7cc058671a06608b01a4/gui/tools/inspector.py#L200-L240 | [
"def",
"show_context_menu",
"(",
"self",
",",
"item",
",",
"mouse_pos",
"=",
"None",
")",
":",
"if",
"item",
":",
"d",
"=",
"self",
".",
"tree",
".",
"GetItemData",
"(",
"item",
")",
"if",
"d",
":",
"obj",
"=",
"d",
".",
"GetData",
"(",
")",
"if"... | aca0a05f6fcde55c94ad7cc058671a06608b01a4 |
test | Timer.set_parent | Re-parent a child control with the new wx_obj parent (owner) | gui/timer.py | def set_parent(self, new_parent, init=False):
"Re-parent a child control with the new wx_obj parent (owner)"
##SubComponent.set_parent(self, new_parent, init)
self.wx_obj.SetOwner(new_parent.wx_obj.GetEventHandler()) | def set_parent(self, new_parent, init=False):
"Re-parent a child control with the new wx_obj parent (owner)"
##SubComponent.set_parent(self, new_parent, init)
self.wx_obj.SetOwner(new_parent.wx_obj.GetEventHandler()) | [
"Re",
"-",
"parent",
"a",
"child",
"control",
"with",
"the",
"new",
"wx_obj",
"parent",
"(",
"owner",
")"
] | reingart/gui2py | python | https://github.com/reingart/gui2py/blob/aca0a05f6fcde55c94ad7cc058671a06608b01a4/gui/timer.py#L28-L31 | [
"def",
"set_parent",
"(",
"self",
",",
"new_parent",
",",
"init",
"=",
"False",
")",
":",
"##SubComponent.set_parent(self, new_parent, init)",
"self",
".",
"wx_obj",
".",
"SetOwner",
"(",
"new_parent",
".",
"wx_obj",
".",
"GetEventHandler",
"(",
")",
")"
] | aca0a05f6fcde55c94ad7cc058671a06608b01a4 |
test | HyperlinkedSorlImageField.to_representation | Perform the actual serialization.
Args:
value: the image to transform
Returns:
a url pointing at a scaled and cached image | sorl_thumbnail_serializer/fields.py | def to_representation(self, value):
"""
Perform the actual serialization.
Args:
value: the image to transform
Returns:
a url pointing at a scaled and cached image
"""
if not value:
return None
image = get_thumbnail(value, self... | def to_representation(self, value):
"""
Perform the actual serialization.
Args:
value: the image to transform
Returns:
a url pointing at a scaled and cached image
"""
if not value:
return None
image = get_thumbnail(value, self... | [
"Perform",
"the",
"actual",
"serialization",
"."
] | dessibelle/sorl-thumbnail-serializer-field | python | https://github.com/dessibelle/sorl-thumbnail-serializer-field/blob/ac36f9de2f1df4c902e7bb371ac5be24d8b50f1f/sorl_thumbnail_serializer/fields.py#L71-L92 | [
"def",
"to_representation",
"(",
"self",
",",
"value",
")",
":",
"if",
"not",
"value",
":",
"return",
"None",
"image",
"=",
"get_thumbnail",
"(",
"value",
",",
"self",
".",
"geometry_string",
",",
"*",
"*",
"self",
".",
"options",
")",
"try",
":",
"req... | ac36f9de2f1df4c902e7bb371ac5be24d8b50f1f |
test | add_selector | Builds and registers a :class:`Selector` object with the given name and configuration.
Args:
name (str): The name of the selector.
Yields:
SelectorFactory: The factory that will build the :class:`Selector`. | capybara/selector/selector.py | def add_selector(name):
"""
Builds and registers a :class:`Selector` object with the given name and configuration.
Args:
name (str): The name of the selector.
Yields:
SelectorFactory: The factory that will build the :class:`Selector`.
"""
factory = SelectorFactory(name)
yi... | def add_selector(name):
"""
Builds and registers a :class:`Selector` object with the given name and configuration.
Args:
name (str): The name of the selector.
Yields:
SelectorFactory: The factory that will build the :class:`Selector`.
"""
factory = SelectorFactory(name)
yi... | [
"Builds",
"and",
"registers",
"a",
":",
"class",
":",
"Selector",
"object",
"with",
"the",
"given",
"name",
"and",
"configuration",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/selector/selector.py#L188-L201 | [
"def",
"add_selector",
"(",
"name",
")",
":",
"factory",
"=",
"SelectorFactory",
"(",
"name",
")",
"yield",
"factory",
"selectors",
"[",
"name",
"]",
"=",
"factory",
".",
"build_selector",
"(",
")"
] | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | Selector.expression_filters | Dict[str, ExpressionFilter]: Returns the expression filters for this selector. | capybara/selector/selector.py | def expression_filters(self):
""" Dict[str, ExpressionFilter]: Returns the expression filters for this selector. """
return {
name: filter for name, filter in iter(self.filters.items())
if isinstance(filter, ExpressionFilter)} | def expression_filters(self):
""" Dict[str, ExpressionFilter]: Returns the expression filters for this selector. """
return {
name: filter for name, filter in iter(self.filters.items())
if isinstance(filter, ExpressionFilter)} | [
"Dict",
"[",
"str",
"ExpressionFilter",
"]",
":",
"Returns",
"the",
"expression",
"filters",
"for",
"this",
"selector",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/selector/selector.py#L57-L62 | [
"def",
"expression_filters",
"(",
"self",
")",
":",
"return",
"{",
"name",
":",
"filter",
"for",
"name",
",",
"filter",
"in",
"iter",
"(",
"self",
".",
"filters",
".",
"items",
"(",
")",
")",
"if",
"isinstance",
"(",
"filter",
",",
"ExpressionFilter",
... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | Selector.node_filters | Dict[str, NodeFilter]: Returns the node filters for this selector. | capybara/selector/selector.py | def node_filters(self):
""" Dict[str, NodeFilter]: Returns the node filters for this selector. """
return {
name: filter for name, filter in iter(self.filters.items())
if isinstance(filter, NodeFilter)} | def node_filters(self):
""" Dict[str, NodeFilter]: Returns the node filters for this selector. """
return {
name: filter for name, filter in iter(self.filters.items())
if isinstance(filter, NodeFilter)} | [
"Dict",
"[",
"str",
"NodeFilter",
"]",
":",
"Returns",
"the",
"node",
"filters",
"for",
"this",
"selector",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/selector/selector.py#L65-L70 | [
"def",
"node_filters",
"(",
"self",
")",
":",
"return",
"{",
"name",
":",
"filter",
"for",
"name",
",",
"filter",
"in",
"iter",
"(",
"self",
".",
"filters",
".",
"items",
"(",
")",
")",
"if",
"isinstance",
"(",
"filter",
",",
"NodeFilter",
")",
"}"
] | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | SelectorFactory.expression_filter | Returns a decorator function for adding an expression filter.
Args:
name (str): The name of the filter.
**kwargs: Variable keyword arguments for the filter.
Returns:
Callable[[Callable[[AbstractExpression, Any], AbstractExpression]]]: A decorator
fun... | capybara/selector/selector.py | def expression_filter(self, name, **kwargs):
"""
Returns a decorator function for adding an expression filter.
Args:
name (str): The name of the filter.
**kwargs: Variable keyword arguments for the filter.
Returns:
Callable[[Callable[[AbstractExpress... | def expression_filter(self, name, **kwargs):
"""
Returns a decorator function for adding an expression filter.
Args:
name (str): The name of the filter.
**kwargs: Variable keyword arguments for the filter.
Returns:
Callable[[Callable[[AbstractExpress... | [
"Returns",
"a",
"decorator",
"function",
"for",
"adding",
"an",
"expression",
"filter",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/selector/selector.py#L123-L139 | [
"def",
"expression_filter",
"(",
"self",
",",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"def",
"decorator",
"(",
"func",
")",
":",
"self",
".",
"filters",
"[",
"name",
"]",
"=",
"ExpressionFilter",
"(",
"name",
",",
"func",
",",
"*",
"*",
"kwargs",
... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | SelectorFactory.node_filter | Returns a decorator function for adding a node filter.
Args:
name (str): The name of the filter.
**kwargs: Variable keyword arguments for the filter.
Returns:
Callable[[Callable[[Element, Any], bool]]]: A decorator function for adding a node
filter. | capybara/selector/selector.py | def node_filter(self, name, **kwargs):
"""
Returns a decorator function for adding a node filter.
Args:
name (str): The name of the filter.
**kwargs: Variable keyword arguments for the filter.
Returns:
Callable[[Callable[[Element, Any], bool]]]: A de... | def node_filter(self, name, **kwargs):
"""
Returns a decorator function for adding a node filter.
Args:
name (str): The name of the filter.
**kwargs: Variable keyword arguments for the filter.
Returns:
Callable[[Callable[[Element, Any], bool]]]: A de... | [
"Returns",
"a",
"decorator",
"function",
"for",
"adding",
"a",
"node",
"filter",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/selector/selector.py#L141-L157 | [
"def",
"node_filter",
"(",
"self",
",",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"def",
"decorator",
"(",
"func",
")",
":",
"self",
".",
"filters",
"[",
"name",
"]",
"=",
"NodeFilter",
"(",
"name",
",",
"func",
",",
"*",
"*",
"kwargs",
")",
"re... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | SelectorFactory.filter_set | Adds filters from a particular global :class:`FilterSet`.
Args:
name (str): The name of the set whose filters should be added. | capybara/selector/selector.py | def filter_set(self, name):
"""
Adds filters from a particular global :class:`FilterSet`.
Args:
name (str): The name of the set whose filters should be added.
"""
filter_set = filter_sets[name]
for name, filter in iter(filter_set.filters.items()):
... | def filter_set(self, name):
"""
Adds filters from a particular global :class:`FilterSet`.
Args:
name (str): The name of the set whose filters should be added.
"""
filter_set = filter_sets[name]
for name, filter in iter(filter_set.filters.items()):
... | [
"Adds",
"filters",
"from",
"a",
"particular",
"global",
":",
"class",
":",
"FilterSet",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/selector/selector.py#L159-L170 | [
"def",
"filter_set",
"(",
"self",
",",
"name",
")",
":",
"filter_set",
"=",
"filter_sets",
"[",
"name",
"]",
"for",
"name",
",",
"filter",
"in",
"iter",
"(",
"filter_set",
".",
"filters",
".",
"items",
"(",
")",
")",
":",
"self",
".",
"filters",
"[",... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | SelectorFactory.build_selector | Selector: Returns a new :class:`Selector` instance with the current configuration. | capybara/selector/selector.py | def build_selector(self):
""" Selector: Returns a new :class:`Selector` instance with the current configuration. """
kwargs = {
'label': self.label,
'descriptions': self.descriptions,
'filters': self.filters}
if self.format == "xpath":
kwargs['xpa... | def build_selector(self):
""" Selector: Returns a new :class:`Selector` instance with the current configuration. """
kwargs = {
'label': self.label,
'descriptions': self.descriptions,
'filters': self.filters}
if self.format == "xpath":
kwargs['xpa... | [
"Selector",
":",
"Returns",
"a",
"new",
":",
"class",
":",
"Selector",
"instance",
"with",
"the",
"current",
"configuration",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/selector/selector.py#L172-L184 | [
"def",
"build_selector",
"(",
"self",
")",
":",
"kwargs",
"=",
"{",
"'label'",
":",
"self",
".",
"label",
",",
"'descriptions'",
":",
"self",
".",
"descriptions",
",",
"'filters'",
":",
"self",
".",
"filters",
"}",
"if",
"self",
".",
"format",
"==",
"\... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | StyleQuery.resolves_for | Resolves this query relative to the given node.
Args:
node (node.Base): The node to be evaluated.
Returns:
int: The number of matches found. | capybara/queries/style_query.py | def resolves_for(self, node):
"""
Resolves this query relative to the given node.
Args:
node (node.Base): The node to be evaluated.
Returns:
int: The number of matches found.
"""
self.node = node
self.actual_styles = node.style(*self.exp... | def resolves_for(self, node):
"""
Resolves this query relative to the given node.
Args:
node (node.Base): The node to be evaluated.
Returns:
int: The number of matches found.
"""
self.node = node
self.actual_styles = node.style(*self.exp... | [
"Resolves",
"this",
"query",
"relative",
"to",
"the",
"given",
"node",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/queries/style_query.py#L27-L43 | [
"def",
"resolves_for",
"(",
"self",
",",
"node",
")",
":",
"self",
".",
"node",
"=",
"node",
"self",
".",
"actual_styles",
"=",
"node",
".",
"style",
"(",
"*",
"self",
".",
"expected_styles",
".",
"keys",
"(",
")",
")",
"return",
"all",
"(",
"toregex... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | StyleQuery.failure_message | str: A message describing the query failure. | capybara/queries/style_query.py | def failure_message(self):
""" str: A message describing the query failure. """
return (
"Expected node to have styles {expected}. "
"Actual styles were {actual}").format(
expected=desc(self.expected_styles),
actual=desc(self.actual_styles)) | def failure_message(self):
""" str: A message describing the query failure. """
return (
"Expected node to have styles {expected}. "
"Actual styles were {actual}").format(
expected=desc(self.expected_styles),
actual=desc(self.actual_styles)) | [
"str",
":",
"A",
"message",
"describing",
"the",
"query",
"failure",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/queries/style_query.py#L46-L52 | [
"def",
"failure_message",
"(",
"self",
")",
":",
"return",
"(",
"\"Expected node to have styles {expected}. \"",
"\"Actual styles were {actual}\"",
")",
".",
"format",
"(",
"expected",
"=",
"desc",
"(",
"self",
".",
"expected_styles",
")",
",",
"actual",
"=",
"desc"... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | SessionMatchersMixin.assert_current_path | Asserts that the page has the given path. By default this will compare against the
path+query portion of the full URL.
Args:
path (str | RegexObject): The string or regex that the current "path" should match.
**kwargs: Arbitrary keyword arguments for :class:`CurrentPathQuery`.
... | capybara/session_matchers.py | def assert_current_path(self, path, **kwargs):
"""
Asserts that the page has the given path. By default this will compare against the
path+query portion of the full URL.
Args:
path (str | RegexObject): The string or regex that the current "path" should match.
**k... | def assert_current_path(self, path, **kwargs):
"""
Asserts that the page has the given path. By default this will compare against the
path+query portion of the full URL.
Args:
path (str | RegexObject): The string or regex that the current "path" should match.
**k... | [
"Asserts",
"that",
"the",
"page",
"has",
"the",
"given",
"path",
".",
"By",
"default",
"this",
"will",
"compare",
"against",
"the",
"path",
"+",
"query",
"portion",
"of",
"the",
"full",
"URL",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/session_matchers.py#L6-L30 | [
"def",
"assert_current_path",
"(",
"self",
",",
"path",
",",
"*",
"*",
"kwargs",
")",
":",
"query",
"=",
"CurrentPathQuery",
"(",
"path",
",",
"*",
"*",
"kwargs",
")",
"@",
"self",
".",
"document",
".",
"synchronize",
"def",
"assert_current_path",
"(",
"... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | SessionMatchersMixin.assert_no_current_path | Asserts that the page doesn't have the given path.
Args:
path (str | RegexObject): The string or regex that the current "path" should match.
**kwargs: Arbitrary keyword arguments for :class:`CurrentPathQuery`.
Returns:
True
Raises:
ExpectationNo... | capybara/session_matchers.py | def assert_no_current_path(self, path, **kwargs):
"""
Asserts that the page doesn't have the given path.
Args:
path (str | RegexObject): The string or regex that the current "path" should match.
**kwargs: Arbitrary keyword arguments for :class:`CurrentPathQuery`.
... | def assert_no_current_path(self, path, **kwargs):
"""
Asserts that the page doesn't have the given path.
Args:
path (str | RegexObject): The string or regex that the current "path" should match.
**kwargs: Arbitrary keyword arguments for :class:`CurrentPathQuery`.
... | [
"Asserts",
"that",
"the",
"page",
"doesn",
"t",
"have",
"the",
"given",
"path",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/session_matchers.py#L32-L56 | [
"def",
"assert_no_current_path",
"(",
"self",
",",
"path",
",",
"*",
"*",
"kwargs",
")",
":",
"query",
"=",
"CurrentPathQuery",
"(",
"path",
",",
"*",
"*",
"kwargs",
")",
"@",
"self",
".",
"document",
".",
"synchronize",
"def",
"assert_no_current_path",
"(... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | SessionMatchersMixin.has_current_path | Checks if the page has the given path.
Args:
path (str | RegexObject): The string or regex that the current "path" should match.
**kwargs: Arbitrary keyword arguments for :class:`CurrentPathQuery`.
Returns:
bool: Whether it matches. | capybara/session_matchers.py | def has_current_path(self, path, **kwargs):
"""
Checks if the page has the given path.
Args:
path (str | RegexObject): The string or regex that the current "path" should match.
**kwargs: Arbitrary keyword arguments for :class:`CurrentPathQuery`.
Returns:
... | def has_current_path(self, path, **kwargs):
"""
Checks if the page has the given path.
Args:
path (str | RegexObject): The string or regex that the current "path" should match.
**kwargs: Arbitrary keyword arguments for :class:`CurrentPathQuery`.
Returns:
... | [
"Checks",
"if",
"the",
"page",
"has",
"the",
"given",
"path",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/session_matchers.py#L58-L73 | [
"def",
"has_current_path",
"(",
"self",
",",
"path",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"return",
"self",
".",
"assert_current_path",
"(",
"path",
",",
"*",
"*",
"kwargs",
")",
"except",
"ExpectationNotMet",
":",
"return",
"False"
] | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | SessionMatchersMixin.has_no_current_path | Checks if the page doesn't have the given path.
Args:
path (str | RegexObject): The string or regex that the current "path" should match.
**kwargs: Arbitrary keyword arguments for :class:`CurrentPathQuery`.
Returns:
bool: Whether it doesn't match. | capybara/session_matchers.py | def has_no_current_path(self, path, **kwargs):
"""
Checks if the page doesn't have the given path.
Args:
path (str | RegexObject): The string or regex that the current "path" should match.
**kwargs: Arbitrary keyword arguments for :class:`CurrentPathQuery`.
Retu... | def has_no_current_path(self, path, **kwargs):
"""
Checks if the page doesn't have the given path.
Args:
path (str | RegexObject): The string or regex that the current "path" should match.
**kwargs: Arbitrary keyword arguments for :class:`CurrentPathQuery`.
Retu... | [
"Checks",
"if",
"the",
"page",
"doesn",
"t",
"have",
"the",
"given",
"path",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/session_matchers.py#L75-L90 | [
"def",
"has_no_current_path",
"(",
"self",
",",
"path",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"return",
"self",
".",
"assert_no_current_path",
"(",
"path",
",",
"*",
"*",
"kwargs",
")",
"except",
"ExpectationNotMet",
":",
"return",
"False"
] | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | Element.text | Retrieve the text of the element. If :data:`capybara.ignore_hidden_elements` is ``True``,
which it is by default, then this will return only text which is visible. The exact
semantics of this may differ between drivers, but generally any text within elements with
``display: none`` is ignored.
... | capybara/node/element.py | def text(self):
"""
Retrieve the text of the element. If :data:`capybara.ignore_hidden_elements` is ``True``,
which it is by default, then this will return only text which is visible. The exact
semantics of this may differ between drivers, but generally any text within elements with
... | def text(self):
"""
Retrieve the text of the element. If :data:`capybara.ignore_hidden_elements` is ``True``,
which it is by default, then this will return only text which is visible. The exact
semantics of this may differ between drivers, but generally any text within elements with
... | [
"Retrieve",
"the",
"text",
"of",
"the",
"element",
".",
"If",
":",
"data",
":",
"capybara",
".",
"ignore_hidden_elements",
"is",
"True",
"which",
"it",
"is",
"by",
"default",
"then",
"this",
"will",
"return",
"only",
"text",
"which",
"is",
"visible",
".",
... | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/node/element.py#L111-L125 | [
"def",
"text",
"(",
"self",
")",
":",
"if",
"capybara",
".",
"ignore_hidden_elements",
"or",
"capybara",
".",
"visible_text_only",
":",
"return",
"self",
".",
"visible_text",
"else",
":",
"return",
"self",
".",
"all_text"
] | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | Element.select_option | Select this node if it is an option element inside a select tag. | capybara/node/element.py | def select_option(self):
""" Select this node if it is an option element inside a select tag. """
if self.disabled:
warn("Attempt to select disabled option: {}".format(self.value or self.text))
self.base.select_option() | def select_option(self):
""" Select this node if it is an option element inside a select tag. """
if self.disabled:
warn("Attempt to select disabled option: {}".format(self.value or self.text))
self.base.select_option() | [
"Select",
"this",
"node",
"if",
"it",
"is",
"an",
"option",
"element",
"inside",
"a",
"select",
"tag",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/node/element.py#L276-L280 | [
"def",
"select_option",
"(",
"self",
")",
":",
"if",
"self",
".",
"disabled",
":",
"warn",
"(",
"\"Attempt to select disabled option: {}\"",
".",
"format",
"(",
"self",
".",
"value",
"or",
"self",
".",
"text",
")",
")",
"self",
".",
"base",
".",
"select_op... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | ExpressionFilter.apply_filter | Returns the given expression filtered by the given value.
Args:
expr (xpath.expression.AbstractExpression): The expression to filter.
value (object): The desired value with which the expression should be filtered.
Returns:
xpath.expression.AbstractExpression: The fi... | capybara/selector/expression_filter.py | def apply_filter(self, expr, value):
"""
Returns the given expression filtered by the given value.
Args:
expr (xpath.expression.AbstractExpression): The expression to filter.
value (object): The desired value with which the expression should be filtered.
Returns... | def apply_filter(self, expr, value):
"""
Returns the given expression filtered by the given value.
Args:
expr (xpath.expression.AbstractExpression): The expression to filter.
value (object): The desired value with which the expression should be filtered.
Returns... | [
"Returns",
"the",
"given",
"expression",
"filtered",
"by",
"the",
"given",
"value",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/selector/expression_filter.py#L7-L34 | [
"def",
"apply_filter",
"(",
"self",
",",
"expr",
",",
"value",
")",
":",
"if",
"self",
".",
"skip",
"(",
"value",
")",
":",
"return",
"expr",
"if",
"not",
"self",
".",
"_valid_value",
"(",
"value",
")",
":",
"msg",
"=",
"\"Invalid value {value} passed to... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | get_browser | Returns an instance of the given browser with the given capabilities.
Args:
browser_name (str): The name of the desired browser.
capabilities (Dict[str, str | bool], optional): The desired capabilities of the browser.
Defaults to None.
options: Arbitrary keyword arguments for th... | capybara/selenium/browser.py | def get_browser(browser_name, capabilities=None, **options):
"""
Returns an instance of the given browser with the given capabilities.
Args:
browser_name (str): The name of the desired browser.
capabilities (Dict[str, str | bool], optional): The desired capabilities of the browser.
... | def get_browser(browser_name, capabilities=None, **options):
"""
Returns an instance of the given browser with the given capabilities.
Args:
browser_name (str): The name of the desired browser.
capabilities (Dict[str, str | bool], optional): The desired capabilities of the browser.
... | [
"Returns",
"an",
"instance",
"of",
"the",
"given",
"browser",
"with",
"the",
"given",
"capabilities",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/selenium/browser.py#L4-L34 | [
"def",
"get_browser",
"(",
"browser_name",
",",
"capabilities",
"=",
"None",
",",
"*",
"*",
"options",
")",
":",
"if",
"browser_name",
"==",
"\"chrome\"",
":",
"return",
"webdriver",
".",
"Chrome",
"(",
"desired_capabilities",
"=",
"capabilities",
",",
"*",
... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | SelectorQuery.kwargs | Dict[str, Any]: The keyword arguments with which this query was initialized. | capybara/queries/selector_query.py | def kwargs(self):
""" Dict[str, Any]: The keyword arguments with which this query was initialized. """
kwargs = {}
kwargs.update(self.options)
kwargs.update(self.filter_options)
return kwargs | def kwargs(self):
""" Dict[str, Any]: The keyword arguments with which this query was initialized. """
kwargs = {}
kwargs.update(self.options)
kwargs.update(self.filter_options)
return kwargs | [
"Dict",
"[",
"str",
"Any",
"]",
":",
"The",
"keyword",
"arguments",
"with",
"which",
"this",
"query",
"was",
"initialized",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/queries/selector_query.py#L93-L98 | [
"def",
"kwargs",
"(",
"self",
")",
":",
"kwargs",
"=",
"{",
"}",
"kwargs",
".",
"update",
"(",
"self",
".",
"options",
")",
"kwargs",
".",
"update",
"(",
"self",
".",
"filter_options",
")",
"return",
"kwargs"
] | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | SelectorQuery.description | str: A long description of this query. | capybara/queries/selector_query.py | def description(self):
""" str: A long description of this query. """
description = self.label
if self.locator:
description += " {}".format(desc(self.locator))
if self.options["text"] is not None:
description += " with text {}".format(desc(self.options["text"]))... | def description(self):
""" str: A long description of this query. """
description = self.label
if self.locator:
description += " {}".format(desc(self.locator))
if self.options["text"] is not None:
description += " with text {}".format(desc(self.options["text"]))... | [
"str",
":",
"A",
"long",
"description",
"of",
"this",
"query",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/queries/selector_query.py#L101-L113 | [
"def",
"description",
"(",
"self",
")",
":",
"description",
"=",
"self",
".",
"label",
"if",
"self",
".",
"locator",
":",
"description",
"+=",
"\" {}\"",
".",
"format",
"(",
"desc",
"(",
"self",
".",
"locator",
")",
")",
"if",
"self",
".",
"options",
... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | SelectorQuery.visible | str: The desired element visibility. | capybara/queries/selector_query.py | def visible(self):
""" str: The desired element visibility. """
if self.options["visible"] is not None:
if self.options["visible"] is True:
return "visible"
elif self.options["visible"] is False:
return "all"
else:
retur... | def visible(self):
""" str: The desired element visibility. """
if self.options["visible"] is not None:
if self.options["visible"] is True:
return "visible"
elif self.options["visible"] is False:
return "all"
else:
retur... | [
"str",
":",
"The",
"desired",
"element",
"visibility",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/queries/selector_query.py#L136-L149 | [
"def",
"visible",
"(",
"self",
")",
":",
"if",
"self",
".",
"options",
"[",
"\"visible\"",
"]",
"is",
"not",
"None",
":",
"if",
"self",
".",
"options",
"[",
"\"visible\"",
"]",
"is",
"True",
":",
"return",
"\"visible\"",
"elif",
"self",
".",
"options",... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | SelectorQuery.xpath | Returns the XPath query for this selector.
Args:
exact (bool, optional): Whether to exactly match text.
Returns:
str: The XPath query for this selector. | capybara/queries/selector_query.py | def xpath(self, exact=None):
"""
Returns the XPath query for this selector.
Args:
exact (bool, optional): Whether to exactly match text.
Returns:
str: The XPath query for this selector.
"""
exact = exact if exact is not None else self.exact
... | def xpath(self, exact=None):
"""
Returns the XPath query for this selector.
Args:
exact (bool, optional): Whether to exactly match text.
Returns:
str: The XPath query for this selector.
"""
exact = exact if exact is not None else self.exact
... | [
"Returns",
"the",
"XPath",
"query",
"for",
"this",
"selector",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/queries/selector_query.py#L160-L178 | [
"def",
"xpath",
"(",
"self",
",",
"exact",
"=",
"None",
")",
":",
"exact",
"=",
"exact",
"if",
"exact",
"is",
"not",
"None",
"else",
"self",
".",
"exact",
"if",
"isinstance",
"(",
"self",
".",
"expression",
",",
"AbstractExpression",
")",
":",
"express... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | SelectorQuery.resolve_for | Resolves this query relative to the given node.
Args:
node (node.Base): The node relative to which this query should be resolved.
exact (bool, optional): Whether to exactly match text.
Returns:
list[Element]: A list of elements matched by this query. | capybara/queries/selector_query.py | def resolve_for(self, node, exact=None):
"""
Resolves this query relative to the given node.
Args:
node (node.Base): The node relative to which this query should be resolved.
exact (bool, optional): Whether to exactly match text.
Returns:
list[Elemen... | def resolve_for(self, node, exact=None):
"""
Resolves this query relative to the given node.
Args:
node (node.Base): The node relative to which this query should be resolved.
exact (bool, optional): Whether to exactly match text.
Returns:
list[Elemen... | [
"Resolves",
"this",
"query",
"relative",
"to",
"the",
"given",
"node",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/queries/selector_query.py#L180-L213 | [
"def",
"resolve_for",
"(",
"self",
",",
"node",
",",
"exact",
"=",
"None",
")",
":",
"from",
"capybara",
".",
"driver",
".",
"node",
"import",
"Node",
"from",
"capybara",
".",
"node",
".",
"element",
"import",
"Element",
"from",
"capybara",
".",
"node",
... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | SelectorQuery.matches_filters | Returns whether the given node matches all filters.
Args:
node (Element): The node to evaluate.
Returns:
bool: Whether the given node matches. | capybara/queries/selector_query.py | def matches_filters(self, node):
"""
Returns whether the given node matches all filters.
Args:
node (Element): The node to evaluate.
Returns:
bool: Whether the given node matches.
"""
visible = self.visible
if self.options["text"]:
... | def matches_filters(self, node):
"""
Returns whether the given node matches all filters.
Args:
node (Element): The node to evaluate.
Returns:
bool: Whether the given node matches.
"""
visible = self.visible
if self.options["text"]:
... | [
"Returns",
"whether",
"the",
"given",
"node",
"matches",
"all",
"filters",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/queries/selector_query.py#L215-L269 | [
"def",
"matches_filters",
"(",
"self",
",",
"node",
")",
":",
"visible",
"=",
"self",
".",
"visible",
"if",
"self",
".",
"options",
"[",
"\"text\"",
"]",
":",
"if",
"isregex",
"(",
"self",
".",
"options",
"[",
"\"text\"",
"]",
")",
":",
"regex",
"=",... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | Session.current_scope | node.Base: The current node relative to which all interaction will be scoped. | capybara/session.py | def current_scope(self):
""" node.Base: The current node relative to which all interaction will be scoped. """
scope = self._scopes[-1]
if scope in [None, "frame"]:
scope = self.document
return scope | def current_scope(self):
""" node.Base: The current node relative to which all interaction will be scoped. """
scope = self._scopes[-1]
if scope in [None, "frame"]:
scope = self.document
return scope | [
"node",
".",
"Base",
":",
"The",
"current",
"node",
"relative",
"to",
"which",
"all",
"interaction",
"will",
"be",
"scoped",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/session.py#L93-L98 | [
"def",
"current_scope",
"(",
"self",
")",
":",
"scope",
"=",
"self",
".",
"_scopes",
"[",
"-",
"1",
"]",
"if",
"scope",
"in",
"[",
"None",
",",
"\"frame\"",
"]",
":",
"scope",
"=",
"self",
".",
"document",
"return",
"scope"
] | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | Session.current_path | str: Path of the current page, without any domain information. | capybara/session.py | def current_path(self):
""" str: Path of the current page, without any domain information. """
if not self.current_url:
return
path = urlparse(self.current_url).path
return path if path else None | def current_path(self):
""" str: Path of the current page, without any domain information. """
if not self.current_url:
return
path = urlparse(self.current_url).path
return path if path else None | [
"str",
":",
"Path",
"of",
"the",
"current",
"page",
"without",
"any",
"domain",
"information",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/session.py#L112-L119 | [
"def",
"current_path",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"current_url",
":",
"return",
"path",
"=",
"urlparse",
"(",
"self",
".",
"current_url",
")",
".",
"path",
"return",
"path",
"if",
"path",
"else",
"None"
] | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | Session.current_host | str: Host of the current page. | capybara/session.py | def current_host(self):
""" str: Host of the current page. """
if not self.current_url:
return
result = urlparse(self.current_url)
scheme, netloc = result.scheme, result.netloc
host = netloc.split(":")[0] if netloc else None
return "{0}://{1}".format(scheme,... | def current_host(self):
""" str: Host of the current page. """
if not self.current_url:
return
result = urlparse(self.current_url)
scheme, netloc = result.scheme, result.netloc
host = netloc.split(":")[0] if netloc else None
return "{0}://{1}".format(scheme,... | [
"str",
":",
"Host",
"of",
"the",
"current",
"page",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/session.py#L122-L131 | [
"def",
"current_host",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"current_url",
":",
"return",
"result",
"=",
"urlparse",
"(",
"self",
".",
"current_url",
")",
"scheme",
",",
"netloc",
"=",
"result",
".",
"scheme",
",",
"result",
".",
"netloc",
... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | Session.visit | Navigate to the given URL. The URL can either be a relative URL or an absolute URL. The
behavior of either depends on the driver. ::
session.visit("/foo")
session.visit("http://google.com")
For drivers which can run against an external application, such as the Selenium driver,
... | capybara/session.py | def visit(self, visit_uri):
"""
Navigate to the given URL. The URL can either be a relative URL or an absolute URL. The
behavior of either depends on the driver. ::
session.visit("/foo")
session.visit("http://google.com")
For drivers which can run against an ext... | def visit(self, visit_uri):
"""
Navigate to the given URL. The URL can either be a relative URL or an absolute URL. The
behavior of either depends on the driver. ::
session.visit("/foo")
session.visit("http://google.com")
For drivers which can run against an ext... | [
"Navigate",
"to",
"the",
"given",
"URL",
".",
"The",
"URL",
"can",
"either",
"be",
"a",
"relative",
"URL",
"or",
"an",
"absolute",
"URL",
".",
"The",
"behavior",
"of",
"either",
"depends",
"on",
"the",
"driver",
".",
"::"
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/session.py#L138-L177 | [
"def",
"visit",
"(",
"self",
",",
"visit_uri",
")",
":",
"self",
".",
"raise_server_error",
"(",
")",
"visit_uri",
"=",
"urlparse",
"(",
"visit_uri",
")",
"if",
"capybara",
".",
"app_host",
":",
"uri_base",
"=",
"urlparse",
"(",
"capybara",
".",
"app_host"... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | Session.scope | Executes the wrapped code within the context of a node. ``scope`` takes the same options
as :meth:`find`. For the duration of the context, any command to Capybara will be handled
as though it were scoped to the given element. ::
with scope("xpath", "//div[@id='delivery-address']"):
... | capybara/session.py | def scope(self, *args, **kwargs):
"""
Executes the wrapped code within the context of a node. ``scope`` takes the same options
as :meth:`find`. For the duration of the context, any command to Capybara will be handled
as though it were scoped to the given element. ::
with sco... | def scope(self, *args, **kwargs):
"""
Executes the wrapped code within the context of a node. ``scope`` takes the same options
as :meth:`find`. For the duration of the context, any command to Capybara will be handled
as though it were scoped to the given element. ::
with sco... | [
"Executes",
"the",
"wrapped",
"code",
"within",
"the",
"context",
"of",
"a",
"node",
".",
"scope",
"takes",
"the",
"same",
"options",
"as",
":",
"meth",
":",
"find",
".",
"For",
"the",
"duration",
"of",
"the",
"context",
"any",
"command",
"to",
"Capybara... | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/session.py#L193-L226 | [
"def",
"scope",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"new_scope",
"=",
"args",
"[",
"0",
"]",
"if",
"isinstance",
"(",
"args",
"[",
"0",
"]",
",",
"Base",
")",
"else",
"self",
".",
"find",
"(",
"*",
"args",
",",
"... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | Session.frame | Execute the wrapped code within the given iframe using the given frame or frame name/id.
May not be supported by all drivers.
Args:
locator (str | Element, optional): The name/id of the frame or the frame's element.
Defaults to the only frame in the document. | capybara/session.py | def frame(self, locator=None, *args, **kwargs):
"""
Execute the wrapped code within the given iframe using the given frame or frame name/id.
May not be supported by all drivers.
Args:
locator (str | Element, optional): The name/id of the frame or the frame's element.
... | def frame(self, locator=None, *args, **kwargs):
"""
Execute the wrapped code within the given iframe using the given frame or frame name/id.
May not be supported by all drivers.
Args:
locator (str | Element, optional): The name/id of the frame or the frame's element.
... | [
"Execute",
"the",
"wrapped",
"code",
"within",
"the",
"given",
"iframe",
"using",
"the",
"given",
"frame",
"or",
"frame",
"name",
"/",
"id",
".",
"May",
"not",
"be",
"supported",
"by",
"all",
"drivers",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/session.py#L254-L268 | [
"def",
"frame",
"(",
"self",
",",
"locator",
"=",
"None",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"switch_to_frame",
"(",
"self",
".",
"_find_frame",
"(",
"locator",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")",
"... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | Session.switch_to_frame | Switch to the given frame.
If you use this method you are responsible for making sure you switch back to the parent
frame when done in the frame changed to. :meth:`frame` is preferred over this method and
should be used when possible. May not be supported by all drivers.
Args:
... | capybara/session.py | def switch_to_frame(self, frame):
"""
Switch to the given frame.
If you use this method you are responsible for making sure you switch back to the parent
frame when done in the frame changed to. :meth:`frame` is preferred over this method and
should be used when possible. May no... | def switch_to_frame(self, frame):
"""
Switch to the given frame.
If you use this method you are responsible for making sure you switch back to the parent
frame when done in the frame changed to. :meth:`frame` is preferred over this method and
should be used when possible. May no... | [
"Switch",
"to",
"the",
"given",
"frame",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/session.py#L308-L340 | [
"def",
"switch_to_frame",
"(",
"self",
",",
"frame",
")",
":",
"if",
"isinstance",
"(",
"frame",
",",
"Element",
")",
":",
"self",
".",
"driver",
".",
"switch_to_frame",
"(",
"frame",
")",
"self",
".",
"_scopes",
".",
"append",
"(",
"\"frame\"",
")",
"... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | Session.switch_to_window | If ``window`` is a lambda, it switches to the first window for which ``window`` returns a
value other than False or None. If a window that matches can't be found, the window will be
switched back and :exc:`WindowError` will be raised.
Args:
window (Window | lambda): The window that ... | capybara/session.py | def switch_to_window(self, window, wait=None):
"""
If ``window`` is a lambda, it switches to the first window for which ``window`` returns a
value other than False or None. If a window that matches can't be found, the window will be
switched back and :exc:`WindowError` will be raised.
... | def switch_to_window(self, window, wait=None):
"""
If ``window`` is a lambda, it switches to the first window for which ``window`` returns a
value other than False or None. If a window that matches can't be found, the window will be
switched back and :exc:`WindowError` will be raised.
... | [
"If",
"window",
"is",
"a",
"lambda",
"it",
"switches",
"to",
"the",
"first",
"window",
"for",
"which",
"window",
"returns",
"a",
"value",
"other",
"than",
"False",
"or",
"None",
".",
"If",
"a",
"window",
"that",
"matches",
"can",
"t",
"be",
"found",
"t... | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/session.py#L342-L386 | [
"def",
"switch_to_window",
"(",
"self",
",",
"window",
",",
"wait",
"=",
"None",
")",
":",
"if",
"len",
"(",
"self",
".",
"_scopes",
")",
">",
"1",
":",
"raise",
"ScopeError",
"(",
"\"`switch_to_window` is not supposed to be invoked from \"",
"\"within `scope`s, `... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | Session.window | This method does the following:
1. Switches to the given window (it can be located by window instance/lambda/string).
2. Executes the given block (within window located at previous step).
3. Switches back (this step will be invoked even if exception happens at second step).
Args:
... | capybara/session.py | def window(self, window):
"""
This method does the following:
1. Switches to the given window (it can be located by window instance/lambda/string).
2. Executes the given block (within window located at previous step).
3. Switches back (this step will be invoked even if exception... | def window(self, window):
"""
This method does the following:
1. Switches to the given window (it can be located by window instance/lambda/string).
2. Executes the given block (within window located at previous step).
3. Switches back (this step will be invoked even if exception... | [
"This",
"method",
"does",
"the",
"following",
":"
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/session.py#L389-L411 | [
"def",
"window",
"(",
"self",
",",
"window",
")",
":",
"original",
"=",
"self",
".",
"current_window",
"if",
"window",
"!=",
"original",
":",
"self",
".",
"switch_to_window",
"(",
"window",
")",
"self",
".",
"_scopes",
".",
"append",
"(",
"None",
")",
... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | Session.window_opened_by | Get the window that has been opened by the passed lambda. It will wait for it to be opened
(in the same way as other Capybara methods wait). It's better to use this method than
``windows[-1]`` `as order of windows isn't defined in some drivers`__.
__ https://dvcs.w3.org/hg/webdriver/raw-file/de... | capybara/session.py | def window_opened_by(self, trigger_func, wait=None):
"""
Get the window that has been opened by the passed lambda. It will wait for it to be opened
(in the same way as other Capybara methods wait). It's better to use this method than
``windows[-1]`` `as order of windows isn't defined in ... | def window_opened_by(self, trigger_func, wait=None):
"""
Get the window that has been opened by the passed lambda. It will wait for it to be opened
(in the same way as other Capybara methods wait). It's better to use this method than
``windows[-1]`` `as order of windows isn't defined in ... | [
"Get",
"the",
"window",
"that",
"has",
"been",
"opened",
"by",
"the",
"passed",
"lambda",
".",
"It",
"will",
"wait",
"for",
"it",
"to",
"be",
"opened",
"(",
"in",
"the",
"same",
"way",
"as",
"other",
"Capybara",
"methods",
"wait",
")",
".",
"It",
"s"... | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/session.py#L413-L445 | [
"def",
"window_opened_by",
"(",
"self",
",",
"trigger_func",
",",
"wait",
"=",
"None",
")",
":",
"old_handles",
"=",
"set",
"(",
"self",
".",
"driver",
".",
"window_handles",
")",
"trigger_func",
"(",
")",
"@",
"self",
".",
"document",
".",
"synchronize",
... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | Session.execute_script | Execute the given script, not returning a result. This is useful for scripts that return
complex objects, such as jQuery statements. ``execute_script`` should be used over
:meth:`evaluate_script` whenever possible.
Args:
script (str): A string of JavaScript to execute.
*... | capybara/session.py | def execute_script(self, script, *args):
"""
Execute the given script, not returning a result. This is useful for scripts that return
complex objects, such as jQuery statements. ``execute_script`` should be used over
:meth:`evaluate_script` whenever possible.
Args:
s... | def execute_script(self, script, *args):
"""
Execute the given script, not returning a result. This is useful for scripts that return
complex objects, such as jQuery statements. ``execute_script`` should be used over
:meth:`evaluate_script` whenever possible.
Args:
s... | [
"Execute",
"the",
"given",
"script",
"not",
"returning",
"a",
"result",
".",
"This",
"is",
"useful",
"for",
"scripts",
"that",
"return",
"complex",
"objects",
"such",
"as",
"jQuery",
"statements",
".",
"execute_script",
"should",
"be",
"used",
"over",
":",
"... | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/session.py#L447-L459 | [
"def",
"execute_script",
"(",
"self",
",",
"script",
",",
"*",
"args",
")",
":",
"args",
"=",
"[",
"arg",
".",
"base",
"if",
"isinstance",
"(",
"arg",
",",
"Base",
")",
"else",
"arg",
"for",
"arg",
"in",
"args",
"]",
"self",
".",
"driver",
".",
"... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | Session.evaluate_script | Evaluate the given JavaScript and return the result. Be careful when using this with
scripts that return complex objects, such as jQuery statements. :meth:`execute_script`
might be a better alternative.
Args:
script (str): A string of JavaScript to evaluate.
*args: Varia... | capybara/session.py | def evaluate_script(self, script, *args):
"""
Evaluate the given JavaScript and return the result. Be careful when using this with
scripts that return complex objects, such as jQuery statements. :meth:`execute_script`
might be a better alternative.
Args:
script (str)... | def evaluate_script(self, script, *args):
"""
Evaluate the given JavaScript and return the result. Be careful when using this with
scripts that return complex objects, such as jQuery statements. :meth:`execute_script`
might be a better alternative.
Args:
script (str)... | [
"Evaluate",
"the",
"given",
"JavaScript",
"and",
"return",
"the",
"result",
".",
"Be",
"careful",
"when",
"using",
"this",
"with",
"scripts",
"that",
"return",
"complex",
"objects",
"such",
"as",
"jQuery",
"statements",
".",
":",
"meth",
":",
"execute_script",... | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/session.py#L461-L477 | [
"def",
"evaluate_script",
"(",
"self",
",",
"script",
",",
"*",
"args",
")",
":",
"args",
"=",
"[",
"arg",
".",
"base",
"if",
"isinstance",
"(",
"arg",
",",
"Base",
")",
"else",
"arg",
"for",
"arg",
"in",
"args",
"]",
"result",
"=",
"self",
".",
... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | Session.accept_alert | Execute the wrapped code, accepting an alert.
Args:
text (str | RegexObject, optional): Text to match against the text in the modal.
wait (int | float, optional): Maximum time to wait for the modal to appear after
executing the wrapped code.
Raises:
... | capybara/session.py | def accept_alert(self, text=None, wait=None):
"""
Execute the wrapped code, accepting an alert.
Args:
text (str | RegexObject, optional): Text to match against the text in the modal.
wait (int | float, optional): Maximum time to wait for the modal to appear after
... | def accept_alert(self, text=None, wait=None):
"""
Execute the wrapped code, accepting an alert.
Args:
text (str | RegexObject, optional): Text to match against the text in the modal.
wait (int | float, optional): Maximum time to wait for the modal to appear after
... | [
"Execute",
"the",
"wrapped",
"code",
"accepting",
"an",
"alert",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/session.py#L497-L512 | [
"def",
"accept_alert",
"(",
"self",
",",
"text",
"=",
"None",
",",
"wait",
"=",
"None",
")",
":",
"wait",
"=",
"wait",
"or",
"capybara",
".",
"default_max_wait_time",
"with",
"self",
".",
"driver",
".",
"accept_modal",
"(",
"\"alert\"",
",",
"text",
"=",... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | Session.accept_confirm | Execute the wrapped code, accepting a confirm.
Args:
text (str | RegexObject, optional): Text to match against the text in the modal.
wait (int | float, optional): Maximum time to wait for the modal to appear after
executing the wrapped code.
Raises:
... | capybara/session.py | def accept_confirm(self, text=None, wait=None):
"""
Execute the wrapped code, accepting a confirm.
Args:
text (str | RegexObject, optional): Text to match against the text in the modal.
wait (int | float, optional): Maximum time to wait for the modal to appear after
... | def accept_confirm(self, text=None, wait=None):
"""
Execute the wrapped code, accepting a confirm.
Args:
text (str | RegexObject, optional): Text to match against the text in the modal.
wait (int | float, optional): Maximum time to wait for the modal to appear after
... | [
"Execute",
"the",
"wrapped",
"code",
"accepting",
"a",
"confirm",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/session.py#L515-L529 | [
"def",
"accept_confirm",
"(",
"self",
",",
"text",
"=",
"None",
",",
"wait",
"=",
"None",
")",
":",
"with",
"self",
".",
"driver",
".",
"accept_modal",
"(",
"\"confirm\"",
",",
"text",
"=",
"text",
",",
"wait",
"=",
"wait",
")",
":",
"yield"
] | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | Session.dismiss_confirm | Execute the wrapped code, dismissing a confirm.
Args:
text (str | RegexObject, optional): Text to match against the text in the modal.
wait (int | float, optional): Maximum time to wait for the modal to appear after
executing the wrapped code.
Raises:
... | capybara/session.py | def dismiss_confirm(self, text=None, wait=None):
"""
Execute the wrapped code, dismissing a confirm.
Args:
text (str | RegexObject, optional): Text to match against the text in the modal.
wait (int | float, optional): Maximum time to wait for the modal to appear after
... | def dismiss_confirm(self, text=None, wait=None):
"""
Execute the wrapped code, dismissing a confirm.
Args:
text (str | RegexObject, optional): Text to match against the text in the modal.
wait (int | float, optional): Maximum time to wait for the modal to appear after
... | [
"Execute",
"the",
"wrapped",
"code",
"dismissing",
"a",
"confirm",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/session.py#L532-L546 | [
"def",
"dismiss_confirm",
"(",
"self",
",",
"text",
"=",
"None",
",",
"wait",
"=",
"None",
")",
":",
"with",
"self",
".",
"driver",
".",
"dismiss_modal",
"(",
"\"confirm\"",
",",
"text",
"=",
"text",
",",
"wait",
"=",
"wait",
")",
":",
"yield"
] | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | Session.accept_prompt | Execute the wrapped code, accepting a prompt, optionally responding to the prompt.
Args:
text (str | RegexObject, optional): Text to match against the text in the modal.
response (str, optional): Response to provide to the prompt.
wait (int | float, optional): Maximum time t... | capybara/session.py | def accept_prompt(self, text=None, response=None, wait=None):
"""
Execute the wrapped code, accepting a prompt, optionally responding to the prompt.
Args:
text (str | RegexObject, optional): Text to match against the text in the modal.
response (str, optional): Response ... | def accept_prompt(self, text=None, response=None, wait=None):
"""
Execute the wrapped code, accepting a prompt, optionally responding to the prompt.
Args:
text (str | RegexObject, optional): Text to match against the text in the modal.
response (str, optional): Response ... | [
"Execute",
"the",
"wrapped",
"code",
"accepting",
"a",
"prompt",
"optionally",
"responding",
"to",
"the",
"prompt",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/session.py#L549-L564 | [
"def",
"accept_prompt",
"(",
"self",
",",
"text",
"=",
"None",
",",
"response",
"=",
"None",
",",
"wait",
"=",
"None",
")",
":",
"with",
"self",
".",
"driver",
".",
"accept_modal",
"(",
"\"prompt\"",
",",
"text",
"=",
"text",
",",
"response",
"=",
"r... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | Session.dismiss_prompt | Execute the wrapped code, dismissing a prompt.
Args:
text (str | RegexObject, optional): Text to match against the text in the modal.
wait (int | float, optional): Maximum time to wait for the modal to appear after
executing the wrapped code.
Raises:
... | capybara/session.py | def dismiss_prompt(self, text=None, wait=None):
"""
Execute the wrapped code, dismissing a prompt.
Args:
text (str | RegexObject, optional): Text to match against the text in the modal.
wait (int | float, optional): Maximum time to wait for the modal to appear after
... | def dismiss_prompt(self, text=None, wait=None):
"""
Execute the wrapped code, dismissing a prompt.
Args:
text (str | RegexObject, optional): Text to match against the text in the modal.
wait (int | float, optional): Maximum time to wait for the modal to appear after
... | [
"Execute",
"the",
"wrapped",
"code",
"dismissing",
"a",
"prompt",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/session.py#L567-L581 | [
"def",
"dismiss_prompt",
"(",
"self",
",",
"text",
"=",
"None",
",",
"wait",
"=",
"None",
")",
":",
"with",
"self",
".",
"driver",
".",
"dismiss_modal",
"(",
"\"prompt\"",
",",
"text",
"=",
"text",
",",
"wait",
"=",
"wait",
")",
":",
"yield"
] | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | Session.save_page | Save a snapshot of the page.
If invoked without arguments, it will save a file to :data:`capybara.save_path` and the
file will be given a randomly generated filename. If invoked with a relative path, the path
will be relative to :data:`capybara.save_path`.
Args:
path (str, ... | capybara/session.py | def save_page(self, path=None):
"""
Save a snapshot of the page.
If invoked without arguments, it will save a file to :data:`capybara.save_path` and the
file will be given a randomly generated filename. If invoked with a relative path, the path
will be relative to :data:`capybar... | def save_page(self, path=None):
"""
Save a snapshot of the page.
If invoked without arguments, it will save a file to :data:`capybara.save_path` and the
file will be given a randomly generated filename. If invoked with a relative path, the path
will be relative to :data:`capybar... | [
"Save",
"a",
"snapshot",
"of",
"the",
"page",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/session.py#L583-L603 | [
"def",
"save_page",
"(",
"self",
",",
"path",
"=",
"None",
")",
":",
"path",
"=",
"_prepare_path",
"(",
"path",
",",
"\"html\"",
")",
"with",
"open",
"(",
"path",
",",
"\"wb\"",
")",
"as",
"f",
":",
"f",
".",
"write",
"(",
"encode_string",
"(",
"se... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | Session.save_screenshot | Save a screenshot of the page.
If invoked without arguments, it will save a file to :data:`capybara.save_path` and the
file will be given a randomly generated filename. If invoked with a relative path, the path
will be relative to :data:`capybara.save_path`.
Args:
path (str... | capybara/session.py | def save_screenshot(self, path=None, **kwargs):
"""
Save a screenshot of the page.
If invoked without arguments, it will save a file to :data:`capybara.save_path` and the
file will be given a randomly generated filename. If invoked with a relative path, the path
will be relative... | def save_screenshot(self, path=None, **kwargs):
"""
Save a screenshot of the page.
If invoked without arguments, it will save a file to :data:`capybara.save_path` and the
file will be given a randomly generated filename. If invoked with a relative path, the path
will be relative... | [
"Save",
"a",
"screenshot",
"of",
"the",
"page",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/session.py#L605-L623 | [
"def",
"save_screenshot",
"(",
"self",
",",
"path",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"path",
"=",
"_prepare_path",
"(",
"path",
",",
"\"png\"",
")",
"self",
".",
"driver",
".",
"save_screenshot",
"(",
"path",
",",
"*",
"*",
"kwargs",
"... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | Session.reset | Reset the session (i.e., remove cookies and navigate to a blank page).
This method does not:
* accept modal dialogs if they are present (the Selenium driver does, but others may not),
* clear the browser cache/HTML 5 local storage/IndexedDB/Web SQL database/etc., or
* modify the state o... | capybara/session.py | def reset(self):
"""
Reset the session (i.e., remove cookies and navigate to a blank page).
This method does not:
* accept modal dialogs if they are present (the Selenium driver does, but others may not),
* clear the browser cache/HTML 5 local storage/IndexedDB/Web SQL database/... | def reset(self):
"""
Reset the session (i.e., remove cookies and navigate to a blank page).
This method does not:
* accept modal dialogs if they are present (the Selenium driver does, but others may not),
* clear the browser cache/HTML 5 local storage/IndexedDB/Web SQL database/... | [
"Reset",
"the",
"session",
"(",
"i",
".",
"e",
".",
"remove",
"cookies",
"and",
"navigate",
"to",
"a",
"blank",
"page",
")",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/session.py#L625-L644 | [
"def",
"reset",
"(",
"self",
")",
":",
"self",
".",
"driver",
".",
"reset",
"(",
")",
"if",
"self",
".",
"server",
":",
"self",
".",
"server",
".",
"wait_for_pending_requests",
"(",
")",
"self",
".",
"raise_server_error",
"(",
")"
] | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | Session.raise_server_error | Raise errors encountered by the server. | capybara/session.py | def raise_server_error(self):
""" Raise errors encountered by the server. """
if self.server and self.server.error:
try:
if capybara.raise_server_errors:
raise self.server.error
finally:
self.server.reset_error() | def raise_server_error(self):
""" Raise errors encountered by the server. """
if self.server and self.server.error:
try:
if capybara.raise_server_errors:
raise self.server.error
finally:
self.server.reset_error() | [
"Raise",
"errors",
"encountered",
"by",
"the",
"server",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/session.py#L646-L653 | [
"def",
"raise_server_error",
"(",
"self",
")",
":",
"if",
"self",
".",
"server",
"and",
"self",
".",
"server",
".",
"error",
":",
"try",
":",
"if",
"capybara",
".",
"raise_server_errors",
":",
"raise",
"self",
".",
"server",
".",
"error",
"finally",
":",... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | NodeFilter.matches | Returns whether the given node matches the filter rule with the given value.
Args:
node (Element): The node to filter.
value (object): The desired value with which the node should be evaluated.
Returns:
bool: Whether the given node matches. | capybara/selector/node_filter.py | def matches(self, node, value):
"""
Returns whether the given node matches the filter rule with the given value.
Args:
node (Element): The node to filter.
value (object): The desired value with which the node should be evaluated.
Returns:
bool: Wheth... | def matches(self, node, value):
"""
Returns whether the given node matches the filter rule with the given value.
Args:
node (Element): The node to filter.
value (object): The desired value with which the node should be evaluated.
Returns:
bool: Wheth... | [
"Returns",
"whether",
"the",
"given",
"node",
"matches",
"the",
"filter",
"rule",
"with",
"the",
"given",
"value",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/selector/node_filter.py#L7-L34 | [
"def",
"matches",
"(",
"self",
",",
"node",
",",
"value",
")",
":",
"if",
"self",
".",
"skip",
"(",
"value",
")",
":",
"return",
"True",
"if",
"not",
"self",
".",
"_valid_value",
"(",
"value",
")",
":",
"msg",
"=",
"\"Invalid value {value} passed to filt... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | get_version | str: The package version. | setup.py | def get_version():
""" str: The package version. """
global_vars = {}
# Compile and execute the individual file to prevent
# the package from being automatically loaded.
source = read(os.path.join("capybara", "version.py"))
code = compile(source, "version.py", "exec")
exec(code, global_var... | def get_version():
""" str: The package version. """
global_vars = {}
# Compile and execute the individual file to prevent
# the package from being automatically loaded.
source = read(os.path.join("capybara", "version.py"))
code = compile(source, "version.py", "exec")
exec(code, global_var... | [
"str",
":",
"The",
"package",
"version",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/setup.py#L41-L52 | [
"def",
"get_version",
"(",
")",
":",
"global_vars",
"=",
"{",
"}",
"# Compile and execute the individual file to prevent",
"# the package from being automatically loaded.",
"source",
"=",
"read",
"(",
"os",
".",
"path",
".",
"join",
"(",
"\"capybara\"",
",",
"\"version.... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | TitleQuery.resolves_for | Resolves this query relative to the given node.
Args:
node (node.Document): The node to be evaluated.
Returns:
bool: Whether the given node matches this query. | capybara/queries/title_query.py | def resolves_for(self, node):
"""
Resolves this query relative to the given node.
Args:
node (node.Document): The node to be evaluated.
Returns:
bool: Whether the given node matches this query.
"""
self.actual_title = normalize_text(node.title)
... | def resolves_for(self, node):
"""
Resolves this query relative to the given node.
Args:
node (node.Document): The node to be evaluated.
Returns:
bool: Whether the given node matches this query.
"""
self.actual_title = normalize_text(node.title)
... | [
"Resolves",
"this",
"query",
"relative",
"to",
"the",
"given",
"node",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/queries/title_query.py#L28-L40 | [
"def",
"resolves_for",
"(",
"self",
",",
"node",
")",
":",
"self",
".",
"actual_title",
"=",
"normalize_text",
"(",
"node",
".",
"title",
")",
"return",
"bool",
"(",
"self",
".",
"search_regexp",
".",
"search",
"(",
"self",
".",
"actual_title",
")",
")"
... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | Base.frame_title | str: The title for the current frame. | capybara/driver/base.py | def frame_title(self):
""" str: The title for the current frame. """
elements = self._find_xpath("/html/head/title")
titles = [element.all_text for element in elements]
return titles[0] if len(titles) else "" | def frame_title(self):
""" str: The title for the current frame. """
elements = self._find_xpath("/html/head/title")
titles = [element.all_text for element in elements]
return titles[0] if len(titles) else "" | [
"str",
":",
"The",
"title",
"for",
"the",
"current",
"frame",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/driver/base.py#L38-L42 | [
"def",
"frame_title",
"(",
"self",
")",
":",
"elements",
"=",
"self",
".",
"_find_xpath",
"(",
"\"/html/head/title\"",
")",
"titles",
"=",
"[",
"element",
".",
"all_text",
"for",
"element",
"in",
"elements",
"]",
"return",
"titles",
"[",
"0",
"]",
"if",
... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | Simple.value | str: The value of the form element. | capybara/node/simple.py | def value(self):
""" str: The value of the form element. """
if self.tag_name == "textarea":
return inner_content(self.native)
elif self.tag_name == "select":
if self["multiple"] == "multiple":
selected_options = self._find_xpath(".//option[@selected='sel... | def value(self):
""" str: The value of the form element. """
if self.tag_name == "textarea":
return inner_content(self.native)
elif self.tag_name == "select":
if self["multiple"] == "multiple":
selected_options = self._find_xpath(".//option[@selected='sel... | [
"str",
":",
"The",
"value",
"of",
"the",
"form",
"element",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/node/simple.py#L60-L77 | [
"def",
"value",
"(",
"self",
")",
":",
"if",
"self",
".",
"tag_name",
"==",
"\"textarea\"",
":",
"return",
"inner_content",
"(",
"self",
".",
"native",
")",
"elif",
"self",
".",
"tag_name",
"==",
"\"select\"",
":",
"if",
"self",
"[",
"\"multiple\"",
"]",... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | add_filter_set | Builds and registers a global :class:`FilterSet`.
Args:
name (str): The name of the set.
Yields:
FilterSetFactory: A configurable factory for building a :class:`FilterSet`. | capybara/selector/filter_set.py | def add_filter_set(name):
"""
Builds and registers a global :class:`FilterSet`.
Args:
name (str): The name of the set.
Yields:
FilterSetFactory: A configurable factory for building a :class:`FilterSet`.
"""
factory = FilterSetFactory(name)
yield factory
filter_sets[nam... | def add_filter_set(name):
"""
Builds and registers a global :class:`FilterSet`.
Args:
name (str): The name of the set.
Yields:
FilterSetFactory: A configurable factory for building a :class:`FilterSet`.
"""
factory = FilterSetFactory(name)
yield factory
filter_sets[nam... | [
"Builds",
"and",
"registers",
"a",
"global",
":",
"class",
":",
"FilterSet",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/selector/filter_set.py#L89-L102 | [
"def",
"add_filter_set",
"(",
"name",
")",
":",
"factory",
"=",
"FilterSetFactory",
"(",
"name",
")",
"yield",
"factory",
"filter_sets",
"[",
"name",
"]",
"=",
"factory",
".",
"build_filter_set",
"(",
")"
] | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | current_session | Returns the :class:`Session` for the current driver and app, instantiating one if needed.
Returns:
Session: The :class:`Session` for the current driver and app. | capybara/__init__.py | def current_session():
"""
Returns the :class:`Session` for the current driver and app, instantiating one if needed.
Returns:
Session: The :class:`Session` for the current driver and app.
"""
driver = current_driver or default_driver
session_key = "{driver}:{session}:{app}".format(
... | def current_session():
"""
Returns the :class:`Session` for the current driver and app, instantiating one if needed.
Returns:
Session: The :class:`Session` for the current driver and app.
"""
driver = current_driver or default_driver
session_key = "{driver}:{session}:{app}".format(
... | [
"Returns",
"the",
":",
"class",
":",
"Session",
"for",
"the",
"current",
"driver",
"and",
"app",
"instantiating",
"one",
"if",
"needed",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/__init__.py#L170-L189 | [
"def",
"current_session",
"(",
")",
":",
"driver",
"=",
"current_driver",
"or",
"default_driver",
"session_key",
"=",
"\"{driver}:{session}:{app}\"",
".",
"format",
"(",
"driver",
"=",
"driver",
",",
"session",
"=",
"session_name",
",",
"app",
"=",
"str",
"(",
... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | MatchersMixin.has_all_of_selectors | Checks if allof the provided selectors are present on the given page or descendants of the
current node. If options are provided, the assertion will check that each locator is present
with those options as well (other than ``wait``). ::
page.has_all_of_selectors("custom", "Tom", "Joe", visi... | capybara/node/matchers.py | def has_all_of_selectors(self, selector, *locators, **kwargs):
"""
Checks if allof the provided selectors are present on the given page or descendants of the
current node. If options are provided, the assertion will check that each locator is present
with those options as well (other tha... | def has_all_of_selectors(self, selector, *locators, **kwargs):
"""
Checks if allof the provided selectors are present on the given page or descendants of the
current node. If options are provided, the assertion will check that each locator is present
with those options as well (other tha... | [
"Checks",
"if",
"allof",
"the",
"provided",
"selectors",
"are",
"present",
"on",
"the",
"given",
"page",
"or",
"descendants",
"of",
"the",
"current",
"node",
".",
"If",
"options",
"are",
"provided",
"the",
"assertion",
"will",
"check",
"that",
"each",
"locat... | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/node/matchers.py#L97-L121 | [
"def",
"has_all_of_selectors",
"(",
"self",
",",
"selector",
",",
"*",
"locators",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"assert_all_of_selectors",
"(",
"selector",
",",
"*",
"locators",
",",
"*",
"*",
"kwargs",
")"
] | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | MatchersMixin.has_none_of_selectors | Checks if none of the provided selectors are present on the given page or descendants of the
current node. If options are provided, the assertion will check that each locator is present
with those options as well (other than ``wait``). ::
page.has_none_of_selectors("custom", "Tom", "Joe", v... | capybara/node/matchers.py | def has_none_of_selectors(self, selector, *locators, **kwargs):
"""
Checks if none of the provided selectors are present on the given page or descendants of the
current node. If options are provided, the assertion will check that each locator is present
with those options as well (other ... | def has_none_of_selectors(self, selector, *locators, **kwargs):
"""
Checks if none of the provided selectors are present on the given page or descendants of the
current node. If options are provided, the assertion will check that each locator is present
with those options as well (other ... | [
"Checks",
"if",
"none",
"of",
"the",
"provided",
"selectors",
"are",
"present",
"on",
"the",
"given",
"page",
"or",
"descendants",
"of",
"the",
"current",
"node",
".",
"If",
"options",
"are",
"provided",
"the",
"assertion",
"will",
"check",
"that",
"each",
... | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/node/matchers.py#L124-L148 | [
"def",
"has_none_of_selectors",
"(",
"self",
",",
"selector",
",",
"*",
"locators",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"assert_none_of_selectors",
"(",
"selector",
",",
"*",
"locators",
",",
"*",
"*",
"kwargs",
")"
] | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | MatchersMixin.assert_selector | Asserts that a given selector is on the page or a descendant of the current node. ::
page.assert_selector("p#foo")
By default it will check if the expression occurs at least once, but a different number can
be specified. ::
page.assert_selector("p.foo", count=4)
This ... | capybara/node/matchers.py | def assert_selector(self, *args, **kwargs):
"""
Asserts that a given selector is on the page or a descendant of the current node. ::
page.assert_selector("p#foo")
By default it will check if the expression occurs at least once, but a different number can
be specified. ::
... | def assert_selector(self, *args, **kwargs):
"""
Asserts that a given selector is on the page or a descendant of the current node. ::
page.assert_selector("p#foo")
By default it will check if the expression occurs at least once, but a different number can
be specified. ::
... | [
"Asserts",
"that",
"a",
"given",
"selector",
"is",
"on",
"the",
"page",
"or",
"a",
"descendant",
"of",
"the",
"current",
"node",
".",
"::"
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/node/matchers.py#L181-L233 | [
"def",
"assert_selector",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"query",
"=",
"SelectorQuery",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"@",
"self",
".",
"synchronize",
"(",
"wait",
"=",
"query",
".",
"wait",
")",... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | MatchersMixin.assert_style | Asserts that an element has the specified CSS styles. ::
element.assert_style({"color": "rgb(0,0,255)", "font-size": re.compile(r"px")})
Args:
styles (Dict[str, str | RegexObject]): The expected styles.
Returns:
True
Raises:
ExpectationNotMet: ... | capybara/node/matchers.py | def assert_style(self, styles, **kwargs):
"""
Asserts that an element has the specified CSS styles. ::
element.assert_style({"color": "rgb(0,0,255)", "font-size": re.compile(r"px")})
Args:
styles (Dict[str, str | RegexObject]): The expected styles.
Returns:
... | def assert_style(self, styles, **kwargs):
"""
Asserts that an element has the specified CSS styles. ::
element.assert_style({"color": "rgb(0,0,255)", "font-size": re.compile(r"px")})
Args:
styles (Dict[str, str | RegexObject]): The expected styles.
Returns:
... | [
"Asserts",
"that",
"an",
"element",
"has",
"the",
"specified",
"CSS",
"styles",
".",
"::"
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/node/matchers.py#L235-L260 | [
"def",
"assert_style",
"(",
"self",
",",
"styles",
",",
"*",
"*",
"kwargs",
")",
":",
"query",
"=",
"StyleQuery",
"(",
"styles",
",",
"*",
"*",
"kwargs",
")",
"@",
"self",
".",
"synchronize",
"(",
"wait",
"=",
"query",
".",
"wait",
")",
"def",
"ass... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | MatchersMixin.assert_all_of_selectors | Asserts that all of the provided selectors are present on the given page or descendants of
the current node. If options are provided, the assertion will check that each locator is
present with those options as well (other than ``wait``). ::
page.assert_all_of_selectors("custom", "Tom", "Joe... | capybara/node/matchers.py | def assert_all_of_selectors(self, selector, *locators, **kwargs):
"""
Asserts that all of the provided selectors are present on the given page or descendants of
the current node. If options are provided, the assertion will check that each locator is
present with those options as well (ot... | def assert_all_of_selectors(self, selector, *locators, **kwargs):
"""
Asserts that all of the provided selectors are present on the given page or descendants of
the current node. If options are provided, the assertion will check that each locator is
present with those options as well (ot... | [
"Asserts",
"that",
"all",
"of",
"the",
"provided",
"selectors",
"are",
"present",
"on",
"the",
"given",
"page",
"or",
"descendants",
"of",
"the",
"current",
"node",
".",
"If",
"options",
"are",
"provided",
"the",
"assertion",
"will",
"check",
"that",
"each",... | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/node/matchers.py#L262-L299 | [
"def",
"assert_all_of_selectors",
"(",
"self",
",",
"selector",
",",
"*",
"locators",
",",
"*",
"*",
"kwargs",
")",
":",
"wait",
"=",
"kwargs",
"[",
"'wait'",
"]",
"if",
"'wait'",
"in",
"kwargs",
"else",
"capybara",
".",
"default_max_wait_time",
"if",
"not... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | MatchersMixin.assert_none_of_selectors | Asserts that none of the provided selectors are present on the given page or descendants of
the current node. If options are provided, the assertion will check that each locator is
present with those options as well (other than ``wait``). ::
page.assert_none_of_selectors("custom", "Tom", "J... | capybara/node/matchers.py | def assert_none_of_selectors(self, selector, *locators, **kwargs):
"""
Asserts that none of the provided selectors are present on the given page or descendants of
the current node. If options are provided, the assertion will check that each locator is
present with those options as well (... | def assert_none_of_selectors(self, selector, *locators, **kwargs):
"""
Asserts that none of the provided selectors are present on the given page or descendants of
the current node. If options are provided, the assertion will check that each locator is
present with those options as well (... | [
"Asserts",
"that",
"none",
"of",
"the",
"provided",
"selectors",
"are",
"present",
"on",
"the",
"given",
"page",
"or",
"descendants",
"of",
"the",
"current",
"node",
".",
"If",
"options",
"are",
"provided",
"the",
"assertion",
"will",
"check",
"that",
"each"... | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/node/matchers.py#L301-L337 | [
"def",
"assert_none_of_selectors",
"(",
"self",
",",
"selector",
",",
"*",
"locators",
",",
"*",
"*",
"kwargs",
")",
":",
"wait",
"=",
"kwargs",
"[",
"'wait'",
"]",
"if",
"'wait'",
"in",
"kwargs",
"else",
"capybara",
".",
"default_max_wait_time",
"if",
"no... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | MatchersMixin.assert_no_selector | Asserts that a given selector is not on the page or a descendant of the current node. Usage
is identical to :meth:`assert_selector`.
Query options such as ``count``, ``minimum``, and ``between`` are considered to be an
integral part of the selector. This will return True, for example, if a page... | capybara/node/matchers.py | def assert_no_selector(self, *args, **kwargs):
"""
Asserts that a given selector is not on the page or a descendant of the current node. Usage
is identical to :meth:`assert_selector`.
Query options such as ``count``, ``minimum``, and ``between`` are considered to be an
integral ... | def assert_no_selector(self, *args, **kwargs):
"""
Asserts that a given selector is not on the page or a descendant of the current node. Usage
is identical to :meth:`assert_selector`.
Query options such as ``count``, ``minimum``, and ``between`` are considered to be an
integral ... | [
"Asserts",
"that",
"a",
"given",
"selector",
"is",
"not",
"on",
"the",
"page",
"or",
"a",
"descendant",
"of",
"the",
"current",
"node",
".",
"Usage",
"is",
"identical",
"to",
":",
"meth",
":",
"assert_selector",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/node/matchers.py#L339-L375 | [
"def",
"assert_no_selector",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"query",
"=",
"SelectorQuery",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"@",
"self",
".",
"synchronize",
"(",
"wait",
"=",
"query",
".",
"wait",
"... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | MatchersMixin.assert_matches_selector | Asserts that the current node matches a given selector. ::
node.assert_matches_selector("p#foo")
node.assert_matches_selector("xpath", "//p[@id='foo']")
It also accepts all options that :meth:`find_all` accepts, such as ``text`` and
``visible``. ::
node.assert_matc... | capybara/node/matchers.py | def assert_matches_selector(self, *args, **kwargs):
"""
Asserts that the current node matches a given selector. ::
node.assert_matches_selector("p#foo")
node.assert_matches_selector("xpath", "//p[@id='foo']")
It also accepts all options that :meth:`find_all` accepts, su... | def assert_matches_selector(self, *args, **kwargs):
"""
Asserts that the current node matches a given selector. ::
node.assert_matches_selector("p#foo")
node.assert_matches_selector("xpath", "//p[@id='foo']")
It also accepts all options that :meth:`find_all` accepts, su... | [
"Asserts",
"that",
"the",
"current",
"node",
"matches",
"a",
"given",
"selector",
".",
"::"
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/node/matchers.py#L380-L414 | [
"def",
"assert_matches_selector",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"query",
"=",
"SelectorQuery",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"@",
"self",
".",
"synchronize",
"(",
"wait",
"=",
"query",
".",
"wait"... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | MatchersMixin.has_checked_field | Checks if the page or current node has a radio button or checkbox with the given label,
value, or id, that is currently checked.
Args:
locator (str): The label, name, or id of a checked field.
**kwargs: Arbitrary keyword arguments for :class:`SelectorQuery`.
Returns:
... | capybara/node/matchers.py | def has_checked_field(self, locator, **kwargs):
"""
Checks if the page or current node has a radio button or checkbox with the given label,
value, or id, that is currently checked.
Args:
locator (str): The label, name, or id of a checked field.
**kwargs: Arbitrar... | def has_checked_field(self, locator, **kwargs):
"""
Checks if the page or current node has a radio button or checkbox with the given label,
value, or id, that is currently checked.
Args:
locator (str): The label, name, or id of a checked field.
**kwargs: Arbitrar... | [
"Checks",
"if",
"the",
"page",
"or",
"current",
"node",
"has",
"a",
"radio",
"button",
"or",
"checkbox",
"with",
"the",
"given",
"label",
"value",
"or",
"id",
"that",
"is",
"currently",
"checked",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/node/matchers.py#L614-L628 | [
"def",
"has_checked_field",
"(",
"self",
",",
"locator",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"[",
"\"checked\"",
"]",
"=",
"True",
"return",
"self",
".",
"has_selector",
"(",
"\"field\"",
",",
"locator",
",",
"*",
"*",
"kwargs",
")"
] | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | MatchersMixin.has_no_checked_field | Checks if the page or current node has no radio button or checkbox with the given label,
value, or id that is currently checked.
Args:
locator (str): The label, name, or id of a checked field.
**kwargs: Arbitrary keyword arguments for :class:`SelectorQuery`.
Returns:
... | capybara/node/matchers.py | def has_no_checked_field(self, locator, **kwargs):
"""
Checks if the page or current node has no radio button or checkbox with the given label,
value, or id that is currently checked.
Args:
locator (str): The label, name, or id of a checked field.
**kwargs: Arbit... | def has_no_checked_field(self, locator, **kwargs):
"""
Checks if the page or current node has no radio button or checkbox with the given label,
value, or id that is currently checked.
Args:
locator (str): The label, name, or id of a checked field.
**kwargs: Arbit... | [
"Checks",
"if",
"the",
"page",
"or",
"current",
"node",
"has",
"no",
"radio",
"button",
"or",
"checkbox",
"with",
"the",
"given",
"label",
"value",
"or",
"id",
"that",
"is",
"currently",
"checked",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/node/matchers.py#L630-L644 | [
"def",
"has_no_checked_field",
"(",
"self",
",",
"locator",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"[",
"\"checked\"",
"]",
"=",
"True",
"return",
"self",
".",
"has_no_selector",
"(",
"\"field\"",
",",
"locator",
",",
"*",
"*",
"kwargs",
")"
] | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | MatchersMixin.has_unchecked_field | Checks if the page or current node has a radio button or checkbox with the given label,
value, or id, that is currently unchecked.
Args:
locator (str): The label, name, or id of an unchecked field.
**kwargs: Arbitrary keyword arguments for :class:`SelectorQuery`.
Return... | capybara/node/matchers.py | def has_unchecked_field(self, locator, **kwargs):
"""
Checks if the page or current node has a radio button or checkbox with the given label,
value, or id, that is currently unchecked.
Args:
locator (str): The label, name, or id of an unchecked field.
**kwargs: A... | def has_unchecked_field(self, locator, **kwargs):
"""
Checks if the page or current node has a radio button or checkbox with the given label,
value, or id, that is currently unchecked.
Args:
locator (str): The label, name, or id of an unchecked field.
**kwargs: A... | [
"Checks",
"if",
"the",
"page",
"or",
"current",
"node",
"has",
"a",
"radio",
"button",
"or",
"checkbox",
"with",
"the",
"given",
"label",
"value",
"or",
"id",
"that",
"is",
"currently",
"unchecked",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/node/matchers.py#L784-L798 | [
"def",
"has_unchecked_field",
"(",
"self",
",",
"locator",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"[",
"\"checked\"",
"]",
"=",
"False",
"return",
"self",
".",
"has_selector",
"(",
"\"field\"",
",",
"locator",
",",
"*",
"*",
"kwargs",
")"
] | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | MatchersMixin.has_no_unchecked_field | Checks if the page or current node has no radio button or checkbox with the given label,
value, or id, that is currently unchecked.
Args:
locator (str): The label, name, or id of an unchecked field.
**kwargs: Arbitrary keyword arguments for :class:`SelectorQuery`.
Retur... | capybara/node/matchers.py | def has_no_unchecked_field(self, locator, **kwargs):
"""
Checks if the page or current node has no radio button or checkbox with the given label,
value, or id, that is currently unchecked.
Args:
locator (str): The label, name, or id of an unchecked field.
**kwarg... | def has_no_unchecked_field(self, locator, **kwargs):
"""
Checks if the page or current node has no radio button or checkbox with the given label,
value, or id, that is currently unchecked.
Args:
locator (str): The label, name, or id of an unchecked field.
**kwarg... | [
"Checks",
"if",
"the",
"page",
"or",
"current",
"node",
"has",
"no",
"radio",
"button",
"or",
"checkbox",
"with",
"the",
"given",
"label",
"value",
"or",
"id",
"that",
"is",
"currently",
"unchecked",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/node/matchers.py#L800-L814 | [
"def",
"has_no_unchecked_field",
"(",
"self",
",",
"locator",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"[",
"\"checked\"",
"]",
"=",
"False",
"return",
"self",
".",
"has_no_selector",
"(",
"\"field\"",
",",
"locator",
",",
"*",
"*",
"kwargs",
")"
] | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | MatchersMixin.assert_text | Asserts that the page or current node has the given text content, ignoring any HTML tags.
Args:
*args: Variable length argument list for :class:`TextQuery`.
**kwargs: Arbitrary keyword arguments for :class:`TextQuery`.
Returns:
True
Raises:
Expe... | capybara/node/matchers.py | def assert_text(self, *args, **kwargs):
"""
Asserts that the page or current node has the given text content, ignoring any HTML tags.
Args:
*args: Variable length argument list for :class:`TextQuery`.
**kwargs: Arbitrary keyword arguments for :class:`TextQuery`.
... | def assert_text(self, *args, **kwargs):
"""
Asserts that the page or current node has the given text content, ignoring any HTML tags.
Args:
*args: Variable length argument list for :class:`TextQuery`.
**kwargs: Arbitrary keyword arguments for :class:`TextQuery`.
... | [
"Asserts",
"that",
"the",
"page",
"or",
"current",
"node",
"has",
"the",
"given",
"text",
"content",
"ignoring",
"any",
"HTML",
"tags",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/node/matchers.py#L816-L843 | [
"def",
"assert_text",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"query",
"=",
"TextQuery",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"@",
"self",
".",
"synchronize",
"(",
"wait",
"=",
"query",
".",
"wait",
")",
"def"... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | MatchersMixin.assert_no_text | Asserts that the page or current node doesn't have the given text content, ignoring any
HTML tags.
Args:
*args: Variable length argument list for :class:`TextQuery`.
**kwargs: Arbitrary keyword arguments for :class:`TextQuery`.
Returns:
True
Raises:... | capybara/node/matchers.py | def assert_no_text(self, *args, **kwargs):
"""
Asserts that the page or current node doesn't have the given text content, ignoring any
HTML tags.
Args:
*args: Variable length argument list for :class:`TextQuery`.
**kwargs: Arbitrary keyword arguments for :class:`... | def assert_no_text(self, *args, **kwargs):
"""
Asserts that the page or current node doesn't have the given text content, ignoring any
HTML tags.
Args:
*args: Variable length argument list for :class:`TextQuery`.
**kwargs: Arbitrary keyword arguments for :class:`... | [
"Asserts",
"that",
"the",
"page",
"or",
"current",
"node",
"doesn",
"t",
"have",
"the",
"given",
"text",
"content",
"ignoring",
"any",
"HTML",
"tags",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/node/matchers.py#L845-L873 | [
"def",
"assert_no_text",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"query",
"=",
"TextQuery",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"@",
"self",
".",
"synchronize",
"(",
"wait",
"=",
"query",
".",
"wait",
")",
"d... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | DocumentMatchersMixin.assert_title | Asserts that the page has the given title.
Args:
title (str | RegexObject): The string or regex that the title should match.
**kwargs: Arbitrary keyword arguments for :class:`TitleQuery`.
Returns:
True
Raises:
ExpectationNotMet: If the assertion... | capybara/node/document_matchers.py | def assert_title(self, title, **kwargs):
"""
Asserts that the page has the given title.
Args:
title (str | RegexObject): The string or regex that the title should match.
**kwargs: Arbitrary keyword arguments for :class:`TitleQuery`.
Returns:
True
... | def assert_title(self, title, **kwargs):
"""
Asserts that the page has the given title.
Args:
title (str | RegexObject): The string or regex that the title should match.
**kwargs: Arbitrary keyword arguments for :class:`TitleQuery`.
Returns:
True
... | [
"Asserts",
"that",
"the",
"page",
"has",
"the",
"given",
"title",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/node/document_matchers.py#L6-L30 | [
"def",
"assert_title",
"(",
"self",
",",
"title",
",",
"*",
"*",
"kwargs",
")",
":",
"query",
"=",
"TitleQuery",
"(",
"title",
",",
"*",
"*",
"kwargs",
")",
"@",
"self",
".",
"synchronize",
"(",
"wait",
"=",
"query",
".",
"wait",
")",
"def",
"asser... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | DocumentMatchersMixin.assert_no_title | Asserts that the page doesn't have the given title.
Args:
title (str | RegexObject): The string that the title should include.
**kwargs: Arbitrary keyword arguments for :class:`TitleQuery`.
Returns:
True
Raises:
ExpectationNotMet: If the asserti... | capybara/node/document_matchers.py | def assert_no_title(self, title, **kwargs):
"""
Asserts that the page doesn't have the given title.
Args:
title (str | RegexObject): The string that the title should include.
**kwargs: Arbitrary keyword arguments for :class:`TitleQuery`.
Returns:
Tru... | def assert_no_title(self, title, **kwargs):
"""
Asserts that the page doesn't have the given title.
Args:
title (str | RegexObject): The string that the title should include.
**kwargs: Arbitrary keyword arguments for :class:`TitleQuery`.
Returns:
Tru... | [
"Asserts",
"that",
"the",
"page",
"doesn",
"t",
"have",
"the",
"given",
"title",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/node/document_matchers.py#L32-L56 | [
"def",
"assert_no_title",
"(",
"self",
",",
"title",
",",
"*",
"*",
"kwargs",
")",
":",
"query",
"=",
"TitleQuery",
"(",
"title",
",",
"*",
"*",
"kwargs",
")",
"@",
"self",
".",
"synchronize",
"(",
"wait",
"=",
"query",
".",
"wait",
")",
"def",
"as... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | DocumentMatchersMixin.has_title | Checks if the page has the given title.
Args:
title (str | RegexObject): The string or regex that the title should match.
**kwargs: Arbitrary keyword arguments for :class:`TitleQuery`.
Returns:
bool: Whether it matches. | capybara/node/document_matchers.py | def has_title(self, title, **kwargs):
"""
Checks if the page has the given title.
Args:
title (str | RegexObject): The string or regex that the title should match.
**kwargs: Arbitrary keyword arguments for :class:`TitleQuery`.
Returns:
bool: Whether ... | def has_title(self, title, **kwargs):
"""
Checks if the page has the given title.
Args:
title (str | RegexObject): The string or regex that the title should match.
**kwargs: Arbitrary keyword arguments for :class:`TitleQuery`.
Returns:
bool: Whether ... | [
"Checks",
"if",
"the",
"page",
"has",
"the",
"given",
"title",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/node/document_matchers.py#L58-L74 | [
"def",
"has_title",
"(",
"self",
",",
"title",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"self",
".",
"assert_title",
"(",
"title",
",",
"*",
"*",
"kwargs",
")",
"return",
"True",
"except",
"ExpectationNotMet",
":",
"return",
"False"
] | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | DocumentMatchersMixin.has_no_title | Checks if the page doesn't have the given title.
Args:
title (str | RegexObject): The string that the title should include.
**kwargs: Arbitrary keyword arguments for :class:`TitleQuery`.
Returns:
bool: Whether it doesn't match. | capybara/node/document_matchers.py | def has_no_title(self, title, **kwargs):
"""
Checks if the page doesn't have the given title.
Args:
title (str | RegexObject): The string that the title should include.
**kwargs: Arbitrary keyword arguments for :class:`TitleQuery`.
Returns:
bool: Whe... | def has_no_title(self, title, **kwargs):
"""
Checks if the page doesn't have the given title.
Args:
title (str | RegexObject): The string that the title should include.
**kwargs: Arbitrary keyword arguments for :class:`TitleQuery`.
Returns:
bool: Whe... | [
"Checks",
"if",
"the",
"page",
"doesn",
"t",
"have",
"the",
"given",
"title",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/node/document_matchers.py#L76-L92 | [
"def",
"has_no_title",
"(",
"self",
",",
"title",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"self",
".",
"assert_no_title",
"(",
"title",
",",
"*",
"*",
"kwargs",
")",
"return",
"True",
"except",
"ExpectationNotMet",
":",
"return",
"False"
] | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | FindersMixin.find_all | Find all elements on the page matching the given selector and options.
Both XPath and CSS expressions are supported, but Capybara does not try to automatically
distinguish between them. The following statements are equivalent::
page.find_all("css", "a#person_123")
page.find_all... | capybara/node/finders.py | def find_all(self, *args, **kwargs):
"""
Find all elements on the page matching the given selector and options.
Both XPath and CSS expressions are supported, but Capybara does not try to automatically
distinguish between them. The following statements are equivalent::
page.... | def find_all(self, *args, **kwargs):
"""
Find all elements on the page matching the given selector and options.
Both XPath and CSS expressions are supported, but Capybara does not try to automatically
distinguish between them. The following statements are equivalent::
page.... | [
"Find",
"all",
"elements",
"on",
"the",
"page",
"matching",
"the",
"given",
"selector",
"and",
"options",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/node/finders.py#L150-L208 | [
"def",
"find_all",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"query",
"=",
"SelectorQuery",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"@",
"self",
".",
"synchronize",
"(",
"wait",
"=",
"query",
".",
"wait",
")",
"def... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | FindersMixin.find_first | Find the first element on the page matching the given selector and options, or None if no
element matches.
By default, no waiting behavior occurs. However, if ``capybara.wait_on_first_by_default``
is set to true, it will trigger Capybara's waiting behavior for a minimum of 1 matching
el... | capybara/node/finders.py | def find_first(self, *args, **kwargs):
"""
Find the first element on the page matching the given selector and options, or None if no
element matches.
By default, no waiting behavior occurs. However, if ``capybara.wait_on_first_by_default``
is set to true, it will trigger Capybar... | def find_first(self, *args, **kwargs):
"""
Find the first element on the page matching the given selector and options, or None if no
element matches.
By default, no waiting behavior occurs. However, if ``capybara.wait_on_first_by_default``
is set to true, it will trigger Capybar... | [
"Find",
"the",
"first",
"element",
"on",
"the",
"page",
"matching",
"the",
"given",
"selector",
"and",
"options",
"or",
"None",
"if",
"no",
"element",
"matches",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/node/finders.py#L210-L234 | [
"def",
"find_first",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"capybara",
".",
"wait_on_first_by_default",
":",
"kwargs",
".",
"setdefault",
"(",
"\"minimum\"",
",",
"1",
")",
"try",
":",
"result",
"=",
"self",
".",
"find... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | TextQuery.resolve_for | Resolves this query relative to the given node.
Args:
node (node.Base): The node to be evaluated.
Returns:
int: The number of matches found. | capybara/queries/text_query.py | def resolve_for(self, node):
"""
Resolves this query relative to the given node.
Args:
node (node.Base): The node to be evaluated.
Returns:
int: The number of matches found.
"""
self.node = node
self.actual_text = normalize_text(
... | def resolve_for(self, node):
"""
Resolves this query relative to the given node.
Args:
node (node.Base): The node to be evaluated.
Returns:
int: The number of matches found.
"""
self.node = node
self.actual_text = normalize_text(
... | [
"Resolves",
"this",
"query",
"relative",
"to",
"the",
"given",
"node",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/queries/text_query.py#L68-L84 | [
"def",
"resolve_for",
"(",
"self",
",",
"node",
")",
":",
"self",
".",
"node",
"=",
"node",
"self",
".",
"actual_text",
"=",
"normalize_text",
"(",
"node",
".",
"visible_text",
"if",
"self",
".",
"query_type",
"==",
"\"visible\"",
"else",
"node",
".",
"a... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | inner_content | Returns the inner content of a given XML node, including tags.
Args:
node (lxml.etree.Element): The node whose inner content is desired.
Returns:
str: The inner content of the node. | capybara/utils.py | def inner_content(node):
"""
Returns the inner content of a given XML node, including tags.
Args:
node (lxml.etree.Element): The node whose inner content is desired.
Returns:
str: The inner content of the node.
"""
from lxml import etree
# Include text content at the star... | def inner_content(node):
"""
Returns the inner content of a given XML node, including tags.
Args:
node (lxml.etree.Element): The node whose inner content is desired.
Returns:
str: The inner content of the node.
"""
from lxml import etree
# Include text content at the star... | [
"Returns",
"the",
"inner",
"content",
"of",
"a",
"given",
"XML",
"node",
"including",
"tags",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/utils.py#L75-L99 | [
"def",
"inner_content",
"(",
"node",
")",
":",
"from",
"lxml",
"import",
"etree",
"# Include text content at the start of the node.",
"parts",
"=",
"[",
"node",
".",
"text",
"]",
"for",
"child",
"in",
"node",
".",
"getchildren",
"(",
")",
":",
"# Include the chi... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
test | inner_text | Returns the inner text of a given XML node, excluding tags.
Args:
node: (lxml.etree.Element): The node whose inner text is desired.
Returns:
str: The inner text of the node. | capybara/utils.py | def inner_text(node):
"""
Returns the inner text of a given XML node, excluding tags.
Args:
node: (lxml.etree.Element): The node whose inner text is desired.
Returns:
str: The inner text of the node.
"""
from lxml import etree
# Include text content at the start of the no... | def inner_text(node):
"""
Returns the inner text of a given XML node, excluding tags.
Args:
node: (lxml.etree.Element): The node whose inner text is desired.
Returns:
str: The inner text of the node.
"""
from lxml import etree
# Include text content at the start of the no... | [
"Returns",
"the",
"inner",
"text",
"of",
"a",
"given",
"XML",
"node",
"excluding",
"tags",
"."
] | elliterate/capybara.py | python | https://github.com/elliterate/capybara.py/blob/0c6ae449cc37e4445ec3cd6af95674533beedc6c/capybara/utils.py#L102-L126 | [
"def",
"inner_text",
"(",
"node",
")",
":",
"from",
"lxml",
"import",
"etree",
"# Include text content at the start of the node.",
"parts",
"=",
"[",
"node",
".",
"text",
"]",
"for",
"child",
"in",
"node",
".",
"getchildren",
"(",
")",
":",
"# Include the raw te... | 0c6ae449cc37e4445ec3cd6af95674533beedc6c |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.