Merge lp:~openerp-dev/openobject-server/trunk-text2html-chm into lp:openobject-server
Proposed by
Christophe Matthieu (OpenERP)
Status: | Needs review |
---|---|
Proposed branch: | lp:~openerp-dev/openobject-server/trunk-text2html-chm |
Merge into: | lp:openobject-server |
Diff against target: |
163 lines (+129/-1) 2 files modified
openerp/tests/test_mail.py (+85/-1) openerp/tools/mail.py (+44/-0) |
To merge this branch: | bzr merge lp:~openerp-dev/openobject-server/trunk-text2html-chm |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Thibault Delavallée (OpenERP) (community) | Needs Information | ||
Christophe Matthieu (OpenERP) (community) | Needs Resubmitting | ||
Vo Minh Thu (community) | Disapprove | ||
Christophe Simonis (OpenERP) | Needs Fixing | ||
Review via email: mp+135607@code.launchpad.net |
To post a comment you must log in.
Unmerged revisions
- 4598. By Christophe Matthieu (OpenERP)
-
[IMP] tools mail: add test for URIs_to_html_link
- 4597. By Christophe Matthieu (OpenERP)
-
[IMP] tools mail: refactoring of URIs_to_html_link
- 4596. By Christophe Matthieu (OpenERP)
-
[IMP]tools mail: add // protocol
- 4595. By Christophe Matthieu (OpenERP)
-
[IMP] tools mail: change double quote into quote for email link
- 4594. By Christophe Matthieu (OpenERP)
-
[IMP] tools mail: URIs_to_html_link, add test email
- 4593. By Christophe Matthieu (OpenERP)
-
[IMP] tools mail: URIs_to_html_link, convert email address into link
- 4592. By Christophe Matthieu (OpenERP)
-
[IMP] tools mail: URIs_to_html_link, convert link with all subdomain (not limited to www and ftp)
- 4591. By Christophe Matthieu (OpenERP)
-
[MERGE] from trunk
- 4590. By Christophe Matthieu (OpenERP)
-
[IMP] tools mail: change comment
- 4589. By Christophe Matthieu (OpenERP)
-
[IMP] tools mail: add tests for test_URIs_
to_html_ link
Howdy (I think this is my first code review for you ;-)
- You have defined a html_regexp_link() function. Please write a proper doc string (not some half-assed comment above).
- Please name the function correctly; its current name doesn't mean anything. In particular its name should make its intent clear. The fact it uses regex for its job is an implementation detail, no need to state it in its name.
- Your variable names are weird: you mix underscore_ separated with camelCase, e.g. new_html and innerText. Why not use simple words like original, input, output, processed, expected, and so on.
- Your tests seem weird: why does each link end with $@ ? Why does each line end with a . ?
- Please think your comments are meant to be read by people who don't know what your code do. For instance
# 7. create link
would probably read better if it was something along the line of
#7. Convert URIs to HTML links.
- Instead of a big innerText (together with its outText), you can make a list of pairs and loop over it.
Now on the biggest gripe I have: please use a existing tool instead of reinventing the wheel all over again, e.g. https:/ /github. com/jsocol/ bleach# readme
If you insist on reimplementing stuff on your own, maybe add a proper test suite, see maybe e.g. https:/ /github. com/jsocol/ bleach/ tree/master/ bleach/ tests
In particular, I would try things like
<a>
alone, or
<href
alone, or
hellowww. openerp. com
you know, weird stuff that people actually write.