Skip to content

Commit

Permalink
New distribution [0.13.3]
Browse files Browse the repository at this point in the history
 - fixed minor bugs in const for number literal incompatibility with Python 3.5
  • Loading branch information
JarryShaw committed Feb 26, 2019
1 parent 913b5c1 commit e1b1221
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion release
Submodule release updated from 7df647 to f4c69b
30 changes: 15 additions & 15 deletions src/const/http/error_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ class ErrorCode(IntEnum):
ErrorCode = vars()

# HTTP/2 Error Code
ErrorCode['NO_ERROR'] = 0x0000_0000 # [RFC 7540, Section 7] Graceful shutdown
ErrorCode['PROTOCOL_ERROR'] = 0x0000_0001 # [RFC 7540, Section 7] Protocol error detected
ErrorCode['INTERNAL_ERROR'] = 0x0000_0002 # [RFC 7540, Section 7] Implementation fault
ErrorCode['FLOW_CONTROL_ERROR'] = 0x0000_0003 # [RFC 7540, Section 7] Flow-control limits exceeded
ErrorCode['SETTINGS_TIMEOUT'] = 0x0000_0004 # [RFC 7540, Section 7] Settings not acknowledged
ErrorCode['STREAM_CLOSED'] = 0x0000_0005 # [RFC 7540, Section 7] Frame received for closed stream
ErrorCode['FRAME_SIZE_ERROR'] = 0x0000_0006 # [RFC 7540, Section 7] Frame size incorrect
ErrorCode['REFUSED_STREAM'] = 0x0000_0007 # [RFC 7540, Section 7] Stream not processed
ErrorCode['CANCEL'] = 0x0000_0008 # [RFC 7540, Section 7] Stream cancelled
ErrorCode['COMPRESSION_ERROR'] = 0x0000_0009 # [RFC 7540, Section 7] Compression state not updated
ErrorCode['CONNECT_ERROR'] = 0x0000_000A # [RFC 7540, Section 7] TCP connection error for CONNECT method
ErrorCode['ENHANCE_YOUR_CALM'] = 0x0000_000B # [RFC 7540, Section 7] Processing capacity exceeded
ErrorCode['INADEQUATE_SECURITY'] = 0x0000_000C # [RFC 7540, Section 7] Negotiated TLS parameters not acceptable
ErrorCode['HTTP_1_1_REQUIRED'] = 0x0000_000D # [RFC 7540, Section 7] Use HTTP/1.1 for the request
ErrorCode['NO_ERROR'] = 0x00000000 # [RFC 7540, Section 7] Graceful shutdown
ErrorCode['PROTOCOL_ERROR'] = 0x00000001 # [RFC 7540, Section 7] Protocol error detected
ErrorCode['INTERNAL_ERROR'] = 0x00000002 # [RFC 7540, Section 7] Implementation fault
ErrorCode['FLOW_CONTROL_ERROR'] = 0x00000003 # [RFC 7540, Section 7] Flow-control limits exceeded
ErrorCode['SETTINGS_TIMEOUT'] = 0x00000004 # [RFC 7540, Section 7] Settings not acknowledged
ErrorCode['STREAM_CLOSED'] = 0x00000005 # [RFC 7540, Section 7] Frame received for closed stream
ErrorCode['FRAME_SIZE_ERROR'] = 0x00000006 # [RFC 7540, Section 7] Frame size incorrect
ErrorCode['REFUSED_STREAM'] = 0x00000007 # [RFC 7540, Section 7] Stream not processed
ErrorCode['CANCEL'] = 0x00000008 # [RFC 7540, Section 7] Stream cancelled
ErrorCode['COMPRESSION_ERROR'] = 0x00000009 # [RFC 7540, Section 7] Compression state not updated
ErrorCode['CONNECT_ERROR'] = 0x0000000A # [RFC 7540, Section 7] TCP connection error for CONNECT method
ErrorCode['ENHANCE_YOUR_CALM'] = 0x0000000B # [RFC 7540, Section 7] Processing capacity exceeded
ErrorCode['INADEQUATE_SECURITY'] = 0x0000000C # [RFC 7540, Section 7] Negotiated TLS parameters not acceptable
ErrorCode['HTTP_1_1_REQUIRED'] = 0x0000000D # [RFC 7540, Section 7] Use HTTP/1.1 for the request

@staticmethod
def get(key, default=-1):
Expand All @@ -38,7 +38,7 @@ def _missing_(cls, value):
"""Lookup function used when value is not found."""
if not (isinstance(value, int) and 0x0000_0000 <= value <= 0xFFFF_FFFF):
raise ValueError('%r is not a valid %s' % (value, cls.__name__))
if 0x0000_000E <= value <= 0xFFFF_FFFF:
if 0x0000000E <= value <= 0xFFFFFFFF:
temp = hex(value)[2:].upper().zfill(8)
extend_enum(cls, 'Unassigned [0x%s]' % (temp[:4]+'_'+temp[4:]), value)
return cls(value)
Expand Down
2 changes: 2 additions & 0 deletions src/const/misc/linktype.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ class LinkType(IntEnum):
LinkType['OPENVIZSLA'] = 278 # DLT_OPENVIZSLA
LinkType['EBHSCR'] = 279 # DLT_EBHSCR
LinkType['VPP_DISPATCH'] = 280 # DLT_VPP_DISPATCH
LinkType['DSA_TAG_BRCM'] = 281 # DLT_DSA_TAG_BRCM
LinkType['DSA_TAG_BRCM_PREPEND'] = 282 # DLT_DSA_TAG_BRCM_PREPEND

@staticmethod
def get(key, default=-1):
Expand Down
2 changes: 1 addition & 1 deletion testbench/rc:protocols
Submodule rc:protocols updated from 3a7590 to 449fa2

0 comments on commit e1b1221

Please sign in to comment.