Python on Windows Help

2008-02-21 Thread msmith
I've written the following script based on information I have found on
the web.  The purpose of the script is to start an HTTP listener on
the machine it's running on that will give status on a particular
service running on that system.  I've tried to create this as a
service on the windows server it's running on, and it will install
fine.  The problem I'm having is that the service will not stop when I
tell it to.  Any help that anyone could provide would be greatly
appreciated.  I'm new to python so please let me know if there is a
more efficient way to do what I'm trying to do.  The code follows:

import win32service
import win32serviceutil
import wmi
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler

class BlobCheck(win32serviceutil.ServiceFramework):
_svc_name_ = "BlobCheck"
_svc_display_name_ = "Epic Blob Checker"
_svc_description_ = "Checks the Epic Blob Service and Creates an HTTP
listener that can be polled for status"

def __init__(self,args):
win32serviceutil.ServiceFramework.__init__(self,args)
self.isAlive = True

def SvcDoRun(self):
import servicemanager
c = wmi.WMI()

while self.isAlive:
class RequestHandler(BaseHTTPRequestHandler):
def _writeheaders(self):
self.send_response(200)
self.send_header('Content-type', 
'text/html')
self.end_headers()

def do_HEAD(self):
self._writeheaders()

def do_GET(self):
self._writeheaders()
running = c.Win32_Process 
(name="notepad.exe")
if running:

self.wfile.write("""Monitor

Kool-Aid!!!""")
else:

self.wfile.write("""Monitor
Oh No!!!""")

serveraddr = ('', 12345)
srvr = HTTPServer(serveraddr, RequestHandler)
srvr.handle_request()

def SvcStop(self):
import servicemanager

servicemanager.LogInfoMsg("aservice - Recieved stop signal")
self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
self.isAlive = False

if __name__ == '__main__':
win32serviceutil.HandleCommandLine(BlobCheck)
-- 
http://mail.python.org/mailman/listinfo/python-list


Diary of a Stripper.

2008-03-13 Thread MSmith
Hi, my name is Michelle, I'm 27, just left being a secretary to become
a stripper, and looking for friends to talk to. I love meeting new
people!

I also have a blog where I talk about my life... http://missxxy.blogspot.com

Talk to you soon!

Michelle
-- 
http://mail.python.org/mailman/listinfo/python-list


I found affordable health insurance.

2008-03-15 Thread MSmith
I couldn't believe it.


Do yourself a favour and at least check it out:

http://www.jdoqocy.com/click-2924912-10359791



Michael
-- 
http://mail.python.org/mailman/listinfo/python-list