Bug 1790816 - Reformat xpcom/ with isort. r=mccr8 DONTBUILD

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D162640
This commit is contained in:
Marco Castelluccio 2022-11-22 13:37:48 +00:00
parent 11b87fc0cb
commit 2784a97322
18 changed files with 44 additions and 37 deletions

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python
from __future__ import absolute_import
from collections import OrderedDict
@ -1379,9 +1380,10 @@ use super::nsresult;
def gen_jinja(output, input_filename):
# This is used to generate Java code for error lists, and can be expanded to
# other required contexts in the future if desired.
from jinja2 import Environment, FileSystemLoader, StrictUndefined
import os
from jinja2 import Environment, FileSystemLoader, StrictUndefined
# FileSystemLoader requires the path to the directory containing templates,
# not the file name of the template itself.
(path, leaf) = os.path.split(input_filename)

View File

@ -3,13 +3,11 @@ import os
import re
import struct
from collections import defaultdict
from uuid import UUID
import buildconfig
from mozbuild.util import FileAvoidWrite
from perfecthash import PerfectHash
import buildconfig
NO_CONTRACT_ID = 0xFFFFFFFF

View File

@ -2,11 +2,12 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import mozunit
import os
import sys
import unittest
import mozunit
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import gen_static_components
from gen_static_components import BackgroundTasksSelector

View File

@ -4,11 +4,16 @@
# flake8: noqa
from Atom import Atom, InheritingAnonBoxAtom, NonInheritingAnonBoxAtom
from Atom import PseudoElementAtom
from HTMLAtoms import HTML_PARSER_ATOMS
import sys
from Atom import (
Atom,
InheritingAnonBoxAtom,
NonInheritingAnonBoxAtom,
PseudoElementAtom,
)
from HTMLAtoms import HTML_PARSER_ATOMS
# Static atom definitions, used to generate nsGkAtomList.h.
#
# Each atom is defined by a call to Atom, PseudoElementAtom,

View File

@ -2,10 +2,11 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from io import StringIO
from incremental_dafsa import Dafsa, Node
import mozunit
import unittest
from io import StringIO
import mozunit
from incremental_dafsa import Dafsa, Node
def _node_to_string(node: Node, prefix, buffer, cache):

View File

@ -10,7 +10,7 @@ functions for converting to a compatible structure. This legacy format is define
in make_dafsa.py.
"""
from typing import List, Dict, Optional, Callable
from typing import Callable, Dict, List, Optional
class Node:

View File

@ -170,8 +170,8 @@ The bytes in the generated array has the following meaning:
9: 0x62 <char> label character 0x62 -> match "b"
10: 0x82 <return_value> 0x82 & 0x0F -> return 2
"""
import sys
import struct
import sys
from incremental_dafsa import Dafsa, Node

View File

@ -21,10 +21,11 @@ maintainable, rather than being as optimized as possible, due to the relatively
small dataset it was designed for. In the future we may want to optimize further.
"""
from collections import namedtuple
from mozbuild.util import ensure_bytes
import textwrap
from collections import namedtuple
import six
from mozbuild.util import ensure_bytes
# Iteration over bytestrings works differently in Python 2 and 3; this function

View File

@ -2,8 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from setuptools import setup, find_packages
from setuptools import find_packages, setup
setup(
name="geckoprocesstypes",

View File

@ -2,8 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from setuptools import setup, find_packages
from setuptools import find_packages, setup
setup(
name="xpidl",

View File

@ -9,10 +9,11 @@
from __future__ import absolute_import
import itertools
import os.path
import re
from xpidl import xpidl
import itertools
printdoccomments = False

View File

@ -9,9 +9,10 @@
from __future__ import absolute_import
from xpidl import xpidl
import json
import itertools
import json
from xpidl import xpidl
# A map of xpidl.py types to xpt enum variants
TypeMap = {

View File

@ -14,10 +14,10 @@ import sys
# which conflicts with the xpidl submodule in the imports further below.
sys.path.pop(0)
import mozunit
import unittest
from xpidl import xpidl
from xpidl import header
import mozunit
from xpidl import header, xpidl
class TestParser(unittest.TestCase):

View File

@ -38,6 +38,7 @@ from __future__ import absolute_import
import os.path
import re
from xpidl import xpidl

View File

@ -8,9 +8,7 @@
from __future__ import absolute_import
from xpidl import rust
from xpidl import xpidl
from xpidl import rust, xpidl
derive_method_tmpl = """\
Method {

View File

@ -7,18 +7,17 @@
"""A parser for cross-platform IDL (XPIDL) files."""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import absolute_import, print_function
import sys
import os.path
import re
from ply import lex
from ply import yacc
import six
import sys
import textwrap
from collections import namedtuple
import six
from ply import lex, yacc
"""A type conforms to the following pattern:
def nativeType(self, calltype):

View File

@ -5,10 +5,10 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import errno
import sys
import os
import shlex
import subprocess
import sys
import tempfile
import buildconfig

View File

@ -6,9 +6,10 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import json
from perfecthash import PerfectHash
from collections import OrderedDict
import buildconfig
from perfecthash import PerfectHash
# Pick a nice power-of-two size for our intermediate PHF tables.
PHFSIZE = 512
@ -628,8 +629,8 @@ def link_and_write(files, outfile, outheader):
def main():
from argparse import ArgumentParser
import sys
from argparse import ArgumentParser
parser = ArgumentParser()
parser.add_argument("outfile", help="Output C++ file to generate")