Search is not available for this dataset
identifier
stringlengths
1
155
parameters
stringlengths
2
6.09k
docstring
stringlengths
11
63.4k
docstring_summary
stringlengths
0
63.4k
function
stringlengths
29
99.8k
function_tokens
list
start_point
list
end_point
list
language
stringclasses
1 value
docstring_language
stringlengths
2
7
docstring_language_predictions
stringlengths
18
23
is_langid_reliable
stringclasses
2 values
CmdSetHome.func
(self)
implement the command
implement the command
def func(self): """implement the command""" if not self.args: string = "Usage: @sethome <obj> [= <home_location>]" self.caller.msg(string) return obj = self.caller.search(self.lhs, global_search=True) if not obj: return if not self...
[ "def", "func", "(", "self", ")", ":", "if", "not", "self", ".", "args", ":", "string", "=", "\"Usage: @sethome <obj> [= <home_location>]\"", "self", ".", "caller", ".", "msg", "(", "string", ")", "return", "obj", "=", "self", ".", "caller", ".", "search", ...
[ 1132, 4 ]
[ 1162, 31 ]
python
en
['en', 'en', 'en']
True
CmdListCmdSets.func
(self)
list the cmdsets
list the cmdsets
def func(self): """list the cmdsets""" caller = self.caller if self.arglist: obj = caller.search(self.arglist[0]) if not obj: return else: obj = caller string = "%s" % obj.cmdset caller.msg(string)
[ "def", "func", "(", "self", ")", ":", "caller", "=", "self", ".", "caller", "if", "self", ".", "arglist", ":", "obj", "=", "caller", ".", "search", "(", "self", ".", "arglist", "[", "0", "]", ")", "if", "not", "obj", ":", "return", "else", ":", ...
[ 1180, 4 ]
[ 1191, 26 ]
python
en
['en', 'de', 'en']
True
CmdName.func
(self)
change the name
change the name
def func(self): """change the name""" caller = self.caller if not self.args: caller.msg("Usage: @name <obj> = <newname>[;alias;alias;...]") return obj = None if self.lhs_objs: objname = self.lhs_objs[0]['name'] if objname.startswi...
[ "def", "func", "(", "self", ")", ":", "caller", "=", "self", ".", "caller", "if", "not", "self", ".", "args", ":", "caller", ".", "msg", "(", "\"Usage: @name <obj> = <newname>[;alias;alias;...]\"", ")", "return", "obj", "=", "None", "if", "self", ".", "lhs...
[ 1211, 4 ]
[ 1266, 75 ]
python
en
['en', 'ceb', 'en']
True
CmdOpen.create_exit
(self, exit_name, location, destination, exit_aliases=None, typeclass=None)
Helper function to avoid code duplication. At this point we know destination is a valid location
Helper function to avoid code duplication. At this point we know destination is a valid location
def create_exit(self, exit_name, location, destination, exit_aliases=None, typeclass=None): """ Helper function to avoid code duplication. At this point we know destination is a valid location """ caller = self.caller string = "" # check if th...
[ "def", "create_exit", "(", "self", ",", "exit_name", ",", "location", ",", "destination", ",", "exit_aliases", "=", "None", ",", "typeclass", "=", "None", ")", ":", "caller", "=", "self", ".", "caller", "string", "=", "\"\"", "# check if this exit object alrea...
[ 1288, 4 ]
[ 1347, 23 ]
python
en
['en', 'error', 'th']
False
CmdOpen.func
(self)
This is where the processing starts. Uses the ObjManipCommand.parser() for pre-processing as well as the self.create_exit() method.
This is where the processing starts. Uses the ObjManipCommand.parser() for pre-processing as well as the self.create_exit() method.
def func(self): """ This is where the processing starts. Uses the ObjManipCommand.parser() for pre-processing as well as the self.create_exit() method. """ caller = self.caller if not self.args or not self.rhs: string = "Usage: @open <new exit>[;alias...
[ "def", "func", "(", "self", ")", ":", "caller", "=", "self", ".", "caller", "if", "not", "self", ".", "args", "or", "not", "self", ".", "rhs", ":", "string", "=", "\"Usage: @open <new exit>[;alias...][:typeclass][,<return exit>[;alias..][:typeclass]]] \"", "string",...
[ 1349, 4 ]
[ 1399, 49 ]
python
en
['en', 'error', 'th']
False
CmdSetAttribute.check_obj
(self, obj)
This may be overridden by subclasses in case restrictions need to be placed on whether certain objects can have attributes set by certain accounts. This function is expected to display its own error message. Returning False will abort the command.
This may be overridden by subclasses in case restrictions need to be placed on whether certain objects can have attributes set by certain accounts.
def check_obj(self, obj): """ This may be overridden by subclasses in case restrictions need to be placed on whether certain objects can have attributes set by certain accounts. This function is expected to display its own error message. Returning False will abort the c...
[ "def", "check_obj", "(", "self", ",", "obj", ")", ":", "return", "True" ]
[ 1516, 4 ]
[ 1526, 19 ]
python
en
['en', 'error', 'th']
False
CmdSetAttribute.check_attr
(self, obj, attr_name)
This may be overridden by subclasses in case restrictions need to be placed on what attributes can be set by who beyond the normal lock. This functions is expected to display its own error message. It is run once for every attribute that is checked, blocking only those attribut...
This may be overridden by subclasses in case restrictions need to be placed on what attributes can be set by who beyond the normal lock.
def check_attr(self, obj, attr_name): """ This may be overridden by subclasses in case restrictions need to be placed on what attributes can be set by who beyond the normal lock. This functions is expected to display its own error message. It is run once for every attribute that...
[ "def", "check_attr", "(", "self", ",", "obj", ",", "attr_name", ")", ":", "return", "attr_name" ]
[ 1528, 4 ]
[ 1537, 24 ]
python
en
['en', 'error', 'th']
False
CmdSetAttribute.view_attr
(self, obj, attr)
Look up the value of an attribute and return a string displaying it.
Look up the value of an attribute and return a string displaying it.
def view_attr(self, obj, attr): """ Look up the value of an attribute and return a string displaying it. """ if obj.attributes.has(attr): return "\nAttribute %s/%s = %s" % (obj.name, attr, obj.attributes.get(attr)) else: ...
[ "def", "view_attr", "(", "self", ",", "obj", ",", "attr", ")", ":", "if", "obj", ".", "attributes", ".", "has", "(", "attr", ")", ":", "return", "\"\\nAttribute %s/%s = %s\"", "%", "(", "obj", ".", "name", ",", "attr", ",", "obj", ".", "attributes", ...
[ 1539, 4 ]
[ 1547, 67 ]
python
en
['en', 'error', 'th']
False
CmdSetAttribute.rm_attr
(self, obj, attr)
Remove an attribute from the object, and report back.
Remove an attribute from the object, and report back.
def rm_attr(self, obj, attr): """ Remove an attribute from the object, and report back. """ if obj.attributes.has(attr): val = obj.attributes.has(attr) obj.attributes.remove(attr) return "\nDeleted attribute '%s' (= %s) from %s." % (attr, val, obj.name...
[ "def", "rm_attr", "(", "self", ",", "obj", ",", "attr", ")", ":", "if", "obj", ".", "attributes", ".", "has", "(", "attr", ")", ":", "val", "=", "obj", ".", "attributes", ".", "has", "(", "attr", ")", "obj", ".", "attributes", ".", "remove", "(",...
[ 1549, 4 ]
[ 1558, 67 ]
python
en
['en', 'error', 'th']
False
CmdSetAttribute.edit_handler
(self, obj, attr)
Activate the line editor
Activate the line editor
def edit_handler(self, obj, attr): """Activate the line editor""" def load(caller): """Called for the editor to load the buffer""" old_value = obj.attributes.get(attr) if old_value is not None and not isinstance(old_value, basestring): typ = type(old_v...
[ "def", "edit_handler", "(", "self", ",", "obj", ",", "attr", ")", ":", "def", "load", "(", "caller", ")", ":", "\"\"\"Called for the editor to load the buffer\"\"\"", "old_value", "=", "obj", ".", "attributes", ".", "get", "(", "attr", ")", "if", "old_value", ...
[ 1573, 4 ]
[ 1590, 68 ]
python
en
['en', 'en', 'en']
True
CmdSetAttribute.search_for_obj
(self, objname)
Searches for an object matching objname. The object may be of different typeclasses. Args: objname: Name of the object we're looking for Returns: A typeclassed object, or None if nothing is found.
Searches for an object matching objname. The object may be of different typeclasses. Args: objname: Name of the object we're looking for
def search_for_obj(self, objname): """ Searches for an object matching objname. The object may be of different typeclasses. Args: objname: Name of the object we're looking for Returns: A typeclassed object, or None if nothing is found. """ from ev...
[ "def", "search_for_obj", "(", "self", ",", "objname", ")", ":", "from", "evennia", ".", "utils", ".", "utils", "import", "variable_from_module", "_AT_SEARCH_RESULT", "=", "variable_from_module", "(", "*", "settings", ".", "SEARCH_AT_RESULT", ".", "rsplit", "(", ...
[ 1592, 4 ]
[ 1622, 24 ]
python
en
['en', 'error', 'th']
False
CmdSetAttribute.func
(self)
Implement the set attribute - a limited form of @py.
Implement the set attribute - a limited form of
def func(self): """Implement the set attribute - a limited form of @py.""" caller = self.caller if not self.args: caller.msg("Usage: @set obj/attr = value. Use empty value to clear.") return # get values prepared by the parser value = self.rhs ob...
[ "def", "func", "(", "self", ")", ":", "caller", "=", "self", ".", "caller", "if", "not", "self", ".", "args", ":", "caller", ".", "msg", "(", "\"Usage: @set obj/attr = value. Use empty value to clear.\"", ")", "return", "# get values prepared by the parser", "value"...
[ 1624, 4 ]
[ 1689, 47 ]
python
en
['en', 'en', 'en']
True
CmdTypeclass.func
(self)
Implements command
Implements command
def func(self): """Implements command""" caller = self.caller if 'list' in self.switches: tclasses = get_all_typeclasses() contribs = [key for key in sorted(tclasses) if key.startswith("evennia.contrib")] or ["<None loaded>"] core = [...
[ "def", "func", "(", "self", ")", ":", "caller", "=", "self", ".", "caller", "if", "'list'", "in", "self", ".", "switches", ":", "tclasses", "=", "get_all_typeclasses", "(", ")", "contribs", "=", "[", "key", "for", "key", "in", "sorted", "(", "tclasses"...
[ 1743, 4 ]
[ 1858, 26 ]
python
en
['en', 'en', 'en']
False
CmdWipe.func
(self)
inp is the dict produced in ObjManipCommand.parse()
inp is the dict produced in ObjManipCommand.parse()
def func(self): """ inp is the dict produced in ObjManipCommand.parse() """ caller = self.caller if not self.args: caller.msg("Usage: @wipe <object>[/<attr>/<attr>...]") return # get the attributes set by our custom parser objname = self...
[ "def", "func", "(", "self", ")", ":", "caller", "=", "self", ".", "caller", "if", "not", "self", ".", "args", ":", "caller", ".", "msg", "(", "\"Usage: @wipe <object>[/<attr>/<attr>...]\"", ")", "return", "# get the attributes set by our custom parser", "objname", ...
[ 1879, 4 ]
[ 1909, 26 ]
python
en
['en', 'error', 'th']
False
CmdLock.func
(self)
Sets up the command
Sets up the command
def func(self): """Sets up the command""" caller = self.caller if not self.args: string = "@lock <object>[ = <lockstring>] or @lock[/switch] " \ "<object>/<access_type>" caller.msg(string) return if '/' in self.lhs: #...
[ "def", "func", "(", "self", ")", ":", "caller", "=", "self", ".", "caller", "if", "not", "self", ".", "args", ":", "string", "=", "\"@lock <object>[ = <lockstring>] or @lock[/switch] \"", "\"<object>/<access_type>\"", "caller", ".", "msg", "(", "string", ")", "r...
[ 1948, 4 ]
[ 2037, 46 ]
python
en
['en', 'en', 'en']
True
CmdExamine.list_attribute
(self, crop, attr, value)
Formats a single attribute line.
Formats a single attribute line.
def list_attribute(self, crop, attr, value): """ Formats a single attribute line. """ if crop: if not isinstance(value, basestring): value = utils.to_str(value, force_string=True) value = utils.crop(value) value = utils.to_unicode(value...
[ "def", "list_attribute", "(", "self", ",", "crop", ",", "attr", ",", "value", ")", ":", "if", "crop", ":", "if", "not", "isinstance", "(", "value", ",", "basestring", ")", ":", "value", "=", "utils", ".", "to_str", "(", "value", ",", "force_string", ...
[ 2067, 4 ]
[ 2079, 21 ]
python
en
['en', 'error', 'th']
False
CmdExamine.format_attributes
(self, obj, attrname=None, crop=True)
Helper function that returns info about attributes and/or non-persistent data stored on object
Helper function that returns info about attributes and/or non-persistent data stored on object
def format_attributes(self, obj, attrname=None, crop=True): """ Helper function that returns info about attributes and/or non-persistent data stored on object """ if attrname: db_attr = [(attrname, obj.attributes.get(attrname))] try: ndb_a...
[ "def", "format_attributes", "(", "self", ",", "obj", ",", "attrname", "=", "None", ",", "crop", "=", "True", ")", ":", "if", "attrname", ":", "db_attr", "=", "[", "(", "attrname", ",", "obj", ".", "attributes", ".", "get", "(", "attrname", ")", ")", ...
[ 2081, 4 ]
[ 2108, 21 ]
python
en
['en', 'error', 'th']
False
CmdExamine.format_output
(self, obj, avail_cmdset)
Helper function that creates a nice report about an object. returns a string.
Helper function that creates a nice report about an object.
def format_output(self, obj, avail_cmdset): """ Helper function that creates a nice report about an object. returns a string. """ string = "\n|wName/key|n: |c%s|n (%s)" % (obj.name, obj.dbref) if hasattr(obj, "aliases") and obj.aliases.all(): string += "\n|w...
[ "def", "format_output", "(", "self", ",", "obj", ",", "avail_cmdset", ")", ":", "string", "=", "\"\\n|wName/key|n: |c%s|n (%s)\"", "%", "(", "obj", ".", "name", ",", "obj", ".", "dbref", ")", "if", "hasattr", "(", "obj", ",", "\"aliases\"", ")", "and", "...
[ 2110, 4 ]
[ 2240, 68 ]
python
en
['en', 'error', 'th']
False
CmdExamine.func
(self)
Process command
Process command
def func(self): """Process command""" caller = self.caller def get_cmdset_callback(cmdset): """ We make use of the cmdhandeler.get_and_merge_cmdsets below. This is an asynchronous function, returning a Twisted deferred. So in order to properly use...
[ "def", "func", "(", "self", ")", ":", "caller", "=", "self", ".", "caller", "def", "get_cmdset_callback", "(", "cmdset", ")", ":", "\"\"\"\n We make use of the cmdhandeler.get_and_merge_cmdsets below. This\n is an asynchronous function, returning a Twisted def...
[ 2242, 4 ]
[ 2311, 136 ]
python
en
['en', 'mk', 'en']
False
CmdFind.func
(self)
Search functionality
Search functionality
def func(self): """Search functionality""" caller = self.caller switches = self.switches if not self.args: caller.msg("Usage: @find <string> [= low [-high]]") return if "locate" in self.cmdstring: # Use option /loc as a default for @locate command alias...
[ "def", "func", "(", "self", ")", ":", "caller", "=", "self", ".", "caller", "switches", "=", "self", ".", "switches", "if", "not", "self", ".", "args", ":", "caller", ".", "msg", "(", "\"Usage: @find <string> [= low [-high]]\"", ")", "return", "if", "\"loc...
[ 2343, 4 ]
[ 2452, 34 ]
python
en
['en', 'en', 'en']
False
Marker.color
(self)
Sets the marker color of selected points. The 'color' property is a color and may be specified as: - A hex string (e.g. '#ff0000') - An rgb/rgba string (e.g. 'rgb(255,0,0)') - An hsl/hsla string (e.g. 'hsl(0,100%,50%)') - An hsv/hsva string (e.g. 'hsv(0,100%...
Sets the marker color of selected points. The 'color' property is a color and may be specified as: - A hex string (e.g. '#ff0000') - An rgb/rgba string (e.g. 'rgb(255,0,0)') - An hsl/hsla string (e.g. 'hsl(0,100%,50%)') - An hsv/hsva string (e.g. 'hsv(0,100%...
def color(self): """ Sets the marker color of selected points. The 'color' property is a color and may be specified as: - A hex string (e.g. '#ff0000') - An rgb/rgba string (e.g. 'rgb(255,0,0)') - An hsl/hsla string (e.g. 'hsl(0,100%,50%)') - An hsv/h...
[ "def", "color", "(", "self", ")", ":", "return", "self", "[", "\"color\"", "]" ]
[ 15, 4 ]
[ 65, 28 ]
python
en
['en', 'error', 'th']
False
Marker.opacity
(self)
Sets the marker opacity of selected points. The 'opacity' property is a number and may be specified as: - An int or float in the interval [0, 1] Returns ------- int|float
Sets the marker opacity of selected points. The 'opacity' property is a number and may be specified as: - An int or float in the interval [0, 1]
def opacity(self): """ Sets the marker opacity of selected points. The 'opacity' property is a number and may be specified as: - An int or float in the interval [0, 1] Returns ------- int|float """ return self["opacity"]
[ "def", "opacity", "(", "self", ")", ":", "return", "self", "[", "\"opacity\"", "]" ]
[ 74, 4 ]
[ 85, 30 ]
python
en
['en', 'error', 'th']
False
Marker.__init__
(self, arg=None, color=None, opacity=None, **kwargs)
Construct a new Marker object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.barpolar.selected.Marker` color Sets the marker color of selected poin...
Construct a new Marker object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.barpolar.selected.Marker` color Sets the marker color of selected poin...
def __init__(self, arg=None, color=None, opacity=None, **kwargs): """ Construct a new Marker object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.barpolar.sele...
[ "def", "__init__", "(", "self", ",", "arg", "=", "None", ",", "color", "=", "None", ",", "opacity", "=", "None", ",", "*", "*", "kwargs", ")", ":", "super", "(", "Marker", ",", "self", ")", ".", "__init__", "(", "\"marker\"", ")", "if", "\"_parent\...
[ 102, 4 ]
[ 165, 34 ]
python
en
['en', 'error', 'th']
False
Textfont.color
(self)
The 'color' property is a color and may be specified as: - A hex string (e.g. '#ff0000') - An rgb/rgba string (e.g. 'rgb(255,0,0)') - An hsl/hsla string (e.g. 'hsl(0,100%,50%)') - An hsv/hsva string (e.g. 'hsv(0,100%,100%)') - A named CSS color: ...
The 'color' property is a color and may be specified as: - A hex string (e.g. '#ff0000') - An rgb/rgba string (e.g. 'rgb(255,0,0)') - An hsl/hsla string (e.g. 'hsl(0,100%,50%)') - An hsv/hsva string (e.g. 'hsv(0,100%,100%)') - A named CSS color: ...
def color(self): """ The 'color' property is a color and may be specified as: - A hex string (e.g. '#ff0000') - An rgb/rgba string (e.g. 'rgb(255,0,0)') - An hsl/hsla string (e.g. 'hsl(0,100%,50%)') - An hsv/hsva string (e.g. 'hsv(0,100%,100%)') - A name...
[ "def", "color", "(", "self", ")", ":", "return", "self", "[", "\"color\"", "]" ]
[ 15, 4 ]
[ 64, 28 ]
python
en
['en', 'error', 'th']
False
Textfont.colorsrc
(self)
Sets the source reference on Chart Studio Cloud for color . The 'colorsrc' property must be specified as a string or as a plotly.grid_objs.Column object Returns ------- str
Sets the source reference on Chart Studio Cloud for color . The 'colorsrc' property must be specified as a string or as a plotly.grid_objs.Column object
def colorsrc(self): """ Sets the source reference on Chart Studio Cloud for color . The 'colorsrc' property must be specified as a string or as a plotly.grid_objs.Column object Returns ------- str """ return self["colorsrc"]
[ "def", "colorsrc", "(", "self", ")", ":", "return", "self", "[", "\"colorsrc\"", "]" ]
[ 73, 4 ]
[ 84, 31 ]
python
en
['en', 'error', 'th']
False
Textfont.family
(self)
HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts ...
HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts ...
def family(self): """ HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the prefer...
[ "def", "family", "(", "self", ")", ":", "return", "self", "[", "\"family\"", "]" ]
[ 93, 4 ]
[ 116, 29 ]
python
en
['en', 'error', 'th']
False
Textfont.familysrc
(self)
Sets the source reference on Chart Studio Cloud for family . The 'familysrc' property must be specified as a string or as a plotly.grid_objs.Column object Returns ------- str
Sets the source reference on Chart Studio Cloud for family . The 'familysrc' property must be specified as a string or as a plotly.grid_objs.Column object
def familysrc(self): """ Sets the source reference on Chart Studio Cloud for family . The 'familysrc' property must be specified as a string or as a plotly.grid_objs.Column object Returns ------- str """ return self["familysrc"]
[ "def", "familysrc", "(", "self", ")", ":", "return", "self", "[", "\"familysrc\"", "]" ]
[ 125, 4 ]
[ 136, 32 ]
python
en
['en', 'error', 'th']
False
Textfont.size
(self)
The 'size' property is a number and may be specified as: - An int or float in the interval [1, inf] - A tuple, list, or one-dimensional numpy array of the above Returns ------- int|float|numpy.ndarray
The 'size' property is a number and may be specified as: - An int or float in the interval [1, inf] - A tuple, list, or one-dimensional numpy array of the above
def size(self): """ The 'size' property is a number and may be specified as: - An int or float in the interval [1, inf] - A tuple, list, or one-dimensional numpy array of the above Returns ------- int|float|numpy.ndarray """ return self["size"...
[ "def", "size", "(", "self", ")", ":", "return", "self", "[", "\"size\"", "]" ]
[ 145, 4 ]
[ 155, 27 ]
python
en
['en', 'error', 'th']
False
Textfont.sizesrc
(self)
Sets the source reference on Chart Studio Cloud for size . The 'sizesrc' property must be specified as a string or as a plotly.grid_objs.Column object Returns ------- str
Sets the source reference on Chart Studio Cloud for size . The 'sizesrc' property must be specified as a string or as a plotly.grid_objs.Column object
def sizesrc(self): """ Sets the source reference on Chart Studio Cloud for size . The 'sizesrc' property must be specified as a string or as a plotly.grid_objs.Column object Returns ------- str """ return self["sizesrc"]
[ "def", "sizesrc", "(", "self", ")", ":", "return", "self", "[", "\"sizesrc\"", "]" ]
[ 164, 4 ]
[ 175, 30 ]
python
en
['en', 'error', 'th']
False
Textfont.__init__
( self, arg=None, color=None, colorsrc=None, family=None, familysrc=None, size=None, sizesrc=None, **kwargs )
Construct a new Textfont object Sets the text font. Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.scatterpolar.Textfont` color colorsrc ...
Construct a new Textfont object Sets the text font.
def __init__( self, arg=None, color=None, colorsrc=None, family=None, familysrc=None, size=None, sizesrc=None, **kwargs ): """ Construct a new Textfont object Sets the text font. Parameters ----...
[ "def", "__init__", "(", "self", ",", "arg", "=", "None", ",", "color", "=", "None", ",", "colorsrc", "=", "None", ",", "family", "=", "None", ",", "familysrc", "=", "None", ",", "size", "=", "None", ",", "sizesrc", "=", "None", ",", "*", "*", "kw...
[ 215, 4 ]
[ 329, 34 ]
python
en
['en', 'error', 'th']
False
Ticker._callback
(self)
This will be called repeatedly every `self.interval` seconds. `self.subscriptions` contain tuples of (obj, args, kwargs) for each subscribing object. If overloading, this callback is expected to handle all subscriptions when it is triggered. It should not return anythin...
This will be called repeatedly every `self.interval` seconds. `self.subscriptions` contain tuples of (obj, args, kwargs) for each subscribing object.
def _callback(self): """ This will be called repeatedly every `self.interval` seconds. `self.subscriptions` contain tuples of (obj, args, kwargs) for each subscribing object. If overloading, this callback is expected to handle all subscriptions when it is triggered. It s...
[ "def", "_callback", "(", "self", ")", ":", "self", ".", "_to_add", "=", "[", "]", "self", ".", "_to_remove", "=", "[", "]", "self", ".", "_is_ticking", "=", "True", "for", "store_key", ",", "(", "args", ",", "kwargs", ")", "in", "self", ".", "subsc...
[ 96, 4 ]
[ 146, 25 ]
python
en
['en', 'error', 'th']
False
Ticker.__init__
(self, interval)
Set up the ticker Args: interval (int): The stepping interval.
Set up the ticker
def __init__(self, interval): """ Set up the ticker Args: interval (int): The stepping interval. """ self.interval = interval self.subscriptions = {} self._is_ticking = False self._to_remove = [] self._to_add = [] # set up a t...
[ "def", "__init__", "(", "self", ",", "interval", ")", ":", "self", ".", "interval", "=", "interval", "self", ".", "subscriptions", "=", "{", "}", "self", ".", "_is_ticking", "=", "False", "self", ".", "_to_remove", "=", "[", "]", "self", ".", "_to_add"...
[ 148, 4 ]
[ 162, 55 ]
python
en
['en', 'error', 'th']
False
Ticker.validate
(self, start_delay=None)
Start/stop the task depending on how many subscribers we have using it. Args: start_delay (int): Time to way before starting.
Start/stop the task depending on how many subscribers we have using it.
def validate(self, start_delay=None): """ Start/stop the task depending on how many subscribers we have using it. Args: start_delay (int): Time to way before starting. """ subs = self.subscriptions if self.task.running: if not subs: ...
[ "def", "validate", "(", "self", ",", "start_delay", "=", "None", ")", ":", "subs", "=", "self", ".", "subscriptions", "if", "self", ".", "task", ".", "running", ":", "if", "not", "subs", ":", "self", ".", "task", ".", "stop", "(", ")", "elif", "sub...
[ 164, 4 ]
[ 178, 78 ]
python
en
['en', 'error', 'th']
False
Ticker.add
(self, store_key, *args, **kwargs)
Sign up a subscriber to this ticker. Args: store_key (str): Unique storage hash for this ticker subscription. args (any, optional): Arguments to call the hook method with. Kwargs: _start_delay (int): If set, this will be used to delay the sta...
Sign up a subscriber to this ticker. Args: store_key (str): Unique storage hash for this ticker subscription. args (any, optional): Arguments to call the hook method with.
def add(self, store_key, *args, **kwargs): """ Sign up a subscriber to this ticker. Args: store_key (str): Unique storage hash for this ticker subscription. args (any, optional): Arguments to call the hook method with. Kwargs: _start_delay (int): If s...
[ "def", "add", "(", "self", ",", "store_key", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "self", ".", "_is_ticking", ":", "# protects the subscription dict from", "# updating while it is looping", "self", ".", "_to_add", ".", "append", "(", "(",...
[ 180, 4 ]
[ 200, 50 ]
python
en
['en', 'error', 'th']
False
Ticker.remove
(self, store_key)
Unsubscribe object from this ticker Args: store_key (str): Unique store key.
Unsubscribe object from this ticker
def remove(self, store_key): """ Unsubscribe object from this ticker Args: store_key (str): Unique store key. """ if self._is_ticking: # this protects the subscription dict from # updating while it is looping self._to_remove.appen...
[ "def", "remove", "(", "self", ",", "store_key", ")", ":", "if", "self", ".", "_is_ticking", ":", "# this protects the subscription dict from", "# updating while it is looping", "self", ".", "_to_remove", ".", "append", "(", "store_key", ")", "else", ":", "self", "...
[ 202, 4 ]
[ 216, 27 ]
python
en
['en', 'error', 'th']
False
Ticker.stop
(self)
Kill the Task, regardless of subscriptions.
Kill the Task, regardless of subscriptions.
def stop(self): """ Kill the Task, regardless of subscriptions. """ self.subscriptions = {} self.validate()
[ "def", "stop", "(", "self", ")", ":", "self", ".", "subscriptions", "=", "{", "}", "self", ".", "validate", "(", ")" ]
[ 218, 4 ]
[ 224, 23 ]
python
en
['en', 'error', 'th']
False
TickerPool.__init__
(self)
Initialize the pool.
Initialize the pool.
def __init__(self): """ Initialize the pool. """ self.tickers = {}
[ "def", "__init__", "(", "self", ")", ":", "self", ".", "tickers", "=", "{", "}" ]
[ 236, 4 ]
[ 241, 25 ]
python
en
['en', 'error', 'th']
False
TickerPool.add
(self, store_key, *args, **kwargs)
Add new ticker subscriber. Args: store_key (str): Unique storage hash. args (any, optional): Arguments to send to the hook method.
Add new ticker subscriber.
def add(self, store_key, *args, **kwargs): """ Add new ticker subscriber. Args: store_key (str): Unique storage hash. args (any, optional): Arguments to send to the hook method. """ _, _, _, interval, _, _ = store_key if not interval: ...
[ "def", "add", "(", "self", ",", "store_key", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_", ",", "_", ",", "_", ",", "interval", ",", "_", ",", "_", "=", "store_key", "if", "not", "interval", ":", "log_err", "(", "_ERROR_ADD_TICKER", "...
[ 243, 4 ]
[ 259, 62 ]
python
en
['en', 'error', 'th']
False
TickerPool.remove
(self, store_key)
Remove subscription from pool. Args: store_key (str): Unique storage hash to remove
Remove subscription from pool.
def remove(self, store_key): """ Remove subscription from pool. Args: store_key (str): Unique storage hash to remove """ _, _, _, interval, _, _ = store_key if interval in self.tickers: self.tickers[interval].remove(store_key) if not ...
[ "def", "remove", "(", "self", ",", "store_key", ")", ":", "_", ",", "_", ",", "_", ",", "interval", ",", "_", ",", "_", "=", "store_key", "if", "interval", "in", "self", ".", "tickers", ":", "self", ".", "tickers", "[", "interval", "]", ".", "rem...
[ 261, 4 ]
[ 273, 42 ]
python
en
['en', 'error', 'th']
False
TickerPool.stop
(self, interval=None)
Stop all scripts in pool. This is done at server reload since restoring the pool will automatically re-populate the pool. Args: interval (int, optional): Only stop tickers with this interval.
Stop all scripts in pool. This is done at server reload since restoring the pool will automatically re-populate the pool.
def stop(self, interval=None): """ Stop all scripts in pool. This is done at server reload since restoring the pool will automatically re-populate the pool. Args: interval (int, optional): Only stop tickers with this interval. """ if interval...
[ "def", "stop", "(", "self", ",", "interval", "=", "None", ")", ":", "if", "interval", "and", "interval", "in", "self", ".", "tickers", ":", "self", ".", "tickers", "[", "interval", "]", ".", "stop", "(", ")", "else", ":", "for", "ticker", "in", "se...
[ 275, 4 ]
[ 289, 29 ]
python
en
['en', 'error', 'th']
False
TickerHandler.__init__
(self, save_name="ticker_storage")
Initialize handler save_name (str, optional): The name of the ServerConfig instance to store the handler state persistently.
Initialize handler
def __init__(self, save_name="ticker_storage"): """ Initialize handler save_name (str, optional): The name of the ServerConfig instance to store the handler state persistently. """ self.ticker_storage = {} self.save_name = save_name self.ticker_pool ...
[ "def", "__init__", "(", "self", ",", "save_name", "=", "\"ticker_storage\"", ")", ":", "self", ".", "ticker_storage", "=", "{", "}", "self", ".", "save_name", "=", "save_name", "self", ".", "ticker_pool", "=", "self", ".", "ticker_pool_class", "(", ")" ]
[ 301, 4 ]
[ 311, 51 ]
python
en
['en', 'error', 'th']
False
TickerHandler._get_callback
(self, callback)
Analyze callback and determine its consituents Args: callback (function or method): This is either a stand-alone function or class method on a typeclassed entitye (that is, an entity that can be saved to the database). Returns: ret (tupl...
Analyze callback and determine its consituents
def _get_callback(self, callback): """ Analyze callback and determine its consituents Args: callback (function or method): This is either a stand-alone function or class method on a typeclassed entitye (that is, an entity that can be saved to the data...
[ "def", "_get_callback", "(", "self", ",", "callback", ")", ":", "outobj", ",", "outpath", ",", "outcallfunc", "=", "None", ",", "None", ",", "None", "if", "callable", "(", "callback", ")", ":", "if", "inspect", ".", "ismethod", "(", "callback", ")", ":...
[ 313, 4 ]
[ 341, 43 ]
python
en
['en', 'error', 'th']
False
TickerHandler._store_key
(self, obj, path, interval, callfunc, idstring="", persistent=True)
Tries to create a store_key for the object. Args: obj (Object, tuple or None): Subscribing object if any. If a tuple, this is a packed_obj tuple from dbserialize. path (str or None): Python-path to callable, if any. interval (int): Ticker interval. ...
Tries to create a store_key for the object.
def _store_key(self, obj, path, interval, callfunc, idstring="", persistent=True): """ Tries to create a store_key for the object. Args: obj (Object, tuple or None): Subscribing object if any. If a tuple, this is a packed_obj tuple from dbserialize. path ...
[ "def", "_store_key", "(", "self", ",", "obj", ",", "path", ",", "interval", ",", "callfunc", ",", "idstring", "=", "\"\"", ",", "persistent", "=", "True", ")", ":", "interval", "=", "int", "(", "interval", ")", "persistent", "=", "bool", "(", "persiste...
[ 343, 4 ]
[ 375, 80 ]
python
en
['en', 'error', 'th']
False
TickerHandler.save
(self)
Save ticker_storage as a serialized string into a temporary ServerConf field. Whereas saving is done on the fly, if called by server when it shuts down, the current timer of each ticker will be saved so it can start over from that point.
Save ticker_storage as a serialized string into a temporary ServerConf field. Whereas saving is done on the fly, if called by server when it shuts down, the current timer of each ticker will be saved so it can start over from that point.
def save(self): """ Save ticker_storage as a serialized string into a temporary ServerConf field. Whereas saving is done on the fly, if called by server when it shuts down, the current timer of each ticker will be saved so it can start over from that point. """ i...
[ "def", "save", "(", "self", ")", ":", "if", "self", ".", "ticker_storage", ":", "# get the current times so the tickers can be restarted with a delay later", "start_delays", "=", "dict", "(", "(", "interval", ",", "ticker", ".", "task", ".", "next_call_time", "(", "...
[ 377, 4 ]
[ 404, 70 ]
python
en
['en', 'error', 'th']
False
TickerHandler.restore
(self, server_reload=True)
Restore ticker_storage from database and re-initialize the handler from storage. This is triggered by the server at restart. Args: server_reload (bool, optional): If this is False, it means the server went through a cold reboot and all non-pe...
Restore ticker_storage from database and re-initialize the handler from storage. This is triggered by the server at restart.
def restore(self, server_reload=True): """ Restore ticker_storage from database and re-initialize the handler from storage. This is triggered by the server at restart. Args: server_reload (bool, optional): If this is False, it means the server went th...
[ "def", "restore", "(", "self", ",", "server_reload", "=", "True", ")", ":", "# load stored command instructions and use them to re-initialize handler", "restored_tickers", "=", "ServerConfig", ".", "objects", ".", "conf", "(", "key", "=", "self", ".", "save_name", ")"...
[ 406, 4 ]
[ 458, 64 ]
python
en
['en', 'error', 'th']
False
TickerHandler.add
(self, interval=60, callback=None, idstring="", persistent=True, *args, **kwargs)
Add subscription to tickerhandler Args: interval (int, optional): Interval in seconds between calling `callable(*args, **kwargs)` callable (callable function or method, optional): This should either be a stand-alone function or a method on a ...
Add subscription to tickerhandler
def add(self, interval=60, callback=None, idstring="", persistent=True, *args, **kwargs): """ Add subscription to tickerhandler Args: interval (int, optional): Interval in seconds between calling `callable(*args, **kwargs)` callable (callable function or ...
[ "def", "add", "(", "self", ",", "interval", "=", "60", ",", "callback", "=", "None", ",", "idstring", "=", "\"\"", ",", "persistent", "=", "True", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "isinstance", "(", "callback", ",", "int",...
[ 460, 4 ]
[ 501, 19 ]
python
en
['en', 'error', 'th']
False
TickerHandler.remove
(self, interval=60, callback=None, idstring="", persistent=True)
Remove object from ticker or only remove it from tickers with a given interval. Args: interval (int, optional): Interval of ticker to remove. callback (callable function or method): Either a function or the method of a typeclassed object. ids...
Remove object from ticker or only remove it from tickers with a given interval.
def remove(self, interval=60, callback=None, idstring="", persistent=True): """ Remove object from ticker or only remove it from tickers with a given interval. Args: interval (int, optional): Interval of ticker to remove. callback (callable function or method): E...
[ "def", "remove", "(", "self", ",", "interval", "=", "60", ",", "callback", "=", "None", ",", "idstring", "=", "\"\"", ",", "persistent", "=", "True", ")", ":", "if", "isinstance", "(", "callback", ",", "int", ")", ":", "raise", "RuntimeError", "(", "...
[ 503, 4 ]
[ 524, 23 ]
python
en
['en', 'error', 'th']
False
TickerHandler.clear
(self, interval=None)
Stop/remove tickers from handler. Args: interval (int): Only stop tickers with this interval. Notes: This is the only supported way to kill tickers related to non-db objects.
Stop/remove tickers from handler.
def clear(self, interval=None): """ Stop/remove tickers from handler. Args: interval (int): Only stop tickers with this interval. Notes: This is the only supported way to kill tickers related to non-db objects. """ self.ticker_pool.s...
[ "def", "clear", "(", "self", ",", "interval", "=", "None", ")", ":", "self", ".", "ticker_pool", ".", "stop", "(", "interval", ")", "if", "interval", ":", "self", ".", "ticker_storage", "=", "dict", "(", "(", "store_key", ",", "store_key", ")", "for", ...
[ 526, 4 ]
[ 545, 19 ]
python
en
['en', 'error', 'th']
False
TickerHandler.all
(self, interval=None)
Get all subscriptions. Args: interval (int): Limit match to tickers with this interval. Returns: tickers (list): If `interval` was given, this is a list of tickers using that interval. tickerpool_layout (dict): If `interval` was *not* given,...
Get all subscriptions.
def all(self, interval=None): """ Get all subscriptions. Args: interval (int): Limit match to tickers with this interval. Returns: tickers (list): If `interval` was given, this is a list of tickers using that interval. tickerpool_layo...
[ "def", "all", "(", "self", ",", "interval", "=", "None", ")", ":", "if", "interval", "is", "None", ":", "# return dict of all, ordered by interval", "return", "dict", "(", "(", "interval", ",", "ticker", ".", "subscriptions", ")", "for", "interval", ",", "ti...
[ 547, 4 ]
[ 570, 23 ]
python
en
['en', 'error', 'th']
False
TickerHandler.all_display
(self)
Get all tickers on an easily displayable form. Returns: tickers (dict): A list of all storekeys
Get all tickers on an easily displayable form.
def all_display(self): """ Get all tickers on an easily displayable form. Returns: tickers (dict): A list of all storekeys """ store_keys = [] for ticker in self.ticker_pool.tickers.itervalues(): for (objtup, callfunc, path, interval, idstring, p...
[ "def", "all_display", "(", "self", ")", ":", "store_keys", "=", "[", "]", "for", "ticker", "in", "self", ".", "ticker_pool", ".", "tickers", ".", "itervalues", "(", ")", ":", "for", "(", "objtup", ",", "callfunc", ",", "path", ",", "interval", ",", "...
[ 572, 4 ]
[ 584, 25 ]
python
en
['en', 'error', 'th']
False
Stream.maxpoints
(self)
Sets the maximum number of points to keep on the plots from an incoming stream. If `maxpoints` is set to 50, only the newest 50 points will be displayed on the plot. The 'maxpoints' property is a number and may be specified as: - An int or float in the interval [0, 10000]...
Sets the maximum number of points to keep on the plots from an incoming stream. If `maxpoints` is set to 50, only the newest 50 points will be displayed on the plot. The 'maxpoints' property is a number and may be specified as: - An int or float in the interval [0, 10000]
def maxpoints(self): """ Sets the maximum number of points to keep on the plots from an incoming stream. If `maxpoints` is set to 50, only the newest 50 points will be displayed on the plot. The 'maxpoints' property is a number and may be specified as: - An int or ...
[ "def", "maxpoints", "(", "self", ")", ":", "return", "self", "[", "\"maxpoints\"", "]" ]
[ 15, 4 ]
[ 28, 32 ]
python
en
['en', 'error', 'th']
False
Stream.token
(self)
The stream id number links a data trace on a plot with a stream. See https://chart-studio.plotly.com/settings for more details. The 'token' property is a string and must be specified as: - A non-empty string Returns ------- str
The stream id number links a data trace on a plot with a stream. See https://chart-studio.plotly.com/settings for more details. The 'token' property is a string and must be specified as: - A non-empty string
def token(self): """ The stream id number links a data trace on a plot with a stream. See https://chart-studio.plotly.com/settings for more details. The 'token' property is a string and must be specified as: - A non-empty string Returns ------- ...
[ "def", "token", "(", "self", ")", ":", "return", "self", "[", "\"token\"", "]" ]
[ 37, 4 ]
[ 50, 28 ]
python
en
['en', 'error', 'th']
False
Stream.__init__
(self, arg=None, maxpoints=None, token=None, **kwargs)
Construct a new Stream object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.image.Stream` maxpoints Sets the maximum number of points to keep on the plots ...
Construct a new Stream object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.image.Stream` maxpoints Sets the maximum number of points to keep on the plots ...
def __init__(self, arg=None, maxpoints=None, token=None, **kwargs): """ Construct a new Stream object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.image.Stream` m...
[ "def", "__init__", "(", "self", ",", "arg", "=", "None", ",", "maxpoints", "=", "None", ",", "token", "=", "None", ",", "*", "*", "kwargs", ")", ":", "super", "(", "Stream", ",", "self", ")", ".", "__init__", "(", "\"stream\"", ")", "if", "\"_paren...
[ 72, 4 ]
[ 139, 34 ]
python
en
['en', 'error', 'th']
False
BaseResponder.__init__
( self, *, connection_id: str = None, reply_session_id: str = None, reply_to_verkey: str = None, )
Initialize a base responder.
Initialize a base responder.
def __init__( self, *, connection_id: str = None, reply_session_id: str = None, reply_to_verkey: str = None, ): """Initialize a base responder.""" self.connection_id = connection_id self.reply_session_id = reply_session_id self.reply_to_verkey ...
[ "def", "__init__", "(", "self", ",", "*", ",", "connection_id", ":", "str", "=", "None", ",", "reply_session_id", ":", "str", "=", "None", ",", "reply_to_verkey", ":", "str", "=", "None", ",", ")", ":", "self", ".", "connection_id", "=", "connection_id",...
[ 24, 4 ]
[ 34, 46 ]
python
en
['en', 'en', 'it']
True
BaseResponder.create_outbound
( self, message: Union[AgentMessage, str, bytes], *, connection_id: str = None, reply_session_id: str = None, reply_thread_id: str = None, reply_to_verkey: str = None, target: ConnectionTarget = None, target_list: Sequence[ConnectionTarget] = None,...
Create an OutboundMessage from a message payload.
Create an OutboundMessage from a message payload.
async def create_outbound( self, message: Union[AgentMessage, str, bytes], *, connection_id: str = None, reply_session_id: str = None, reply_thread_id: str = None, reply_to_verkey: str = None, target: ConnectionTarget = None, target_list: Sequence[...
[ "async", "def", "create_outbound", "(", "self", ",", "message", ":", "Union", "[", "AgentMessage", ",", "str", ",", "bytes", "]", ",", "*", ",", "connection_id", ":", "str", "=", "None", ",", "reply_session_id", ":", "str", "=", "None", ",", "reply_threa...
[ 36, 4 ]
[ 65, 9 ]
python
en
['en', 'en', 'en']
True
BaseResponder.send
(self, message: Union[AgentMessage, str, bytes], **kwargs)
Convert a message to an OutboundMessage and send it.
Convert a message to an OutboundMessage and send it.
async def send(self, message: Union[AgentMessage, str, bytes], **kwargs): """Convert a message to an OutboundMessage and send it.""" outbound = await self.create_outbound(message, **kwargs) await self.send_outbound(outbound)
[ "async", "def", "send", "(", "self", ",", "message", ":", "Union", "[", "AgentMessage", ",", "str", ",", "bytes", "]", ",", "*", "*", "kwargs", ")", ":", "outbound", "=", "await", "self", ".", "create_outbound", "(", "message", ",", "*", "*", "kwargs...
[ 67, 4 ]
[ 70, 42 ]
python
en
['en', 'en', 'en']
True
BaseResponder.send_reply
( self, message: Union[AgentMessage, str, bytes], *, connection_id: str = None, target: ConnectionTarget = None, target_list: Sequence[ConnectionTarget] = None, )
Send a reply to an incoming message. Args: message: the `AgentMessage`, or pre-packed str or bytes to reply with connection_id: optionally override the target connection ID target: optionally specify a `ConnectionTarget` to send to Raises: Respo...
Send a reply to an incoming message.
async def send_reply( self, message: Union[AgentMessage, str, bytes], *, connection_id: str = None, target: ConnectionTarget = None, target_list: Sequence[ConnectionTarget] = None, ): """ Send a reply to an incoming message. Args: ...
[ "async", "def", "send_reply", "(", "self", ",", "message", ":", "Union", "[", "AgentMessage", ",", "str", ",", "bytes", "]", ",", "*", ",", "connection_id", ":", "str", "=", "None", ",", "target", ":", "ConnectionTarget", "=", "None", ",", "target_list",...
[ 72, 4 ]
[ 100, 42 ]
python
en
['en', 'error', 'th']
False
BaseResponder.send_outbound
(self, message: OutboundMessage)
Send an outbound message. Args: message: The `OutboundMessage` to be sent
Send an outbound message.
async def send_outbound(self, message: OutboundMessage): """ Send an outbound message. Args: message: The `OutboundMessage` to be sent """
[ "async", "def", "send_outbound", "(", "self", ",", "message", ":", "OutboundMessage", ")", ":" ]
[ 103, 4 ]
[ 109, 11 ]
python
en
['en', 'error', 'th']
False
BaseResponder.send_webhook
(self, topic: str, payload: dict)
Dispatch a webhook. Args: topic: the webhook topic identifier payload: the webhook payload value
Dispatch a webhook.
async def send_webhook(self, topic: str, payload: dict): """ Dispatch a webhook. Args: topic: the webhook topic identifier payload: the webhook payload value """
[ "async", "def", "send_webhook", "(", "self", ",", "topic", ":", "str", ",", "payload", ":", "dict", ")", ":" ]
[ 112, 4 ]
[ 119, 11 ]
python
en
['en', 'error', 'th']
False
MockResponder.__init__
(self)
Initialize the mock responder.
Initialize the mock responder.
def __init__(self): """Initialize the mock responder.""" self.messages = [] self.webhooks = []
[ "def", "__init__", "(", "self", ")", ":", "self", ".", "messages", "=", "[", "]", "self", ".", "webhooks", "=", "[", "]" ]
[ 125, 4 ]
[ 128, 26 ]
python
en
['en', 'en', 'en']
True
MockResponder.send
(self, message: Union[AgentMessage, str, bytes], **kwargs)
Convert a message to an OutboundMessage and send it.
Convert a message to an OutboundMessage and send it.
async def send(self, message: Union[AgentMessage, str, bytes], **kwargs): """Convert a message to an OutboundMessage and send it.""" self.messages.append((message, kwargs))
[ "async", "def", "send", "(", "self", ",", "message", ":", "Union", "[", "AgentMessage", ",", "str", ",", "bytes", "]", ",", "*", "*", "kwargs", ")", ":", "self", ".", "messages", ".", "append", "(", "(", "message", ",", "kwargs", ")", ")" ]
[ 130, 4 ]
[ 132, 47 ]
python
en
['en', 'en', 'en']
True
MockResponder.send_reply
(self, message: Union[AgentMessage, str, bytes], **kwargs)
Send a reply to an incoming message.
Send a reply to an incoming message.
async def send_reply(self, message: Union[AgentMessage, str, bytes], **kwargs): """Send a reply to an incoming message.""" self.messages.append((message, kwargs))
[ "async", "def", "send_reply", "(", "self", ",", "message", ":", "Union", "[", "AgentMessage", ",", "str", ",", "bytes", "]", ",", "*", "*", "kwargs", ")", ":", "self", ".", "messages", ".", "append", "(", "(", "message", ",", "kwargs", ")", ")" ]
[ 134, 4 ]
[ 136, 47 ]
python
en
['en', 'en', 'en']
True
MockResponder.send_outbound
(self, message: OutboundMessage)
Send an outbound message.
Send an outbound message.
async def send_outbound(self, message: OutboundMessage): """Send an outbound message.""" self.messages.append((message, None))
[ "async", "def", "send_outbound", "(", "self", ",", "message", ":", "OutboundMessage", ")", ":", "self", ".", "messages", ".", "append", "(", "(", "message", ",", "None", ")", ")" ]
[ 138, 4 ]
[ 140, 45 ]
python
en
['en', 'lb', 'en']
True
MockResponder.send_webhook
(self, topic: str, payload: dict)
Send an outbound message.
Send an outbound message.
async def send_webhook(self, topic: str, payload: dict): """Send an outbound message.""" self.webhooks.append((topic, payload))
[ "async", "def", "send_webhook", "(", "self", ",", "topic", ":", "str", ",", "payload", ":", "dict", ")", ":", "self", ".", "webhooks", ".", "append", "(", "(", "topic", ",", "payload", ")", ")" ]
[ 142, 4 ]
[ 144, 46 ]
python
en
['en', 'lb', 'en']
True
runtime
()
Get the total runtime of the server since first start (minus downtimes) Args: format (bool, optional): Format into a time representation. Returns: time (float or tuple): The runtime or the same time split up into time units.
Get the total runtime of the server since first start (minus downtimes)
def runtime(): """ Get the total runtime of the server since first start (minus downtimes) Args: format (bool, optional): Format into a time representation. Returns: time (float or tuple): The runtime or the same time split up into time units. """ return SERVER...
[ "def", "runtime", "(", ")", ":", "return", "SERVER_RUNTIME", "+", "time", ".", "time", "(", ")", "-", "SERVER_RUNTIME_LAST_UPDATED" ]
[ 66, 0 ]
[ 79, 69 ]
python
en
['en', 'error', 'th']
False
server_epoch
()
Get the server epoch. We may need to calculate this on the fly.
Get the server epoch. We may need to calculate this on the fly.
def server_epoch(): """ Get the server epoch. We may need to calculate this on the fly. """ global _SERVER_EPOCH if not _SERVER_EPOCH: _SERVER_EPOCH = ServerConfig.objects.conf("server_epoch", default=None) \ or time.time() - runtime() return _SERVER_EPOCH
[ "def", "server_epoch", "(", ")", ":", "global", "_SERVER_EPOCH", "if", "not", "_SERVER_EPOCH", ":", "_SERVER_EPOCH", "=", "ServerConfig", ".", "objects", ".", "conf", "(", "\"server_epoch\"", ",", "default", "=", "None", ")", "or", "time", ".", "time", "(", ...
[ 82, 0 ]
[ 91, 24 ]
python
en
['en', 'error', 'th']
False
uptime
()
Get the current uptime of the server since last reload Args: format (bool, optional): Format into time representation. Returns: time (float or tuple): The uptime or the same time split up into time units.
Get the current uptime of the server since last reload
def uptime(): """ Get the current uptime of the server since last reload Args: format (bool, optional): Format into time representation. Returns: time (float or tuple): The uptime or the same time split up into time units. """ return time.time() - SERVER_START_TIME
[ "def", "uptime", "(", ")", ":", "return", "time", ".", "time", "(", ")", "-", "SERVER_START_TIME" ]
[ 94, 0 ]
[ 106, 42 ]
python
en
['en', 'error', 'th']
False
game_epoch
()
Get the game epoch.
Get the game epoch.
def game_epoch(): """ Get the game epoch. """ game_epoch = settings.TIME_GAME_EPOCH return game_epoch if game_epoch is not None else server_epoch()
[ "def", "game_epoch", "(", ")", ":", "game_epoch", "=", "settings", ".", "TIME_GAME_EPOCH", "return", "game_epoch", "if", "game_epoch", "is", "not", "None", "else", "server_epoch", "(", ")" ]
[ 109, 0 ]
[ 115, 67 ]
python
en
['en', 'error', 'th']
False
gametime
(absolute=False)
Get the total gametime of the server since first start (minus downtimes) Args: absolute (bool, optional): Get the absolute game time, including the epoch. This could be converted to an absolute in-game date. Returns: time (float): The gametime as a virtual timestam...
Get the total gametime of the server since first start (minus downtimes)
def gametime(absolute=False): """ Get the total gametime of the server since first start (minus downtimes) Args: absolute (bool, optional): Get the absolute game time, including the epoch. This could be converted to an absolute in-game date. Returns: time (float...
[ "def", "gametime", "(", "absolute", "=", "False", ")", ":", "epoch", "=", "game_epoch", "(", ")", "if", "absolute", "else", "0", "if", "IGNORE_DOWNTIMES", ":", "gtime", "=", "epoch", "+", "(", "time", ".", "time", "(", ")", "-", "server_epoch", "(", ...
[ 118, 0 ]
[ 141, 16 ]
python
en
['en', 'error', 'th']
False
real_seconds_until
(sec=None, min=None, hour=None, day=None, month=None, year=None)
Return the real seconds until game time. Args: sec (int or None): number of absolute seconds. min (int or None): number of absolute minutes. hour (int or None): number of absolute hours. day (int or None): number of absolute days. month (int or None): number of absolute...
Return the real seconds until game time.
def real_seconds_until(sec=None, min=None, hour=None, day=None, month=None, year=None): """ Return the real seconds until game time. Args: sec (int or None): number of absolute seconds. min (int or None): number of absolute minutes. hour (int or None): number ...
[ "def", "real_seconds_until", "(", "sec", "=", "None", ",", "min", "=", "None", ",", "hour", "=", "None", ",", "day", "=", "None", ",", "month", "=", "None", ",", "year", "=", "None", ")", ":", "current", "=", "datetime", ".", "fromtimestamp", "(", ...
[ 144, 0 ]
[ 195, 31 ]
python
en
['en', 'error', 'th']
False
schedule
(callback, repeat=False, sec=None, min=None, hour=None, day=None, month=None, year=None)
Call a callback at a given in-game time. Args: callback (function): The callback function that will be called. Note that the callback must be a module-level function, since the script will be persistent. repeat (bool, optional): Defines if the callback should be called ...
Call a callback at a given in-game time.
def schedule(callback, repeat=False, sec=None, min=None, hour=None, day=None, month=None, year=None): """ Call a callback at a given in-game time. Args: callback (function): The callback function that will be called. Note that the callback must be a module-level function, s...
[ "def", "schedule", "(", "callback", ",", "repeat", "=", "False", ",", "sec", "=", "None", ",", "min", "=", "None", ",", "hour", "=", "None", ",", "day", "=", "None", ",", "month", "=", "None", ",", "year", "=", "None", ")", ":", "seconds", "=", ...
[ 198, 0 ]
[ 238, 17 ]
python
en
['en', 'error', 'th']
False
reset_gametime
()
Resets the game time to make it start from the current time. Note that the epoch set by `settings.TIME_GAME_EPOCH` will still apply.
Resets the game time to make it start from the current time. Note that the epoch set by `settings.TIME_GAME_EPOCH` will still apply.
def reset_gametime(): """ Resets the game time to make it start from the current time. Note that the epoch set by `settings.TIME_GAME_EPOCH` will still apply. """ global GAME_TIME_OFFSET GAME_TIME_OFFSET = runtime() ServerConfig.objects.conf("gametime_offset", GAME_TIME_OFFSET)
[ "def", "reset_gametime", "(", ")", ":", "global", "GAME_TIME_OFFSET", "GAME_TIME_OFFSET", "=", "runtime", "(", ")", "ServerConfig", ".", "objects", ".", "conf", "(", "\"gametime_offset\"", ",", "GAME_TIME_OFFSET", ")" ]
[ 241, 0 ]
[ 249, 66 ]
python
en
['en', 'error', 'th']
False
TimeScript.at_script_creation
(self)
The script is created.
The script is created.
def at_script_creation(self): """The script is created.""" self.key = "unknown scr" self.interval = 100 self.start_delay = True self.persistent = True
[ "def", "at_script_creation", "(", "self", ")", ":", "self", ".", "key", "=", "\"unknown scr\"", "self", ".", "interval", "=", "100", "self", ".", "start_delay", "=", "True", "self", ".", "persistent", "=", "True" ]
[ 47, 4 ]
[ 52, 30 ]
python
en
['en', 'en', 'en']
True
TimeScript.at_repeat
(self)
Call the callback and reset interval.
Call the callback and reset interval.
def at_repeat(self): """Call the callback and reset interval.""" callback = self.db.callback if callback: callback() seconds = real_seconds_until(**self.db.gametime) self.restart(interval=seconds)
[ "def", "at_repeat", "(", "self", ")", ":", "callback", "=", "self", ".", "db", ".", "callback", "if", "callback", ":", "callback", "(", ")", "seconds", "=", "real_seconds_until", "(", "*", "*", "self", ".", "db", ".", "gametime", ")", "self", ".", "r...
[ 54, 4 ]
[ 61, 38 ]
python
en
['en', 'en', 'en']
True
_to_rect
(lines)
Forces all lines to be as long as the longest Args: lines (list): list of `ANSIString`s Returns: (list): list of `ANSIString`s of same length as the longest input line
Forces all lines to be as long as the longest
def _to_rect(lines): """ Forces all lines to be as long as the longest Args: lines (list): list of `ANSIString`s Returns: (list): list of `ANSIString`s of same length as the longest input line """ maxl = max(len(line) for line in lines) return [line + ' ' * (maxl -...
[ "def", "_to_rect", "(", "lines", ")", ":", "maxl", "=", "max", "(", "len", "(", "line", ")", "for", "line", "in", "lines", ")", "return", "[", "line", "+", "' '", "*", "(", "maxl", "-", "len", "(", "line", ")", ")", "for", "line", "in", "lines"...
[ 155, 0 ]
[ 168, 62 ]
python
en
['en', 'error', 'th']
False
_to_ansi
(obj, regexable=False)
convert to ANSIString
convert to ANSIString
def _to_ansi(obj, regexable=False): "convert to ANSIString" if isinstance(obj, basestring): # since ansi will be parsed twice (here and in the normal ansi send), we have to # escape the |-structure twice. obj = _ANSI_ESCAPE.sub(r"||||", obj) if isinstance(obj, dict): return d...
[ "def", "_to_ansi", "(", "obj", ",", "regexable", "=", "False", ")", ":", "if", "isinstance", "(", "obj", ",", "basestring", ")", ":", "# since ansi will be parsed twice (here and in the normal ansi send), we have to", "# escape the |-structure twice.", "obj", "=", "_ANSI_...
[ 171, 0 ]
[ 182, 63 ]
python
en
['en', 'en', 'en']
True
_test
()
test evform. This is used by the unittest system.
test evform. This is used by the unittest system.
def _test(): "test evform. This is used by the unittest system." form = EvForm("evennia.utils.tests.data.evform_example") # add data to each tagged form cell form.map(cells={"AA": "|gTom the Bouncer", 2: "|yGriatch", 3: "A sturdy fellow", 4: 1...
[ "def", "_test", "(", ")", ":", "form", "=", "EvForm", "(", "\"evennia.utils.tests.data.evform_example\"", ")", "# add data to each tagged form cell", "form", ".", "map", "(", "cells", "=", "{", "\"AA\"", ":", "\"|gTom the Bouncer\"", ",", "2", ":", "\"|yGriatch\"", ...
[ 447, 0 ]
[ 474, 24 ]
python
en
['en', 'en', 'en']
True
EvForm.__init__
(self, filename=None, cells=None, tables=None, form=None, **kwargs)
Initiate the form Kwargs: filename (str): Path to template file. cells (dict): A dictionary mapping of {id:text} tables (dict): A dictionary mapping of {id:EvTable}. form (dict): A dictionary of {"FORMCHAR":char, ...
Initiate the form
def __init__(self, filename=None, cells=None, tables=None, form=None, **kwargs): """ Initiate the form Kwargs: filename (str): Path to template file. cells (dict): A dictionary mapping of {id:text} tables (dict): A dictionary mapping of {id:EvTable}. ...
[ "def", "__init__", "(", "self", ",", "filename", "=", "None", ",", "cells", "=", "None", ",", "tables", "=", "None", ",", "form", "=", "None", ",", "*", "*", "kwargs", ")", ":", "self", ".", "filename", "=", "filename", "self", ".", "input_form_dict"...
[ 194, 4 ]
[ 230, 21 ]
python
en
['en', 'error', 'th']
False
EvForm._parse_rectangles
(self, cellchar, tablechar, form, **kwargs)
Parse a form for rectangular formfields identified by formchar enclosing an identifier.
Parse a form for rectangular formfields identified by formchar enclosing an identifier.
def _parse_rectangles(self, cellchar, tablechar, form, **kwargs): """ Parse a form for rectangular formfields identified by formchar enclosing an identifier. """ # update options given at creation with new input - this # allows e.g. self.map() to add custom settings for...
[ "def", "_parse_rectangles", "(", "self", ",", "cellchar", ",", "tablechar", ",", "form", ",", "*", "*", "kwargs", ")", ":", "# update options given at creation with new input - this", "# allows e.g. self.map() to add custom settings for individual", "# cells/tables", "custom_op...
[ 232, 4 ]
[ 351, 22 ]
python
en
['en', 'error', 'th']
False
EvForm._populate_form
(self, raw_form, mapping)
Insert cell contents into form at given locations
Insert cell contents into form at given locations
def _populate_form(self, raw_form, mapping): """ Insert cell contents into form at given locations """ form = copy.copy(raw_form) for key, (iy0, ix0, width, height, cell_or_table) in mapping.items(): # rect is a list of <height> lines, each <width> wide r...
[ "def", "_populate_form", "(", "self", ",", "raw_form", ",", "mapping", ")", ":", "form", "=", "copy", ".", "copy", "(", "raw_form", ")", "for", "key", ",", "(", "iy0", ",", "ix0", ",", "width", ",", "height", ",", "cell_or_table", ")", "in", "mapping...
[ 353, 4 ]
[ 366, 19 ]
python
en
['en', 'error', 'th']
False
EvForm.map
(self, cells=None, tables=None, **kwargs)
Add mapping for form. Args: cells (dict): A dictionary of {identifier:celltext} tables (dict): A dictionary of {identifier:table} Notes: kwargs will be forwarded to tables/cells. See `evtable.EvCell` and `evtable.EvTable` for info.
Add mapping for form.
def map(self, cells=None, tables=None, **kwargs): """ Add mapping for form. Args: cells (dict): A dictionary of {identifier:celltext} tables (dict): A dictionary of {identifier:table} Notes: kwargs will be forwarded to tables/cells. See `...
[ "def", "map", "(", "self", ",", "cells", "=", "None", ",", "tables", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# clean kwargs (these cannot be overridden)", "kwargs", ".", "pop", "(", "\"enforce_size\"", ",", "None", ")", "kwargs", ".", "pop", "(", ...
[ 368, 4 ]
[ 391, 21 ]
python
en
['en', 'error', 'th']
False
EvForm.reload
(self, filename=None, form=None, **kwargs)
Creates the form from a stored file name. Args: filename (str): The file to read from. form (dict): A mapping for the form. Notes: Kwargs are passed through to Cel creation.
Creates the form from a stored file name.
def reload(self, filename=None, form=None, **kwargs): """ Creates the form from a stored file name. Args: filename (str): The file to read from. form (dict): A mapping for the form. Notes: Kwargs are passed through to Cel creation. """ ...
[ "def", "reload", "(", "self", ",", "filename", "=", "None", ",", "form", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# clean kwargs (these cannot be overridden)", "kwargs", ".", "pop", "(", "\"enforce_size\"", ",", "None", ")", "kwargs", ".", "pop", "...
[ 393, 4 ]
[ 436, 68 ]
python
en
['en', 'error', 'th']
False
EvForm.__str__
(self)
Prints the form
Prints the form
def __str__(self): "Prints the form" return ANSIString("\n").join([line for line in self.form])
[ "def", "__str__", "(", "self", ")", ":", "return", "ANSIString", "(", "\"\\n\"", ")", ".", "join", "(", "[", "line", "for", "line", "in", "self", ".", "form", "]", ")" ]
[ 438, 4 ]
[ 440, 66 ]
python
en
['en', 'en', 'en']
True
EvForm.__unicode__
(self)
prints the form
prints the form
def __unicode__(self): "prints the form" return unicode(ANSIString("\n").join([line for line in self.form]))
[ "def", "__unicode__", "(", "self", ")", ":", "return", "unicode", "(", "ANSIString", "(", "\"\\n\"", ")", ".", "join", "(", "[", "line", "for", "line", "in", "self", ".", "form", "]", ")", ")" ]
[ 442, 4 ]
[ 444, 75 ]
python
en
['en', 'en', 'en']
True
Line.color
(self)
Sets the color of the line enclosing each sector. Defaults to the `paper_bgcolor` value. The 'color' property is a color and may be specified as: - A hex string (e.g. '#ff0000') - An rgb/rgba string (e.g. 'rgb(255,0,0)') - An hsl/hsla string (e.g. 'hsl(0,100%,...
Sets the color of the line enclosing each sector. Defaults to the `paper_bgcolor` value. The 'color' property is a color and may be specified as: - A hex string (e.g. '#ff0000') - An rgb/rgba string (e.g. 'rgb(255,0,0)') - An hsl/hsla string (e.g. 'hsl(0,100%,...
def color(self): """ Sets the color of the line enclosing each sector. Defaults to the `paper_bgcolor` value. The 'color' property is a color and may be specified as: - A hex string (e.g. '#ff0000') - An rgb/rgba string (e.g. 'rgb(255,0,0)') - An hsl/hs...
[ "def", "color", "(", "self", ")", ":", "return", "self", "[", "\"color\"", "]" ]
[ 15, 4 ]
[ 67, 28 ]
python
en
['en', 'error', 'th']
False
Line.colorsrc
(self)
Sets the source reference on Chart Studio Cloud for color . The 'colorsrc' property must be specified as a string or as a plotly.grid_objs.Column object Returns ------- str
Sets the source reference on Chart Studio Cloud for color . The 'colorsrc' property must be specified as a string or as a plotly.grid_objs.Column object
def colorsrc(self): """ Sets the source reference on Chart Studio Cloud for color . The 'colorsrc' property must be specified as a string or as a plotly.grid_objs.Column object Returns ------- str """ return self["colorsrc"]
[ "def", "colorsrc", "(", "self", ")", ":", "return", "self", "[", "\"colorsrc\"", "]" ]
[ 76, 4 ]
[ 87, 31 ]
python
en
['en', 'error', 'th']
False
Line.width
(self)
Sets the width (in px) of the line enclosing each sector. The 'width' property is a number and may be specified as: - An int or float in the interval [0, inf] - A tuple, list, or one-dimensional numpy array of the above Returns ------- int|float|numpy.n...
Sets the width (in px) of the line enclosing each sector. The 'width' property is a number and may be specified as: - An int or float in the interval [0, inf] - A tuple, list, or one-dimensional numpy array of the above
def width(self): """ Sets the width (in px) of the line enclosing each sector. The 'width' property is a number and may be specified as: - An int or float in the interval [0, inf] - A tuple, list, or one-dimensional numpy array of the above Returns -----...
[ "def", "width", "(", "self", ")", ":", "return", "self", "[", "\"width\"", "]" ]
[ 96, 4 ]
[ 108, 28 ]
python
en
['en', 'error', 'th']
False
Line.widthsrc
(self)
Sets the source reference on Chart Studio Cloud for width . The 'widthsrc' property must be specified as a string or as a plotly.grid_objs.Column object Returns ------- str
Sets the source reference on Chart Studio Cloud for width . The 'widthsrc' property must be specified as a string or as a plotly.grid_objs.Column object
def widthsrc(self): """ Sets the source reference on Chart Studio Cloud for width . The 'widthsrc' property must be specified as a string or as a plotly.grid_objs.Column object Returns ------- str """ return self["widthsrc"]
[ "def", "widthsrc", "(", "self", ")", ":", "return", "self", "[", "\"widthsrc\"", "]" ]
[ 117, 4 ]
[ 128, 31 ]
python
en
['en', 'error', 'th']
False
Line.__init__
( self, arg=None, color=None, colorsrc=None, width=None, widthsrc=None, **kwargs )
Construct a new Line object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.funnelarea.marker.Line` color Sets the color of the line enclosing each ...
Construct a new Line object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.funnelarea.marker.Line` color Sets the color of the line enclosing each ...
def __init__( self, arg=None, color=None, colorsrc=None, width=None, widthsrc=None, **kwargs ): """ Construct a new Line object Parameters ---------- arg dict of properties compatible with this constructor or an instance of ...
[ "def", "__init__", "(", "self", ",", "arg", "=", "None", ",", "color", "=", "None", ",", "colorsrc", "=", "None", ",", "width", "=", "None", ",", "widthsrc", "=", "None", ",", "*", "*", "kwargs", ")", ":", "super", "(", "Line", ",", "self", ")", ...
[ 153, 4 ]
[ 234, 34 ]
python
en
['en', 'error', 'th']
False
roll_dice
(dicenum, dicetype, modifier=None, conditional=None, return_tuple=False)
This is a standard dice roller. Args: dicenum (int): Number of dice to roll (the result to be added). dicetype (int): Number of sides of the dice to be rolled. modifier (tuple): A tuple `(operator, value)`, where operator is one of `"+"`, `"-"`, `"/"` or `"*"`. The result of the dice ...
This is a standard dice roller.
def roll_dice(dicenum, dicetype, modifier=None, conditional=None, return_tuple=False): """ This is a standard dice roller. Args: dicenum (int): Number of dice to roll (the result to be added). dicetype (int): Number of sides of the dice to be rolled. modifier (tuple): A tuple `(operator, val...
[ "def", "roll_dice", "(", "dicenum", ",", "dicetype", ",", "modifier", "=", "None", ",", "conditional", "=", "None", ",", "return_tuple", "=", "False", ")", ":", "dicenum", "=", "int", "(", "dicenum", ")", "dicetype", "=", "int", "(", "dicetype", ")", "...
[ 38, 0 ]
[ 118, 25 ]
python
en
['en', 'error', 'th']
False
CmdDice.func
(self)
Mostly parsing for calling the dice roller function
Mostly parsing for calling the dice roller function
def func(self): """Mostly parsing for calling the dice roller function""" if not self.args: self.caller.msg("Usage: @dice <nr>d<sides> [modifier] [conditional]") return argstring = "".join(str(arg) for arg in self.args) parts = [part for part in RE_PARTS.split(s...
[ "def", "func", "(", "self", ")", ":", "if", "not", "self", ".", "args", ":", "self", ".", "caller", ".", "msg", "(", "\"Usage: @dice <nr>d<sides> [modifier] [conditional]\"", ")", "return", "argstring", "=", "\"\"", ".", "join", "(", "str", "(", "arg", ")"...
[ 157, 4 ]
[ 250, 53 ]
python
en
['en', 'en', 'en']
True
DiceCmdSet.at_cmdset_creation
(self)
Called when set is created
Called when set is created
def at_cmdset_creation(self): """Called when set is created""" self.add(CmdDice())
[ "def", "at_cmdset_creation", "(", "self", ")", ":", "self", ".", "add", "(", "CmdDice", "(", ")", ")" ]
[ 259, 4 ]
[ 261, 27 ]
python
en
['en', 'en', 'en']
True
ScriptHandler.__init__
(self, obj)
Set up internal state. Args: obj (Object): A reference to the object this handler is attached to.
Set up internal state.
def __init__(self, obj): """ Set up internal state. Args: obj (Object): A reference to the object this handler is attached to. """ self.obj = obj
[ "def", "__init__", "(", "self", ",", "obj", ")", ":", "self", ".", "obj", "=", "obj" ]
[ 22, 4 ]
[ 31, 22 ]
python
en
['en', 'error', 'th']
False
ScriptHandler.__str__
(self)
List the scripts tied to this object.
List the scripts tied to this object.
def __str__(self): """ List the scripts tied to this object. """ scripts = ScriptDB.objects.get_all_scripts_on_obj(self.obj) string = "" for script in scripts: interval = "inf" next_repeat = "inf" repeats = "inf" if script....
[ "def", "__str__", "(", "self", ")", ":", "scripts", "=", "ScriptDB", ".", "objects", ".", "get_all_scripts_on_obj", "(", "self", ".", "obj", ")", "string", "=", "\"\"", "for", "script", "in", "scripts", ":", "interval", "=", "\"inf\"", "next_repeat", "=", ...
[ 33, 4 ]
[ 55, 29 ]
python
en
['en', 'error', 'th']
False
ScriptHandler.add
(self, scriptclass, key=None, autostart=True)
Add a script to this object. Args: scriptclass (Scriptclass, Script or str): Either a class object inheriting from DefaultScript, an instantiated script object or a python path to such a class object. key (str, optional): Identifier for the scrip...
Add a script to this object.
def add(self, scriptclass, key=None, autostart=True): """ Add a script to this object. Args: scriptclass (Scriptclass, Script or str): Either a class object inheriting from DefaultScript, an instantiated script object or a python path to such a class ...
[ "def", "add", "(", "self", ",", "scriptclass", ",", "key", "=", "None", ",", "autostart", "=", "True", ")", ":", "if", "self", ".", "obj", ".", "__dbclass__", ".", "__name__", "==", "\"AccountDB\"", ":", "# we add to an Account, not an Object", "script", "="...
[ 57, 4 ]
[ 81, 19 ]
python
en
['en', 'error', 'th']
False
ScriptHandler.start
(self, key)
Find scripts and force-start them Args: key (str): The script's key or dbref. Returns: nr_started (int): The number of started scripts found.
Find scripts and force-start them
def start(self, key): """ Find scripts and force-start them Args: key (str): The script's key or dbref. Returns: nr_started (int): The number of started scripts found. """ scripts = ScriptDB.objects.get_all_scripts_on_obj(self.obj, key=key) ...
[ "def", "start", "(", "self", ",", "key", ")", ":", "scripts", "=", "ScriptDB", ".", "objects", ".", "get_all_scripts_on_obj", "(", "self", ".", "obj", ",", "key", "=", "key", ")", "num", "=", "0", "for", "script", "in", "scripts", ":", "num", "+=", ...
[ 83, 4 ]
[ 98, 18 ]
python
en
['en', 'error', 'th']
False
ScriptHandler.get
(self, key)
Search scripts on this object. Args: key (str): Search criterion, the script's key or dbref. Returns: scripts (list): The found scripts matching `key`.
Search scripts on this object.
def get(self, key): """ Search scripts on this object. Args: key (str): Search criterion, the script's key or dbref. Returns: scripts (list): The found scripts matching `key`. """ return list(ScriptDB.objects.get_all_scripts_on_obj(self.obj, key...
[ "def", "get", "(", "self", ",", "key", ")", ":", "return", "list", "(", "ScriptDB", ".", "objects", ".", "get_all_scripts_on_obj", "(", "self", ".", "obj", ",", "key", "=", "key", ")", ")" ]
[ 100, 4 ]
[ 111, 79 ]
python
en
['en', 'error', 'th']
False
ScriptHandler.delete
(self, key=None)
Forcibly delete a script from this object. Args: key (str, optional): A script key or the path to a script (in the latter case all scripts with this path will be deleted!) If no key is given, delete *all* scripts on the object!
Forcibly delete a script from this object.
def delete(self, key=None): """ Forcibly delete a script from this object. Args: key (str, optional): A script key or the path to a script (in the latter case all scripts with this path will be deleted!) If no key is given, delete *all* scripts on the...
[ "def", "delete", "(", "self", ",", "key", "=", "None", ")", ":", "delscripts", "=", "ScriptDB", ".", "objects", ".", "get_all_scripts_on_obj", "(", "self", ".", "obj", ",", "key", "=", "key", ")", "if", "not", "delscripts", ":", "delscripts", "=", "[",...
[ 113, 4 ]
[ 129, 18 ]
python
en
['en', 'error', 'th']
False
ScriptHandler.all
(self)
Get all scripts stored in this handler.
Get all scripts stored in this handler.
def all(self): """ Get all scripts stored in this handler. """ return ScriptDB.objects.get_all_scripts_on_obj(self.obj)
[ "def", "all", "(", "self", ")", ":", "return", "ScriptDB", ".", "objects", ".", "get_all_scripts_on_obj", "(", "self", ".", "obj", ")" ]
[ 133, 4 ]
[ 138, 64 ]
python
en
['en', 'error', 'th']
False
ScriptHandler.validate
(self, init_mode=False)
Runs a validation on this object's scripts only. This should be called regularly to crank the wheels. Args: init_mode (str, optional): - This is used during server upstart and can have three values: - `False` (no init mode). Called during run. ...
Runs a validation on this object's scripts only. This should be called regularly to crank the wheels.
def validate(self, init_mode=False): """ Runs a validation on this object's scripts only. This should be called regularly to crank the wheels. Args: init_mode (str, optional): - This is used during server upstart and can have three values: - ...
[ "def", "validate", "(", "self", ",", "init_mode", "=", "False", ")", ":", "ScriptDB", ".", "objects", ".", "validate", "(", "obj", "=", "self", ".", "obj", ",", "init_mode", "=", "init_mode", ")" ]
[ 140, 4 ]
[ 153, 68 ]
python
en
['en', 'error', 'th']
False