On Dec 3, 2010, at 11:32 AM, Jonathan Lundell wrote:
>
> On Dec 3, 2010, at 11:27 AM, Jonathan Lundell wrote:
>>
>> On Dec 3, 2010, at 11:20 AM, Fran wrote:
>>>
>>> On Dec 3, 6:20 pm, Jonathan Lundell <[email protected]> wrote:
>>>> I sent Massimo a patch that will retain backward compatibility.
>>>
>>> Thanks but not quite yet:
>>> Traceback (most recent call last):
>>> File "C:\Bin\web2py\gluon\winservice.py", line 46, in SvcDoRun
>>> self.start()
>>> File "C:\Bin\web2py\gluon\winservice.py", line 103, in start
>>> if options.get('numthreads') is not None and
>>> options.get('minthreads') is None:
>>> AttributeError: 'module' object has no attribute 'get'
>>
>> Crap. OK, thanks; I'll take another look. If it's convenient, could you
>> probe a little and tell me what exactly options is? I assumed it was a dict,
>> but apparently not.
>
> Never mind, I figured it out. One more patch coming.
A patch is on its way to Massimo. In the meantime, here's the relevant section
of winservice.py if you want to try it out. Let me know. (If you define both
minthreads and maxthreads in options.py, you can change "if True" to "if False"
and avoid the legacy logic altogether, but please try it first as-is.)
options = __import__(opt_mod, [], [], '')
if True: # legacy support for old options files, which have only
(deprecated) numthreads
if hasattr(options, 'numthreads') and not hasattr(options,
'minthreads'):
options.minthreads = options.numthreads
if not hasattr(options, 'minthreads'): options.minthreads = None
if not hasattr(options, 'maxthreads'): options.maxthreads = None
import main
self.server = main.HttpServer(
ip=options.ip,
port=options.port,
password=options.password,
pid_filename=options.pid_filename,
log_filename=options.log_filename,
profiler_filename=options.profiler_filename,
ssl_certificate=options.ssl_certificate,
ssl_private_key=options.ssl_private_key,
min_threads=options.minthreads,
max_threads=options.maxthreads,
server_name=options.server_name,
request_queue_size=options.request_queue_size,
timeout=options.timeout,
shutdown_timeout=options.shutdown_timeout,
path=options.folder
)