mercurial/wireprotoframing.py
changeset 51686 493034cc3265
parent 50926 18c8c18993f0
child 51696 7f0cb9ee0534
equal deleted inserted replaced
51685:39e2b2d062c1 51686:493034cc3265
   544     formatters to be applied at rendering time. In terms of the ``ui``
   544     formatters to be applied at rendering time. In terms of the ``ui``
   545     class, each atom corresponds to a ``ui.write()``.
   545     class, each atom corresponds to a ``ui.write()``.
   546     """
   546     """
   547     atomdicts = []
   547     atomdicts = []
   548 
   548 
   549     for (formatting, args, labels) in atoms:
   549     for formatting, args, labels in atoms:
   550         # TODO look for localstr, other types here?
   550         # TODO look for localstr, other types here?
   551 
   551 
   552         if not isinstance(formatting, bytes):
   552         if not isinstance(formatting, bytes):
   553             raise ValueError(b'must use bytes formatting strings')
   553             raise ValueError(b'must use bytes formatting strings')
   554         for arg in args:
   554         for arg in args:
  1196                         stream,
  1196                         stream,
  1197                         requestid,
  1197                         requestid,
  1198                         b'%s' % stringutil.forcebytestr(e),
  1198                         b'%s' % stringutil.forcebytestr(e),
  1199                         errtype=b'server',
  1199                         errtype=b'server',
  1200                     ):
  1200                     ):
  1201 
       
  1202                         yield frame
  1201                         yield frame
  1203 
  1202 
  1204                     break
  1203                     break
  1205 
  1204 
  1206                 try:
  1205                 try:
  1257                         o, wireprototypes.indefinitebytestringresponse
  1256                         o, wireprototypes.indefinitebytestringresponse
  1258                     ):
  1257                     ):
  1259                         for chunk in cborutil.streamencodebytestringfromiter(
  1258                         for chunk in cborutil.streamencodebytestringfromiter(
  1260                             o.chunks
  1259                             o.chunks
  1261                         ):
  1260                         ):
  1262 
       
  1263                             for frame in emitter.send(chunk):
  1261                             for frame in emitter.send(chunk):
  1264                                 yield frame
  1262                                 yield frame
  1265 
  1263 
  1266                     # A regular object is CBOR encoded.
  1264                     # A regular object is CBOR encoded.
  1267                     else:
  1265                     else: