diff --git a/Documents/changelog.md b/Documents/changelog.md index 947a381..6f202a6 100755 --- a/Documents/changelog.md +++ b/Documents/changelog.md @@ -4,4 +4,7 @@ Version control history: * Version 1.1-1 OCT 2019 * First version +* Version 1.2-2 Nov 2019 + * Small Patch so script work with windows 10 powershell due to ANSI escapes sequences not working in windows shell + diff --git a/README.md b/README.md index b7a42b5..a889a38 100644 --- a/README.md +++ b/README.md @@ -36,8 +36,6 @@ Where tag default = youtube, A custom tag can be added using -t option. Usage -------- -NOTE: Currently only works on Linux. - 1. Download the python program, opml_convert_rss.py. 2. In a web browser navigate to subscription manager page of youtube. https://www.youtube.com/subscription_manager @@ -74,3 +72,4 @@ optional arguments: * -o OUTFILE output filename and/or full path, default ./outfile.txt * -t TAGNAME tagname, default = youtube +NOTE: Works in windows powershell but without Colour text \ No newline at end of file diff --git a/code/opml_convert_rss.py b/code/opml_convert_rss.py index 35ed156..cd40748 100755 --- a/code/opml_convert_rss.py +++ b/code/opml_convert_rss.py @@ -6,7 +6,7 @@ # opml sub file into text file for rss reader newsboat. # author : Gavin Lyons # date : OCT 2019 -# version : 1.1 +# version : 1.2 # web : See __URL__ # mail : glyons66@hotmail.com # python_version : 3.6.8 @@ -15,10 +15,11 @@ # Import the system modules needed to run from xml.etree import ElementTree import argparse +from sys import platform # =============Functions============== # metadata -__VERSION__ = "1.1" +__VERSION__ = "1.2" __URL__ = "https://github.com/gavinlyonsrepo/opml_convert_RSS" @@ -103,29 +104,32 @@ def process_cmd_arguments(): def msg_func(myprocess, mytext): """NAME : msg_func DESCRIPTION :prints to screen - prints line, text and anykey prompts, + prints line, text. INPUTS : $1 process name $2 text input PROCESS :[1] print line [2] print text "green , red ,blue " + NOTE: only works for linux , for windows just prints text as asni escape codes + did not work in powershell """ - - # colours for print - blue = '\033[94m' - red = '\033[91m' - bold = '\033[1m' - end = '\033[0m' - - if myprocess == "line": # print blue horizontal line of = - print(blue + "="*80 + end) - - if myprocess == "red": # print red text - print(red + mytext + end) - - if myprocess == "blue": # print blue text - print(blue + mytext + end) - - if myprocess == "bold": # print bold text - print(bold + mytext + end) + if platform == 'win32': + print(mytext) + else: + # colours for print + blue = '\033[94m' + red = '\033[91m' + bold = '\033[1m' + end = '\033[0m' + if myprocess == "line": # print blue horizontal line of = + print(blue + "="*80 + end) + + if myprocess == "red": # print red text + print(red + mytext + end) + + if myprocess == "blue": # print blue text + print(blue + mytext + end) + + if myprocess == "bold": # print bold text + print(bold + mytext + end) # =====================MAIN===============================