abertschi / postcard_creator_wrapper

A python wrapper around the Rest API of the Swiss Postcard creator :postbox:
https://abertschi.ch/blog/2022/receiving-postcards/
Apache License 2.0
52 stars 10 forks source link

Newlines #35

Closed maede97 closed 3 years ago

maede97 commented 3 years ago

First of all: thanks for this awesome tool! Works like a charm!

My question is about new-lines

Like one way would be entering python text like this: message = "First Line\n Second Line

or even, with the triple ":

message = """First Line
Second Line"""

Is there a way that this wrapper supports this? Because newlines are (in my case) just ignored by this tool (https://github.com/abertschi/postcard_creator_wrapper/blob/master/postcard_creator/postcard_img_util.py#L126)

abertschi commented 3 years ago

thanks for shouting out. hmm, you are right, newlines are indeed dropped. off the top of my head there are the following things you could do (none of them are supported as is):

I may look into this too, but as of right now I am busy with other things. :)

maede97 commented 3 years ago

https://github.com/maede97/postcard_creator_wrapper/commit/230704f59848955537b6fd1dbdde5fcaade557f4

I think I fixed it :-) Maybe you can have a short look at it (my use-case seemed to work fine). If you want, I can create a PR. Just ping me :-)

wp99cp commented 3 years ago

Any updates? Would also be interested in this feature. @maede97 can you create a PR?