Changeset View
Changeset View
Standalone View
Standalone View
build/coala/LicenseYearBear.py
Show All 23 Lines | def get_last_modification(self, filename): | ||||
was_modified = False | was_modified = False | ||||
for status in client.status(): | for status in client.status(): | ||||
if status.type_raw_name == 'modified': | if status.type_raw_name == 'modified': | ||||
was_modified = True | was_modified = True | ||||
break | break | ||||
if not was_modified: | if not was_modified: | ||||
try: | try: | ||||
return client.info()['commit_date'].year | return client.info()['commit_date'].year | ||||
except SvnException: | except (AttributeError, SvnException): | ||||
return None | return None | ||||
else: | else: | ||||
return date.today().year | return date.today().year | ||||
def run(self, filename, file): | def run(self, filename, file): | ||||
modification_year = self.get_last_modification(filename) | modification_year = self.get_last_modification(filename) | ||||
if not modification_year: | if not modification_year: | ||||
return | return | ||||
Show All 19 Lines |
Wildfire Games · Phabricator