Skip to content

Commit

Permalink
version 1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinlyonsrepo committed Dec 10, 2019
1 parent e57b79f commit d3553c1
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 23 deletions.
3 changes: 3 additions & 0 deletions Documents/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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


3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
46 changes: 25 additions & 21 deletions code/opml_convert_rss.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 : [email protected]
# python_version : 3.6.8
Expand All @@ -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"


Expand Down Expand Up @@ -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===============================
Expand Down

0 comments on commit d3553c1

Please sign in to comment.