Index: c/log2.py
===================================================================
--- /src/log2.py	(revision 6)
+++ 	(revision )
@@ -1,5 +1,0 @@
-
-import math
-
-def log2(x):
-    return int(math.ceil(math.log(x,2)))
Index: /src/mpy.py
===================================================================
--- /src/mpy.py	(revision 6)
+++ /src/mpy.py	(revision 1)
@@ -21,11 +21,10 @@
 # requires doctutils package to run rst2html 
 #
-# TODO step by step execution
-# TODO write a manual
-# TODO add unitary tests
-# TODO add [ and { despecialization
-# -------------------------------------------------------------------------------------------------
-_date = '2011-01-05 14:30'
-_version = '1.08'
+# TODO exectution step by step
+# TODO ecrire un manuel
+# TODO faire des tests unitaires
+# -------------------------------------------------------------------------------------------------
+_date = '2009-12-30 16:00'
+_version = '1.07'
 _authors = 'Franck Wajsburt'
 _organization = '(UPMC/LIP6/SOC)'
@@ -39,5 +38,5 @@
 ==========================================================================='''
 
-import os, sys, pdb, math, re
+import os, sys, pdb
 from optparse import OptionParser
 from datetime import datetime
@@ -61,6 +60,4 @@
    "if fname does not exist then returns ''"
    if fname == 'stdin':
-      return fname
-   elif os.path.isabs(fname):
       return fname
    else:
@@ -123,5 +120,4 @@
    global mpyglobals
    mpylog     = mpyglobals['mpylog']     # log file
-   mpylist    = mpyglobals['mpylist']    # file list log file
    mpydebug   = mpyglobals['mpydebug']   # True|False
    mpyverbose = mpyglobals['mpyverbose'] # True|False
@@ -137,5 +133,4 @@
          sys.stdout = open( mpywdir+'/'+mpyout, "w")
          mpyoutlist.append(mpywdir+'/'+mpyout)
-         mpylist.write(mpywdir+'/'+mpyout+'\n')
       except IOError, e: _exit(e)
 
@@ -288,33 +283,31 @@
                         # test if buf is a file name, if yes includes file
                         # therefore pushes the current file and opens the new
-
-                        if re.match("\w*(\.\w*)+",buf):
-                           incname = _mpyfindfile(buf,mpyidir)
-                           if incname != '':
-                              if mpydebug == True:
-                                 _mpylog("\nInclude  to %s from %s" % (mpyout, incname))
-
-                              # push known parameters of the current opened file
-                              opened_mpyin.append((mpyin, mpybuf, mpyfname,
+                        incname = _mpyfindfile(buf,mpyidir)
+                        if incname != '':
+                           if mpydebug == True:
+                              _mpylog("\nInclude  to %s from %s" % (mpyout, incname))
+
+                           # push known parameters of the current opened file
+                           opened_mpyin.append((mpyin, mpybuf, mpyfname,
                                                 mpylineno, mpycharno, mpylength))
 
-                              # old values required for test of recursivity just below
-                              oldmpyfname = mpyfname
-                              oldmpylineno = mpylineno
-
-                              # open the include file
-                              mpyin, mpyfname = _mpyopen(realfname = incname)
-                              mpybuf = mpyin.read(-1)
-                              mpylineno = 1
-                              mpycharno = 0
-                              mpylength = len(mpybuf)
-                              level = 0
-                              buf = mode = ''
-
-                              # test recursive include
-                              for f in opened_mpyin[:-1]:
-                                 if mpyfname in f:
-                                    _exit ("%s[%d]: forbidden recursive inclusion on %s"
-                                           % (oldmpyfname, oldmpylineno, mpyfname))
+                           # old values required for test of recursivity just below
+                           oldmpyfname = mpyfname
+                           oldmpylineno = mpylineno
+
+                           # open the include file
+                           mpyin, mpyfname = _mpyopen(realfname = incname)
+                           mpybuf = mpyin.read(-1)
+                           mpylineno = 1
+                           mpycharno = 0
+                           mpylength = len(mpybuf)
+                           level = 0
+                           buf = mode = ''
+
+                           # test recursive include
+                           for f in opened_mpyin[:-1]:
+                              if mpyfname in f:
+                                 _exit ("%s[%d]: forbidden recursive inclusion on %s"
+                                        % (oldmpyfname, oldmpylineno, mpyfname))
 
                         # just evaluate buf
@@ -411,13 +404,7 @@
    hashnumber = _mpyhash(`param`)
    mpyout_base = '.'.join(mpyout[0:-2])
-
-   if not param.has_key('modelname'):
-      mpyout = mpyout_base+'_'+hashnumber+'.'+mpyout[-1]
-      mpymodelname = mpyout_base+'_'+hashnumber
-      param['mpymodelname'] = mpymodelname
-   else:
-      mpyout = param['modelname']+'.'+mpyout[-1]
-      mpymodelname = param['modelname']
-      param['mpymodelname'] = mpymodelname
+   mpyout = mpyout_base+'_'+hashnumber+'.'+mpyout[-1]
+   mpymodelname = mpyout_base+'_'+hashnumber
+   param['mpymodelname'] = mpymodelname
 
    # call the macro processor
@@ -438,9 +425,4 @@
       _exit('argument of mpyexp: must be a string not %s' % type(txt))
    _mpy(mpytxt = txt, mpydict = param)
-
-# -------------------------------------------------------------------------------------------------
-
-def log2(x):
-    return int(math.ceil(math.log(x,2)))
 
 # -------------------------------------------------------------------------------------------------
@@ -471,6 +453,4 @@
 _parser.add_option("-o", "--output", dest = "ofile", default = 'stdout'
                   , help = "define output filename [default: %default] ")
-_parser.add_option("-n", "--name", dest = "name", default = 'mpy'
-                  , help = "define instance name, basename for logs [default: 'mpy']")
 _parser.add_option("-i", "--idir", dest = "idir" 
                   , help = "list of directories (separated with colon ':') "
@@ -495,12 +475,10 @@
    _exit('%s is not a working directory' % _options.wdir)
 try: 
-   _mpymetaname = os.path.join(_options.wdir,_options.name+"_meta.log")
-   _mpytreename = os.path.join(_options.wdir,_options.name+"_tree.log")
-   _mpylistname = os.path.join(_options.wdir,_options.name+".list")
+   _mpymetaname = os.path.join(_options.wdir,"mpy_meta.log")
+   _mpytreename = os.path.join(_options.wdir,"mpy_tree.log")
    _mpymetafile = open(_mpymetaname,"a")
    _mpytreefile = open(_mpytreename,"a")
-   _mpylistfile = open(_mpylistname,"a")
-   _logname = os.path.join(_options.wdir, _options.name+".log")
-   _htmlname = os.path.join(_options.wdir,_options.name+".html")
+   _logname = os.path.join(_options.wdir,"mpy.log")
+   _htmlname = os.path.join(_options.wdir,"mpy.html")
 except IOError, e: 
    _exit(e) 
@@ -510,8 +488,7 @@
                  , mpywdir = _options.wdir # working directory
                  , mpyidir = [_options.wdir]+_options.idir.split(':') # split pathes in a list
-                 , mpylevelgen = 1      # level of generation (tree deep)
+                 , mpylevelgen = 1 		# level of generation (tree deep)
                  , mpylog  = _mpymetafile
                  , mpytree = _mpytreefile
-                 , mpylist = _mpylistfile
                  , mpytabwidth = _options.tab
                  , mpyoutlist = [_options.ofile])
@@ -534,7 +511,7 @@
    try:
       os.system('cat '+_mpytreename+' '+_mpymetaname+' > '+_logname)
+      os.system('rst2html '+_logname+' '+_htmlname)
       os.remove(_mpytreename)
       os.remove(_mpymetaname)
-      os.system('rst2html '+_logname+' '+_htmlname+' 2> /dev/null')
    except:
       pass
