|
6 | 6 | # opml sub file into text file for rss reader newsboat.
|
7 | 7 | # author : Gavin Lyons
|
8 | 8 | # date : OCT 2019
|
9 |
| -# version : 1.1 |
| 9 | +# version : 1.2 |
10 | 10 | # web : See __URL__
|
11 | 11 |
|
12 | 12 | # python_version : 3.6.8
|
|
15 | 15 | # Import the system modules needed to run
|
16 | 16 | from xml.etree import ElementTree
|
17 | 17 | import argparse
|
| 18 | +from sys import platform |
18 | 19 |
|
19 | 20 | # =============Functions==============
|
20 | 21 | # metadata
|
21 |
| -__VERSION__ = "1.1" |
| 22 | +__VERSION__ = "1.2" |
22 | 23 | __URL__ = "https://github.com/gavinlyonsrepo/opml_convert_RSS"
|
23 | 24 |
|
24 | 25 |
|
@@ -103,29 +104,32 @@ def process_cmd_arguments():
|
103 | 104 | def msg_func(myprocess, mytext):
|
104 | 105 | """NAME : msg_func
|
105 | 106 | DESCRIPTION :prints to screen
|
106 |
| - prints line, text and anykey prompts, |
| 107 | + prints line, text. |
107 | 108 | INPUTS : $1 process name $2 text input
|
108 | 109 | PROCESS :[1] print line
|
109 | 110 | [2] print text "green , red ,blue "
|
| 111 | + NOTE: only works for linux , for windows just prints text as asni escape codes |
| 112 | + did not work in powershell |
110 | 113 | """
|
111 |
| - |
112 |
| - # colours for print |
113 |
| - blue = '\033[94m' |
114 |
| - red = '\033[91m' |
115 |
| - bold = '\033[1m' |
116 |
| - end = '\033[0m' |
117 |
| - |
118 |
| - if myprocess == "line": # print blue horizontal line of = |
119 |
| - print(blue + "="*80 + end) |
120 |
| - |
121 |
| - if myprocess == "red": # print red text |
122 |
| - print(red + mytext + end) |
123 |
| - |
124 |
| - if myprocess == "blue": # print blue text |
125 |
| - print(blue + mytext + end) |
126 |
| - |
127 |
| - if myprocess == "bold": # print bold text |
128 |
| - print(bold + mytext + end) |
| 114 | + if platform == 'win32': |
| 115 | + print(mytext) |
| 116 | + else: |
| 117 | + # colours for print |
| 118 | + blue = '\033[94m' |
| 119 | + red = '\033[91m' |
| 120 | + bold = '\033[1m' |
| 121 | + end = '\033[0m' |
| 122 | + if myprocess == "line": # print blue horizontal line of = |
| 123 | + print(blue + "="*80 + end) |
| 124 | + |
| 125 | + if myprocess == "red": # print red text |
| 126 | + print(red + mytext + end) |
| 127 | + |
| 128 | + if myprocess == "blue": # print blue text |
| 129 | + print(blue + mytext + end) |
| 130 | + |
| 131 | + if myprocess == "bold": # print bold text |
| 132 | + print(bold + mytext + end) |
129 | 133 |
|
130 | 134 |
|
131 | 135 | # =====================MAIN===============================
|
|
0 commit comments