-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Toolbar and omnibar changes #18
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -161,36 +161,36 @@ def validated_data_field(data, field_name): | |
return field_value | ||
|
||
|
||
def generate_backgrounds_license(preamble, backgrounds): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we dont need to comment this out if already commented below There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. actually yes, but this code is not needed by us |
||
notices = '' | ||
|
||
for background in backgrounds: | ||
if notices: | ||
notices += '\n' | ||
|
||
filename = validated_data_field(background, 'wallpaperImageUrl') | ||
author_name = validated_data_field(background, 'author') | ||
# Don't validate link. it can be empty. | ||
author_link = background['link'] | ||
original_url = validated_data_field(background, 'originalUrl') | ||
license_text = validated_data_field(background, 'license') | ||
if license_text != 'used with permission' \ | ||
and license_text[0:8] != 'https://' \ | ||
and license_text[0:7] != 'http://': | ||
print('Invalid license for background image ' \ | ||
f"{background['name']}. It needs to be a URL or the " \ | ||
'string "used with permission".') | ||
sys.exit(1) | ||
|
||
if author_link != '': | ||
notices += f'File: {filename}\nAuthor: {author_name} ' \ | ||
f'({author_link})\nURL: {original_url}\n' \ | ||
f'License: {license_text}\n' | ||
else: | ||
notices += f'File: {filename}\nAuthor: {author_name}\n' \ | ||
f'URL: {original_url}\nLicense: {license_text}\n' | ||
|
||
return f'{preamble}\n\n{notices}' | ||
# def generate_backgrounds_license(preamble, backgrounds): | ||
# notices = '' | ||
|
||
# for background in backgrounds: | ||
# if notices: | ||
# notices += '\n' | ||
|
||
# filename = validated_data_field(background, 'wallpaperImageUrl') | ||
# author_name = validated_data_field(background, 'author') | ||
# # Don't validate link. it can be empty. | ||
# author_link = background['link'] | ||
# original_url = validated_data_field(background, 'originalUrl') | ||
# license_text = validated_data_field(background, 'license') | ||
# if license_text != 'used with permission' \ | ||
# and license_text[0:8] != 'https://' \ | ||
# and license_text[0:7] != 'http://': | ||
# print('Invalid license for background image ' \ | ||
# f"{background['name']}. It needs to be a URL or the " \ | ||
# 'string "used with permission".') | ||
# sys.exit(1) | ||
|
||
# if author_link != '': | ||
# notices += f'File: {filename}\nAuthor: {author_name} ' \ | ||
# f'({author_link})\nURL: {original_url}\n' \ | ||
# f'License: {license_text}\n' | ||
# else: | ||
# notices += f'File: {filename}\nAuthor: {author_name}\n' \ | ||
# f'URL: {original_url}\nLicense: {license_text}\n' | ||
|
||
# return f'{preamble}\n\n{notices}' | ||
|
||
|
||
def main(): | ||
|
@@ -233,12 +233,12 @@ def main(): | |
'background images used on the new tab page. The Brave Browser and ' \ | ||
'such data files are separate and independent works.' | ||
|
||
ntp_backgrounds = list_ntp_backgrounds( | ||
os.path.join(ntp_data_dir, 'backgrounds.ts')) | ||
if write_license_file(ntp_data_dir, generate_backgrounds_license( | ||
ntp_backgrounds_preamble, ntp_backgrounds)): | ||
print(f'- {len(ntp_backgrounds)} sub-components added in ' \ | ||
'brave_new_tab_ui/data/LICENSE') | ||
# ntp_backgrounds = list_ntp_backgrounds( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. try to remove only the things not needed. if this is already removed from react then need not comment this |
||
# os.path.join(ntp_data_dir, 'backgrounds.ts')) | ||
# if write_license_file(ntp_data_dir, generate_backgrounds_licens( | ||
# ntp_backgrounds_preamble, ntp_backgrounds)): | ||
# print(f'- {len(ntp_backgrounds)} sub-components added in ' \ | ||
# 'brave_new_tab_ui/data/LICENSE') | ||
|
||
|
||
if __name__ == '__main__': | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this file doing?