https://codereview.tryton.org/371581002/diff/375261002/trytond/trytond/tools/misc.py File trytond/trytond/tools/misc.py (right): https://codereview.tryton.org/371581002/diff/375261002/trytond/trytond/tools/misc.py#newcode277 trytond/trytond/tools/misc.py:277: def remove_forbidden_chars(value): I'm wondering if it makes sense to ...
https://codereview.tryton.org/371581002/diff/375261002/trytond/trytond/tools/...
File trytond/trytond/tools/misc.py (right):
https://codereview.tryton.org/371581002/diff/375261002/trytond/trytond/tools/...
trytond/trytond/tools/misc.py:277: def remove_forbidden_chars(value):
On 2021/08/25 09:45:30, ced wrote:
> On 2021/08/25 09:42:59, pokoli wrote:
> > I'm wondering if it makes sense to have a replace argument which defaults to
> =
> > ' '.
> >
> > This way one may specify the char to used as replacement.
>
> For which use case?
To be able to replace with '' or some other character like # to indicate that
the is a forbidden char in the source text
https://codereview.tryton.org/371581002/diff/375261002/trytond/trytond/tools/...
File trytond/trytond/tools/misc.py (right):
https://codereview.tryton.org/371581002/diff/375261002/trytond/trytond/tools/...
trytond/trytond/tools/misc.py:277: def remove_forbidden_chars(value):
On 2021/08/25 09:50:21, pokoli wrote:
> On 2021/08/25 09:45:30, ced wrote:
> > On 2021/08/25 09:42:59, pokoli wrote:
> > > I'm wondering if it makes sense to have a replace argument which defaults
to
>
> > =
> > > ' '.
> > >
> > > This way one may specify the char to used as replacement.
> >
> > For which use case?
>
> To be able to replace with '' or some other character like # to indicate that
> the is a forbidden char in the source text
I do not get it. Why replace a space-like char with something else than space?
And also what would be the rational for the strip()?
https://codereview.tryton.org/371581002/diff/375261002/trytond/trytond/tools/...
File trytond/trytond/tools/misc.py (right):
https://codereview.tryton.org/371581002/diff/375261002/trytond/trytond/tools/...
trytond/trytond/tools/misc.py:277: def remove_forbidden_chars(value):
On 2021/08/25 09:54:10, ced wrote:
> On 2021/08/25 09:50:21, pokoli wrote:
> > On 2021/08/25 09:45:30, ced wrote:
> > > On 2021/08/25 09:42:59, pokoli wrote:
> > > > I'm wondering if it makes sense to have a replace argument which
defaults
> to
> >
> > > =
> > > > ' '.
> > > >
> > > > This way one may specify the char to used as replacement.
> > >
> > > For which use case?
> >
> > To be able to replace with '' or some other character like # to indicate
that
> > the is a forbidden char in the source text
>
> I do not get it. Why replace a space-like char with something else than space?
If you know that the input just contains line breaks or tabs you may be
interested on replacing them with ''.
For example: Hel\nlo -> Hello
> And also what would be the rational for the strip()?
If we strip spaces, we should strip also the replace char.
https://codereview.tryton.org/371581002/diff/375261002/trytond/trytond/tools/...
File trytond/trytond/tools/misc.py (right):
https://codereview.tryton.org/371581002/diff/375261002/trytond/trytond/tools/...
trytond/trytond/tools/misc.py:277: def remove_forbidden_chars(value):
On 2021/08/25 10:18:28, pokoli wrote:
> On 2021/08/25 09:54:10, ced wrote:
> > On 2021/08/25 09:50:21, pokoli wrote:
> > > On 2021/08/25 09:45:30, ced wrote:
> > > > On 2021/08/25 09:42:59, pokoli wrote:
> > > > > I'm wondering if it makes sense to have a replace argument which
> defaults
> > to
> > >
> > > > =
> > > > > ' '.
> > > > >
> > > > > This way one may specify the char to used as replacement.
> > > >
> > > > For which use case?
> > >
> > > To be able to replace with '' or some other character like # to indicate
> that
> > > the is a forbidden char in the source text
> >
> > I do not get it. Why replace a space-like char with something else than
space?
>
> If you know that the input just contains line breaks or tabs you may be
> interested on replacing them with ''.
>
> For example: Hel\nlo -> Hello
This is not the same content.
> > And also what would be the rational for the strip()?
>
> If we strip spaces, we should strip also the replace char.
I do not understand.
New changeset f8dcec13ebe9 by Cédric Krier in branch 'default': Add remove_forbidden_chars in tools https://hg.tryton.org/modules/country/rev/f8dcec13ebe9
8 months, 2 weeks ago
(2021-09-13 21:43:23 UTC)
#9
New changeset 7e5a44176bd4 by Cédric Krier in branch 'default': Add remove_forbidden_chars in tools https://hg.tryton.org/modules/currency/rev/7e5a44176bd4
8 months, 2 weeks ago
(2021-09-13 21:43:33 UTC)
#10
New changeset 023ac0481f31 by Cédric Krier in branch 'default': Add remove_forbidden_chars in tools https://hg.tryton.org/modules/web_shop_vue_storefront/rev/023ac0481f31
8 months, 2 weeks ago
(2021-09-13 21:43:39 UTC)
#11
Issue 371581002: tryton-env: Add remove_forbidden_chars in tools
(Closed)
Created 9 months ago by ced
Modified 8 months, 2 weeks ago
Reviewers: pokoli, reviewbot, rietveld-bot_tryton.org
Base URL:
Comments: 6