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 Thijs Triemstra)

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 Thijs Triemstra

Author: thijs
Branch: branches/py3-text-6341

(In [37342]) Branching to 'py3-text-6341'

comment:2 Changed 9 years ago by Thijs Triemstra

(In [37344]) port t.p.text, add news file. refs #6341

comment:3 Changed 9 years ago by Jean-Paul Calderone

Or uses of it could be replaced by textwrap and twisted.python.text could be deprecated and eventually removed.

comment:4 in reply to:  3 Changed 9 years ago by Thijs Triemstra

Keywords: review added

Replying to exarkun:

Or uses of it could be replaced by textwrap and twisted.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 Jean-Paul Calderone

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 Thijs Triemstra

Alright, if you put it that way. I thought there might've been something with value in there.. :)

  1. Couldn't find any usage of stringyString, isMultiline, endsInNewline, and removeLeadingBlanks, these can be deprecated directly.
  2. 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

  1. removeLeadingTrailingBlanks is used quite a lot, but only, in lore..
  2. splitQuoted is used in mail, python, words.. quite a alot.
  3. strFile is used twice in twisted/mail/imap4.py

So completely deprecating the module isn't possible without doing the work listed above.

comment:7 Changed 9 years ago by Jean-Paul Calderone

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 Thijs Triemstra

Description: modified (diff)
Keywords: review removed
Milestone: Python-3.x
Owner: set to Thijs Triemstra
Status: newassigned
Summary: Port twisted.python.text to Python 3Replace usage of twisted.python.text and deprecate it

Thanks for the review ;) Updating ticket title and description.

Note: See TracTickets for help on using tickets.