misc

Extra classes that implementent miscellaneous needed functionailty

python_sikuli_client.misc.DEFERRED(func)[source]

Decorator for unimplemented interfaces :type func: function

class python_sikuli_client.misc.RemoteLib(remote)[source]

Re-exposes a classes keywords wrapped by robotremotelibrary.py

class python_sikuli_client.misc.SikuliUnreflected(remote)[source]

Custom keyword handlers rather than those reflected over RPC

find(PS)[source]
Parameters:PSPattern or str
Return type:Match

Find a particular GUI element, which is seen as the given image or just plain text. The given file name of an image specifies the element’s appearance. It searches within the region and returns the best match, which shows a similarity greater than the minimum similarity given by the pattern. If no similarity was set for the pattern by python_sikuli_client.pattern.Pattern.similar() before, a default minimum similarity of 0.7 is set automatically.

If autoWaitTimeout is set to a non-zero value, find() just acts as a wait().

Side Effect lastMatch: the best match can be accessed using getLastMatch() afterwards.

python_sikuli_client.misc.TODO(func)[source]

Decorator for unimplemented interfaces :type func: function

python_sikuli_client.misc.constructor(cls)[source]
Parameters:cls – class to use decorated function as constructor for

Uses func as a potential constructor for cls: func should return the string which when evaluated by jython gives the object we want.

@constructor(cls)
def func(*args, **kwargs):
    ...
python_sikuli_client.misc.dropNones(num_required, keys, *args, **kwargs)[source]

Was finding this repoetitive. :param num_required: how many args are required in total :param keys: dict of keys and (bool) is_required (None ignores this) :param args: :param kwargs: some of these will not

python_sikuli_client.misc.return_from_remote(rtype)[source]

Decorator factory returning a run_on_remote decorator which marshals and unmarshals the return type as rtype where rtype must be either a subclass of ClientSikuliClass, or the string name of a class in classes

Parameters:rtype – return type
@return_from_remote(rtype)
def func(*args, **kwargs):
    ...
python_sikuli_client.misc.run_on_remote(func)[source]
Parameters:func – function to decorate

Runs the decorated function but discards the result, so you can use it for sanity-checking but should not use it for actual processing, as this will be done on the server side.

The decorated function can have a number of properties that modify the way it is run, each of which should be a function itself:

func.arg(*args, **kwargs):
The output of this will be used as args for the inner wrapper
func.post(result):
This takes the output of the inner wrapper, and its ouput is returned by the outer wrapper
func.func(*args, **kwargs):
Replaces the default inner function - should handle all interaction with the server
@run_on_remote
def func(*args, **kwargs):
    ...
python_sikuli_client.misc.s_repr(obj)[source]
Parameters:obj – object

Previous topic

match

Next topic

pattern

This Page