From c73806410548a4d142e7acc1c97c0c4f643713b6 Mon Sep 17 00:00:00 2001 From: Vidyadheesha D N Date: Mon, 23 Oct 2017 23:20:11 +0530 Subject: [PATCH] Added colours for better readability --- ExtractMainContent.pyc | Bin 0 -> 3347 bytes Extractor.pyc | Bin 0 -> 6842 bytes ...ing About America\342\200\231s Future.txt" | 26 ++++++++++++++++++ Main.py | 26 ++++++++++-------- NewsPulling.py | 7 +++-- NewsPulling.pyc | Bin 0 -> 3535 bytes configReader.pyc | Bin 0 -> 1643 bytes 7 files changed, 44 insertions(+), 15 deletions(-) create mode 100644 ExtractMainContent.pyc create mode 100644 Extractor.pyc create mode 100644 "Harry Belafonte Issues A Frightening Warning About America\342\200\231s Future.txt" create mode 100644 NewsPulling.pyc create mode 100644 configReader.pyc diff --git a/ExtractMainContent.pyc b/ExtractMainContent.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b4cf8928281371c5d1c82861d6157e787a2537d4 GIT binary patch literal 3347 zcmcguSyLNF5T4aaV95|4I6kV9)K;oekq^X;6MU3GcEATpvLYd-NU4_Hku+kpBk#;w zkb)=jkMh6rk{^(K-7BC{el_0Gw0e53KECN5_n*nis~dm64aMkl@&63X_#lxGJD`q; z3Lpsc;!hz?gm}9%PMb8V2xdV zUwn+dVA|xjgL&nz8%wHgu9bp}Ehb=I5 znHHIrn2r(cjEf^7TI0fAqHeED^wP;FyutIboN#9KyFO~Q-x58vMPvM zDv97aLoO@ZYh+utXXLvK!qJ#5K{`~C?JDdcsx*nW*vQ&#M9=EvCvB{CA#c3h;{Ua^ zx-Fx>7Hi#KlW7N*3$dOBX{3ULJ6m13fx|O9fsrlMm*&Uz%LK!A5(1e=SEsQumY|#C zVqMy8xo4D>&1^8xDez_~D4W4xK&sH0GRgW9$dQ&p*3?-VN>(aMV?Nnp^I;kc;BuUd z&Ney&nVt<&p961;m|5ju(C&R8Hj~=jABXJcA1QYW!xcbWO zFGi+j_g57i22oc^(+zf?OS5nFV7DQM=2_T}n3-O+({_!Q100u&a&oi+~64G8GY=OLj;AUV?&rZ6_DG}otCGcpOj zNt6r8y!;-VUZD%OkKnc%MI&(P^bPJTIoObvB1hi;jGKWtH;$;o*{#Ky3^+SMZahU{ zub89o%x=m>KKawm7PQXYsff1jRsIbR^yI7_m1yj#)UhD($Yu+I&T#0 zDQDvRCX!D$*aI-RKVUp1e@Ecj;bN|D;A-L?-U36t++DbyxRO8wq%M&n2+*7hk@WWq zB8{n7=PPLVd}6}yfV^@y%qtxI=}~#`YA-E@yuL(5slHc{)HA9dbmU!cfMQkK(q21DF+26%D>>wKJeP;Pb?sUF zu-TrB^$@8l*{?G82si%cAe>d&$by_kVwrHRIZrWM3#_tnUWasM2bsNa)LnvRYZ6Z^ z)js?NyrD!Roa;^rC7|S7Lo0Fb68^a)P*Qi%7>F;yd9%CDb1Rps@9Xw4p2j^FUUAvb2WJ^kIeL)n)aIV^u`qzEAAHJOAuk}M2k zZ6qi9Jb~ZGEiSJ-ZB%F{gaFTq?V0pXJ(9>T0zj z9YWi$z_W`(ev;>J@%%wXkFB$u?@!T0s%UzzCqv6;d=hKe*^hJgJ|zYCr7(s>d)28p H6NUc(`b_+M literal 0 HcmV?d00001 diff --git a/Extractor.pyc b/Extractor.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bc0ddfba24628e68d03500e047c27a7e8ecafdf3 GIT binary patch literal 6842 zcmd^D-EJGl6+TN+lt^2)V>^nQA9wTTvPBs6PVO654bfK-ucOrL1HgD7VwAX--ghs(clqK6m*0KQy>#*2zqKJgY&Ne1BfFjDm))!B z?by0&aoXE%#y{iNa?p)kgjkNyDDIAuwQMxB4QT$pWAmV6vwY@IHeN7m)~cYoL&3z4R**~$0?pTS%+(f3qAe{eOq6srW1}5g)UkoN4zY51>l+j0 zX6xHH+zrC*C^Fl@*0spow%KrNHTt)?(iw!BXGR7<&xm%IFnv84GcchQ}ob*KY>Z+;A7!Ih& zxGHxYXK!A1)@3{|*KU3(dkZpNkbYHwv`~>1)}>cNJK1Z<&N&%3(C(D%HD%nCJ}O|! zok%vub?MLPw{B5GU{f>GU=S5(00uoa(>}e(j1p^E z9t3gP$x_SDIP^5%M1C^8pl7tlS+RvWQE|9vI*o4EG532BMU0sx4(Xh9jyv_ri?LK_tJw_#iT%)pHX;d{hu8+D{ z*`CePuQOvisMp^t?p+jTalb$40sik0{WV5E*WSDip=;`Pv)nEFb=k2?d}5pqJ7yv_ zR*=jK5C9=!Y>eF)un)@(LjlCr6ZgewY<*vM69rf4uR~pD?==kh292Wu*eCdpiBY3Q zbG2ti7rO=gakqxJq%T%2Wf=dz*mfry46_tqc6HlhuevhD`fE`IJ9t{t zBi`OZnoO_7X?fh>J({ag=KEpR0W|3e#b;^DQ-J2H7{x_0+`j5g-Dy}H{5b3s|;W8SW>$~k+S-9IK z^xUF60jD0zM*_sZmeacrh~6Jj^^6ecVkiRpegrNruN(w{45|`==*;Ea<@v$hCAx(B z(UWX~-g$n_{k?>q@5gBx1&fJRabsU|~uJK^s8_NgF{23))!H!JR*m>+!<|@5R?{E|EWyj)DX> zq(32v-^+#)MNml)#e!zSC=gVU6HY`>msp4?i zJL&Bf(gX2&Uf*PnJYFxrwhh|1FJ8HV%1giMexBk?{$0mxM(6B{S;i|DRbzID%oE1! z`66aOtf}}Y4^hm@vlOwD=`R+UPv>j(! z9E6WL^qyv<8BrzJR!Xc6zsY5=HYKX`cU~v@v{3Ftv9D3>dvXk(o0JV_-i2H_X{tz Bc+mg= literal 0 HcmV?d00001 diff --git "a/Harry Belafonte Issues A Frightening Warning About America\342\200\231s Future.txt" "b/Harry Belafonte Issues A Frightening Warning About America\342\200\231s Future.txt" new file mode 100644 index 0000000..975133c --- /dev/null +++ "b/Harry Belafonte Issues A Frightening Warning About America\342\200\231s Future.txt" @@ -0,0 +1,26 @@ + +Legendary entertainer and civil rights activist Harry Belafonte used his final public appearance to issue a warning about the future of the nation. +According to The Guardian, Belafonte, 90, said “the country made a mistake” when it elected Donald Trump as president.  + + + +“I think the next mistake might very well be the gas chamber and what happened to Jews [under] Hitler is not too far from our door,” he was quoted as saying.  +Belafonte gave a wide-ranging talk at the Carnegie Music Hall in Pittsburgh on Friday about his life, his music and his decades-long fight for social justice. + + + + +He also sounded an optimistic note.   + + + +“We have achieved a lot in my lifetime,” Belafonte said, per The Guardian. “Dr. King was not about nothing. Eleanor Roosevelt was not about nothing. I think in the final analysis that we shall overcome because what we did is … we left a harvest that generations to come [will] reap. That they have not yet plowed. That they have not yet harvested.” + + + + + + + +Belafonte was the first African American to win an Emmy Award. “The King of Calypso” was also the recipient of several Grammys as well as a Tony. In 2014, he received the honorary Jean Hersholt Humanitarian Award at the Academy Awards.  +A member of the audience posted an audio recording of the Pittsburgh event:  diff --git a/Main.py b/Main.py index bea51da..ca4a494 100644 --- a/Main.py +++ b/Main.py @@ -9,6 +9,7 @@ from ExtractMainContent import ExtractMainContent import sys import codecs +from lazyme.string import color_print def NewsSources(): @@ -19,39 +20,40 @@ def App(): newsSources=NewsSources() while True: for i in xrange(len(newsSources)): - print ("["+str(i)+"]" +"\t" +newsSources[i]) - print ("Please enter the index of the news source or press 99 to quit") + color_print ("["+str(i)+"]" +"\t" +newsSources[i],color='yellow') + color_print ("Please enter the index of the news source or press 99 to quit", color='red') try: - newsSourceNumber=raw_input("News Source Number >>>> ") + color_print("News Source Number >>>> ",color="red") + newsSourceNumber=raw_input() except ValueError: - print ("That is not a valid News Source Number") + color_print ("That is not a valid News Source Number", color='red') newsSourceNumber=int(newsSourceNumber) if newsSourceNumber==99: sys.exit() if (newsSourceNumber >=len(newsSources)): - print ("Please select the index no less than "+ str(len(newsSources))) + color_print ("Please select the index no less than "+ str(len(newsSources)), color='red') obj=NewsPulling(newsSources[newsSourceNumber]) Articles=obj.BeautifyArticles(); while True: - print ("Do you want to read any story further? If yes, please select the number corresponding to the article") - print ("Press 66 to go back to the main menu") - print ("Press 99 to quit") + color_print ("Do you want to read any story further? If yes, please select the number corresponding to the article", color='red') + color_print ("Press 66 to go back to the main menu", color='red') + color_print ("Press 99 to quit", color='red') try: articleNumber=raw_input("Article No >>>> ") except ValueError: - print ("That is not a valid Article Number") + color_print ("That is not a valid Article Number", color='red') articleNumber=int(articleNumber) if articleNumber==99 : sys.exit() elif articleNumber==66 : break elif (articleNumber >= len(Articles)): - print ("Please select the index no less than "+ str(len(Articles))) - #print Articles[articleNumber][2] + color_print ("Please select the index no less than "+ str(len(Articles)), color='red') + #color_print Articles[articleNumber][2] else: extr=ExtractMainContent(newsSources[newsSourceNumber],Articles[articleNumber][2]) extr.Beautify() - print ("Do you want to save this article in file") + color_print ("Do you want to save this article in file", color='red') YesorNo = int(raw_input("Press 1 to save else press 0 to continue >>> ")) if YesorNo == 1: extr.FileSave() diff --git a/NewsPulling.py b/NewsPulling.py index 0b5e3e5..df497c9 100644 --- a/NewsPulling.py +++ b/NewsPulling.py @@ -9,6 +9,7 @@ from configReader import ConfigurationReader from requests import ConnectionError import sys +from lazyme.string import color_print class NewsPulling(object): """This class is used to pull news from the internet depending on the source specified """ @@ -73,9 +74,9 @@ def BeautifyArticles(self): if self.Articles is None or len(self.Articles)==0: print "No articles found" sys.exit() - print "=================STORIES==================================" + color_print("=================STORIES==================================",color='cyan') for i in xrange(len(self.Articles)): - print "[" +str(i) +"]", + color_print("[" +str(i) +"]",color='yellow') # print(sequence,end='') used for python 3.x if self.Articles[i][1] is not None: print "\t"+self.Articles[i][1] @@ -85,7 +86,7 @@ def BeautifyArticles(self): print "\t"+self.Articles[i][4] if self.Articles[i][3] is not None: print "\t"+self.Articles[i][3]+"\n" - print "***************************************************************" + color_print("***************************************************************",color='cyan') return self.Articles diff --git a/NewsPulling.pyc b/NewsPulling.pyc new file mode 100644 index 0000000000000000000000000000000000000000..74d9311908b8d09e8ac59feaa44bc6323e94ab5a GIT binary patch literal 3535 zcmcIn-ESL35T8ANBz6-B6cGXlPJEi8q_iMF5rL*@=?5rO=Rj#FIvscGc)LpJ%>*b(H#N-|^4Bwf)wa?YFse=G{#+ z?=_p}qLJ(7#kRk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