Update of /cvsroot/pygccxml/source/pyplusplus/file_writers
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28954/pyplusplus/file_writers
Modified Files:
multiple_files.py writer.py
Log Message:
There are a lot of changes, sorry CVS did not worked for week or something like this
Changes
1. Lots of code clean up
2. Adding and updating documentation
3. Adding new method on decl_wrapper - readme. This method will return list of msgs to the developer.
For example if function takes by reference fundamental type it will say that this function could not be called from Python
4. Logging functionlity has been added to file writers too
5. Few bug fixes
6. For operator [] call policies is always set.
Index: writer.py
===================================================================
RCS file: /cvsroot/pygccxml/source/pyplusplus/file_writers/writer.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** writer.py 9 Mar 2006 10:58:23 -0000 1.13
--- writer.py 6 Apr 2006 06:16:08 -0000 1.14
***************
*** 5,12 ****
import os
! import shutil
from pyplusplus import code_repository
-
class writer_t(object):
"""Base class for all module/code writers.
--- 5,12 ----
import os
! import time
! from pyplusplus import _logging_
from pyplusplus import code_repository
class writer_t(object):
"""Base class for all module/code writers.
***************
*** 43,46 ****
--- 43,48 ----
def write_file( fpath, content ):
+ _logging_.logger.debug( 'write code to file "%s" - started' % fpath )
+ start_time = time.clock()
fcontent_new = []
fcontent_new.append( '// This file has been generated by pyplusplus.' )
***************
*** 56,63 ****
--- 58,72 ----
f.close()
if fcontent == fcontent_new:
+ _logging_.logger.debug( 'file was not changed - done( %f seconds )'
+ % ( time.clock() - start_time ) )
return
+ else:
+ _logging_.logger.debug( 'file does not exist' )
+
writer_t.create_backup( fpath )
f = file( fpath, 'w+b' )
f.write( fcontent_new )
f.close()
+ _logging_.logger.debug( 'write code - done( %f seconds )' % ( time.clock() - start_time ) )
+
write_file = staticmethod( write_file )
Index: multiple_files.py
===================================================================
RCS file: /cvsroot/pygccxml/source/pyplusplus/file_writers/multiple_files.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** multiple_files.py 28 Feb 2006 07:31:33 -0000 1.15
--- multiple_files.py 6 Apr 2006 06:16:08 -0000 1.16
***************
*** 152,155 ****
--- 152,156 ----
self.split_creators( creators, '_free_functions', 'register_free_functions', -1 )
+ #TODO: move write_main to __init__
def write(self, write_main=True):
""" Write out the module.
|