[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: 4 KDE - ЗАЧЕМ? кому это надо?



Alexey Pechnikov wrote:
> Если все так просто,
> может, продемонстрируете, как на питоне сгенерить питоновский конфиг,
> аналогичный вот такому тиклевскому:
> 
> ns_section "ns/server/${servername}/adp/parsers"
> ns_param   adp             ".adp"   ;# The simple parser looks for <\% ...
> \%>
> 
> ns_section "ns/server/${servername}/module/nssock"
> ns_param   port            $httpport ;# Port for HTTP (typically 80)
> ns_param   hostname   $hostname ;# This is not the same as your hostname
> ns_param   address       $address  ;# This is not the same as your host
> addr
> ns_param   location      "http://$hostname";     ;# URL for auto-redirects
> (trailing slash)
> ns_param maxpost        [expr 20 * 1024 * 1024] ;
> ns_param maxinput       [expr 20 * 1024 * 1024] ;
> 
> Ага, с сохранением кавычек, комментариев и заданием параметров в удобном
> виде: 20 * 1024 * 1024. Нет, я не знаю, в какое место нужно запихать
> параметры питону, чтобы получить аналогичную древовидную структуру.

Например так (отступы здесь только для удобства):

ns_section('ns/server/' + servername + '/module/nssock',
   port = httpport, # Port for HTTP (typically 80)
   hostname = hostname, # This is not the same as your hostname
   address = address,  # This is not the same as your host addr
   location = 'http://' + hostname,     # URL for auto-redirects (trailing slash)
   maxpost = 20 * 1024 * 1024,
   maxinput = 20 * 1024 * 1024
)

Или так:

ns_section('ns', 'server', servername, 'module', 'nssock',
   port = httpport, # Port for HTTP (typically 80)
   hostname = hostname, # This is not the same as your hostname
   address = address,  # This is not the same as your host addr
   location = 'http://' + hostname,     # URL for auto-redirects (trailing slash)
   maxpost = 20 * 1024 * 1024,
   maxinput = 20 * 1024 * 1024
)

Или даже так:

ns.server[servername].module.nssock(
   port = httpport, # Port for HTTP (typically 80)
   hostname = hostname, # This is not the same as your hostname
   address = address,  # This is not the same as your host addr
   location = 'http://' + hostname,     # URL for auto-redirects (trailing slash)
   maxpost = 20 * 1024 * 1024,
   maxinput = 20 * 1024 * 1024
)

В чём проблема-то?


Reply to: