scipy/weave/ext_tools.py
def generate_module(module_string, module_file):
    """ generate the source code file.  Only overwrite
        the existing file if the actual source has changed.
    """
    file_changed = 1
    if os.path.exists(module_file):
        f = open(module_file,'r')
        old_string = f.read()
        f.close()
        if old_string == module_string:
            file_changed = 0
    if file_changed:
        f = open(module_file,'w')
        f.write(module_string)
        f.close()
    return module_file
 generate the source code file.  Only overwrite
        the existing file if the actual source has changed.
    
generate the source code file.  Only overwrite
the existing file if the actual source has changed.
generate the source code file . Only overwrite the existing file if the actual source has changed .
def generate_module(module_string, module_file):
    file_changed = 1
    if os.path.exists(module_file):
        f = open(module_file,'r')
        old_string = f.read()
        f.close()
        if old_string == module_string:
            file_changed = 0
    if file_changed:
        f = open(module_file,'w')
        f.write(module_string)
        f.close()
    return module_file
def generate_module ( module_string , module_file ) : file_changed = 1 if os . path . exists ( module_file ) : f = open ( module_file , 'r' ) old_string = f . read ( ) f . close ( ) if old_string == module_string : file_changed = 0 if file_changed : f = open ( module_file , 'w' ) f . write ( module_string ) f . close ( ) return module_file
generate the source code file.
generate the source code file .
""" generate the source code file.  Only overwrite
        the existing file if the actual source has changed.
    """
module_string
module_file