Changeset 4865


Ignore:
Timestamp:
Nov 29, 2007, 6:51:29 PM (17 years ago)
Author:
ole
Message:

Work towards ticket:222

File:
1 edited

Legend:

Unmodified
Added
Removed
  • create_distribution.py

    r4857 r4865  
    2121"""
    2222
    23 from os import sep, system, remove
     23from os import sep, system, remove, walk
     24from string import join
    2425from tempfile import mktemp
    2526from sys import platform, stdout
     
    116117system(s)
    117118
     119
     120
     121#----------------------------------------------------
     122# Identify potential data files that might violate IP
     123#----------------------------------------------------
     124
     125
     126print '---------------------------------------------'
     127print 'Files that need to be assessed for IP issues:'
     128print '---------------------------------------------'
     129
     130# Print header
     131dirwidth = 72
     132print '---------------------------------------------'
     133print 'Directory'.ljust(dirwidth), 'File'
     134print '---------------------------------------------'
     135
     136# Ignore source code files
     137extensions_to_ignore = ['.py','.c','.h', '.f'] #,'gif']
     138
     139# Ignore certain other files
     140files_to_ignore = ['README.txt']
     141
     142for 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
     169
     170
    118171#------------------
    119172# Zip everything up
     
    136189print s
    137190system(s)
    138 
    139 
    140 
    141191
    142192
Note: See TracChangeset for help on using the changeset viewer.