Changeset 4931


Ignore:
Timestamp:
Jan 11, 2008, 6:03:06 PM (16 years ago)
Author:
ole
Message:

Factored the data_audit skeleton out as a separate script.
More to come

Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • create_distribution.py

    r4865 r4931  
    2121"""
    2222
    23 from os import sep, system, remove, walk
     23from os import sep, system
    2424from string import join
    2525from tempfile import mktemp
     
    118118
    119119
    120 
    121 #----------------------------------------------------
    122 # Identify potential data files that might violate IP
    123 #----------------------------------------------------
    124 
    125 
    126 print '---------------------------------------------'
    127 print 'Files that need to be assessed for IP issues:'
    128 print '---------------------------------------------'
    129 
    130 # Print header
    131 dirwidth = 72
    132 print '---------------------------------------------'
    133 print 'Directory'.ljust(dirwidth), 'File'
    134 print '---------------------------------------------'
    135 
    136 # Ignore source code files
    137 extensions_to_ignore = ['.py','.c','.h', '.f'] #,'gif']
    138 
    139 # Ignore certain other files
    140 files_to_ignore = ['README.txt']
    141 
    142 for dirpath, dirnames, filenames in walk(distro_dir):
    143 
    144     #print 'Searching dir', dirpath
    145    
    146 
    147     for filename in filenames:
    148 
    149 
    150         # Ignore extensions that need no IP check
    151         ignore = False
    152         for ext in extensions_to_ignore:
    153             if filename.endswith(ext):
    154                 ignore = True
    155 
    156         if filename in files_to_ignore:
    157             ignore = True
    158 
    159         if ignore is False:
    160             subdirs = dirpath.split(sep)
    161            
    162             print join(subdirs[3:],sep).ljust(dirwidth), filename
    163        
    164 
    165 # FIXME (Ole): Here we could put in a check testing if
    166 # all the files above have a .license file associated with them
    167 # explaining their origins.
    168 
     120from data_audit import identify_data_files
     121identify_data_files(distro_dir)
    169122
    170123
Note: See TracChangeset for help on using the changeset viewer.