472,364 Members | 2,009 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,364 software developers and data experts.

SimpleXMLRPCServer - disable output

Hi,
I thought I posted this, but its been about 10min and hasnt shown up
on the group.
Basically I created a SimpleXMLRPCServer and when one of its methods
gets called and it returns a response to the client, the server prints
some info out to the console, such as,

localhost - - [14/Apr/2005 16:06:28] "POST /RPC2 HTTP/1.0" 200 -

Anyhow, is there a way I can surpress that so its not printed to the
console? I looked at SimpleXMLRPCServer.py ...it doesn't explicitly
print that, I think perhaps std is...but not sure. Any ideas??

thanks.

Jul 19 '05 #1
4 2237

codecraig> I thought I posted this, but its been about 10min and hasnt
codecraig> shown up on the group.

Patience...

codecraig> localhost - - [14/Apr/2005 16:06:28] "POST /RPC2 HTTP/1.0" 200 -

codecraig> Anyhow, is there a way I can surpress that so its not printed
codecraig> to the console? I looked at SimpleXMLRPCServer.py ...it
codecraig> doesn't explicitly print that, I think perhaps std is...but
codecraig> not sure. Any ideas??

Introspection is your friend:
import SimpleXMLRPCServer
for a in dir(SimpleXMLRPCServer):

... matches = [m for m in dir(getattr(SimpleXMLRPCServer, a))
... if m.find("log") != -1]
... if matches:
... print "***", a, "***"
... print matches
...
*** SimpleXMLRPCRequestHandler ***
['log_date_time_string', 'log_error', 'log_message', 'log_request']
*** os ***
['getlogin']

Skip
Jul 19 '05 #2
codecraig wrote:
Hi,
I thought I posted this, but its been about 10min and hasnt shown up
on the group.
Basically I created a SimpleXMLRPCServer and when one of its methods
gets called and it returns a response to the client, the server prints
some info out to the console, such as,

localhost - - [14/Apr/2005 16:06:28] "POST /RPC2 HTTP/1.0" 200 -

Anyhow, is there a way I can surpress that so its not printed to the
console? I looked at SimpleXMLRPCServer.py ...it doesn't explicitly
print that, I think perhaps std is...but not sure. Any ideas??

thanks.

Here's the entire SimpleMLRPCServer class from SimpleXMLRPCServer.py:
class SimpleXMLRPCServer(SocketServer.TCPServer,
SimpleXMLRPCDispatcher):
"""Simple XML-RPC server.

Simple XML-RPC server that allows functions and a single instance
to be installed to handle requests. The default implementation
attempts to dispatch XML-RPC calls to the functions or instance
installed in the server. Override the _dispatch method inhereted
from SimpleXMLRPCDispatcher to change this behavior.
"""

def __init__(self, addr, requestHandler=SimpleXMLRPCRequestHandler,
logRequests=1):
self.logRequests = logRequests

SimpleXMLRPCDispatcher.__init__(self)
SocketServer.TCPServer.__init__(self, addr, requestHandler)

You should be able to change logRequests to 0 and that should fix it. I just tested it at a prompt and it worked just fine.
Jeremy Jones

Jul 19 '05 #3

Jeremy Jones wrote:
codecraig wrote:
Hi,
I thought I posted this, but its been about 10min and hasnt shown upon the group.
Basically I created a SimpleXMLRPCServer and when one of its methodsgets called and it returns a response to the client, the server printssome info out to the console, such as,

localhost - - [14/Apr/2005 16:06:28] "POST /RPC2 HTTP/1.0" 200 -

Anyhow, is there a way I can surpress that so its not printed to the
console? I looked at SimpleXMLRPCServer.py ...it doesn't explicitly
print that, I think perhaps std is...but not sure. Any ideas??

thanks.
Here's the entire SimpleMLRPCServer class from SimpleXMLRPCServer.py:
class SimpleXMLRPCServer(SocketServer.TCPServer,
SimpleXMLRPCDispatcher):
"""Simple XML-RPC server.

Simple XML-RPC server that allows functions and a single instance
to be installed to handle requests. The default implementation
attempts to dispatch XML-RPC calls to the functions or instance
installed in the server. Override the _dispatch method inhereted
from SimpleXMLRPCDispatcher to change this behavior.
"""

def __init__(self, addr,

requestHandler=SimpleXMLRPCRequestHandler, logRequests=1):
self.logRequests = logRequests

SimpleXMLRPCDispatcher.__init__(self)
SocketServer.TCPServer.__init__(self, addr, requestHandler)

You should be able to change logRequests to 0 and that should fix it. I just tested it at a prompt and it worked just fine.

Jeremy Jones


Jeremy,
So can you explain what I can do to set logRequests = 0? Do i just
do..

server = SimpleXMLRPCServer(0) ???

I am sorta new to python thanks.

Jul 19 '05 #4
Jeremy,
Thanks for clearing that up. I am so used to java (i.e.
foo.setLogRequests(0))...that I forgot I could just do, foo.logRequests
= 0.

Learning one day at a time :)

Thanks.

Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Marco Aschwanden | last post by:
I would like to develop a server based on python's xmlrpc. But I realized that SimpleXMLRPCServer does not spawn a thread for each request. How could the SimpleXMLRPCServer be turned into a...
3
by: Maxim Khesin | last post by:
Hi, the typical usage of SimpleXMLRPCServer registers some class with the server instance and then jumps into a serve-forever loop, e.g. server = SimpleXMLRPCServer(('', 8000))...
0
by: Thomas G. Apostolou | last post by:
Hello all, I use Python 2.3.3 and try to patch SimpleXMLRPCServer.py with the patch i got from Python.org. so after changing to the directory where both SimpleXMLRPCServer.py and...
0
by: JDF | last post by:
I am trying to create a Windows service using SimpleXMLRPCServer and win32serviceutil. The service itself seems to be working properly (starts, stops, etc) and I can connect using an XMLRPC client...
2
by: Laszlo Nagy | last post by:
Hello, I ran in the same problem again. Many others have the same problem. Just Google for this: "SimpleXMLRPCServer allow_none site:python.org". Looks like the 'allow_none' patch was commited...
0
by: Juju | last post by:
Hi, First, sorry for my poor English ! I used the SimpleXMLRPCServer facility of Python to develop a multithread-server, here's part of my code : -- class...
0
by: Rudy Schockaert | last post by:
After some Googling I found a post of someone who wanted to do exactly as what I want to do now. There is however a problem in his code that makes the service fails after the first connection. I...
3
by: Achim Domma | last post by:
Hi, is SimpleXMLRPCServer multithreaded or how does it handle multiple clients? I want to implement a simple server which will be queried by multiple processes for work to be done. The server...
9
by: Bret | last post by:
I'm coming back to Python after an absence and it's surprising how many things I've forgotten since wandering (against my will) into Java land. Anyway, I have a need for a way to make...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.