Sorry, it's only replied to Enrico, now, reply to the list ...

On 06/19/2013 06:33 PM, Enrico Scholz wrote:


Robert Yang <liezhi.yang-cwa4wttnnzf54taoqty...@public.gmane.org>
writes:

The recipe's DESCRIPTION is wrapped automatically by textwrap, make it
support newline ("\n") to let the user can wrap it manually, e.g.:

-                    ctrlfile.write('Description: %s\n' % summary)
-                    ctrlfile.write('%s\n' % textwrap.fill(description, 
width=74, initial_indent=' ', subsequent_indent=' '))
+                    for t in description.split('\\n'):
+                        ctrlfile.write('%s\n' % textwrap.fill(t, width=74, 
initial_indent=' ', subsequent_indent=' '))

When user wrapped lines manually, why is textwrap.fill() called on the
lines again?  E.g. when user wrapped manually at 78 columns, this will
create long - short - long - short lines (in german, why call this
effect "Kammquoting" (comb quoting)) .

I suggest to avoid textwrap.fill() when text contains '\n'.


Because I think that the "\n" is mainly used for splitting paragraph,
so the auto wrap is still useful when there is a "\n", e.g.:

DESCRIPTION = "FOO \n<Too many characters>"

The ouput is:
 FOO
 <74 characters>
 <74 characters>
 [snip]

I think that this is better than:
 FOO
 <Too many characters>

// Robert



Enrico



_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Reply via email to