Back to index

radiance  4R0+20100331
Functions
build_utils.copyright Namespace Reference

Functions

def _get_ltextl
def _show_ltextl
def show_license

Function Documentation

Definition at line 7 of file copyright.py.

00007 
00008 def _get_ltextl():
00009        f = open(os.path.join('src','common','copyright.h'), 'r')
00010        ltl = f.readlines()
00011        f.close()
00012        ltl2 = []
00013        for line in ltl:
00014               line = line.strip()
00015               if line == '*/': line = ''
00016               elif line.find('$Id:') > -1: line = ''
00017               elif line and line[0] == '*':
00018                      line = line[2:]
00019               elif line and line[1] == '*':
00020                      line = line[3:]
00021               ltl2.append(line)
00022        return ltl2 + ['']

Here is the caller graph for this function:

def build_utils.copyright._show_ltextl (   ltextl,
  lines = 23 
) [private]

Definition at line 23 of file copyright.py.

00023 
00024 def _show_ltextl(ltextl, lines=23):
00025        llen = len(ltextl)
00026        for i in range(0, llen, lines):
00027               sys.stderr.write('\n'.join(ltextl[i:i+lines]))
00028               if i+lines < llen:
00029                      raw_input('\n[press <return> to continue] ')

Here is the caller graph for this function:

Definition at line 30 of file copyright.py.

00030 
00031 def show_license():
00032        try:
00033               ltextl = _get_ltextl()
00034               _show_ltextl(ltextl)
00035               sys.stderr.write(
00036               'Do you understand and accept the terms of this agreement [n]?\n\n')
00037               answer = ''
00038               s =  'Please enter "yes" or "no", or use ^C to exit: '
00039               while answer not in ['y', 'ye', 'yes', 'n', 'no']:
00040                      if answer: sys.stderr.write('invalid input "%s"\n' % answer)
00041                      answer = string.lower(raw_input(s))
00042 
00043               if answer[0] == 'y':
00044                      return
00045               else:
00046                      sys.stderr.write('\n*** Installation cancelled ***\n')
00047                      sys.exit(1)
00048        except KeyboardInterrupt:
00049               sys.stderr.write('\n*** Installation cancelled ***\n')
00050               sys.exit(1)
00051 

Here is the call graph for this function: