Back to index

enigmail  1.4.3
Functions
build.appini_header Namespace Reference

Functions

def main

Function Documentation

def build.appini_header.main (   file)

Definition at line 44 of file appini_header.py.

00044 
00045 def main(file):
00046     config = ConfigParser.RawConfigParser()
00047     config.read(file)
00048     flags = set()
00049     try:
00050         if config.getint('XRE', 'EnableExtensionManager') == 1:
00051             flags.add('NS_XRE_ENABLE_EXTENSION_MANAGER')
00052     except: pass
00053     try:
00054         if config.getint('XRE', 'EnableProfileMigrator') == 1:
00055             flags.add('NS_XRE_ENABLE_PROFILE_MIGRATOR')
00056     except: pass
00057     try:
00058         if config.getint('Crash Reporter', 'Enabled') == 1:
00059             flags.add('NS_XRE_ENABLE_CRASH_REPORTER')
00060     except: pass
00061     appdata = dict(("%s:%s" % (s, o), config.get(s, o)) for s in config.sections() for o in config.options(s))
00062     appdata['flags'] = ' | '.join(flags) if flags else '0'
00063     appdata['App:profile'] = '"%s"' % appdata['App:profile'] if 'App:profile' in appdata else 'NULL'
00064 
00065     print '''#include "nsXREAppData.h"
00066              static const nsXREAppData sAppData = {
00067                  sizeof(nsXREAppData),
00068                  NULL, // directory
00069                  "%(App:vendor)s",
00070                  "%(App:name)s",
00071                  "%(App:version)s",
00072                  "%(App:buildid)s",
00073                  "%(App:id)s",
00074                  NULL, // copyright
00075                  %(flags)s,
00076                  NULL, // xreDirectory
00077                  "%(Gecko:minversion)s",
00078                  "%(Gecko:maxversion)s",
00079                  "%(Crash Reporter:serverurl)s",
00080                  %(App:profile)s
00081              };''' % appdata

Here is the caller graph for this function: