Returns True if the file needs updating, False otherwise.
(self)
| 92 | return not self.is_excluded() and self.one_of_replace_extensions() |
| 93 | |
| 94 | def needs_update(self): |
| 95 | """Returns True if the file needs updating, False otherwise.""" |
| 96 | |
| 97 | self.content = open(self.filename).read() |
| 98 | self.matches = re.search(self.RE_PART_OF_TEXWORKS, self.content[:1000]) |
| 99 | if self.matches is None: |
| 100 | print(' [WARNING] No Copyright notice found in {0}'.format(self.filename)) |
| 101 | return self.matches |
| 102 | |
| 103 | def update_copyright(self): |
| 104 | """Updates the copyright line in the file.""" |