[Opensim-dev] New configuration capabilities

Shaun T. Erickson ste at smxy.org
Sat Oct 11 14:05:37 UTC 2014


Perhaps we could just call the "Const" section "C", which would reduce 
the visual clutter considerably:

[C]
   ;Constants
   BaseURL =http://example.com
   PublicPort = 8002
   PrivatePort = 8003


[LoginService]

     MapTileURL = ${C|BaseURL}:${C|PublicPort}/
  
     SRV_HomeURI = "${C|BaseURL}:${C|PublicPort}"
     SRV_InventoryServerURI = "${C|BaseURL}:${C|PublicPort}"
     SRV_AssetServerURI = "${C|BaseURL}:${C|PublicPort}"
     SRV_ProfileServerURI = "${C|BaseURL}:${C|PublicPort}"
     SRV_FriendsServerURI = "${C|BaseURL}:${C|PublicPort}"
     SRV_IMServerURI = "${C|BaseURL}:${C|PublicPort}"
     SRV_GroupsServerURI = "${C|BaseURL}:${C|PrivatePort}"

-ste


On 10/11/14, 8:34 AM, James Hughes wrote:
> On Sat, 2014-10-11 at 10:31 +0300, Oren Hurvitz wrote:
>> Sound like a good idea. But I would prefer to see a simpler syntax:
>> just ${BaseURL} (i.e., remove "Const|"). That's a syntax that is
>> commonly used in many programming languages and template systems, and
>> it makes the config files more readable.
> The "Const" is not needed if the value is used inside the section that
> it is used in. The syntax is part of Nini and the feature has always
> been part of that package. We just never had our code setup to use it.
> Nini does not know about global key/value pairs, but compartmentalizes
> all keys inside sections. Then they provide the${Section|Key} syntax to
> allow us to to use values from any other defined section.


More information about the Opensim-dev mailing list