11##
22# .protocol.element3
33##
4- 'PQ version 3.0 elements'
4+ """
5+ PQ version 3.0 elements.
6+ """
57import sys
68import os
79import pprint
@@ -300,7 +302,9 @@ class Suspension(EmptyMessage):
300302Suspension .SingleInstance = SuspensionMessage
301303
302304class Ready (Message ):
303- 'Ready for new query'
305+ """
306+ Ready for new query message.
307+ """
304308 type = message_types [b'Z' [0 ]]
305309 possible_states = (
306310 message_types [b'I' [0 ]],
@@ -319,7 +323,7 @@ def serialize(self):
319323
320324class Notice (Message , dict ):
321325 """
322- Notification message
326+ Notification message.
323327
324328 Used by PQ to emit INFO, NOTICE, and WARNING messages among other
325329 severities.
@@ -353,7 +357,9 @@ def parse(self):
353357 raise RuntimeError ("cannot parse ClientNotice" )
354358
355359class Error (Notice ):
356- """Incoming error"""
360+ """
361+ Error information message.
362+ """
357363 type = message_types [b'E' [0 ]]
358364 __slots__ = ()
359365
@@ -368,7 +374,9 @@ def parse(self):
368374 raise RuntimeError ("cannot serialize ClientError" )
369375
370376class FunctionResult (Message ):
371- """Function result value"""
377+ """
378+ Function result value.
379+ """
372380 type = message_types [b'V' [0 ]]
373381 __slots__ = ('result' ,)
374382
@@ -394,7 +402,9 @@ def parse(typ, data):
394402 return typ (data )
395403
396404class AttributeTypes (TupleMessage ):
397- """Tuple attribute types"""
405+ """
406+ Tuple attribute types.
407+ """
398408 type = message_types [b't' [0 ]]
399409 __slots__ = ()
400410
@@ -410,7 +420,9 @@ def parse(typ, data):
410420 return typ (unpack ('!%dL' % (ac ,), args ))
411421
412422class TupleDescriptor (TupleMessage ):
413- """Tuple description"""
423+ """
424+ Tuple structure description.
425+ """
414426 type = message_types [b'T' [0 ]]
415427 struct = Struct ("!LhLhlh" )
416428 __slots__ = ()
@@ -442,7 +454,9 @@ def parse(typ, data):
442454 return typ (atts )
443455
444456class Tuple (TupleMessage ):
445- """Incoming tuple"""
457+ """
458+ Tuple Data.
459+ """
446460 type = message_types [b'D' [0 ]]
447461 __slots__ = ()
448462
@@ -480,7 +494,9 @@ def parse(typ, data,
480494 pass
481495
482496class KillInformation (Message ):
483- 'Backend cancellation information'
497+ """
498+ Backend cancellation information.
499+ """
484500 type = message_types [b'K' [0 ]]
485501 struct = Struct ("!LL" )
486502 __slots__ = ('pid' , 'key' )
@@ -497,7 +513,9 @@ def parse(typ, data):
497513 return typ (* typ .struct .unpack (data ))
498514
499515class CancelRequest (KillInformation ):
500- 'Abort the query in the specified backend'
516+ """
517+ Abort the query in the specified backend.
518+ """
501519 type = b''
502520 from .version import CancelRequestCode as version
503521 packed_version = version .bytes ()
@@ -519,7 +537,9 @@ def parse(typ, data):
519537 return typ (* typ .struct .unpack (data [4 :]))
520538
521539class NegotiateSSL (Message ):
522- "Discover backend's SSL support"
540+ """
541+ Discover backend's SSL support.
542+ """
523543 type = b''
524544 from .version import NegotiateSSLCode as version
525545 packed_version = version .bytes ()
@@ -605,7 +625,9 @@ def parse(typ, data):
605625}
606626
607627class Authentication (Message ):
608- """Authentication(request, salt)"""
628+ """
629+ Authentication(request, salt)
630+ """
609631 type = message_types [b'R' [0 ]]
610632 __slots__ = ('request' , 'salt' )
611633
@@ -621,38 +643,50 @@ def parse(typ, data):
621643 return typ (ulong_unpack (data [0 :4 ]), data [4 :])
622644
623645class Password (StringMessage ):
624- 'Password supplement'
646+ """
647+ Password supplement.
648+ """
625649 type = message_types [b'p' [0 ]]
626650 __slots__ = ('data' ,)
627651
628652class Disconnect (EmptyMessage ):
629- 'Close the connection'
653+ """
654+ Connection closed message.
655+ """
630656 type = message_types [b'X' [0 ]]
631657 __slots__ = ()
632658DisconnectMessage = Message .__new__ (Disconnect )
633659Disconnect .SingleInstance = DisconnectMessage
634660
635661class Flush (EmptyMessage ):
636- 'Flush'
662+ """
663+ Flush message.
664+ """
637665 type = message_types [b'H' [0 ]]
638666 __slots__ = ()
639667FlushMessage = Message .__new__ (Flush )
640668Flush .SingleInstance = FlushMessage
641669
642670class Synchronize (EmptyMessage ):
643- 'Synchronize'
671+ """
672+ Synchronize.
673+ """
644674 type = message_types [b'S' [0 ]]
645675 __slots__ = ()
646676SynchronizeMessage = Message .__new__ (Synchronize )
647677Synchronize .SingleInstance = SynchronizeMessage
648678
649679class Query (StringMessage ):
650- """Execute the query with the given arguments"""
680+ """
681+ Execute the query with the given arguments.
682+ """
651683 type = message_types [b'Q' [0 ]]
652684 __slots__ = ('data' ,)
653685
654686class Parse (Message ):
655- """Parse a query with the specified argument types"""
687+ """
688+ Parse a query with the specified argument types.
689+ """
656690 type = message_types [b'P' [0 ]]
657691 __slots__ = ('name' , 'statement' , 'argtypes' )
658692
@@ -741,7 +775,9 @@ def parse(typ, message_data):
741775 return typ (name , statement , aformats , args , rformats )
742776
743777class Execute (Message ):
744- """Fetch results from the specified Portal"""
778+ """
779+ Fetch results from the specified Portal.
780+ """
745781 type = message_types [b'E' [0 ]]
746782 __slots__ = ('name' , 'max' )
747783
@@ -758,7 +794,9 @@ def parse(typ, data):
758794 return typ (name , ulong_unpack (max ))
759795
760796class Describe (StringMessage ):
761- """Describe a Portal or Prepared Statement"""
797+ """
798+ Request a description of a Portal or Prepared Statement.
799+ """
762800 type = message_types [b'D' [0 ]]
763801 __slots__ = ('data' ,)
764802
@@ -784,7 +822,9 @@ class DescribePortal(Describe):
784822 __slots__ = ('data' ,)
785823
786824class Close (StringMessage ):
787- """Generic Close"""
825+ """
826+ Generic Close
827+ """
788828 type = message_types [b'C' [0 ]]
789829 __slots__ = ()
790830
@@ -802,17 +842,24 @@ def parse(typ, data):
802842 return super ().parse (data [1 :])
803843
804844class CloseStatement (Close ):
805- """Close the specified Statement"""
845+ """
846+ Close the specified Statement
847+ """
806848 subtype = message_types [b'S' [0 ]]
807849 __slots__ = ()
808850
809851class ClosePortal (Close ):
810- """Close the specified Portal"""
852+ """
853+ Close the specified Portal
854+ """
811855 subtype = message_types [b'P' [0 ]]
812856 __slots__ = ()
813857
814858class Function (Message ):
815- """Execute the specified function with the given arguments"""
859+ """
860+ Execute the specified function with the given arguments
861+ """
862+
816863 type = message_types [b'F' [0 ]]
817864 __slots__ = ('oid' , 'aformats' , 'arguments' , 'rformat' )
818865
@@ -881,12 +928,16 @@ def parse(typ, data):
881928 ])
882929
883930class CopyToBegin (CopyBegin ):
884- """Begin copying to"""
931+ """
932+ Begin copying to.
933+ """
885934 type = message_types [b'H' [0 ]]
886935 __slots__ = ('format' , 'formats' )
887936
888937class CopyFromBegin (CopyBegin ):
889- """Begin copying from"""
938+ """
939+ Begin copying from.
940+ """
890941 type = message_types [b'G' [0 ]]
891942 __slots__ = ('format' , 'formats' )
892943
0 commit comments