| |
---|
| | users a rich set of configuration features. |
---|
| | |
---|
| | |
---|
| | .SH INSTALLATION |
---|
| | There are three ways to install \*(TC depending on your preferences |
---|
| | and type of system. In each of these installation methods you must be |
---|
| | logged in with root authority on Unix-like systems or as the |
---|
| | Administrator on Win32 systems. |
---|
| | |
---|
| | |
---|
| | .SS Preparation - Getting And Extracting The Package |
---|
| | |
---|
| | |
---|
| | For the first two installation methods, you must first download the |
---|
| | latest release from: |
---|
| | |
---|
| | .nf |
---|
| | http://www.tundraware.com/Software/tconfpy/ |
---|
| | .fi |
---|
| | |
---|
| | Then unpack the contents by issuing the following command: |
---|
| | |
---|
| | .nf |
---|
| | tar -xzvf py-tconfpy-X.XXX.tar.gz (where X.XXX is the version number) |
---|
| | .fi |
---|
| | |
---|
| | Win32 users who do not have tar installed on their system can find |
---|
| | a Windows version of the program at: |
---|
| | |
---|
| | .nf |
---|
| | http://unxutils.sourceforge.net/ |
---|
| | .fi |
---|
| | |
---|
| | |
---|
| | .SS Install Method #1 - All Systems (Semi-Automated) |
---|
| | |
---|
| | |
---|
| | Enter the directory created in the unpacking step above. Then issue |
---|
| | the following command: |
---|
| | |
---|
| | .nf |
---|
| | python setup.py install |
---|
| | .fi |
---|
| | |
---|
| | This will install the \*(TC module and compile it. |
---|
| | |
---|
| | You will manually have to copy the 'test-tc.py' program to a directory |
---|
| | somewhere in your executable path. Similarly, copy the documentation |
---|
| | files to locations appropriate for your system. |
---|
| | |
---|
| | |
---|
| | .SS Install Method #2 - All Systems (Manual) |
---|
| | |
---|
| | |
---|
| | Enter the directory created in the unpacking step above. Then, |
---|
| | manually copy the tconfpy.py file to a directory somewhere in your |
---|
| | PYTHONPATH. The recommended location for Unix-like systems is: |
---|
| | |
---|
| | .nf |
---|
| | .../pythonX.Y/site-packages |
---|
| | .fi |
---|
| | |
---|
| | For Win32 systems, the recommended location is: |
---|
| | |
---|
| | .nf |
---|
| | ...\\PythonX.Y\\lib\\site-packages |
---|
| | .fi |
---|
| | |
---|
| | Where X.Y is the Python release number. |
---|
| | |
---|
| | |
---|
| | You can pre-compile the \*(TC module by starting Python interactively |
---|
| | and then issuing the command: |
---|
| | |
---|
| | .nf |
---|
| | import tconfpy |
---|
| | .fi |
---|
| | |
---|
| | Manually copy the 'test-tc.py' program to a directory |
---|
| | somewhere in your executable path. Copy the documentation |
---|
| | files to locations appropriate for your system. |
---|
| | |
---|
| | |
---|
| | .SS Install Method #3 - FreeBSD Only (Fully-Automated) |
---|
| | |
---|
| | |
---|
| | Make sure you are logged in as root, then: |
---|
| | |
---|
| | .nf |
---|
| | cd /usr/ports/devel/py-tconfpy |
---|
| | make install |
---|
| | .fi |
---|
| | |
---|
| | This is a fully-automated install that puts both code and |
---|
| | documentation where it belongs. After this command has completed |
---|
| | you'll find the license agreement and all the documentation (in the |
---|
| | various formats) in: |
---|
| | |
---|
| | .nf |
---|
| | /usr/local/share/doc/py-tconfpy |
---|
| | .fi |
---|
| | |
---|
| | The 'man' pages will have been properly installed so either of these |
---|
| | commands will work: |
---|
| | |
---|
| | .nf |
---|
| | man tconfpy |
---|
| | man test-tc |
---|
| | .fi |
---|
| | |
---|
| | .SS Bundling \*(TC With Your Own Programs |
---|
| | |
---|
| | |
---|
| | If you write a program that depends on \*(TC you'll need to ensure |
---|
| | that the end-users have it installed on their systems. There are two |
---|
| | ways to do this: |
---|
| | |
---|
| | 1) Tell them to download and install the package as described above. |
---|
| | This is not recommended since you cannot rely on the technical |
---|
| | ability of end users to do this correctly. |
---|
| | |
---|
| | 2) Just include 'tconfpy.py' in your program distribution directory. |
---|
| | This ensures that the module is available to your program |
---|
| | regardless of what the end-user system has installed. |
---|
| | |
---|
| | |
---|
| | |
---|
| | |
---|
| | .SH PROGRAMMING USING THE \*(TC API |
---|
| | |
---|
| |
---|
| | program. This section discusses how to invoke the \*(TC parser, the |
---|
| | options available when doing so, and what the parser returns to |
---|
| | the calling program. |
---|
| | |
---|
| | .SS API OVERVIEW |
---|
| | .SS API Overview |
---|
| | |
---|
| | .nf |
---|
| | |
---|
| | .B ParseConfig(cfgfile, InitialSymTbl={}, Debug=False, LiteralVars=False) |
---|
| |
---|
| | See the section in the language reference below on \'.literal\' |
---|
| | usage for details. |
---|
| | |
---|
| | |
---|
| | .SS PARSING A CONFIGURATION FILE |
---|
| | |
---|
| | .SS PASSING AN INITIAL SYMBOL TABLE |
---|
| | |
---|
| | .SS THE \'Debug\' OPTION |
---|
| | |
---|
| | .SS THE \'LiteralVars\' OPTION |
---|
| | |
---|
| | .SS WHAT \*(TC RETURNS |
---|
| | .SS Parsing A Configuration File |
---|
| | |
---|
| | .SS Passing An Initial Symbol Table |
---|
| | |
---|
| | .SS The \'Debug\' Option |
---|
| | |
---|
| | .SS The \'LiteralVars\' Option |
---|
| | |
---|
| | .SS \*(TC Return Values |
---|
| | |
---|
| | |
---|
| | |
---|
| | .SH CONFIGURATION LANGUAGE REFERENCE |
---|
| |
---|
| | conditionals, type and value enforcement, and lexical namespaces. |
---|
| | This section of the document describes that language and provides |
---|
| | examples of how each feature can be used. |
---|
| | |
---|
| | .SS GENERAL RULES FOR THE \*(TC CONFIGURATION LANGUAGE |
---|
| | |
---|
| | .SS VARIABLES AND VARIABLE REFERENCES |
---|
| | |
---|
| | .SS PREDEFINED VARIABLES |
---|
| | |
---|
| | .SS THE \'.include\' DIRECTIVE |
---|
| | |
---|
| | .SS CONDITIONAL DIRECTIVES |
---|
| | |
---|
| | .SS \'.literal\. - USING \*(TC AS A PREPROCESSOR FOR OTHER LANGUAGES |
---|
| | |
---|
| | .SS TYPE AND VALUE ENFORCEMENT |
---|
| | |
---|
| | .SS LEXICAL NAMESPACES |
---|
| | .SS General Rules For The \*(TC Configuration Language |
---|
| | |
---|
| | .SS Variables And Variable References |
---|
| | |
---|
| | .SS Predefined Variables |
---|
| | |
---|
| | .SS The \'.include\' Directive |
---|
| | |
---|
| | .SS Conditional Directives |
---|
| | |
---|
| | .SS \'.literal\. - Using \*(TC As A Preprocessor For Other Languages |
---|
| | |
---|
| | .SS Type And Value Enforcement |
---|
| | |
---|
| | .SS Lexical Namespaces |
---|
| | |
---|
| | .SH ADVANCED TOPICS |
---|
| | |
---|
| | .SS GUARANTEEING A CORRECT BASE CONFIGURATION |
---|
| | |
---|
| | .SS ENFORCING MANDATORY CONFIGURATIONS |
---|
| | .SS Guaranteeing A Correct Base Configuration |
---|
| | |
---|
| | .SS Enforcing Mandatory Configurations |
---|
| | |
---|
| | |
---|
| | .SH OTHER |
---|
| | |
---|
| |
---|
| | |