[BangPypers] UML <=> Python...and other things...

Vishal vsapre80 at gmail.com
Tue Mar 31 12:14:26 CEST 2009


Bruno,
Something on these lines would have to be done:

>>> d = obj.__doc__
>>> d
'\n    This class encapsulates all methods for doing\n    whatever you would
like to do\n    with it\n'
>>> d2 = d.split('\n')
>>> d2
['',
 '    This class encapsulates all methods for doing',
 '    whatever you would like to do',
 '    with it',
 '']
>>> import string
>>> d4 = map(string.strip, d2)
>>> d4
['',
 'This class encapsulates all methods for doing',
 'whatever you would like to do',
 'with it'
 '']>>> print '\n'.join(d4)

This class encapsulates all methods for doing
whatever you would like to do
with it

Vishal

On Tue, Mar 31, 2009 at 3:19 PM, Vishal <vsapre80 at gmail.com> wrote:

> Hi Bruno,
> Thanks for the email. The only reason I had not put a remark on BOUML
> trackers forum was that I was not using BOUML heavily.
>
> I think while creating code, the indentation should certainly be there.
> Usually when ever I introspect about __doc__ from a python class/function,
> I dont see the indentation in that...but that might be because my IDE takes
> care of removing
> the indentation.
> So to answer your question, when introspecting code, can you make it such
> that a query for __doc__ removes indentation (left side space gets trimmed
> for each line) from the block that is returned?
>
> Thanks and best regards,
> Vishal Sapre
>
> p.s: Just wanted to congratulate you on a wonderful piece of software
> (BOUML) that you have been doing for so long.
>
>
> On Tue, Mar 31, 2009 at 1:38 PM, bruno pages <bouml at free.fr> wrote:
>
>>
>> Hi,
>>
>>
>> Vishal-7 wrote:
>> >
>> > BOUML works wonderfully, except the default indentation of docstrings.
>> >
>>
>> I am the author of Bouml, I never receive a remark from you or other
>> Python
>> user on Bouml forums/trackers about that
>>
>> Yes the Python generator doesn't indent docstring because If I do that the
>> string returned by __doc__ contains these indentations, and I supposed
>> this
>> is not the expected behavior
>>
>> But I am not a Python programmer (sorry), can you confirm the docstring
>> must
>> be indented even this pollutes __doc__ ?
>>
>> Thanks and best regards,
>> Bruno
>>
>> --
>> View this message in context:
>> http://www.nabble.com/UML-%3C%3D%3E-Python...and-other-things...-tp22391762p22800277.html
>> Sent from the BangPypers - Bangalore Python Users Group mailing list
>> archive at Nabble.com.
>>
>> _______________________________________________
>> BangPypers mailing list
>> BangPypers at python.org
>> http://mail.python.org/mailman/listinfo/bangpypers
>>
>
>
>
> --
> "So say...Day by day, in every way, I am getting better, better and better
> !!!"
> "A Strong and Positive attitude creates more miracles than anything else.
> Because...Life is 10% how you make it, and 90% how you take it"
> "Diamond is another piece of coal that did well under pressure”
> "Happiness keeps u Sweet, Trials keep u Strong,
> Sorrow keeps u Human, Failure Keeps u Humble,
> Success keeps u Glowing, But only God Keeps u Going.....Keep Going....."
>



-- 
"So say...Day by day, in every way, I am getting better, better and better
!!!"
"A Strong and Positive attitude creates more miracles than anything else.
Because...Life is 10% how you make it, and 90% how you take it"
"Diamond is another piece of coal that did well under pressure”
"Happiness keeps u Sweet, Trials keep u Strong,
Sorrow keeps u Human, Failure Keeps u Humble,
Success keeps u Glowing, But only God Keeps u Going.....Keep Going....."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/bangpypers/attachments/20090331/0b42df70/attachment.htm>


More information about the BangPypers mailing list