§ 2.5 - Parameters

When you invoke aa_macro within Python 2.7, you can supply optional parameters that modify aa_macro's behavior upon instantiating the class:

  print macro(dothis,mode,back,nodinner,noshell,noinclude,noembrace,semantic)  

  mod = macro(dothis,mode,back,nodinner,noshell,noinclude,noembrace,semantic)  

§ 2.5.1 - dothis invocation parameter

  dothis   is a string containing aa_macro syntax source to be processed. When used directly, as shown in the   print   statement above, this is how you pass in the code to be processed. Output is available via aa_macro's   __str__()   method, which is how the example   print   statement would return its results.   dothis   defaults to   None  .

§ 2.5.2 - mode invocation parameter

  mode   is a string that defaults to   '3.2'  , which means that aa_macro's built-in HTML operators such as  [i]  and  [color]  will generate HTML 3.2 compatible code. You can set this to   '4.01s'  , in which case aa_macro will use that level of HTML code instead.

There is a corresponding  [mode]  operator that allows you to change this state within the context of aa_macro source text.

§ 2.5.3 - back invocation parameter

  back   is a string sets the background color for the  [color]  operator. If defaults to   back='ffffff'  , which is white.

There is a corresponding aa_macro  [back]  operator that allows you to change this state within the context of aa_macro source text.

Note: The   back   parameter is only relevant when   mode='4.01s'  .

§ 2.5.4 - nodinner invocation parameter

  nodinner   is a boolean that defaults to   False  , which means aa_macro will remove any sequence of two spaces followed immediately by a newline (linefeed) character. With   nodinner=True   it will not perform the replacement.

§ 2.5.5 - noshell invocation parameter

  noshell   is a boolean that defaults to   False  . In this state, aa_macro's  [sys] ,  [load]  and  [gload]  operators work normally, which is to say, you can call system commands and load variables from files. If you set   noshell=True  , then the  [sys] ,  [load]  and  [gload]  operators return warning text. This is a security mechanism to prevent those using aa_macro from interacting directly with the host computer.

§ 2.5.6 - noinclude invocation parameter

  noinclude   is a boolean that defaults to   False  . In this state, aa_macro's  [include]  operator works normally, which is to say, you can include macro source code from files. If you set   noinclude=True  , then the  [include]  operator returns warning text. This is a security mechanism to prevent those using aa_macro from interacting directly with the host computer.

§ 2.5.7 - noembrace invocation parameter

  noembrace   is a boolean that defaults to   False  . In this state, aa_macro's  [embrace]  operator works normally, which is to say, you can include Python 2.7 source code from files.

If you set   noembrace=True  , then the  [embrace]  operator returns warning text. This is a security mechanism to prevent those using aa_macro from interacting directly with the host computer.

§ 2.5.8 - debug invocation parameter

  debug   is a boolean that defaults to   False  . In this state, debugging is off.

If you set   debug=True  , then aa_macro will keep a stack trace of what it's doing as it processes your content. Once you're done processing, you can call   result=getdebug()   to get a text string that contains the stack trace.

See also: Appendix B, Debugging

§ 2.5.9 - locklipath invocation parameter

This defaults to an empty string. If you set it to a string, then lipath cannot be changed from that string using either  [lipath]  or the lipath option in the  [locimg]  and  [limg]  built-ins. This prevents users from accessing image or other files outside of a locked server-side directory.

§ 2.5.10 - lockwepath invocation parameter

This defaults to an empty string. If you set it to a string, then wepath cannot be changed from that string using either  [wepath]  or the wepath option in the  [locimg]  and  [limg]  built-ins. This prevents users from accessing image or other files outside of a locked web-side directory.

§ 2.5.11 - xlimit invocation parameter

This defaults to zero. If you set it to a non-zero number, operations that take an N parameter for iteration or repetition will limit themselves to within one repeat of this number.

§ 2.5.12 - dlimit invocation parameter

This defaults to zero. If you set it to a non-zero number, operations that do iteration or repetition will abort if the nesting depth exceeds this value.

§ 2.5.13 - semantic invocation parameter

This defaults to True. When true, the  [i content]  tag uses  <em>  and  </em>  and the  [b content]  tag uses  <strong>  and  </strong> . When false, the  [i content]  tag uses  <i>  and  </i>  and the  [b content]  tag uses  <b>  and  </b> .

Keyboard Navigation
, Previous Page . Next Page t TOC i Index

Valid HTML 4.01 Loose
 

This manual was generated with wtfm
wtfm uses aa_macro and SqLite
aa_macro uses Python 2.7