| |
- __builtin__.object
-
- _XXClient
- rox.xxmlrpc.XXMLRPCServer
-
- _XXServer
-
- FileHandler
Client = class _XXClient(__builtin__.object) |
|
Provides the client side of the client/server model. This is the
XXMLRPC implementation. Create an instance of this class with the
appropriate service, interface and object parameters then call the
required methods. A rox.xxmlrpc.NoSuchService exception may be raised
if the server side cannot be contacted. |
|
Methods defined here:
- __init__(self, service_name, interface_name, object_path='Default')
- Constructor.
service_name - namespaced name giving the service to contact, e.g.
net.sf.rox.Session
interface_name - namespaced name defining the set of methods that
may be called, e.g. net.sf.rox.Session.Control. This is ignored but
must still be specified for compatability with the DBus implementation
object_path - determines the data the methods work on, defaults to
'Default' if not specified
|
class FileHandler(_XXServer) |
|
An example Server derivation, providing the most common use case.
This provides the interface 'net.sourceforge.rox.FileHandler' on the object
'Default'. Three methods are defined and one, Quit(), is implemented.
To use this class you must derive a class from it and implement:
* A class member, service_name, naming the service (e.g.
com.mydomain.MyApp)
* An implementation of the OpenFile() method. This takes one argument,
a file name. This should open a new window for that file. |
|
Methods defined here:
- OpenFile(self, file_name)
- Open the file file_name. This method must be implemented.
- OpenOptions(self)
- Open the applications options, only if the file 'Options.xml' exists
in the app dir and is readable.
- Quit(self)
- Stop acting as a server. The window count is reduced by one (if
this is the first call to Quit) to remove the ref added by __init__.
The application will remain running while it still has windows open
unless you override this to change the behavior.
- __init__(self, service_name=None, interface_name=None, object_path=None)
- Constructor.
service_name - namespaced name giving the service to provide, e.g.
com.mydomain.MyApp
interface_name - namespaced name defining the set of methods that
may be called, e.g. net.sourceforge.rox.FileHandler. This is ignored
but must still be specified for compatability with the DBus
implementation
object_path - determines the data the methods work on, 'Default'.
These all must be None or the same as the class variables of the
same name (so that rox.singleton.contact() can work as expected).
This method increments the window count by one, so that the main loop
will remain running even when no windows are open.
Class methods defined here:
- open_file(cls, file_name) from __builtin__.classobj
- Class method.
Open the named file. If the server could be contacted then
it is used to open the file, otherwise a new instance of this class
becomes the server and opens it.
- open_options(cls) from __builtin__.classobj
- Class method
Open the options dialog. If the server could be contacted then
it is used to show the options dialog, otherwise a new instance of
this class becomes the server and shows it.
- quit(cls) from __builtin__.classobj
- Class method.
Tell the current server to quit (see the Quit() method). If there
is no server then take no action.
- run(cls, file_name=None) from __builtin__.classobj
- Class method.
Open the named file This is as the open_file() method, except that
if an existing server could not be contacted then as well as
creating a server instance rox.mainloop() is called until the
server exits.
file_name can be None, in which case the call returns if a server
exists and installs a new server without opening a window if one
does not exist.
True is returned if a server instance was installed and has now
exited, False if an existing server was used.
|
Server = class _XXServer(rox.xxmlrpc.XXMLRPCServer) |
|
Provides the server side of the client/server model. You should
derive your own class from this and provide:
* A member allowed_methods which is a tuple of strings listing the
name of each method that may be called.
* An implementation of each method listed in available_methods.
Alternatively derive from the FileHandler class instead if that meets
your needs. This class only supports a single object, use
rox.xxmlrpc.XXMLRPCServer if you need to support multiple objects.
This is the XXMLRPC implementation. |
|
Methods defined here:
- __init__(self, service_name, interface_name, object_path='Default')
- Constructor.
service_name - namespaced name giving the service to provide, e.g.
com.mydomain.MyApp
interface_name - namespaced name defining the set of methods that
may be called, e.g. com.mydomain.MyApp.Control. This is ignored but
must still be specified for compatability with the DBus implementation
object_path - determines the data the methods work on, defaults to
'Default' if not specified.
This initialises rox.xxmlrpc.XXMLRPCServer with service_name and
adds itself as a single object of the given path.
| |