yt.utilities.rpdb module

class yt.utilities.rpdb.PdbXMLRPCServer(addr, requestHandler=<class 'xmlrpc.server.SimpleXMLRPCRequestHandler'>, logRequests=True, allow_none=False, encoding=None, bind_and_activate=True, use_builtin_types=False)[source]

Bases: SimpleXMLRPCServer

shutdown-enabled XMLRPCServer from

http://code.activestate.com/recipes/114579/

address_family = 2
allow_reuse_address = True
allow_reuse_port = False
close_request(request)

Called to clean up an individual request.

fileno()

Return socket file number.

Interface required by selector.

finish_request(request, client_address)

Finish one request by instantiating RequestHandlerClass.

finished = False
get_request()

Get the request and client address from the socket.

May be overridden.

handle_error(request, client_address)

Handle an error gracefully. May be overridden.

The default is to print a traceback and continue.

handle_request()

Handle one request, possibly blocking.

Respects self.timeout.

handle_timeout()

Called if no new request arrives within self.timeout.

Overridden by ForkingMixIn.

process_request(request, client_address)

Call finish_request.

Overridden by ForkingMixIn and ThreadingMixIn.

register_function(function=None, name=None)

Registers a function to respond to XML-RPC requests.

The optional name argument can be used to set a Unicode name for the function.

register_instance(instance, allow_dotted_names=False)

Registers an instance to respond to XML-RPC requests.

Only one instance can be installed at a time.

If the registered instance has a _dispatch method then that method will be called with the name of the XML-RPC method and its parameters as a tuple e.g. instance._dispatch(‘add’,(2,3))

If the registered instance does not have a _dispatch method then the instance will be searched to find a matching method and, if found, will be called. Methods beginning with an ‘_’ are considered private and will not be called by SimpleXMLRPCServer.

If a registered function matches an XML-RPC request, then it will be called instead of the registered instance.

If the optional allow_dotted_names argument is true and the instance does not have a _dispatch method, method names containing dots are supported and resolved, as long as none of the name segments start with an ‘_’.

* SECURITY WARNING: *

Enabling the allow_dotted_names options allows intruders to access your module’s global variables and may allow intruders to execute arbitrary code on your machine. Only use this option on a secure, closed network.

register_introspection_functions()

Registers the XML-RPC introspection methods in the system namespace.

see http://xmlrpc.usefulinc.com/doc/reserved.html

register_multicall_functions()

Registers the XML-RPC multicall method in the system namespace.

see http://www.xmlrpc.com/discuss/msgReader$1208

register_signal(signum)[source]
request_queue_size = 5
serve_forever()[source]

Handle one request at a time until shutdown.

Polls for shutdown every poll_interval seconds. Ignores self.timeout. If you need to do periodic tasks, do them in another thread.

server_activate()

Called by constructor to activate the server.

May be overridden.

server_bind()

Called by constructor to bind the socket.

May be overridden.

server_close()

Called to clean-up the server.

May be overridden.

service_actions()

Called by the serve_forever() loop.

May be overridden by a subclass / Mixin to implement any code that needs to be run during the loop.

shutdown()[source]

Stops the serve_forever loop.

Blocks until the loop has finished. This must be called while serve_forever() is running in another thread, or it will deadlock.

shutdown_request(request)

Called to shutdown and close an individual request.

signal_handler(signum, frame)[source]
socket_type = 1
system_listMethods()

system.listMethods() => [‘add’, ‘subtract’, ‘multiple’]

Returns a list of the methods supported by the server.

system_methodHelp(method_name)

system.methodHelp(‘add’) => “Adds two integers together”

Returns a string containing documentation for the specified method.

system_methodSignature(method_name)

system.methodSignature(‘add’) => [double, int, int]

Returns a list describing the signature of the method. In the above example, the add method takes two integers as arguments and returns a double result.

This server does NOT support system.methodSignature.

system_multicall(call_list)

system.multicall([{‘methodName’: ‘add’, ‘params’: [2, 2]}, …]) => [[4], …]

Allows the caller to package multiple XML-RPC calls into a single request.

See http://www.xmlrpc.com/discuss/msgReader$1208

timeout = None
verify_request(request, client_address)

Verify the request. May be overridden.

Return True if we should proceed with this request.

class yt.utilities.rpdb.pdb_handler(tb)[source]

Bases: object

execute(line)[source]
class yt.utilities.rpdb.rpdb_cmd(proxy)[source]

Bases: Cmd

cmdloop(intro=None)

Repeatedly issue a prompt, accept input, parse an initial prefix off the received input, and dispatch to action methods, passing them the remainder of the line as argument.

columnize(list, displaywidth=80)

Display a list of strings as a compact set of columns.

Each column is only as wide as necessary. Columns are separated by two spaces (one was not legible enough).

complete(text, state)

Return the next possible completion for ‘text’.

If a command has not been entered, then complete against command list. Otherwise try to call complete_<command> to get list of completions.

complete_help(*args)
completedefault(*ignored)

Method called to complete an input line when no command-specific complete_*() method is available.

By default, it returns an empty list.

completenames(text, *ignored)
default(line)[source]

Called on an input line when the command prefix is not recognized.

If this method is not overridden, it prints an error message and returns.

do_help(line)[source]

List available commands with “help” or detailed help with “help cmd”.

do_shutdown(args)[source]
doc_header = 'Documented commands (type help <topic>):'
doc_leader = ''
emptyline()

Called when an empty line is entered in response to the prompt.

If this method is not overridden, it repeats the last nonempty command entered.

get_names()
identchars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_'
intro = None
lastcmd = ''
misc_header = 'Miscellaneous help topics:'
nohelp = '*** No help on %s'
onecmd(line)

Interpret the argument as though it had been typed in response to the prompt.

This may be overridden, but should not normally need to be; see the precmd() and postcmd() methods for useful execution hooks. The return value is a flag indicating whether interpretation of commands by the interpreter should stop.

parseline(line)

Parse the line into a command name and a string containing the arguments. Returns a tuple containing (command, args, line). ‘command’ and ‘args’ may be None if the line couldn’t be parsed.

postcmd(stop, line)[source]

Hook method executed just after a command dispatch is finished.

postloop()[source]

Hook method executed once when the cmdloop() method is about to return.

precmd(line)

Hook method executed just before the command line is interpreted, but after the input prompt is generated and issued.

preloop()

Hook method executed once when the cmdloop() method is called.

print_topics(header, cmds, cmdlen, maxcol)
prompt = '(Cmd) '
ruler = '='
undoc_header = 'Undocumented commands:'
use_rawinput = 1
yt.utilities.rpdb.rpdb_excepthook(exc_type, exc, tb)[source]
yt.utilities.rpdb.run_rpdb(task=None)[source]