mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
* Mass change: get rid of all init() methods, in favor of __init__()
constructors. There is no backward compatibility. Not everything has
been tested.
* aiff.{py,doc}: deleted in favor of aifc.py (which contains its docs as
comments)
This commit is contained in:
parent
aa14837bd0
commit
7bc817d5ba
42 changed files with 153 additions and 207 deletions
11
Lib/pipes.py
11
Lib/pipes.py
|
|
@ -29,7 +29,7 @@
|
|||
# -----------
|
||||
#
|
||||
# To create a template:
|
||||
# t = Template().init()
|
||||
# t = Template()
|
||||
#
|
||||
# To add a conversion step to a template:
|
||||
# t.append(command, kind)
|
||||
|
|
@ -85,11 +85,10 @@ stepkinds = [FILEIN_FILEOUT, STDIN_FILEOUT, FILEIN_STDOUT, STDIN_STDOUT, \
|
|||
|
||||
class Template:
|
||||
|
||||
# Template().init() returns a fresh pipeline template
|
||||
def init(self):
|
||||
# Template() returns a fresh pipeline template
|
||||
def __init__(self):
|
||||
self.debugging = 0
|
||||
self.reset()
|
||||
return self
|
||||
|
||||
# t.__repr__() implements `t`
|
||||
def __repr__(self):
|
||||
|
|
@ -102,7 +101,7 @@ class Template:
|
|||
# t.clone() returns a new pipeline template with identical
|
||||
# initial state as the current one
|
||||
def clone(self):
|
||||
t = Template().init()
|
||||
t = Template()
|
||||
t.steps = self.steps[:]
|
||||
t.debugging = self.debugging
|
||||
return t
|
||||
|
|
@ -291,7 +290,7 @@ def quote(file):
|
|||
def test():
|
||||
import os
|
||||
print 'Testing...'
|
||||
t = Template().init()
|
||||
t = Template()
|
||||
t.append('togif $IN $OUT', 'ff')
|
||||
t.append('giftoppm', '--')
|
||||
t.append('ppmtogif >$OUT', '-f')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue