Print help instead of crash
This commit is contained in:
parent
9b6d87f3e5
commit
58b51a4b77
1 changed files with 6 additions and 1 deletions
|
|
@ -217,7 +217,12 @@ class Downloadboob(object):
|
||||||
config = ConfigParser.ConfigParser()
|
config = ConfigParser.ConfigParser()
|
||||||
config.read(['/etc/downloadboob.conf', os.path.expanduser('~/downloadboob.conf'), 'downloadboob.conf'])
|
config.read(['/etc/downloadboob.conf', os.path.expanduser('~/downloadboob.conf'), 'downloadboob.conf'])
|
||||||
|
|
||||||
links_directory=os.path.expanduser(config.get('main','directory', '.'))
|
try:
|
||||||
|
links_directory=os.path.expanduser(config.get('main','directory', '.'))
|
||||||
|
except ConfigParser.NoSectionError:
|
||||||
|
print "Please create a documentation file (see the README file and the downloadboob.conf example file)"
|
||||||
|
sys.exit(2)
|
||||||
|
|
||||||
links_directory=links_directory.decode('utf-8')
|
links_directory=links_directory.decode('utf-8')
|
||||||
|
|
||||||
download_directory=os.path.join(links_directory, DOWNLOAD_DIRECTORY)
|
download_directory=os.path.join(links_directory, DOWNLOAD_DIRECTORY)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue