mirror of https://github.com/python/cpython.git
Conform to the bloody coding standards: "def foo()" not "def foo ()".
Yuck.
This commit is contained in:
parent
9b4864e40a
commit
cb320eb938
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
|
|
||||||
# XXX is this going to be implemented properly somewhere in 2.3?
|
# XXX is this going to be implemented properly somewhere in 2.3?
|
||||||
def islower (c):
|
def islower(c):
|
||||||
return c in string.lowercase
|
return c in string.lowercase
|
||||||
|
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ def __init__ (self):
|
||||||
# -- Private methods -----------------------------------------------
|
# -- Private methods -----------------------------------------------
|
||||||
# (possibly useful for subclasses to override)
|
# (possibly useful for subclasses to override)
|
||||||
|
|
||||||
def _munge_whitespace (self, text):
|
def _munge_whitespace(self, text):
|
||||||
"""_munge_whitespace(text : string) -> string
|
"""_munge_whitespace(text : string) -> string
|
||||||
|
|
||||||
Munge whitespace in text: expand tabs and convert all other
|
Munge whitespace in text: expand tabs and convert all other
|
||||||
|
@ -86,7 +86,7 @@ def _munge_whitespace (self, text):
|
||||||
return text
|
return text
|
||||||
|
|
||||||
|
|
||||||
def _split (self, text):
|
def _split(self, text):
|
||||||
"""_split(text : string) -> [string]
|
"""_split(text : string) -> [string]
|
||||||
|
|
||||||
Split the text to wrap into indivisible chunks. Chunks are
|
Split the text to wrap into indivisible chunks. Chunks are
|
||||||
|
@ -101,7 +101,7 @@ def _split (self, text):
|
||||||
chunks = filter(None, chunks)
|
chunks = filter(None, chunks)
|
||||||
return chunks
|
return chunks
|
||||||
|
|
||||||
def _fix_sentence_endings (self, chunks):
|
def _fix_sentence_endings(self, chunks):
|
||||||
"""_fix_sentence_endings(chunks : [string])
|
"""_fix_sentence_endings(chunks : [string])
|
||||||
|
|
||||||
Correct for sentence endings buried in 'chunks'. Eg. when the
|
Correct for sentence endings buried in 'chunks'. Eg. when the
|
||||||
|
@ -119,7 +119,7 @@ def _fix_sentence_endings (self, chunks):
|
||||||
else:
|
else:
|
||||||
i += 1
|
i += 1
|
||||||
|
|
||||||
def _handle_long_word (self, chunks, cur_line, cur_len, width):
|
def _handle_long_word(self, chunks, cur_line, cur_len, width):
|
||||||
"""_handle_long_word(chunks : [string],
|
"""_handle_long_word(chunks : [string],
|
||||||
cur_line : [string],
|
cur_line : [string],
|
||||||
cur_len : int, width : int)
|
cur_len : int, width : int)
|
||||||
|
@ -147,7 +147,7 @@ def _handle_long_word (self, chunks, cur_line, cur_len, width):
|
||||||
# cur_len will be zero, so the next line will be entirely
|
# cur_len will be zero, so the next line will be entirely
|
||||||
# devoted to the long word that we can't handle right now.
|
# devoted to the long word that we can't handle right now.
|
||||||
|
|
||||||
def _wrap_chunks (self, chunks, width):
|
def _wrap_chunks(self, chunks, width):
|
||||||
"""_wrap_chunks(chunks : [string], width : int) -> [string]
|
"""_wrap_chunks(chunks : [string], width : int) -> [string]
|
||||||
|
|
||||||
Wrap a sequence of text chunks and return a list of lines of
|
Wrap a sequence of text chunks and return a list of lines of
|
||||||
|
@ -202,7 +202,7 @@ def _wrap_chunks (self, chunks, width):
|
||||||
|
|
||||||
# -- Public interface ----------------------------------------------
|
# -- Public interface ----------------------------------------------
|
||||||
|
|
||||||
def wrap (self, text, width):
|
def wrap(self, text, width):
|
||||||
"""wrap(text : string, width : int) -> [string]
|
"""wrap(text : string, width : int) -> [string]
|
||||||
|
|
||||||
Split 'text' into multiple lines of no more than 'width'
|
Split 'text' into multiple lines of no more than 'width'
|
||||||
|
@ -219,7 +219,7 @@ def wrap (self, text, width):
|
||||||
self._fix_sentence_endings(chunks)
|
self._fix_sentence_endings(chunks)
|
||||||
return self._wrap_chunks(chunks, width)
|
return self._wrap_chunks(chunks, width)
|
||||||
|
|
||||||
def fill (self, text, width, initial_tab="", subsequent_tab=""):
|
def fill(self, text, width, initial_tab="", subsequent_tab=""):
|
||||||
"""fill(text : string,
|
"""fill(text : string,
|
||||||
width : int,
|
width : int,
|
||||||
initial_tab : string = "",
|
initial_tab : string = "",
|
||||||
|
@ -241,8 +241,8 @@ def fill (self, text, width, initial_tab="", subsequent_tab=""):
|
||||||
|
|
||||||
_wrapper = TextWrapper()
|
_wrapper = TextWrapper()
|
||||||
|
|
||||||
def wrap (text, width):
|
def wrap(text, width):
|
||||||
return _wrapper.wrap(text, width)
|
return _wrapper.wrap(text, width)
|
||||||
|
|
||||||
def fill (text, width, initial_tab="", subsequent_tab=""):
|
def fill(text, width, initial_tab="", subsequent_tab=""):
|
||||||
return _wrapper.fill(text, width, initial_tab, subsequent_tab)
|
return _wrapper.fill(text, width, initial_tab, subsequent_tab)
|
||||||
|
|
Loading…
Reference in New Issue