From b3572e143d977349d5c5289219413f18cfffb1c1 Mon Sep 17 00:00:00 2001 From: pictuga Date: Wed, 11 Mar 2015 14:23:14 +0800 Subject: [PATCH] New way of calling the program python -m morss, python morss/main.py --- README.md | 10 +++++----- main.py | 4 ++++ morss/__main__.py | 4 ++++ 3 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 main.py create mode 100644 morss/__main__.py diff --git a/README.md b/README.md index c49d331..4090977 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ To achieve this, you will have to move the files of `/morss/` and of `/www/` int For this, you need to make sure your host allows python script execution. This method uses HTTP calls to fetch the RSS feeds, which will be handled through `mod_cgi` for example on Apache severs. -Please pay attention to `/www/morss.py` permissions for it to be executable. Also ensure that the provided `/www/.htaccess` works well with your server. +Please pay attention to `/www/main.py` permissions for it to be executable. Also ensure that the provided `/www/.htaccess` works well with your server. ####Using morss' internal HTTP server @@ -93,16 +93,16 @@ Works like a charm with [Tiny Tiny RSS](http://tt-rss.org/redmine/projects/tt-rs ###As a CLI application -Run: **`[python2.7] -m morss.morss [argwithoutvalue] [argwithvalue=value] [...] FEEDURL`** -For example: `python2.7 morss.py debug http://feeds.bbci.co.uk/news/rss.xml` +Run: **`python[2.7] -m morss [argwithoutvalue] [argwithvalue=value] [...] FEEDURL`** +For example: `python -m morss debug http://feeds.bbci.co.uk/news/rss.xml` *(Brackets indicate optional text)* ###As a newsreader hook To use it, the newsreader [Liferea](http://lzone.de/liferea/) is required (unless other newsreaders provide the same kind of feature), since custom scripts can be run on top of the RSS feed, using its [output](http://lzone.de/liferea/scraping.htm) as an RSS feed. -To use this script, you have to enable "(Unix) command" in liferea feed settings, and use the command: **`[python2.7] PATH/TO/MORSS/morss.py [argwithoutvalue] [argwithvalue=value] [...] FEEDURL`** -For example: `python2.7 PATH/TO/MORSS/morss.py http://feeds.bbci.co.uk/news/rss.xml` +To use this script, you have to enable "(Unix) command" in liferea feed settings, and use the command: **`[python2.7] PATH/TO/MORSS/main.py [argwithoutvalue] [argwithvalue=value] [...] FEEDURL`** +For example: `python2.7 PATH/TO/MORSS/main.py http://feeds.bbci.co.uk/news/rss.xml` *(Brackets indicate optional text)* ###As a python library diff --git a/main.py b/main.py new file mode 100644 index 0000000..6545d0e --- /dev/null +++ b/main.py @@ -0,0 +1,4 @@ +from morss import main + +if __name__ == '__main__': + main() diff --git a/morss/__main__.py b/morss/__main__.py new file mode 100644 index 0000000..5716cce --- /dev/null +++ b/morss/__main__.py @@ -0,0 +1,4 @@ +from .morss import main + +if __name__ == '__main__': + main()