7"""Script that generates a page_set for the webpages_playback.py script."""
10from __future__
import print_function
15PAGE_SET_TEMPLATE =
'page_set_template'
16PAGE_SET_DIR =
'page_sets'
20 created_page_sets = []
22 user_agent = raw_input(
'user agent? (mobile/desktop/tablet): ')
23 url_name = raw_input(
'URL name? (eg: google): ')
24 url = raw_input(
'URL? (eg: http://www.google.com): ')
25 comment = raw_input(
'Reason for adding the URL? (eg: go/skia-skps-3-2019): ')
27 with open(PAGE_SET_TEMPLATE)
as f:
28 t = jinja2.Template(f.read())
30 'user_agent': user_agent,
36 page_set_name =
'skia_%s_%s.py' % (url_name, user_agent)
37 page_set_path = os.path.join(PAGE_SET_DIR, page_set_name)
38 with open(page_set_path,
'w')
as f:
39 f.write(t.render(**subs))
40 created_page_sets.append(page_set_path)
41 print(
'\nPage set has been created in %s\n\n' % page_set_path)
43 keep_going = raw_input(
'Do you have more page sets to create? (y/n)')
47 print(
'\n\nSummarizing all created page sets:')
48 for page_set_path
in created_page_sets:
49 print(
'* %s' % page_set_path)
52if __name__ ==
'__main__':
def print(*args, **kwargs)