File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22import os
33
44output = pypandoc .convert ('README.md' , 'rst' )
5- f = open ('README.txt' ,'w+' )
6- f .write (str (output .encode ('utf-8' )))
7- f .close ()
5+ with open ('README.txt' 'w+' ) as f :
6+ f .write (str (output .encode ('utf-8' )))
87
98readme_rst = open ('./README.txt' ).read ()
10- replace = '.. figure:: https://uiux.s3.amazonaws.com/2016-logos/email-logo%402x.png\n :alt: SendGrid Logo\n \n SendGrid Logo\n '
11- replacement = '|SendGrid Logo|\n \n .. |SendGrid Logo| image:: https://uiux.s3.amazonaws.com/2016-logos/email-logo%402x.png\n :target: https://www.sendgrid.com'
12- final_text = readme_rst .replace (replace ,replacement )
9+ replace = '''
10+ .. figure:: https://uiux.s3.amazonaws.com/2016-logos/email-logo
11+ %402x.png\n :alt: SendGrid Logo\n \n SendGrid Logo\n
12+ '''
13+ replacement = '''
14+ |SendGrid Logo|\n \n .. |SendGrid Logo| image::
15+ https://uiux.s3.amazonaws.com/2016-logos/email-logo%402x.png
16+ \n :target: https://www.sendgrid.com
17+ '''
18+ final_text = readme_rst .replace (replace , replacement )
1319with open ('./README.txt' , 'w' ) as f :
14- f .write (final_text )
20+ f .write (final_text )
You can’t perform that action at this time.
0 commit comments