engelbert gruber | 1 Sep 16:26 2008
Picon
Picon

Patch [ 1878977 ] make_id(): deaccent characters

hello,

any objections to apply this patch

--- docutils/nodes.py   (revision 5503)
+++ docutils/nodes.py   (working copy)
 <at>  <at>  -1766,13 +1766,183  <at>  <at> 
    .. _HTML 4.01 spec: http://www.w3.org/TR/html401
    .. _CSS1 spec: http://www.w3.org/TR/REC-CSS1
    """
-    id = _non_id_chars.sub('-', ' '.join(string.lower().split()))
+    if isinstance(string, unicode):
+        id = string.lower().translate(_non_id_translate)
+    else:
+        try:
+            id = string.decode().lower().translate(_non_id_translate)
+        except UnicodeDecodeError:
+            id = string.lower()
+    id = _non_id_chars.sub('-', ' '.join(id.split()))
    id = _non_id_at_ends.sub('', id)
    return str(id)

 _non_id_chars = re.compile('[^a-z0-9]+')
 _non_id_at_ends = re.compile('^[-0-9]+|-+$')
+_non_id_translate = {
+    # From Latin-1 Supplement
+    0x00df: u'ss',      # sharp s
+    0x00e0: ord('a'),   # a with grave
and 180 other mappings

(Continue reading)

David Goodger | 3 Sep 17:21 2008

Re: Patch [ 1878977 ] make_id(): deaccent characters

Please include a link next time:
https://sourceforge.net/tracker/?func=detail&atid=422032&aid=1878977&group_id=38414

On Mon, Sep 1, 2008 at 10:26, engelbert gruber
<grubert <at> users.sourceforge.net> wrote:
> any objections to apply this patch

Yes, because the _non_id_translate dictionary is huge and incomplete,
and most of its function can automatically be calculated from
unicodedata. Far fewer explicit expansions would be necessary.

See the 2008-02-03 comment from mgeisler. I would be in favor of the
patch if these changes are made. Note that this would require Python
2.3, but I think that is fine.

> is the test ``isinstance(string, unicode)`` required ?

It shouldn't be required, but I'm not sure. Try it without.

> tests pass and i would extend test_nodes.test_make_id a little

--

-- 
David Goodger <http://python.net/~goodger>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
(Continue reading)

engelbert gruber | 4 Sep 08:48 2008
Picon
Picon

Re: Patch [ 1878977 ] make_id(): deaccent characters

>  See the 2008-02-03 comment from mgeisler. I would be in favor of the
>  patch if these changes are made. Note that this would require Python
>  2.3, but I think that is fine.

i uploaded a patch using unicodedata.normalize
this reduces the translate dictionary to 41 entries

unicodedata.normalize does not exist in python2.2
possibly unicodedata.decomposition does similar

but mapping from ``\u00df`` to ``sz`` is not supprted
in python2.2 string.translate either.

https://sourceforge.net/tracker/index.php?func=detail&aid=1878977&group_id=38414&atid=422032

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
David Goodger | 4 Sep 22:37 2008

Re: Patch [ 1878977 ] make_id(): deaccent characters

I uploaded an updated patch that handles Python 2.2 (disables the
feature by catching exceptions). When we drop 2.2-compatibility, the
try/except can be removed.

Add some tests (the more comprehensive, the better) and it's good to go.

https://sourceforge.net/tracker/index.php?func=detail&aid=1878977&group_id=38414&atid=422032

--

-- 
David Goodger <http://python.net/~goodger>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
SourceForge.net | 8 Sep 19:23 2008
Picon
Picon

[ docutils-Support Requests-2100641 ] not on internap mirror (San Jose)

Support Requests item #2100641, was opened at 2008-09-08 10:23
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=422031&aid=2100641&group_id=38414

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Install Problem (example)
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nathan Youngman (nyoungman)
Assigned to: Nobody/Anonymous (nobody)
Summary: not on internap mirror (San Jose)

Initial Comment:
The default mirror SF picks for me is internap in San Jose. Seems the 0.5.0 download isn't there, and gives an
error. I originally got this error while trying to easy_install Sphinx.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=422031&aid=2100641&group_id=38414

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
(Continue reading)

Georg Brandl | 12 Sep 19:20 2008
Picon
Picon

Include roman.py as a submodule?

Just a suggestion for the next release: why not include roman.py as a
submodule of docutils? There are lots of problems people have with the
status quo, where roman is distributed and installed as a separate
toplevel module...

Georg

--

-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
Robert Kern | 12 Sep 21:07 2008
Picon

Re: Include roman.py as a submodule?

Georg Brandl wrote:
> Just a suggestion for the next release: why not include roman.py as a
> submodule of docutils? There are lots of problems people have with the
> status quo, where roman is distributed and installed as a separate
> toplevel module...

The last time this was suggested, David Goodger did not want to do so since 
docutils is public domain whereas roman.py has a copyright and furthermore that 
he did not want to ask the author to release it into the public domain.

See the thread "roman.py in site-packages" in docutils-user on 2008-07-22.

--

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
Alan G Isaac | 12 Sep 21:12 2008
Picon

Re: Include roman.py as a submodule?

> Georg Brandl wrote:
>> Just a suggestion for the next release: why not include roman.py as a 
>> submodule of docutils? There are lots of problems people have with the 
>> status quo, where roman is distributed and installed as a separate 
>> toplevel module... 

On 9/12/2008 3:07 PM Robert Kern apparently wrote:
> The last time this was suggested, David Goodger did not want to do so since 
> docutils is public domain whereas roman.py has a copyright and furthermore that 
> he did not want to ask the author to release it into the public domain. 
> See the thread "roman.py in site-packages" in docutils-user on 2008-07-22. 

However if you can be specific about the "problems" you
encounter, it may prove possible to change his mind.

Cheers,
Alan Isaac

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
Martin Maney | 22 Sep 17:09 2008
Picon

I was thinking that reST would be just the thing for this application...


How to describe it?  I need a not too user-unfriendly format for
entering items that are mostly a scrap of descriptive text and a
hypertext link.  The tricky bit is that this is part of a system that
has a catalog of URLs, and I want to allow items to refere to cataloged
links by name - so that when a URL changes, there's one place to fix
it, or to redirect to a "sorry, this resource is no longer available"
(and, in my dreams, maybe suggest alternatives... but that's only a
dream for now).

I've been trying to avoid reinventing this wheel, but the first few
things I looked at didn't do well on the user ratings.  reST's
hyperlink syntax has always seemed kind of funky to me, but my users
seem to like it.  The problem then would be that this seems to call for
a transform, and it's probably quite simple... except that the
documentation of that area is so incomplete as to be useless.  I've
groveled the code enough to decide that if I have to go that route it
truly will be simpler to reinvent the wheel once again (this so is a
Pythonic trope, isn't it?).  I'd lose the other things that reST
provides, but frankly they're not of great importance for items, at
least we currently envision using them.

So sorry, but code is really crappy documentation, even when the trees
aren't lost in an ocean of do-nothing classes (was this designed by
someone with extensive Jave experience, perhaps?).  From what I've been
able to make out, dimly, I believe I need to

1) get the item parsed into nodes - that turns out to be easier than
the __doc__ suggested, just publish_doctree(item_string) (okay, with
stderr redirected if my extended syntax isn't quite legal reST form).
(Continue reading)

David Goodger | 22 Sep 19:19 2008

Re: I was thinking that reST would be just the thing for this application...

Martin,

I have no idea what you're asking for, beyond some hand-holding with
transforms. There is some documentation available:

http://docutils.sourceforge.net/docs/api/publisher.html (search for
publish_doctree)
http://docutils.sourceforge.net/docs/peps/pep-0258.html
http://docutils.sourceforge.net/docs/dev/hacking.html
http://docutils.sourceforge.net/docs/ref/doctree.html
http://docutils.sourceforge.net/docs/ref/docutils.dtd
and the code itself

Yes, it's inadequate. Sorry, but nobody has had the right combination
of time/will/need to remedy that. Contributions are welcome.

You'd do well to ask concrete questions, minimize the flowery prose,
and avoid disparaging remarks directed at the very people you're
asking for help.

Care to try again?

-- David Goodger

On Mon, Sep 22, 2008 at 11:09, Martin Maney <maney <at> two14.net> wrote:
>
> How to describe it?  I need a not too user-unfriendly format for
> entering items that are mostly a scrap of descriptive text and a
> hypertext link.  The tricky bit is that this is part of a system that
> has a catalog of URLs, and I want to allow items to refere to cataloged
(Continue reading)


Gmane