Esempio n. 1
0
 def endOfFile(self):
     reply = QtGui.QMessageBox.question(self, 'File Completed',
                                        "Is this your final version ?",
                                        QtGui.QMessageBox.Yes,
                                        QtGui.QMessageBox.No)
     if reply != QtGui.QMessageBox.Yes:
         self.outFileName = path.splitext(self.outFileName)[0] + '.noe'
     putFileContent(self.outFileName, self.doneLines)
Esempio n. 2
0
 def Exit(self):
     if self.doneLines != []:
         self.outFileName = path.splitext(self.outFileName)[0] + '.noe'
         poolLines = self.doneLines
         for line in self.waitLines:
             print '>' + line[1][0] + line[1][1] + line[1][2]
             poolLines.append(line[1][0] + line[1][1] + line[1][2])
         poolLines.extend(self.leftLines)
         print poolLines
         putFileContent(self.outFileName, poolLines)
     sys.exit(1)
Esempio n. 3
0
    def putContent(self, fileName):

        geo = []
        # assuming the first polygon is the outside domain
        ip = self.order[0]
        geo.extend(self.writePolygon(self.poly[ip]))
        # add the other polygons
        for ip in self.order[1:]:
            geo.extend(self.writePolygon(self.poly[ip]))

        # make up surface with wholes
        psurf = self.isurf[-1]
        geo.append('Plane Surface(' + str(psurf + 1) + ') = {' +
                   ','.join([str(i) for i in self.iloop[1:]]) + '};')
        self.isurf.append(psurf + 1)

        # write up
        putFileContent(fileName, geo)
Esempio n. 4
0
 def compilePRINCI(self,cfg,rebuild):
    if not "compile" in self.available.split(';'): return
    xref = self.active["xref"]; cfgname = self.active['cfg']
    active = self.dids[xref][cfgname]
    confirmed = False
    # ~~> principal PRINCI file
    value,default = getKeyWord('FICHIER FORTRAN',active['cas'],DICOS[active['dico']]['dico'],DICOS[active['dico']]['frgb'])
    princiFile = ''; princiSafe = ''
    if value != []:       # you do not need to compile the default executable
       princiFile = path.join(active['path'],eval(value[0]))
       if path.exists(princiFile):
          exeFile = path.join(active['safe'],path.splitext(eval(value[0]))[0] + cfg['SYSTEM']['sfx_exe'])
          if not path.exists(exeFile) or cfg['REBUILD'] == 0:
             print '     +> compiling princi file: ' + path.basename(princiFile)
             copyFile(princiFile,active['safe'])
             princiSafe = path.join(active['safe'],path.basename(princiFile))
             confirmed = True
       else:
          raise Exception([{'name':'ACTION::compilePRINCI','msg':'I could not find your PRINCI file: '+princiFile}])
    # ~~> associated PRINCI file
    for mod in active["links"]:
       link = active["links"][mod]
       value,default = getKeyWord('FICHIER FORTRAN',link['cas'],DICOS[link['dico']]['dico'],DICOS[link['dico']]['frgb'])
       princiFilePlage = ''
       if value != []:       # you do not need to compile the default executable
          princiFilePlage = path.join(active['path'],eval(value[0]))
          if path.exists(princiFilePlage):
             if princiSafe != '':
                putFileContent(princiSafe,getFileContent(princiSafe)+['']+getFileContent(princiFilePlage))
             else:
                print '     +> compiling princi file: ' + path.basename(princiFilePlage)
                exeFile = path.join(active['safe'],path.splitext(eval(value[0]))[0] + cfg['SYSTEM']['sfx_exe'])
                princiSafe = path.join(active['safe'],path.basename(princiFilePlage))
                copyFile(princiFilePlage,active['safe'])
             confirmed = True
          else:
             raise Exception([{'name':'ACTION::compilePRINCI','msg':'I could not find your PRINCI file: '+princiFilePlage}])
    if confirmed:
       try:
          compilePRINCI(princiSafe,active["code"],self.active['cfg'],cfg,self.bypass)
       except Exception as e:
          raise Exception([filterMessage({'name':'ACTION::compilePRINCI'},e,self.bypass)])  # only one item here
       #moveFile(exeFile,active['safe'])
       print '       ~> compilation successful ! created: ' + path.basename(exeFile)
Esempio n. 5
0
def putInS(file, head, fileType, poly, type=None):

    # ~~ Write head ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    if head != []: core = head
    else:
        core = [
            ':FileType ' + fileType + ' ASCII EnSim 1.0',
            ':Application BlueKenue', ':Version 3.2.24',
            ':WrittenBy sebourban', ':CreationDate Thu, Dec 08, 2011 02:47 PM',
            ':Name ' + path.basename(file), ':AttributeUnits 1 m', ':EndHeader'
        ]

    # ~~ Look for closed lines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    if type == None:
        type = []
        for ip in poly:
            if isClose(ip[0], ip[len(ip) - 1]): type.append(True)
            else: type.append(False)

    # ~~ Write body ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    for ip, it in zip(poly, type):
        il = len(ip)
        if il != 0 and not isClose(ip[0], ip[len(ip) - 1]): il += it
        core.append(str(il) + ' 0')  #TODO: you should use proper values
        if fileType == 'i2s':
            for xyi in ip:
                core.append(str(xyi[0]) + ' ' + str(xyi[1]))
            if il != len(ip): core.append(str(ip[0][0]) + ' ' + str(ip[0][1]))
        elif fileType == 'i3s':
            for xyi in ip:
                core.append(
                    str(xyi[0]) + ' ' + str(xyi[1]) + ' ' + str(xyi[2]))
            if il != len(ip):
                core.append(
                    str(ip[0][0]) + ' ' + str(ip[0][1]) + ' ' + str(ip[0][2]))

    # ~~ Put all ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    putFileContent(file, core)

    return
Esempio n. 6
0
def putLQD(fle, head, vrs, date0, time, xyz):

    # ~~ Write head ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    core = head
    from datetime import datetime
    core.append("#Date&Time: " +
                datetime(*date0).strftime("%d/%m/%Y %H:%M:%S"))

    names = 'T'
    units = 's'
    if xyz.ndim == 2:
        for name, unit in vrs:
            names += ' ' + name.strip().replace(' ', '_')
            units += ' ' + unit.strip().replace(' ', '_')
        core.append(names + '\n' + units)
    elif xyz.ndim == 3:
        for ivar in range(len(vrs[0])):
            for inod in vrs[1]:
                names += ' ' + vrs[0][ivar][0].strip().replace(
                    ' ', '_') + '(' + str(inod) + ')'
                units += ' ' + vrs[0][ivar][1].strip().replace(' ', '_')
        core.append(names + '\n' + units)
    if xyz.ndim == 2:
        for itim in range(xyz.shape[1]):
            line = str(time[itim])
            for ivar in range(xyz.shape[0]):
                line += ' ' + str(xyz[ivar][itim])
            core.append(line)
    elif xyz.ndim == 3:
        for itim in range(xyz.shape[2]):
            line = str(time[itim])
            for ivar in range(xyz.shape[0]):
                for inod in range(xyz.shape[1]):
                    line += ' ' + str(xyz[ivar][inod][itim])
            core.append(line)

    # ~~ Put all ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    putFileContent(fle, core)

    return
Esempio n. 7
0
 def dump(self):  # /!\ TODO:(JCP) Update with CSV call functionalities (?)
     if self.reports == {}: return
     contents = {}
     # ~~> Copy the default header in all files
     for repName in self.reports:
         for fileName in self.reports[repName]['file']:
             if fileName not in contents:
                 content = deepcopy(self.reports[repName]['head'])
                 content.append(self.delimiter.join(self.heads))
                 contents.update({fileName: content})
     # ~~> Line template for those absenties
     emptyline = []
     for head in self.heads:
         emptyline.append('')
     # ~~> Copy the core passed/failed vallues
     for repName in sorted(
             self.reports):  # repname  (could be "Validation-Summary")
         for fileName in sorted(self.reports[repName]
                                ['file']):  # filename (root dependant)
             for caseName in sorted(
                     self.reports[repName]
                 ['core']):  # case name (could bumpflu.xml)
                 for cast in self.reports[repName]['core'][caseName][
                         'casts']:
                     line = deepcopy(emptyline)
                     for key in cast:
                         line[self.hkeys.index(key)] = '"' + str(
                             cast[key]) + '"'
                     line[self.hkeys.index('file')] = caseName
                     line[self.hkeys.index('path')] = path.dirname(
                         self.reports[repName]['core'][caseName]['file'])
                     line[self.hkeys.index('duration')] = str(
                         self.reports[repName]['core'][caseName]
                         ['duration'])
                     contents[fileName].append(self.delimiter.join(line))
     for fileName in contents:
         putFileContent(fileName, contents[fileName])
Esempio n. 8
0
def putXYn(file, head, fileType, xyz):

    # ~~ Write head ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    core = head
    #if head != []: core = head
    #<else: core = [':FileType '+fileType+' ASCII EnSim 1.0',
    #   ':Application BlueKenue', ':Version 3.2.24',
    #   ':WrittenBy sebourban', ':CreationDate Thu, Dec 08, 2011 02:47 PM',
    #   ':Name ' + path.basename(file),
    #   ':AttributeUnits 1 m',
    #   ':EndHeader' ]

    # ~~ Write body ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    if fileType == 'xy':
        for i in xyz:
            core.append(str(xyz[0]) + ' ' + str(xyz[1]))
    elif fileType == 'xyz':
        for i in xyz:
            core.append(str(xyz[0]) + ' ' + str(xyz[1]) + ' ' + str(xyz[2]))

    # ~~ Put all ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    putFileContent(file, core)

    return
Esempio n. 9
0
    def putContent(self, fileName, head=[]):

        # ~~> file extension processing
        _, tail = path.splitext(fileName)
        if tail[1:] != self.fileType:
            if head != []:
                head = [
                    '\n'.join(head).replace(':FileType ' + self.fileType,
                                            ':FileType ' + tail[1:])
                ]
            self.fileType = tail[1:]

        # ~~> write head
        if head != []: core = head
        else:
            core = [
                ':FileType ' + self.fileType + ' ASCII EnSim 1.0',
                ':Application BlueKenue',
                ':Version 3.2.24',
                ':WrittenBy sebourban',
                ':CreationDate Thu, Dec 08, 2011 02:47 PM',
                ':Name ' + path.basename(fileName),
                #':AttributeName 1 level',
                #':AttributeType 1 float',
                #':AttributeUnits 1 m',
                ':EndHeader'
            ]

        # ~~> look for closed lines
        if self.type == []:
            for ip in self.poly:
                if isClose(ip[0][:2], ip[len(ip) - 1][:2]): self.type.append(1)
                else: self.type.append(0)

        # ~~> fill-up empty attributes
        if self.atrbut == {}:
            self.atrbut = {1: ['ArbitraryName1']}
            for _ in self.poly:
                self.atrbut[1].append(0)
            self.oatrbut = [1]

        # ~~> fill-up attribute names
        if head == []:
            for i, o in zip(range(len(self.oatrbut)), self.oatrbut):
                core.insert(-1,
                            ':AttributeName ' + repr(i + 1) + ' ' + repr(o))

        # ~~ Write body ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        for i, ip, iv, it in zip(range(len(self.poly)), self.poly, self.vals,
                                 self.type):
            il = len(ip)
            if il != 0 and not isClose(ip[0], ip[len(ip) - 1]): il += it
            line = repr(il)
            for o in self.oatrbut:
                line = line + ' ' + str(self.atrbut[o][i])
            core.append(line)
            if self.fileType == 'i2s':
                for xyi in ip:
                    core.append(repr(xyi[0]) + ' ' + repr(xyi[1]))
                if il != len(ip):
                    core.append(repr(ip[0][0]) + ' ' + repr(ip[0][1]))
            elif self.fileType == 'i3s':
                if np.shape(iv)[1] == 0:
                    for xyi in ip:
                        core.append(repr(xyi[0]) + ' ' + repr(xyi[1]) + ' 0.0')
                    if il != len(ip):
                        core.append(
                            repr(ip[0][0]) + ' ' + repr(ip[0][1]) + ' 0.0')
                else:
                    for xyi, val in zip(ip, iv):
                        core.append(
                            repr(xyi[0]) + ' ' + repr(xyi[1]) + ' ' +
                            ' '.join([repr(v) for v in val]))
                    if il != len(ip):
                        core.append(
                            repr(ip[0][0]) + ' ' + repr(ip[0][1]) + ' ' +
                            ' '.join([repr(v) for v in iv[0]]))

        # ~~ Put all ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        putFileContent(fileName, core)
Esempio n. 10
0
def translateCAS(cas, frgb):
    casLines = getFileContent(cas)

    core = []
    for i in range(len(casLines)):
        # ~~> scan through to remove all comments
        casLines[i] = casLines[i].replace('"""', "'''").replace('"', "'")
        proc = re.match(key_comment, casLines[i] + '/')
        head = proc.group('before').strip()
        core.append(head)
    casStream = ' '.join(core)

    frLines = []
    gbLines = []
    for i in range(len(casLines)):

        # ~~> split comments
        casLines[i] = casLines[i].replace('"""', "'''").replace('"', "'")
        proc = re.match(key_comment, casLines[i] + '/')
        head = proc.group('before').strip()
        tail = proc.group('after').rstrip('/').strip()  # /!\ is not translated
        # ~~ special keys starting with '&'
        p = re.match(key_none, head + ' ')
        if p:
            head = ''
            tail = casLines[i].strip()
        frline = head
        gbline = head

        if head != '' and casStream == '':
            raise Exception([{
                'name':
                'translateCAS',
                'msg':
                'could not translate this cas file after the line:\n' + head
            }])
        # ~~> this is a must for multiple keywords on one line
        while casStream != '':
            proc = re.match(key_equals, casStream)
            if not proc:
                raise Exception([{
                    'name':
                    'scanCAS',
                    'msg':
                    '... hmmm, did not see this one coming ...\n   around there :'
                    + casStream[:100]
                }])
            kw = proc.group('key').strip()
            if kw not in head: break  # move on to next line

            # ~~> translate the keyword
            head = head.replace(kw, '', 1)
            if kw.upper() in frgb['GB']:
                frline = frline.replace(kw, frgb['GB'][kw], 1)
            if kw.upper() in frgb['FR']:
                gbline = gbline.replace(kw, frgb['FR'][kw], 1)

            # ~~> look for less obvious keywords
            casStream = proc.group('after')  # still hold the separator
            proc = re.match(val_equals, casStream)
            if not proc:
                raise Exception([{
                    'name': 'translateCAS',
                    'msg': 'no value to keyword: ' + kw
                }])
            while proc:
                casStream = proc.group('after')  # still hold the separator
                proc = re.match(val_equals, casStream)

        # final append
        if frline != '': frline = ' ' + frline
        frLines.append(frline + tail)
        if gbline != '': gbline = ' ' + gbline
        gbLines.append(gbline + tail)

    # ~~ print FR and GB versions of the CAS file
    putFileContent(cas + '.fr', frLines)
    putFileContent(cas + '.gb', gbLines)

    return cas + '.fr', cas + '.gb'
Esempio n. 11
0
def createExeFiles(ename, ecfg, eprog, bypass):

    # ~~ Directories ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ExeDir = path.join(cfg['MODULES'][eprog.lower()]['path'], ecfg)
    chdir(ExeDir)

    # ~~ Removes existing executables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    if 'homere' in ename or 'systeme' in ename:
        ExeFile = path.join(ExeDir,
                            eprog + cfg['version'] + cfg['SYSTEM']['sfx_exe'])
        LibFile = path.join(ExeDir,
                            eprog + cfg['version'] + cfg['SYSTEM']['sfx_lib'])
        ObjCmd = path.join(ExeDir, eprog + cfg['version'] + '.cmdo')
        ExeCmd = path.join(ExeDir, eprog + cfg['version'] + '.cmdx')
    else:
        ExeFile = path.join(ExeDir, ename + cfg['SYSTEM']['sfx_exe'])
        LibFile = path.join(ExeDir, ename + cfg['SYSTEM']['sfx_lib'])
        ObjCmd = path.join(ExeDir, ename + '.cmdo')
        ExeCmd = path.join(ExeDir, ename + '.cmdx')
    #if cfg['COMPILER']['REBUILD'] > 0 and path.exists(ExeFile): remove(ExeFile)

    # ~~ Lists all system libraries ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    LibFiles = ''
    for lib in HOMERES[ename.upper(
    )]['deps'][1:]:  # /!\ [1:] to create the exe from local objs.
        #ModDir = path.join(cfg['MODULES'][eprog.lower()]['path'],ecfg)
        l = path.join(ExeDir,
                      lib.lower() + cfg['version'] + cfg['SYSTEM']['sfx_lib'])
        if not path.exists(l):
            raise Exception([{
                'name': 'createExeFiles',
                'msg': 'Library missing:\n      ' + l
            }])
        LibFiles = LibFiles + l + ' '

    # ~~ Add external libraries ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    for lib in cfg['MODULES'][eprog]['libs'].split():
        # FD@EDF : temporary removal of the following action
        # => interesting but we should also support LDFLAGS as -lpthread -lmpich -lmed...
        #if not path.exists(lib): raise Exception([{'name':'createExeFiles','msg':'External library missing:\n      '+lib}])
        LibFiles = LibFiles + lib + ' '

    # ~~ Lists local objects ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ObjFiles = ''
    for obj, lib in HOMERES[ename.upper()]['add']:
        Root, Suffix = path.splitext(obj)
        if lib == eprog and obj.lower(
        ) + cfg['SYSTEM']['sfx_obj'] not in ObjFiles.split():
            o = Root.lower() + cfg['SYSTEM']['sfx_obj']
            if not path.exists(o):
                raise Exception([{
                    'name': 'createExeFiles',
                    'msg': 'Object missing:\n      ' + o
                }])
            ObjFiles = ObjFiles + o + ' '
    #if ObjFiles.strip() == '' and path.exists(ExeFile): return True
    for obj, lib in HOMERES[ename.upper()]['tag']:
        if lib == eprog and obj.lower(
        ) + cfg['SYSTEM']['sfx_obj'] not in ObjFiles.split():
            o = obj.lower() + cfg['SYSTEM']['sfx_obj']
            if not path.exists(o):
                raise Exception([{
                    'name': 'createExeFiles',
                    'msg': 'Object missing:\n      ' + o
                }])
            ObjFiles = ObjFiles + o + ' '

    # ~~ is executable necessary ? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    if path.exists(ExeFile):
        if cfg['COMPILER']['REBUILD'] > 0 and cfg['COMPILER']['REBUILD'] < 3:
            remove(ExeFile)
    if path.exists(ExeFile):
        if cfg['COMPILER']['REBUILD'] > 2 or cfg['COMPILER']['REBUILD'] == 0:
            refresh = False
            for o in ObjFiles.split():
                refresh = refresh or (isNewer(o, ExeFile) == 0)
            for l in LibFiles.split():
                refresh = refresh or (isNewer(l, ExeFile) == 0)
            if refresh: remove(ExeFile)
    if path.exists(ExeFile): return

    # ~~ creation of the exe (according to makefile.wnt + systel.ini):
    # ~~ xilink.exe /stack:536870912 /out:postel3dV5P9.exe declarations_postel3d.obj coupeh.obj lecdon_postel3d.obj postel3d.obj coupev.obj lecr3d.obj pre2dh.obj pre2dv.obj ecrdeb.obj nomtra.obj homere_postel3d.obj point_postel3d.obj ..\..\..\bief\bief_V5P9\1\biefV5P9.lib ..\..\..\damocles\damo_V5P9\1\damoV5P9.lib ..\..\..\paravoid\paravoid_V5P9\1\paravoidV5P9.lib ..\..\..\special\special_V5P9\1\specialV5P9.lib
    cmd = cfg['COMPILER']['cmd_exe']
    cmd = cmd.replace('<libs>', LibFiles)
    cmd = cmd.replace('<objs>', ObjFiles)
    cmd = cmd.replace('<exename>',
                      ExeFile).replace('<config>',
                                       ExeDir).replace('<root>', cfg['root'])

    xocmd = cfg['COMPILER']['cmd_obj']
    xocmd = xocmd.replace('<incs>', cfg['MODULES'][eprog]['incs'])
    mods = ''
    for mod in HOMERES[ename.upper()]['deps']:
        mods = mods + path.join(
            cfg['MODULES'][eprog]['mods'].replace(
                '<config>', cfg['MODULES'][mod]['path']), ecfg) + ' '
    xocmd = xocmd.replace('<mods>', mods)
    # <f95name> ... still to be replaced
    xocmd = xocmd.replace('<config>', ExeDir).replace('<root>', cfg['root'])

    xecmd = cfg['COMPILER']['cmd_exe']
    xecmd = xecmd.replace('<libs>', LibFile + ' ' + LibFiles)
    # <exename> and <objs> ... still to be replaced
    xecmd = xecmd.replace('<config>', ExeDir).replace('<root>', cfg['root'])

    if debug: print cmd
    mes = MESSAGES(size=10)
    try:
        tail, code = mes.runCmd(cmd, bypass)
        if tail != '':
            if path.exists(ObjCmd): remove(ObjCmd)
            if path.exists(ExeCmd): remove(ExeCmd)
    except Exception as e:
        if path.exists(ObjCmd): remove(ObjCmd)
        if path.exists(ExeCmd): remove(ExeCmd)
        raise Exception([
            filterMessage(
                {
                    'name':
                    'createExeFiles',
                    'msg':
                    'Could not link your executable. Please verify your external library installation or the python script itself.'
                }, e, bypass)
        ])
    if code != 0:
        if path.exists(ObjCmd): remove(ObjCmd)
        if path.exists(ExeCmd): remove(ExeCmd)
        raise Exception([{
            'name':
            'createExeFiles',
            'msg':
            'something went wrong, I am not sure why (runcode=' + str(code) +
            ').\n      ' + tail
        }])
    print '   - created ' + ExeFile
    putFileContent(ObjCmd, [xocmd])
    putFileContent(ExeCmd, [xecmd])
    return
Esempio n. 12
0
def replaceDOXYGEN(doxydocs):

    iTextList = [('<!DOCTYPE HTML PUBLIC', '<BODY BGCOLOR="#FFFFFF">'),
                 ('<DIV class="div-page">', '<hr>'),
                 ('<div class="header">', '<div class="summary">'),
                 ('<hr>\n<div class="div-footer">', '</html>'),
                 ('<dl class="user"><dt><b', '>'), ('</b></dt><d', 'd><br/>')]
    oTextList = [
        r"""<!DOCTYPE install PUBLIC "-//Joomla! 2.5//DTD template 1.0//EN" "http://www.joomla.org/xml/dtd/1.6/template-install.dtd">
   <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
   <head>
      <meta http-equiv="content-type" content="text/html; charset=utf-8" />
      <meta name="keywords" content="open, telemac, mascaret, hydraulique, surface libre, houle, vague, hydraulic, free surface, wave, sediment" />
      <meta name="robots" content="index, follow" />
      <meta name="date" content="2013-07-24T16:49:04+0100"/>
      <meta name="description" content="The open TELEMAC-MASCARET system is a set of software for free surface numerical modelling of:\n* 2D, 3D Hydrodynamics,\n* Sediment (sand and muds),\n* Waves." />
      <TITLE>The open TELEMAC-MASCARET system: 2D, 3D hydrodynamics sediment waves simulation system</TITLE>
      <link rel="shortcut icon" href="./images/favicon.ico" type="image/vnd.microsoft.icon" />
      <script src="./images/jquery-1.4.2.min.js" type="text/javascript"></script>
      <link rel="stylesheet" href="./images/system.css" type="text/css" />
      <link rel="stylesheet" href="./images/position.css" type="text/css" media="screen,projection" />
      <link rel="stylesheet" href="./images/layout.css" type="text/css" media="screen,projection" />
      <link rel="stylesheet" href="./images/general.css" type="text/css" />
      <link rel="stylesheet" href="./images/principal.css" type="text/css" />
      <style type="text/css">
      #ahgalleryOTconsortium { margin-left: auto; margin-right: auto; margin-top: 0px !important; margin-bottom: 0px !important; width: 1000px; }
      #ahgalleryOTconsortium ul.hover_block0, #ahgalleryOTconsortium ul.hover_block1, #ahgalleryOTconsortium ul.hover_block2 { display: block; overflow: hidden; padding-top: 20px; padding-left: 2px; background: transparent; margin-left: 2px; margin-top: 0 !important; margin-bottom: 0 !important; }
      #ahgalleryOTconsortium ul.bottom_block { padding-bottom: 20px ; }
      #ahgalleryOTconsortium ul.hover_block0 li.item, #ahgalleryOTconsortium ul.hover_block1 li.item, #ahgalleryOTconsortium ul.hover_block2 li.item { margin-left: 0; padding-left: 0; list-style:none; list-style-position: inside; float:left; background: transparent; width: 150px; position: relative; }
      #ahgalleryOTconsortium ul.hover_block0 li a.teaser, #ahgalleryOTconsortium ul.hover_block1 li a.teaser , #ahgalleryOTconsortium ul.hover_block2 li a.teaser{ display: block; position: relative; overflow: hidden; height: 60px; width: 130px; padding: 1px; }
      #ahgalleryOTconsortium ul.hover_block0 li div.teaser, #ahgalleryOTconsortium ul.hover_block1 li div.teaser , #ahgalleryOTconsortium ul.hover_block2 li div.teaser { display: block; position: relative; overflow: hidden; height: 60px; width: 140px; padding: 1px; }
      #ahgalleryOTconsortium ul.hover_block0 li img.overlay, #ahgalleryOTconsortium ul.hover_block1 li img.overlay, #ahgalleryOTconsortium ul.hover_block2 li img.overlay { margin: 0; position: absolute; top: 5px; left: 0; border: 0; }
      </style>
      <script type="text/javascript" src="./images/hide.js"></script>
      <script type="text/javascript">
         window.addEvent(\'load\', function() {
            new JCaption(\'img.caption\');
         });
         window.addEvent(\'domready\', function() {
            $$(\'.hasTip\').each(function(el) {
               var title = el.get(\'title\');
               if (title) {
                  var parts = title.split(\'::\', 2);
                  el.store(\'tip:title\', parts[0]);
                  el.store(\'tip:text\', parts[1]);
            }});
            var JTooltips = new Tips($$(\'.hasTip\'), { maxTitleChars: 50, fixed: false});
         });
      </script>
      <link href="./images/tabsVTK.css" rel="stylesheet" type="text/css"/>
      <link href="./images/searchVTK.css" rel="stylesheet" type="text/css"/>
      <script type="text/javaScript" src="./images/searchVTK.js"></script>
      <link href="./images/doxygenVTK.css" rel="stylesheet" type="text/css"/>
      </HEAD>
   <BODY BGCOLOR="#FFFFFF">""", """<div id="all">
    <div id="header">
        <div class="logoheader">
            <h1 id="logo">open TELEMAC-MASCARET               <span class="header1">The mathematically superior suite of solvers</span></h1>
         </div>
         <div class="bar-top" >
         <ul class="menu">
          <li><a href="http://www.opentelemac.org/" ><img src="./images/OTM_Home-icon_15pix_212-118-0.png" alt="Home" /><span class="image-title">Home</span> </a></li>
       <li><a href="http://www.opentelemac.org/index.php/contact2"><img src="./images/OTM_Mail-icon_15pix_212-118-0.png" alt="Contact"/><span class="image-title">CONTACT</span> </a></li>
       <li><span class="separator"><img src="./images/OTM_transparent_15x080pix.png" /><img src="./images/OTM_transparent_15x080pix.png" /></span></li>
       <li><a href="http://www.opentelemac.org/index.php/community"><span class="image-title">COMMUNITY</span> </a></li>
       <li><a href="http://www.opentelemac.org/index.php/user-conference"><span class="image-title">CONFERENCE</span> </a></li>
       <li><a href="http://www.opentelemac.org/index.php/download"><span class="image-title">DOWNLOAD</span> </a></li>
          <li><a href="http://docs.opentelemac.org/" style="color:#333;background:#ffd1a3;padding:10px;"><span class="image-title">DOXY DOCS</span> </a></li>
       <li><a href="http://www.opentelemac.org/index.php/kunena"><span class="image-title">FORUM</span> </a></li>
          <li><a href="http://wiki.opentelemac.org/doku.php"><span class="image-title">WIKI</span> </a></li>
            </ul>
            </div>
            </div>

      <!-- Generated by Doxygen 1.7.0 -->
      <script type="text/javascript">
      function hasClass(ele,cls) {
        return ele.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)'));
      }
      function addClass(ele,cls) {
        if (!this.hasClass(ele,cls)) ele.className += " "+cls;
      }
      function removeClass(ele,cls) {
        if (hasClass(ele,cls)) {
          var reg = new RegExp('(\\s|^)'+cls+'(\\s|$)');
          ele.className=ele.className.replace(reg,' ');
        }
      }
      function toggleVisibility(linkObj) {
       var base = linkObj.getAttribute('id');
       var summary = document.getElementById(base + '-summary');
       var content = document.getElementById(base + '-content');
       var trigger = document.getElementById(base + '-trigger');
       if ( hasClass(linkObj,'closed') ) {
         summary.style.display = 'none';
         content.style.display = 'block';
         trigger.src = 'open.png';
         removeClass(linkObj,'closed');
         addClass(linkObj,'opened');
       } else if ( hasClass(linkObj,'opened') ) {
         summary.style.display = 'block';
         content.style.display = 'none';
         trigger.src = 'closed.png';
         removeClass(linkObj,'opened');
         addClass(linkObj,'closed');
       }
       return false;
      }
      </script>
      <br>""", """<div  id="main" >
         <div  class="header" >
         <div  class="summary" >""", """<br>
      </div></div>
               <h2 class="unseen">Generated on Fri Aug 31 2013 18:12:58 by S.E.Bourban (HRW) using <A href="http://www.doxygen.org/index.html"><img class="footer" width=70px src="doxygen.png" alt="doxygen"/></A> 1.7.0</h2>
               <div  id="footer-outer" ><div id="footer-inner"><div id="bottom"><div class="box box1"><div class="moduletable">
               <script type="text/javascript">
              jQuery.noConflict();
        jQuery(document).ready(function($)
         {
          $('#ahgalleryOTconsortium ul.hover_block0 li.item').hover(function(){
           $(this).find('img.overlay').animate({top:'60px'},{queue:false,duration:500});
          }, function(){
           $(this).find('img.overlay').animate({top:'5px'},{queue:false,duration:500});
          });
        });
        </script>
               <div id="ahgalleryOTconsortium">
                  <ul class="hover_block0 bottom_block">
                     <li class="item"><a class="teaser" style="background-color:transparent !important;  font-weight: normal; text-decoration: none;" href="http://www.arteliagroup.com/" target="_blank"><img class="overlay" src="./images/Sogreah-Artelia.jpg" alt="" />
                        <span style="color:grey; font-size: 14px; font-weight: bold; line-height: 18px; font-family: arial; margin-bottom: 0.5em; margin-top: 0.5em; display: block; text-align: center;">Artelia</span>
                        <span style="color:white; display: block; font-size: 12px; font-weight: normal; font-family: arial; margin-bottom: 0.5em; margin-top: 0.5em;"></span></a></li>
                     <li class="item"><a class="teaser" style="background-color:transparent !important;  font-weight: normal; text-decoration: none;" href="http://www.baw.de/de/index.php.html" target="_blank"><img class="overlay" src="./images/logo_baw.png" alt="" />
                        <span style="color:grey; font-size: 14px; font-weight: bold; line-height: 18px; font-family: arial; margin-bottom: 0.5em; margin-top: 0.5em; display: block; text-align: center;">BundesAnstalt fur Wasserbau</span>
                        <span style="color:white; display: block; font-size: 12px; font-weight: normal; font-family: arial; margin-bottom: 0.5em; margin-top: 0.5em;"></span></a></li>
                     <li class="item"><a class="teaser" style="background-color:transparent !important;  font-weight: normal; text-decoration: none;" href="http://www.cetmef.equipement.gouv.fr/" target="_blank"><img class="overlay" src="./images/logo_cetmef_v2.png" alt="" />
                        <span style="color:grey; font-size: 14px; font-weight: bold; line-height: 18px; font-family: arial; margin-bottom: 0.5em; margin-top: 0.5em; display: block; text-align: center;">CETMEF</span>
                        <span style="color:white; display: block; font-size: 12px; font-weight: normal; font-family: arial; margin-bottom: 0.5em; margin-top: 0.5em;"></span></a></li>
                     <li class="item"><a class="teaser" style="background-color:transparent !important;  font-weight: normal; text-decoration: none;" href="http://www.stfc.ac.uk/About%20STFC/45.aspx" target="_blank"><img class="overlay" src="./images/logo_Daresbury_v3.gif" alt="" />
                        <span style="color:grey; font-size: 14px; font-weight: bold; line-height: 18px; font-family: arial; margin-bottom: 0.5em; margin-top: 0.5em; display: block; text-align: center;">Daresbury Laboratory</span>
                        <span style="color:white; display: block; font-size: 12px; font-weight: normal; font-family: arial; margin-bottom: 0.5em; margin-top: 0.5em;"></span></a></li>
                     <li class="item"><a class="teaser" style="background-color:transparent !important;  font-weight: normal; text-decoration: none;" href="http://research.edf.com/research-and-innovation-44204.html&amp;tab=44205" target="_blank"><img class="overlay" src="./images/logo_edfR&D.jpg" alt="" />
                        <span style="color:grey; font-size: 14px; font-weight: bold; line-height: 18px; font-family: arial; margin-bottom: 0.5em; margin-top: 0.5em; display: block; text-align: center;">EDF R&D</span>
                        <span style="color:white; display: block; font-size: 12px; font-weight: normal; font-family: arial; margin-bottom: 0.5em; margin-top: 0.5em;"></span></a></li>
                     <li class="item"><a class="teaser" style="background-color:transparent !important;  font-weight: normal; text-decoration: none;" href="http://www.hrwallingford.com" target="_blank"><img class="overlay" src="./images/logo_HRW.png" alt="" />
                        <span style="color:grey; font-size: 14px; font-weight: bold; line-height: 18px; font-family: arial; margin-bottom: 0.5em; margin-top: 0.5em; display: block; text-align: center;">HR Wallingford</span>
                        <span style="color:white; display: block; font-size: 12px; font-weight: normal; font-family: arial; margin-bottom: 0.5em; margin-top: 0.5em;"></span></a></li>
                  </ul></div>
        <div class="clr"></div>
       </div></div>
       </div></div>
               <div id="footer-sub"><div id="footer">
                  <ul class="menu">
                     <li class="item-187"><a href="http://www.opentelemac.org/index.php/forum-rules" >Forum rules</a></li>
                     <li class="item-111"><a href="http://www.opentelemac.org/index.php/licence" >Licence</a></li>
                     <li class="item-112"><a href="http://www.opentelemac.org/index.php/privacy" >Privacy</a></li>
                     <li class="item-112"><a href="http://www.opentelemac.org/index.php/terms-and-conditions" >Terms &amp; Conditions</a></li>
                  </ul>
               </div>
       </div></div>
      </body></html>""", '<dl class="user"><dt><h3><b>',
        '</b></h3></dt><dd><br/>'
    ]

    text = r'(?P<before>[\s\S]*?)(?P<text>%s)(?P<after>[\s\S]*)'
    if path.exists(doxydocs):
        dirpath, _, filenames = walk(doxydocs).next()
        for fle in filenames:
            head, tail = path.splitext(fle)
            if tail == '.html':
                print '    +> ', fle
                lines = ''.join(getFileContent(path.join(dirpath, fle)))
                proc = True
                while proc:
                    proc = False
                    for itext, otext in zip(iTextList, oTextList):
                        proc0 = re.match(re.compile(text % (itext[0]), re.I),
                                         lines)
                        if proc0:
                            a = proc0.group('before')
                            proc1 = re.match(
                                re.compile(text % (itext[1]), re.I),
                                proc0.group('after'))
                            if proc1:
                                proc = True
                                b = proc1.group('after')
                                lines = a + otext + b
                                #print 'replacing: ',proc0.group('text')+proc1.group('before')
                putFileContent(path.join(dirpath, fle), [lines])

    return
Esempio n. 13
0
    fic, mdl, sbt, fct, prg, dep, racine = scanSources(cfgname, cfg, BYPASS)

    # ~~ Scann all source files to update Doxygen ~~~~~~~~~~~~~~~~
    for mod in fic:
        print '\nCreating the DOXYGEN headers for ' + mod + '\n' + '~' * 72 + '\n'
        for ifile in fic[mod]:

            # ~~ Read the content of the source file ~~~~~~~~~~~~
            ilines = getFileContent(ifile)
            # ~~ Update its Doxygen content ~~~~~~~~~~~~~~~~~~~~~
            olines = createDOXYGEN(ifile, ilines, mod, racine)
            # ~~ Make sure the distination exists ~~~~~~~~~~~~~~~
            ofile = ifile.replace(cfg['root'], cfg['doxydocs'])
            createDirectories(path.dirname(ofile))
            # ~~ Write the content of the source file ~~~~~~~~~~~
            putFileContent(ofile, olines)

    # ~~ Run Doxygen ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    print '\nNow running DOXYGEN within ' + cfg[
        'doxydocs'] + '\n' + '~' * 72 + '\n'
    chdir(cfg['doxydocs'])
    if not path.exists(cfgs[cfgname]['cmd_doxygen']):
        print 'Do not know where to find ', cfgs[cfgname]['cmd_doxygen']
        print ' ... you can correct this through the key cmd_doxygen in your configuration file'
        sys.exit(1)
    if sp.call([cfgs[cfgname]['cmd_doxygen']]):
        sys.exit(1)

    # ~~ Scan all HTML files and replace template in phases
    replaceDOXYGEN(path.join(cfgs[cfgname]['doxydocs'], 'html'))