Hi!

I used the service example to make Pylons webapp in windows.

But as I see, the pages never reload - except on service (re)starting.

To force it I tried with:

    def SvcDoRun(self):
        os.chdir(os.path.dirname(__file__))
        s = Server(None)
        try:
            s.run(["--reload", self.iniFile])
        except:
            import sys, traceback
            exceptionType, exceptionValue, exceptionTraceback =
sys.exc_info()
            s = "\n".join(traceback.format_exception(exceptionType,
exceptionValue, exceptionTraceback))
            f = open("c:\debug.file", "w")
            f.write(s)
            f.close()
            raise
        win32event.WaitForSingleObject(self.stop_event,
win32event.INFINITE)

But I got this error message:

Traceback (most recent call last):

  File "c:\web\pylons\akarmi\WindowsService.py", line 86, in SvcDoRun
    s.run(["--reload", self.iniFile])

  File "c:\python25\lib\site-packages\pastescript-1.7.3-py2.5.egg\paste
\script\command.py", line 218, in run
    result = self.command()

  File "c:\python25\lib\site-packages\pastescript-1.7.3-py2.5.egg\paste
\script\serve.py", line 186, in command
    return self.restart_with_reloader()

  File "c:\python25\lib\site-packages\pastescript-1.7.3-py2.5.egg\paste
\script\serve.py", line 416, in restart_with_reloader
    self.restart_with_monitor(reloader=True)

  File "c:\python25\lib\site-packages\pastescript-1.7.3-py2.5.egg\paste
\script\serve.py", line 434, in restart_with_monitor
    _turn_sigterm_into_systemexit()

  File "c:\python25\lib\site-packages\pastescript-1.7.3-py2.5.egg\paste
\script\serve.py", line 642, in _turn_sigterm_into_systemexit
    signal.signal(signal.SIGTERM, handle_term)

ValueError: signal only works in main thread

To test other options, I replace it with:

            s.run(["--log-file", "all.log", self.iniFile])

This working good, the "all.log" is growing.

Interesting question: why Pylons reloading is works in normal (batch)
mode, and why it isn't works in service mode? What is the different?

Thanks for your help:
   dd
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to