mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
parent
ecfeb7f095
commit
70a6b49821
246 changed files with 926 additions and 962 deletions
10
Lib/pipes.py
10
Lib/pipes.py
|
@ -89,8 +89,8 @@ class Template:
|
|||
self.reset()
|
||||
|
||||
def __repr__(self):
|
||||
"""t.__repr__() implements `t`."""
|
||||
return '<Template instance, steps=' + `self.steps` + '>'
|
||||
"""t.__repr__() implements repr(t)."""
|
||||
return '<Template instance, steps=%r>' % (self.steps,)
|
||||
|
||||
def reset(self):
|
||||
"""t.reset() restores a pipeline template to its initial state."""
|
||||
|
@ -115,7 +115,7 @@ class Template:
|
|||
'Template.append: cmd must be a string'
|
||||
if kind not in stepkinds:
|
||||
raise ValueError, \
|
||||
'Template.append: bad kind ' + `kind`
|
||||
'Template.append: bad kind %r' % (kind,)
|
||||
if kind == SOURCE:
|
||||
raise ValueError, \
|
||||
'Template.append: SOURCE can only be prepended'
|
||||
|
@ -137,7 +137,7 @@ class Template:
|
|||
'Template.prepend: cmd must be a string'
|
||||
if kind not in stepkinds:
|
||||
raise ValueError, \
|
||||
'Template.prepend: bad kind ' + `kind`
|
||||
'Template.prepend: bad kind %r' % (kind,)
|
||||
if kind == SINK:
|
||||
raise ValueError, \
|
||||
'Template.prepend: SINK can only be appended'
|
||||
|
@ -160,7 +160,7 @@ class Template:
|
|||
if rw == 'w':
|
||||
return self.open_w(file)
|
||||
raise ValueError, \
|
||||
'Template.open: rw must be \'r\' or \'w\', not ' + `rw`
|
||||
'Template.open: rw must be \'r\' or \'w\', not %r' % (rw,)
|
||||
|
||||
def open_r(self, file):
|
||||
"""t.open_r(file) and t.open_w(file) implement
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue