Hello Tim Roberts, Thanks a lot. I will open up the source code and try to understand the implementation. I will continue to work with my existing code.
On Thu, Mar 29, 2012 at 10:37 PM, Tim Roberts <t...@probo.com> wrote: > pavi ena wrote: > > > > I am new to Python Window services development. I have small code below. > > ... > > Generally i run this script as batch file which takes parameters like > > user_id > > and password > > > > python demo_svcs.py install > > python demo_svcs.py start %user_id% %password% > > > > At present in my code i am passing user_id and password as argv > > "win32serviceutil.HandleCommandLine(DemoService, argv=sys.argv)" > > which intern i am accessing these user_id and password in 'SvcDoRun' > > method > > with 'args', i just wanted to know is this the correct approach or do > > we have flexibility > > to overwrite 'SvcDoRun' method to get these 'user_id' and 'password' > > as kwd_args > > and use these kwd_args in 'start_mail_check' method. > > Remember that you have the full source code to win32serviceutil.py in > your Python distribution. You can go look it up. SvcDoRun is called > from win32serviceutil.py. You'll see that it is called from > ServiceFramework.SvcRun with no parameters: > self.SvcDoRun() > > SvcRun is called in response to a message from the Service Control > Manager, so there's really no place to make a modification like that. I > think you need to keep doing what you are doing. > > -- > Tim Roberts, t...@probo.com > Providenza & Boekelheide, Inc. > > _______________________________________________ > python-win32 mailing list > python-win32@python.org > http://mail.python.org/mailman/listinfo/python-win32 >
_______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32