isa_parser.py (7788:4dd870e2c91d) | isa_parser.py (7816:b5003ac75977) |
---|---|
1# Copyright (c) 2003-2005 The Regents of The University of Michigan 2# All rights reserved. 3# 4# Redistribution and use in source and binary forms, with or without 5# modification, are permitted provided that the following conditions are 6# met: redistributions of source code must retain the above copyright 7# notice, this list of conditions and the following disclaimer; 8# redistributions in binary form must reproduce the above copyright --- 1966 unchanged lines hidden (view full) --- 1975 1976 file = os.path.join(self.output_dir, file) 1977 update = False 1978 if os.access(file, os.R_OK): 1979 f = open(file, 'r') 1980 old_contents = f.read() 1981 f.close() 1982 if contents != old_contents: | 1# Copyright (c) 2003-2005 The Regents of The University of Michigan 2# All rights reserved. 3# 4# Redistribution and use in source and binary forms, with or without 5# modification, are permitted provided that the following conditions are 6# met: redistributions of source code must retain the above copyright 7# notice, this list of conditions and the following disclaimer; 8# redistributions in binary form must reproduce the above copyright --- 1966 unchanged lines hidden (view full) --- 1975 1976 file = os.path.join(self.output_dir, file) 1977 update = False 1978 if os.access(file, os.R_OK): 1979 f = open(file, 'r') 1980 old_contents = f.read() 1981 f.close() 1982 if contents != old_contents: |
1983 print 'Updating', file | |
1984 os.remove(file) # in case it's write-protected 1985 update = True 1986 else: 1987 print 'File', file, 'is unchanged' 1988 else: | 1983 os.remove(file) # in case it's write-protected 1984 update = True 1985 else: 1986 print 'File', file, 'is unchanged' 1987 else: |
1989 print ' [GENERATE]', file | |
1990 update = True 1991 if update: 1992 f = open(file, 'w') 1993 f.write(contents) 1994 f.close() 1995 1996 # This regular expression matches '##include' directives 1997 includeRE = re.compile(r'^\s*##include\s+"(?P<filename>[\w/.-]*)".*$', --- 98 unchanged lines hidden --- | 1988 update = True 1989 if update: 1990 f = open(file, 'w') 1991 f.write(contents) 1992 f.close() 1993 1994 # This regular expression matches '##include' directives 1995 includeRE = re.compile(r'^\s*##include\s+"(?P<filename>[\w/.-]*)".*$', --- 98 unchanged lines hidden --- |