Back to index

enigmail  1.4.3
Functions
make-stl-wrappers Namespace Reference

Functions

def find_in_path
def header_path
def is_comment
def main

Function Documentation

def make-stl-wrappers.find_in_path (   file,
  searchpath 
)

Definition at line 40 of file make-stl-wrappers.py.

00040 
00041 def find_in_path(file, searchpath):
00042     for dir in searchpath.split(os.pathsep):
00043         f = os.path.join(dir, file)
00044         if os.path.exists(f):
00045             return f
00046     return ''

Here is the caller graph for this function:

def make-stl-wrappers.header_path (   header,
  compiler 
)

Definition at line 47 of file make-stl-wrappers.py.

00047 
00048 def header_path(header, compiler):
00049     if compiler == 'gcc':
00050         # we use include_next on gcc
00051         return header
00052     elif compiler == 'msvc':
00053         return find_in_path(header, os.environ.get('INCLUDE', ''))
00054     else:
00055         # hope someone notices this ...
00056         raise NotImplementedError, compiler

Here is the call graph for this function:

Here is the caller graph for this function:

def make-stl-wrappers.is_comment (   line)

Definition at line 57 of file make-stl-wrappers.py.

00057 
00058 def is_comment(line):
00059     return re.match(r'\s*#.*', line)

Here is the caller graph for this function:

def make-stl-wrappers.main (   outdir,
  compiler,
  template_file,
  header_list_file 
)

Definition at line 60 of file make-stl-wrappers.py.

00060 
00061 def main(outdir, compiler, template_file, header_list_file):
00062     if not os.path.isdir(outdir):
00063         os.mkdir(outdir)
00064 
00065     template = open(template_file, 'r').read()
00066     path_to_new = header_path('new', compiler)
00067 
00068     for header in open(header_list_file, 'r'):
00069         header = header.rstrip()
00070         if 0 == len(header) or is_comment(header):
00071             continue
00072 
00073         path = header_path(header, compiler)
00074         try:
00075             f = open(os.path.join(outdir, header), 'w')
00076             f.write(string.Template(template).substitute(HEADER=header,
00077                                                          HEADER_PATH=path,
00078                                                          NEW_HEADER_PATH=path_to_new))
00079         finally:
00080             f.close()
00081 

Here is the call graph for this function: