mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
tools/lib: Text-wrap long lines exceeding 110.
This commit is contained in:
@@ -25,7 +25,8 @@ if __name__ == "__main__":
|
||||
properties[Profiles.CSS_LEVEL_2]['-webkit-text-size-adjust'] = r'none|auto|{percentage}'
|
||||
properties[Profiles.CSS_LEVEL_2]['-webkit-font-smoothing'] = r'none|antialiased|subpixel-antialiased'
|
||||
properties[Profiles.CSS_LEVEL_2]['mso-hide'] = 'all'
|
||||
properties[Profiles.CSS_LEVEL_2]['pointer-events'] = (r'auto|none|visiblePainted|visibleFill|visibleStroke|'
|
||||
properties[Profiles.CSS_LEVEL_2]['pointer-events'] = (r'auto|none|visiblePainted|'
|
||||
r'visibleFill|visibleStroke|'
|
||||
r'visible|painted|fill|stroke|all|inherit')
|
||||
|
||||
profile.addProfiles([(Profiles.CSS_LEVEL_2, properties[Profiles.CSS_LEVEL_2], macros[Profiles.CSS_LEVEL_2])])
|
||||
|
||||
@@ -94,8 +94,9 @@ def pretty_print_html(html, num_spaces=4):
|
||||
ignore_lines=[]
|
||||
)
|
||||
stack.append(info)
|
||||
elif token.kind in ('html_end', 'handlebars_end',
|
||||
'html_singleton_end', 'django_end') and (stack[-1]['tag'] != 'pre' or token.tag == 'pre'):
|
||||
elif (token.kind in ('html_end', 'handlebars_end', 'html_singleton_end',
|
||||
'django_end') and
|
||||
(stack[-1]['tag'] != 'pre' or token.tag == 'pre')):
|
||||
info = stack.pop()
|
||||
if info['block']:
|
||||
# We are at the end of an indentation block. We
|
||||
@@ -121,7 +122,8 @@ def pretty_print_html(html, num_spaces=4):
|
||||
info['extra_indent_prev'])
|
||||
elif (start_line + info['line_span'] - 1 == end_line and
|
||||
info['line_span'] > 2 and token.kind != 'html_singleton_end'):
|
||||
offsets[end_line] = (1 + info['extra_indent'] + (info['depth'] + 1) * num_spaces) - adjustment
|
||||
offsets[end_line] = (1 + info['extra_indent'] +
|
||||
(info['depth'] + 1) * num_spaces) - adjustment
|
||||
elif token.line != info['line']:
|
||||
offsets[end_line] = info['offset']
|
||||
if token.tag != 'pre' and token.kind != 'html_singleton_end' and token.tag != 'script':
|
||||
@@ -184,7 +186,8 @@ def validate_indent_html(fn):
|
||||
temp_file = open('/var/tmp/pretty_html.txt', 'w')
|
||||
temp_file.write(phtml)
|
||||
temp_file.close()
|
||||
print('Invalid Indentation detected in file: %s\nDiff for the file against expected indented file:' % (fn))
|
||||
print('Invalid Indentation detected in file: '
|
||||
'%s\nDiff for the file against expected indented file:' % (fn))
|
||||
subprocess.call(['diff', fn, '/var/tmp/pretty_html.txt'], stderr=subprocess.STDOUT)
|
||||
return 0
|
||||
return 1
|
||||
|
||||
@@ -88,7 +88,8 @@ if platform.architecture()[0] == '64bit':
|
||||
elif platform.architecture()[0] == '32bit':
|
||||
arch = "i386"
|
||||
else:
|
||||
logging.critical("Only x86 is supported; ping zulip-devel@googlegroups.com if you want another architecture.")
|
||||
logging.critical("Only x86 is supported;"
|
||||
"ping zulip-devel@googlegroups.com if you want another architecture.")
|
||||
sys.exit(1)
|
||||
|
||||
# Ideally we wouldn't need to install a dependency here, before we
|
||||
|
||||
@@ -15,5 +15,6 @@ def check_venv(filename):
|
||||
if user_name != 'vagrant' and user_name != 'zulipdev':
|
||||
print("If you are using Vagrant, you can `vagrant ssh` to enter the Vagrant guest.")
|
||||
else:
|
||||
print("You can `source /srv/zulip-py3-venv/bin/activate` to enter the Zulip development environment.")
|
||||
print("You can `source /srv/zulip-py3-venv/bin/activate` "
|
||||
"to enter the Zulip development environment.")
|
||||
sys.exit(1)
|
||||
|
||||
Reference in New Issue
Block a user