69
69
# argument bytes in this delta.
70
70
71
71
def _arg_raw (dvi , delta ):
72
- """Return *delta* without reading anything more from the dvi file"""
72
+ """Return *delta* without reading anything more from the dvi file. """
73
73
return delta
74
74
75
75
76
76
def _arg (bytes , signed , dvi , _ ):
77
- """Read *bytes* bytes, returning the bytes interpreted as a
78
- signed integer if *signed* is true, unsigned otherwise."""
77
+ """
78
+ Read *bytes* bytes, returning the bytes interpreted as a signed integer
79
+ if *signed* is true, unsigned otherwise.
80
+ """
79
81
return dvi ._arg (bytes , signed )
80
82
81
83
82
84
def _arg_slen (dvi , delta ):
83
- """Signed, length *delta*
85
+ """
86
+ Signed, length *delta*
84
87
85
- Read *delta* bytes, returning None if *delta* is zero, and
86
- the bytes interpreted as a signed integer otherwise."""
88
+ Read *delta* bytes, returning None if *delta* is zero, and the bytes
89
+ interpreted as a signed integer otherwise.
90
+ """
87
91
if delta == 0 :
88
92
return None
89
93
return dvi ._arg (delta , True )
90
94
91
95
92
96
def _arg_slen1 (dvi , delta ):
93
- """Signed, length *delta*+1
97
+ """
98
+ Signed, length *delta*+1
94
99
95
- Read *delta*+1 bytes, returning the bytes interpreted as signed."""
100
+ Read *delta*+1 bytes, returning the bytes interpreted as signed.
101
+ """
96
102
return dvi ._arg (delta + 1 , True )
97
103
98
104
99
105
def _arg_ulen1 (dvi , delta ):
100
- """Unsigned length *delta*+1
106
+ """
107
+ Unsigned length *delta*+1
101
108
102
- Read *delta*+1 bytes, returning the bytes interpreted as unsigned."""
109
+ Read *delta*+1 bytes, returning the bytes interpreted as unsigned.
110
+ """
103
111
return dvi ._arg (delta + 1 , False )
104
112
105
113
106
114
def _arg_olen1 (dvi , delta ):
107
- """Optionally signed, length *delta*+1
115
+ """
116
+ Optionally signed, length *delta*+1
108
117
109
118
Read *delta*+1 bytes, returning the bytes interpreted as
110
- unsigned integer for 0<=*delta*<3 and signed if *delta*==3."""
119
+ unsigned integer for 0<=*delta*<3 and signed if *delta*==3.
120
+ """
111
121
return dvi ._arg (delta + 1 , delta == 3 )
112
122
113
123
@@ -122,7 +132,8 @@ def _arg_olen1(dvi, delta):
122
132
123
133
124
134
def _dispatch (table , min , max = None , state = None , args = ('raw' ,)):
125
- """Decorator for dispatch by opcode. Sets the values in *table*
135
+ """
136
+ Decorator for dispatch by opcode. Sets the values in *table*
126
137
from *min* to *max* to this method, adds a check that the Dvi state
127
138
matches *state* if not None, reads arguments from the file according
128
139
to *args*.
0 commit comments