Class p.u.v.v.poller(object):

Part of pida.utils.vim.vimcom View In Hierarchy

DEPRECATED: WE DO NOT USE THIS ANYMORE

An instance of Vim on a pseudoterminal which can be reliably polled.

This class is used to provide an instance of Vim which can be communicated with using the Vim client/server protocol, in order to retrieve an accurate and current server list, and also which can be polled accurately as to whether it is alive before communicating with it.

This method is much cheaper in resources than running vim --serverlist each time, and much more accurate than using the root window's VimRegistry property, and also more accurate than using GDK methods for assessing whether a window is alive.

Line # Kind Name Docs
121 Method __init__ Constructor.
137 Method start Start the Vim instance if it is not already running.
167 Method is_alive Check if the Vim instance is alive.
def __init__(self):
Constructor.

Create a temporary and unique name for use as the servername, and initialise the instance variables.

@param cb: An instance of the main application class. @type cb: pida.main.Application.

def start(self):
Start the Vim instance if it is not already running.

This command forks in a pseudoterminal, and starts Vim, if Vim is not already running. The pid is stored for later use.

def is_alive(self):
Check if the Vim instance is alive.

This method uses os.waitpid, with no blocking to determine whether the process is still alive. If it is not, it sets the internal pid attribute to None, so that it may be restarted.

@returns: alive @rtype alive: boolean

API Documentation for PIDA, generated by pydoctor.