moosic_factory
index
/home/daniel/projects/moosic/moosic-1.5.0/moosic_factory.py

Factory functions for creating Moosic server proxies.
 
This module contains functions that make it very quick and easy to create a
proxy object that exposes all the methods of a Moosic server.  These proxy
objects are instances of xmlrpclib.ServerProxy, so you should refer to the
documentation for the xmlrpclib module for more detailed information about
ServerProxy objects.  These factory functions are not necessary for creating
proper Moosic server proxies, but they are a very convenient way of doing so.
 
This module also contains a subclass of xmlrpclib.Transport that adapts the
XML-RPC client implementation for use with Unix sockets.
 
It is safe to "import *" from this module.

 
Modules
       
httplib
os
popen2
socket
sys
urllib
xmlrpclib

 
Classes
       
xmlrpclib.Transport
UnixStreamTransport

 
class UnixStreamTransport(xmlrpclib.Transport)
    An adapter for speaking HTTP over a Unix socket instead of a TCP/IP socket.
 
  Methods defined here:
make_connection(self, host)

Methods inherited from xmlrpclib.Transport:
get_host_info(self, host)
getparser(self)
parse_response(self, file)
request(self, host, handler, request_body, verbose=0)
send_content(self, connection, request_body)
send_host(self, connection, host)
send_request(self, connection, handler, request_body)
send_user_agent(self, connection)

Data and other attributes inherited from xmlrpclib.Transport:
user_agent = 'xmlrpclib.py/1.0.1 (by www.pythonware.com)'

 
Functions
       
InetMoosicProxy(host, port)
Creates a proxy to a Moosic server that is listening to a TCP/IP socket.
 
The first argument, "host", is the hostname or IP address where the server
is located. The second argument, "port", is the TCP port that the server is
listening to.
LocalMoosicProxy(filename=None)
Creates a proxy to a Moosic server that is listening to a local (Unix
address family) socket.
 
The optional "filename" argument is the location of the socket file that the
Moosic server is using as its address.
UnixMoosicProxy(filename=None)
An alias for the LocalMoosicProxy function.
startServer(config_dir)
Attempts to run the "moosicd" program.
 
The location of the program is first sought in the MOOSICD environment
variable (which should contain the full pathname of the program), and then
sought in the directories listed in the PATH environment variable.
 
The "config_dir" parameter is the path name of the directory where moosicd
should locate the files it uses at runtime. This is usually set to the
".moosic" directory in the user's home directory.
 
If moosicd can't be started, a string describing why is returned.
Otherwise, None is returned.

 
Data
        __all__ = ('UnixStreamTransport', 'LocalMoosicProxy', 'UnixMoosicProxy', 'InetMoosicProxy', 'startServer')