Pyro4.utils.flame
— Foreign Location Automatic Module Exposer
Pyro FLAME: Foreign Location Automatic Module Exposer. Easy but potentially very dangerous way of exposing remote modules and builtins. Flame requires the pickle serializer to be used.
- class Pyro4.utils.flame.Flame
The actual FLAME server logic. Usually created by using
core.Daemon.startFlame()
. Be very cautious before starting this: it allows the clients full access to everything on your system.- builtin(name)
returns a proxy to the given builtin on the server
- console()
get a proxy for a remote interactive console session
- evaluate(expression)
evaluate an expression and return its result
- execute(code)
execute a piece of code
- getfile(filename)
read any accessible file from the server
- getmodule(modulename)
obtain the source code from a module on the server
- module(name)
Import a module on the server given by the module name and returns a proxy to it. The returned proxy does not support direct attribute access, if you want that, you should use the
evaluate
method instead.
- sendfile(filename, filedata)
store a new file on the server
- sendmodule(modulename, modulesource)
Send the source of a module to the server and make the server load it. Note that you still have to actually
import
it on the server to access it. Sending a module again will replace the previous one with the new.
- Pyro4.utils.flame.connect(location, hmac_key=None)
Connect to a Flame server on the given location, for instance localhost:9999 or ./u:unixsock This is just a convenience function to creates an appropriate Pyro proxy.
- Pyro4.utils.flame.createModule(name, source, filename='<dynamic-module>', namespace=None)
Utility function to create a new module with the given name (dotted notation allowed), directly from the source string. Adds it to sys.modules, and returns the new module object. If you provide a namespace dict (such as
globals()
), it will import the module into that namespace too.
- Pyro4.utils.flame.start(daemon)
Create and register a Flame server in the given daemon. Be very cautious before starting this: it allows the clients full access to everything on your system.