Update slixfeed.py
This commit is contained in:
parent
be04cfec89
commit
69a5dc1f12
1 changed files with 16 additions and 17 deletions
33
slixfeed.py
33
slixfeed.py
|
@ -125,13 +125,12 @@ class Slixfeed(slixmpp.ClientXMPP):
|
||||||
while True:
|
while True:
|
||||||
db_dir = get_default_dbdir()
|
db_dir = get_default_dbdir()
|
||||||
if not os.path.isdir(db_dir):
|
if not os.path.isdir(db_dir):
|
||||||
# NOTE: Impossible scenario
|
# TODO Print the Slixfeed's JID .format(self.jid)
|
||||||
msg = """
|
msg = ("Slixfeed can not work without a database. \n"
|
||||||
No database directory was found. \n
|
"To create a database, follow these steps: \n"
|
||||||
To create News database,send these messages to bot: \n
|
"Add Slixfeed contact to your roster \n"
|
||||||
add feed https://reclaimthenet.org/feed/
|
"Send a feed to the bot by: \n"
|
||||||
update
|
"feed add https://reclaimthenet.org/feed/")
|
||||||
"""
|
|
||||||
print(msg)
|
print(msg)
|
||||||
else:
|
else:
|
||||||
os.chdir(db_dir)
|
os.chdir(db_dir)
|
||||||
|
@ -147,13 +146,11 @@ class Slixfeed(slixmpp.ClientXMPP):
|
||||||
while True:
|
while True:
|
||||||
db_dir = get_default_dbdir()
|
db_dir = get_default_dbdir()
|
||||||
if not os.path.isdir(db_dir):
|
if not os.path.isdir(db_dir):
|
||||||
# NOTE: Impossible scenario
|
msg = ("Slixfeed can not work without a database. \n"
|
||||||
msg = """
|
"To create a database, follow these steps: \n"
|
||||||
No database directory was found. \n
|
"Add Slixfeed contact to your roster \n"
|
||||||
To create News database,send these messages to bot: \n
|
"Send a feed to the bot by: \n"
|
||||||
add feed https://reclaimthenet.org/feed/
|
"feed add https://reclaimthenet.org/feed/")
|
||||||
update
|
|
||||||
"""
|
|
||||||
print(msg)
|
print(msg)
|
||||||
else:
|
else:
|
||||||
os.chdir(db_dir)
|
os.chdir(db_dir)
|
||||||
|
@ -219,10 +216,12 @@ def print_help():
|
||||||
" List recent N news items. \n"
|
" List recent N news items. \n"
|
||||||
"\n"
|
"\n"
|
||||||
"DOCUMENTATION: \n"
|
"DOCUMENTATION: \n"
|
||||||
" feedparser \n"
|
" Slixfeed \n"
|
||||||
" https://pythonhosted.org/feedparser \n"
|
" https://gitgud.io/sjehuda/slixfeed \n"
|
||||||
" Slixmpp \n"
|
" Slixmpp \n"
|
||||||
" https://slixmpp.readthedocs.io/")
|
" https://slixmpp.readthedocs.io/ \n"
|
||||||
|
" feedparser \n"
|
||||||
|
" https://pythonhosted.org/feedparser")
|
||||||
|
|
||||||
return msg
|
return msg
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue