Opened 9 years ago
Last modified 8 years ago
#6341 enhancement assigned
— at Replace usage of twisted.python.text and deprecate itVersion 8
Reported by: | Thijs Triemstra | Owned by: | Thijs Triemstra |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | core | Keywords: | |
Cc: | Thijs Triemstra | Branch: |
branches/py3-text-6341
branch-diff, diff-cov, branch-cov, buildbot |
Author: | thijs |
Description (last modified by )
twisted.python.text
still needs to be ported to Python 3, but can be deprecated instead (after replacing usage of it).
Change History (8)
comment:1 Changed 9 years ago by
Author: | → thijs |
---|---|
Branch: | → branches/py3-text-6341 |
comment:3 follow-up: 4 Changed 9 years ago by
Or uses of it could be replaced by textwrap
and twisted.python.text
could be deprecated and eventually removed.
comment:4 Changed 9 years ago by
Keywords: | review added |
---|
Replying to exarkun:
Or uses of it could be replaced by
textwrap
andtwisted.python.text
could be deprecated and eventually removed.
Sounds good. Let's port it (which was quite simple) and file new tickets to replace usage and deprecate it. I'd like to see it's supported on py3 until it's removed in x releases. Current coverage is 93%.
Forced a new build, please review.
comment:5 Changed 9 years ago by
Let's port it (which was quite simple) and file new tickets to replace usage and deprecate it
I appreciate that you've already done some of the porting work, but as a general plan, this doesn't sound great. Why do more work instead of less work?
comment:6 Changed 9 years ago by
Alright, if you put it that way. I thought there might've been something with value in there.. :)
- Couldn't find any usage of
stringyString
,isMultiline
,endsInNewline
, andremoveLeadingBlanks
, these can be deprecated directly. greedyWrap
is used once:./twisted/conch/insults/window.py:599: wrappedLines = tptext.greedyWrap(inputLines.pop(0), width)
and it's alias wordWrap
twice in twisted/python/usage.py
removeLeadingTrailingBlanks
is used quite a lot, but only, in lore..splitQuoted
is used in mail, python, words.. quite a alot.strFile
is used twice intwisted/mail/imap4.py
So completely deprecating the module isn't possible without doing the work listed above.
comment:7 Changed 9 years ago by
greedyWrap
is just textwrap.wrap
.
splitQuoted
is just shlex.split
.
At first glance, removeLeadingTrailingBlanks
looks really, *really* like str.strip
.
strFile
could be made into a private helper for imap4.py
.
comment:8 Changed 9 years ago by
Description: | modified (diff) |
---|---|
Keywords: | review removed |
Milestone: | Python-3.x |
Owner: | set to Thijs Triemstra |
Status: | new → assigned |
Summary: | Port twisted.python.text to Python 3 → Replace usage of twisted.python.text and deprecate it |
Thanks for the review ;) Updating ticket title and description.
(In [37342]) Branching to 'py3-text-6341'