z4r / python-rtkit

Python Api for Request Tracker's REST interface
http://z4r.github.com/python-rtkit/
Other
68 stars 44 forks source link

Parsing Removes Newlines in Comment Field #23

Closed v01d-cypher closed 11 years ago

v01d-cypher commented 11 years ago

Hi,

I just started using this API. It's awesome thx! :-)

I noticed on line 111 in parser.py :

if line[0].isspace():
     logic_lines[-1] += ' ' + line.strip(' ')

if I change line 112 to make it '\n' instead of ' ', so :

if line[0].isspace()
     logic_lines[-1] += '\n' + line.strip(' ')

It correctly keeps the newlines that are in the comment field of a ticket. i.e. The email correspondence.

Is this something I'm doing wrong, or does it need to change to '\n' as in my example?

Regards, Nevar

z4r commented 11 years ago

Hi, In order to help me to understand the issue and translate it a test using http://rt.easter-eggs.org/demos/stable/ could you create a tkt and point me to the right call REST?

z4r commented 11 years ago

Do you mean something like this one? http://rt.easter-eggs.org/demos/stable/REST/1.0/ticket/216/history/id/2831

user: john.foo password: john.foo

v01d-cypher commented 11 years ago

Hi Andrea,

Yes like this ticket. The content is multiline. After it's been parsed, i.e. when accessing it from response.parsed, the newlines are removed. I would like the newlines to remain in then content field.

Let me know if you still want me to create another ticket.

Regards, Nevar

On Thu, Feb 14, 2013 at 8:03 PM, Andrea de Marco notifications@github.comwrote:

Do you mean something like this one? http://rt.easter-eggs.org/demos/stable/REST/1.0/ticket/216/history/id/2831

— Reply to this email directly or view it on GitHubhttps://github.com/z4r/python-rtkit/issues/23#issuecomment-13569275.

z4r commented 11 years ago

Ok, I understand #5 too. The problem with RT is that every other header (EG requestor) will preserve newline.

Today I'll push this issue, but we've to remember it with the new high API.

v01d-cypher commented 11 years ago

The REST call I'm using is /REST/1.0/ticket/216/history?format=l

v01d-cypher commented 11 years ago

Great, thank you.

z4r commented 11 years ago

0.5.0 solves this issue