Skip to content

Commit

Permalink
update-carbon-rating
Browse files Browse the repository at this point in the history
  • Loading branch information
7h3Rabbit committed Nov 18, 2024
1 parent 1c336fc commit 1630767
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 14 deletions.
6 changes: 6 additions & 0 deletions default.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ def update_browser(self, _):
update_user_agent()
sys.exit(0)

def update_carbon_rating(self, _):
update_mdn_rules()
sys.exit(0)

def update_mdn(self, _):
update_mdn_rules()
sys.exit(0)
Expand Down Expand Up @@ -528,6 +532,7 @@ def handle_option(self, opt, arg):
("-b", "--update-browser"): self.update_browser,
("-d", "--update-definitions"): self.update_software_definitions,
("--ums", "--update-mdn-sources"): self.update_mdn,
("--ucr", "--update-carbon-rating"): self.update_carbon_rating,
("-s", "--setting"): self.set_setting,
("-ss", "--save-setting"): self.save_setting
}
Expand Down Expand Up @@ -574,6 +579,7 @@ def main(argv):
"uc" ,"update-credits",
"ums", "update-mdn-sources",
"update-browser", "update-definitions=",
"update-carbon-rating",
"is=", "it=", "setting=", "save-setting="])
except getopt.GetoptError:
print(main.__doc__)
Expand Down
File renamed without changes.
7 changes: 0 additions & 7 deletions helpers/mdn_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,3 @@ def save_mdn_rules(rules):
with open(file_path, 'w', encoding='utf-8') as outfile:
json.dump(rules, outfile, indent=4)
return rules


"""
If file is executed on itself then call a definition, mostly for testing purposes
"""
if __name__ == '__main__':
main(sys.argv[1:])
7 changes: 0 additions & 7 deletions helpers/update_software_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -1202,10 +1202,3 @@ def get_apache_httpd_versions():
for version in versions:
versions_dict[version] = []
return versions_dict


"""
If file is executed on itself then call a definition, mostly for testing purposes
"""
if __name__ == '__main__':
main(sys.argv[1:])

0 comments on commit 1630767

Please sign in to comment.