final polish for 1.0

This commit is contained in:
Mathew Guest 2017-08-25 18:32:19 -06:00
parent b851be0d03
commit 4a9609023b
4 changed files with 17 additions and 3 deletions

@ -91,7 +91,7 @@ class DefaultSettings:
'model': {
'level': logging.DEBUG,
'handlers': ['stderr'],
'propagate': True
'propagate': True # Send to root logger
},
'cli': {
'level': logging.DEBUG,

@ -6,7 +6,6 @@
import baker
import sys
if sys.platform == 'linux':
import readline # Needed for command history <up> and <down> arrows to work
@ -56,7 +55,7 @@ class InteractiveInterface:
commander.usage()
except Exception as ex:
log.LOGGER['cli'].error('caught general exception!!')
log.LOGGER['cli'].error(type(ex), ex)
log.LOGGER['cli'].error(ex)
def start_command_loop(self):
"""
@ -170,6 +169,10 @@ class InteractiveInterface:
self.run_command(args, main=False)
@commander.command
def play_specific_page(self, title):
pass
@commander.command
def play_random_page(self):
"""

@ -1,3 +1,6 @@
# Nothing is implemented here yet... This is intended to be a future
# excercise.
import sqlite3
import pycurl
import os

@ -221,6 +221,8 @@ class ArticlePage(PageRootObject):
return False
if self._is_link_audio(el):
return False
if self._is_not_wikipedia(el):
return False
return True
def _is_link_in_parenthesis(self, p, el):
@ -299,3 +301,9 @@ class ArticlePage(PageRootObject):
return True
return False
def _is_not_wikipedia(self, el):
href = el.get_attribute('href')
if 'wikipedia.org' not in href:
return True
return False