[Python-checkins] python/dist/src/Lib mhlib.py,1.30,1.31 netrc.py,1.15,1.16 poplib.py,1.20,1.21 pprint.py,1.21,1.22 profile.py,1.45,1.46 pstats.py,1.24,1.25 py_compile.py,1.19,1.20
rhettinger@users.sourceforge.net
rhettinger@users.sourceforge.net
Sat, 01 Jun 2002 09:07:18 -0700
Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv588
Modified Files:
mhlib.py netrc.py poplib.py pprint.py profile.py pstats.py
py_compile.py
Log Message:
Replace boolean test with is None.
Index: mhlib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/mhlib.py,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** mhlib.py 1 Jun 2002 14:18:46 -0000 1.30
--- mhlib.py 1 Jun 2002 16:07:16 -0000 1.31
***************
*** 99,105 ****
def __init__(self, path = None, profile = None):
"""Constructor."""
! if not profile: profile = MH_PROFILE
self.profile = os.path.expanduser(profile)
! if not path: path = self.getprofile('Path')
if not path: path = PATH
if not os.path.isabs(path) and path[0] != '~':
--- 99,105 ----
def __init__(self, path = None, profile = None):
"""Constructor."""
! if profile is None: profile = MH_PROFILE
self.profile = os.path.expanduser(profile)
! if path is None: path = self.getprofile('Path')
if not path: path = PATH
if not os.path.isabs(path) and path[0] != '~':
***************
*** 666,670 ****
self.folder = f
self.number = n
! if not fp:
path = f.getmessagefilename(n)
fp = open(path, 'r')
--- 666,670 ----
self.folder = f
self.number = n
! if fp is None:
path = f.getmessagefilename(n)
fp = open(path, 'r')
***************
*** 680,684 ****
decide which headers to return (its argument is the header
name converted to lower case)."""
! if not pred:
return ''.join(self.headers)
headers = []
--- 680,684 ----
decide which headers to return (its argument is the header
name converted to lower case)."""
! if pred is None:
return ''.join(self.headers)
headers = []
***************
*** 792,796 ****
self.sep = sep
self.rng = rng
! if data: self.fromstring(data)
def reset(self):
--- 792,796 ----
self.sep = sep
self.rng = rng
! if data is not None: self.fromstring(data)
def reset(self):
Index: netrc.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/netrc.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** netrc.py 1 Jun 2002 14:18:46 -0000 1.15
--- netrc.py 1 Jun 2002 16:07:16 -0000 1.16
***************
*** 22,26 ****
class netrc:
def __init__(self, file=None):
! if not file:
try:
file = os.path.join(os.environ['HOME'], ".netrc")
--- 22,26 ----
class netrc:
def __init__(self, file=None):
! if file is None:
try:
file = os.path.join(os.environ['HOME'], ".netrc")
Index: poplib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/poplib.py,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** poplib.py 16 Feb 2002 23:06:18 -0000 1.20
--- poplib.py 1 Jun 2002 16:07:16 -0000 1.21
***************
*** 221,225 ****
single response: the "scan listing" for that message.
"""
! if which:
return self._shortcmd('LIST %s' % which)
return self._longcmd('LIST')
--- 221,225 ----
single response: the "scan listing" for that message.
"""
! if which is not None:
return self._shortcmd('LIST %s' % which)
return self._longcmd('LIST')
***************
*** 314,318 ****
the list ['response', ['mesgnum uid', ...], octets]
"""
! if which:
return self._shortcmd('UIDL %s' % which)
return self._longcmd('UIDL')
--- 314,318 ----
the list ['response', ['mesgnum uid', ...], octets]
"""
! if which is not None:
return self._shortcmd('UIDL %s' % which)
return self._longcmd('UIDL')
Index: pprint.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/pprint.py,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** pprint.py 7 Apr 2002 06:36:23 -0000 1.21
--- pprint.py 1 Jun 2002 16:07:16 -0000 1.22
***************
*** 102,106 ****
self.__indent_per_level = indent
self.__width = width
! if stream:
self.__stream = stream
else:
--- 102,106 ----
self.__indent_per_level = indent
self.__width = width
! if stream is not None:
self.__stream = stream
else:
Index: profile.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/profile.py,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -d -r1.45 -r1.46
*** profile.py 1 Jun 2002 14:18:46 -0000 1.45
--- profile.py 1 Jun 2002 16:07:16 -0000 1.46
***************
*** 151,155 ****
self.bias = bias # Materialize in local dict for lookup speed.
! if not timer:
if os.name == 'mac':
self.timer = MacOS.GetTicks
--- 151,155 ----
self.bias = bias # Materialize in local dict for lookup speed.
! if timer is None:
if os.name == 'mac':
self.timer = MacOS.GetTicks
Index: pstats.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/pstats.py,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** pstats.py 1 Jun 2002 14:18:46 -0000 1.24
--- pstats.py 1 Jun 2002 16:07:16 -0000 1.25
***************
*** 507,511 ****
cmd.Cmd.__init__(self)
self.prompt = "% "
! if profile:
self.stats = Stats(profile)
else:
--- 507,511 ----
cmd.Cmd.__init__(self)
self.prompt = "% "
! if profile is not None:
self.stats = Stats(profile)
else:
Index: py_compile.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/py_compile.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** py_compile.py 14 Apr 2002 20:12:40 -0000 1.19
--- py_compile.py 1 Jun 2002 16:07:16 -0000 1.20
***************
*** 68,72 ****
'File "%s"' % (dfile or file)))
return
! if not cfile:
cfile = file + (__debug__ and 'c' or 'o')
fc = open(cfile, 'wb')
--- 68,72 ----
'File "%s"' % (dfile or file)))
return
! if cfile is None:
cfile = file + (__debug__ and 'c' or 'o')
fc = open(cfile, 'wb')