20 created_page_sets = []
21 while True:
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): ')
26
27 with open(PAGE_SET_TEMPLATE) as f:
28 t = jinja2.Template(f.read())
29 subs = {
30 'user_agent': user_agent,
31 'url_name': url_name,
32 'url': url,
33 'comment': comment,
34 }
35
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)
42
43 keep_going = raw_input('Do you have more page sets to create? (y/n)')
44 if keep_going != 'y':
45 break
46
47 print(
'\n\nSummarizing all created page sets:')
48 for page_set_path in created_page_sets:
49 print(
'* %s' % page_set_path)
50
51
def print(*args, **kwargs)