next up previous contents
Next: import Up: Initialization of dotdotfiles Previous: Initialization of dotdotfiles

The main dotdotfile - main.template

  The main dotdotfile is the one which initialize the Dotfile Generator, and sources tcl script written by the module programmer. You have the following optional associative arrays, which you can set in this file:

setup

  An associative array called setup with the following keys:

print
Boolean flag indicating whether to print on generate.
file
Boolean flag indicating whether to save to file on generate.
whatToGenerate
This variable can have three different values:
one
This tells the Dotfile Generator to generate only the actual page (the one on the screen)
selected
This tells the Dotfile Generator to generate those pages which have been marked for generation
all
This tells the Dotfile Generator to generate all pages.

generateDefault
Boolean flag indicating whether default shall be generated or not.
saveOnGenerate
Boolean flag indicating whether save shall be done on generate.
placeWindows
Boolean flag indicating whether the Dotfile Generator should place windows or it is the window manager's job.
preventBytecompile
This boolean flag is used to prevent byte compilation when you are developing your module, and it would be meaningless (Remember to remove it from the dotdotfile when you release your module)
dotfile
This is a list of list, where the index's elements have the following meanings:
  1. A token to be used in print
  2. A text to be show in the setup menu
  3. The name of the file to connect with this token
  4. Comment character for this file.
An example:
    set setup(dotfile) {
      {access "Configuration file for access control" access.conf \#}
      {httpd "General configuration file" httpd.conf \#}
      {mime "Mime types" mime.types \#}
    }

module

And in the associative array module

creator
This is your name.
version
This is the version of your module.
name
This is the name of the program, which your module configures.
overAllDesc
This is the description, which will be placed at the top of the output file. The Dotfile Generator will inseret the comment char of the language on every start of a line. (Lines are seperated with \n)
parser
This is the name of a tcl script to read the original dotfile (see Importing the original dotfile)
email
This is your email address. If this is not set, bug repports and suggestion can NOT be sent to you from The Dotfile Generator .

The file main.temlate is always read, while all the other template files only are read, when the module is NOT bytecompiled. That is the reason why you have to source additional tcl scripts from main.template.

In main.template you may refer to a variable called loadedByteCompileFile, which contain the value 1 if the module has been bytecompile.

This is very usefull, when used with the SaveVars function, which the following example will show:

if {!$loadedByteCompileFile} {
  global colorList
  set colorList [showRgb2list]
  SaveVars colorList
}
In this example, the function showRgb2list reads the colors from the system, and sort them. This takes several minutes, so it is best if this is only done the first time the module is read. This value will then be saved into the bytecompiled file.


next up previous contents
Next: import Up: Initialization of dotdotfiles Previous: Initialization of dotdotfiles

Jesper Kjær Pedersen <blackie@imada.ou.dk>
Wed Oct 2 13:29:53 MET DST 1996