Rev b52e79b improves @ifx settings selectors

18 views
Skip to first unread message

Edward K. Ream

unread,
Apr 26, 2015, 6:25:04 AM4/26/15
to leo-e...@googlegroups.com
This rev adds support for @ifenv, improves support for @ifplatform and @ifhostname.

I have decided not to add support for either @if or @ifgui.  The former is not needed and is a scripting risk, the latter is pretty much useless. Here are the details:

@ifenv
name, one-or-more-comma-separated values
 
Includes descendant settings if os.getenv(name) matches any of the values.

- Case is significant in the *name* of the environment variable.
- Case is ignored in the *values*.

Examples:

@ifenv HOSTNAME,bob
    Enables descendant settings if os.environ('HOSTNAME') is 'Bob' or 'bob'
   
@ifenv EDITOR,leo,lion
    Enables descendant settings if os.environ('Editor') is 'Leo' or 'Lion', etc.

@ifplatform name,  one-or-more-comma-separated values.
  
Includes descendant settings if sys.platform matches any of the values, ignoring case.

Examples:

@ifplatform darwin,linux2
    Enables descendant settings for MacOS and Linux.

@ifplatform win32
    Enables descendant settings for Windows
  
@ifhostname name

Includes descendant settings if os.environ('HOSTNAME') == name

@ifhostname !name

Includes descendant settings if os.environ('HOSTNAME') != name

Please report any problems

Edward
Reply all
Reply to author
Forward
0 new messages