##// END OF EJS Templates
pytype: convert type comment for inline variable too...
marmoute -
r52181:8b2ea224 default
parent child Browse files
Show More
@@ -48,6 +48,10 b' import stat'
48 48 import struct
49 49 import time
50 50
51 from typing import (
52 Optional,
53 )
54
51 55 from .i18n import _
52 56 from .node import hex
53 57
@@ -628,14 +632,16 b' class chgunixservicehandler:'
628 632
629 633 pollinterval = 1 # [sec]
630 634
635 _hashstate: Optional[hashstate]
636 _baseaddress: Optional[bytes]
637 _realaddress: Optional[bytes]
638
631 639 def __init__(self, ui):
632 640 self.ui = ui
633 641
634 # TODO: use PEP 526 syntax (`_hashstate: hashstate` at the class level)
635 # when 3.5 support is dropped.
636 self._hashstate = None # type: hashstate
637 self._baseaddress = None # type: bytes
638 self._realaddress = None # type: bytes
642 self._hashstate = None
643 self._baseaddress = None
644 self._realaddress = None
639 645
640 646 self._idletimeout = ui.configint(b'chgserver', b'idletimeout')
641 647 self._lastactive = time.time()
@@ -57,7 +57,7 b' class Hint:'
57 57 """
58 58
59 59 def __init__(self, *args, **kw):
60 self.hint = kw.pop('hint', None) # type: Optional[bytes]
60 self.hint: Optional[bytes] = kw.pop('hint', None)
61 61 super(Hint, self).__init__(*args, **kw)
62 62
63 63
@@ -89,7 +89,7 b' def gettext(message: bytes) -> bytes:'
89 89 if message not in cache:
90 90 if type(message) is str:
91 91 # goofy unicode docstrings in test
92 paragraphs = message.split(u'\n\n') # type: List[str]
92 paragraphs: List[str] = message.split(u'\n\n')
93 93 else:
94 94 # should be ascii, but we have unicode docstrings in test, which
95 95 # are converted to utf-8 bytes on Python 3.
@@ -392,4 +392,4 b' if rustdirs is not None:'
392 392 # rather not let our internals know that we're thinking in posix terms
393 393 # - instead we'll let them be oblivious.
394 394 join = posixpath.join
395 dirname = posixpath.dirname # type: Callable[[bytes], bytes]
395 dirname: Callable[[bytes], bytes] = posixpath.dirname
@@ -163,7 +163,9 b' if typing.TYPE_CHECKING:'
163 163 _fphasesentry = struct.Struct(b'>i20s')
164 164
165 165 # record phase index
166 public, draft, secret = range(3) # type: int
166 public: int = 0
167 draft: int = 1
168 secret: int = 2
167 169 archived = 32 # non-continuous for compatibility
168 170 internal = 96 # non-continuous for compatibility
169 171 allphases = (public, draft, secret, archived, internal)
@@ -108,7 +108,7 b' class improvement:'
108 108 compatible_with_share = False
109 109
110 110
111 allformatvariant = [] # type: List[Type['formatvariant']]
111 allformatvariant: List[Type['formatvariant']] = []
112 112
113 113
114 114 def registerformatvariant(cls):
General Comments 0
You need to be logged in to leave comments. Login now