mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
style: autopep8
Bug: 1468273 Reviewed-by: ted MozReview-Commit-ID: 8j8EU3E08GP
This commit is contained in:
parent
b539ae7fe5
commit
498592ff61
4 changed files with 12 additions and 7 deletions
|
@ -28,5 +28,6 @@ predefined! {
|
||||||
f.write(' "%s",\n' % name)
|
f.write(' "%s",\n' % name)
|
||||||
f.write('}\n')
|
f.write('}\n')
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main(os.path.join(os.path.dirname(__file__), "predefined.rs"))
|
main(os.path.join(os.path.dirname(__file__), "predefined.rs"))
|
||||||
|
|
|
@ -21,7 +21,7 @@ PRELUDE = """
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
/* Autogenerated file created by components/style/gecko/binding_tools/regen_atoms.py, DO NOT EDIT DIRECTLY */
|
/* Autogenerated file created by components/style/gecko/binding_tools/regen_atoms.py, DO NOT EDIT DIRECTLY */
|
||||||
"""[1:]
|
"""[1:] # NOQA: E501
|
||||||
|
|
||||||
|
|
||||||
def gnu_symbolify(source, ident):
|
def gnu_symbolify(source, ident):
|
||||||
|
@ -57,7 +57,7 @@ class CSSPseudoElementsAtomSource:
|
||||||
|
|
||||||
|
|
||||||
class CSSAnonBoxesAtomSource:
|
class CSSAnonBoxesAtomSource:
|
||||||
PATTERN = re.compile('^(CSS_ANON_BOX|CSS_NON_INHERITING_ANON_BOX|CSS_WRAPPER_ANON_BOX)\(([^,]*),[^"]*"([^"]*)"\)',
|
PATTERN = re.compile('^(CSS_ANON_BOX|CSS_NON_INHERITING_ANON_BOX|CSS_WRAPPER_ANON_BOX)\(([^,]*),[^"]*"([^"]*)"\)', # NOQA: E501
|
||||||
re.MULTILINE)
|
re.MULTILINE)
|
||||||
FILE = "include/nsCSSAnonBoxList.h"
|
FILE = "include/nsCSSAnonBoxList.h"
|
||||||
CLASS = "nsCSSAnonBoxes"
|
CLASS = "nsCSSAnonBoxes"
|
||||||
|
|
|
@ -49,7 +49,8 @@ STYLE_STRUCT_LIST = [
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
usage = "Usage: %s [ servo | gecko ] [ style-crate | geckolib <template> | html ]" % sys.argv[0]
|
usage = ("Usage: %s [ servo | gecko ] [ style-crate | geckolib <template> | html ]" %
|
||||||
|
sys.argv[0])
|
||||||
if len(sys.argv) < 3:
|
if len(sys.argv) < 3:
|
||||||
abort(usage)
|
abort(usage)
|
||||||
product = sys.argv[1]
|
product = sys.argv[1]
|
||||||
|
@ -122,7 +123,7 @@ def render(filename, **context):
|
||||||
# Uncomment to debug generated Python code:
|
# Uncomment to debug generated Python code:
|
||||||
# write("/tmp", "mako_%s.py" % os.path.basename(filename), template.code)
|
# write("/tmp", "mako_%s.py" % os.path.basename(filename), template.code)
|
||||||
return template.render(**context).encode("utf8")
|
return template.render(**context).encode("utf8")
|
||||||
except:
|
except Exception:
|
||||||
# Uncomment to see a traceback in generated Python code:
|
# Uncomment to see a traceback in generated Python code:
|
||||||
# raise
|
# raise
|
||||||
abort(exceptions.text_error_template().render().encode("utf8"))
|
abort(exceptions.text_error_template().render().encode("utf8"))
|
||||||
|
|
|
@ -75,7 +75,8 @@ class Keyword(object):
|
||||||
self.name = name
|
self.name = name
|
||||||
self.values = values.split()
|
self.values = values.split()
|
||||||
if gecko_constant_prefix and gecko_enum_prefix:
|
if gecko_constant_prefix and gecko_enum_prefix:
|
||||||
raise TypeError("Only one of gecko_constant_prefix and gecko_enum_prefix can be specified")
|
raise TypeError("Only one of gecko_constant_prefix and gecko_enum_prefix "
|
||||||
|
"can be specified")
|
||||||
self.gecko_constant_prefix = gecko_constant_prefix or \
|
self.gecko_constant_prefix = gecko_constant_prefix or \
|
||||||
"NS_STYLE_" + self.name.upper().replace("-", "_")
|
"NS_STYLE_" + self.name.upper().replace("-", "_")
|
||||||
self.gecko_enum_prefix = gecko_enum_prefix
|
self.gecko_enum_prefix = gecko_enum_prefix
|
||||||
|
@ -116,7 +117,8 @@ class Keyword(object):
|
||||||
raise Exception("Bad product: " + product)
|
raise Exception("Bad product: " + product)
|
||||||
|
|
||||||
def gecko_constant(self, value):
|
def gecko_constant(self, value):
|
||||||
moz_stripped = value.replace("-moz-", '') if self.gecko_strip_moz_prefix else value.replace("-moz-", 'moz-')
|
moz_stripped = (value.replace("-moz-", '')
|
||||||
|
if self.gecko_strip_moz_prefix else value.replace("-moz-", 'moz-'))
|
||||||
mapped = self.consts_map.get(value)
|
mapped = self.consts_map.get(value)
|
||||||
if self.gecko_enum_prefix:
|
if self.gecko_enum_prefix:
|
||||||
parts = moz_stripped.replace('-', '_').split('_')
|
parts = moz_stripped.replace('-', '_').split('_')
|
||||||
|
@ -167,7 +169,8 @@ class Longhand(object):
|
||||||
gecko_ffi_name=None,
|
gecko_ffi_name=None,
|
||||||
allowed_in_keyframe_block=True, cast_type='u8',
|
allowed_in_keyframe_block=True, cast_type='u8',
|
||||||
logical=False, alias=None, extra_prefixes=None, boxed=False,
|
logical=False, alias=None, extra_prefixes=None, boxed=False,
|
||||||
flags=None, allowed_in_page_rule=False, allow_quirks=False, ignored_when_colors_disabled=False,
|
flags=None, allowed_in_page_rule=False, allow_quirks=False,
|
||||||
|
ignored_when_colors_disabled=False,
|
||||||
vector=False, servo_restyle_damage="repaint"):
|
vector=False, servo_restyle_damage="repaint"):
|
||||||
self.name = name
|
self.name = name
|
||||||
if not spec:
|
if not spec:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue