Newer
Older
tconfpy / tconfpy-spec.txt
  1. $Id: tconfpy-spec.txt,v 1.106 2004/03/21 12:44:57 tundra Exp $
  2.  
  3. tconfpy SPECIFICATION
  4. =====================
  5.  
  6.  
  7.  
  8. API
  9. ===
  10.  
  11. tconfpy.ParseConfig(FileName, InitialSymTbl, Debug=False, LiteralVars=False)
  12.  
  13. ---> [SymTable, ErrorMsgs, WarningMsgs, DebugMsgs, LiteralLines]
  14.  
  15.  
  16. where,
  17.  
  18. FileName ---> String
  19.  
  20. InitialSymbolTbl ---> Dictionary in {varname:tconfpy.VarDescriptor, ...} format
  21.  
  22. Debug ---> Turn on debug output.
  23.  
  24. LiteralVars ---> Replace variable references in Literal Lines
  25.  
  26.  
  27.  
  28. RETURN VALUES
  29. -------------
  30.  
  31.  
  32. SymTable ---> {varname:tconfpy.VarDescriptor, ...}
  33.  
  34. ErrorMsgs ---> List of Error Messages
  35.  
  36. WarningMsgs ---> List of Warning Messages
  37.  
  38. DebugMsgs ---> List of Debug Messages (empty if Debug=False)
  39.  
  40. LiteralLines ---> Lines processed literally - w/vars replaced if LiteralVars=True
  41.  
  42.  
  43. ------------------------------------------------------------------------------
  44.  
  45.  
  46. VARIABLE DESCRIPTOR
  47. ===================
  48.  
  49. class VarDescriptor:
  50.  
  51. # Default variable type is a writeable string with no constraints
  52. def __init__(self):
  53. self.Value = ""
  54. self.Writeable = True
  55. self.Type = TYPE_STRING
  56. self.Default = ""
  57. self.LegalVals = None
  58. self.Min = None
  59. self.Max = None
  60.  
  61.  
  62. Possible Types:
  63.  
  64. TYPE_BOOL = type(True)
  65. TYPE_COMPLEX = type(1-1j)
  66. TYPE_FLOAT = type(3.14)
  67. TYPE_INT = type(1)
  68. TYPE_STRING = type('s')