1818# limitations under the License.
1919
2020import os
21+ from pdb import set_trace
2122import re
2223import codecs
2324
@@ -30,6 +31,19 @@ def read(filename):
3031 with codecs .open (os .path .join (cwd , filename ), 'rb' , 'utf-8' ) as h :
3132 return h .read ()
3233
34+ def convert_txt (txt ):
35+ lst_txt = txt .split ('\n ' )
36+ for i in range (len (lst_txt )):
37+ line = lst_txt [i ]
38+ match = re .match (r' +(\S.+)' , line )
39+ if match is not None :
40+ lst_txt [i ] = '\n | {}' .format (match .group (1 ))
41+ else :
42+ match_date = re .match (r'(\d+-\d+-\d+)' , line )
43+ if match_date is not None :
44+ lst_txt [i ] = '\n **{}**' .format (match_date .group (1 ))
45+ return '\n ' .join (lst_txt )
46+
3347metadata = read (os .path .join (cwd , 'twitter' , '__init__.py' ))
3448
3549def extract_metaitem (meta ):
@@ -41,13 +55,13 @@ def extract_metaitem(meta):
4155 raise RuntimeError ('Unable to find __{meta}__ string.' .format (meta = meta ))
4256
4357setup (
44- name = 'python-twitter_test ' ,
58+ name = 'python-twitter ' ,
4559 version = extract_metaitem ('version' ),
4660 license = extract_metaitem ('license' ),
4761 description = extract_metaitem ('description' ),
4862 long_description = (read ('README.rst' ) + '\n \n ' +
4963 read ('AUTHORS.rst' ) + '\n \n ' +
50- read ('CHANGES' )),
64+ convert_txt ( read ('CHANGES' ) )),
5165 long_description_content_type = 'text/x-rst' ,
5266 author = extract_metaitem ('author' ),
5367 author_email = extract_metaitem ('email' ),
0 commit comments