Mercurial > hg
comparison mercurial/interfaces/util.py @ 43076:2372284d9457
formatting: blacken the codebase
This is using my patch to black
(https://github.com/psf/black/pull/826) so we don't un-wrap collection
literals.
Done with:
hg files 'set:**.py - mercurial/thirdparty/** - "contrib/python-zstandard/**"' | xargs black -S
# skip-blame mass-reformatting only
# no-check-commit reformats foo_bar functions
Differential Revision: https://phab.mercurial-scm.org/D6971
author | Augie Fackler <augie@google.com> |
---|---|
date | Sun, 06 Oct 2019 09:45:02 -0400 |
parents | 2c4f656c8e9f |
children | 687b865b95ad |
comparison
equal
deleted
inserted
replaced
43075:57875cf423c9 | 43076:2372284d9457 |
---|---|
9 # bookkeeping for declaring interfaces. So, we use stubs for various | 9 # bookkeeping for declaring interfaces. So, we use stubs for various |
10 # zope.interface primitives unless instructed otherwise. | 10 # zope.interface primitives unless instructed otherwise. |
11 | 11 |
12 from __future__ import absolute_import | 12 from __future__ import absolute_import |
13 | 13 |
14 from .. import ( | 14 from .. import encoding |
15 encoding, | |
16 ) | |
17 | 15 |
18 if encoding.environ.get('HGREALINTERFACES'): | 16 if encoding.environ.get('HGREALINTERFACES'): |
19 from ..thirdparty.zope import ( | 17 from ..thirdparty.zope import interface as zi |
20 interface as zi, | |
21 ) | |
22 | 18 |
23 Attribute = zi.Attribute | 19 Attribute = zi.Attribute |
24 Interface = zi.Interface | 20 Interface = zi.Interface |
25 implementer = zi.implementer | 21 implementer = zi.implementer |
26 else: | 22 else: |
23 | |
27 class Attribute(object): | 24 class Attribute(object): |
28 def __init__(self, __name__, __doc__=''): | 25 def __init__(self, __name__, __doc__=''): |
29 pass | 26 pass |
30 | 27 |
31 class Interface(object): | 28 class Interface(object): |
32 def __init__(self, name, bases=(), attrs=None, __doc__=None, | 29 def __init__( |
33 __module__=None): | 30 self, name, bases=(), attrs=None, __doc__=None, __module__=None |
31 ): | |
34 pass | 32 pass |
35 | 33 |
36 def implementer(*ifaces): | 34 def implementer(*ifaces): |
37 def wrapper(cls): | 35 def wrapper(cls): |
38 return cls | 36 return cls |