Updated docs from master

This commit is contained in:
Manuel Ebert 2013-11-20 16:55:50 -08:00
parent 036ce235a4
commit 954ee5676e
5 changed files with 8 additions and 6 deletions

View file

@ -30,7 +30,7 @@
</div>
</div>
<div id="nav">
<a href="{{ pathto('overview') }}" title="Documentation">Documenation</a>
<a href="{{ pathto('overview') }}" title="Documentation">Documentation</a>
<a href="http://github.com/maebert/jrnl" title="View on Github">Fork me on GitHub</a>
<a id="twitter-nav" href="https://twitter.com/intent/tweet?text=Write+your+memoirs+on+the+command+line.+Like+a+boss.+%23jrnl&url=http%3A%2F%2Fmaebert.github.io%2Fjrnl&via=maebert">Tell your friends on twitter</a>
<a href="{{ pathto('installation') }}" title="Quick Start" class="cta">Download &#9654;</a>

View file

@ -110,7 +110,7 @@ class Journal(object):
journal = None
if 'password' in self.config:
journal = validate_password(self.config['password'])
if not journal:
if journal is None:
journal = util.get_password(keychain=self.name, validator=validate_password)
else:
with codecs.open(filename, "r", "utf-8") as f:

View file

@ -7,7 +7,7 @@ jrnl is a simple journal application for your command line.
"""
__title__ = 'jrnl'
__version__ = '1.6.3'
__version__ = '1.6.4'
__author__ = 'Manuel Ebert'
__license__ = 'MIT License'
__copyright__ = 'Copyright 2013 Manuel Ebert'

View file

@ -75,6 +75,8 @@ def install_jrnl(config_path='~/.jrnl_config'):
default_config['encrypt'] = True
if util.yesno("Do you want to store the password in your keychain?", default=True):
util.set_keychain("default", password)
else:
util.set_keychain("default", None)
print("Journal will be encrypted.")
else:
password = None

View file

@ -29,15 +29,15 @@ def get_password(validator, keychain=None, max_attempts=3):
password = pwd_from_keychain or getpass()
result = validator(password)
# Password is bad:
if not result and pwd_from_keychain:
if result is None and pwd_from_keychain:
set_keychain(keychain, None)
attempt = 1
while not result and attempt < max_attempts:
while result is None and attempt < max_attempts:
prompt("Wrong password, try again.")
password = getpass()
result = validator(password)
attempt += 1
if result:
if result is not None:
return result
else:
prompt("Extremely wrong password.")