diff --git a/jrnl/EncryptedJournal.py b/jrnl/EncryptedJournal.py index 9fe51927..e0bce398 100644 --- a/jrnl/EncryptedJournal.py +++ b/jrnl/EncryptedJournal.py @@ -67,15 +67,7 @@ class EncryptedJournal(Journal.Journal): key = make_key(password) return _decrypt(journal_encrypted, key) - text = None - - if 'password' in self.config: - text = validate_password(self.config['password']) - - if text is None: - text = util.get_password(keychain=self.name, validator=validate_password) - - return text + return util.get_password(keychain=self.name, validator=validate_password) def _store(self, filename, text): key = make_key(self.config['password']) diff --git a/jrnl/cli.py b/jrnl/cli.py index b67a16c2..fa45c8ea 100644 --- a/jrnl/cli.py +++ b/jrnl/cli.py @@ -120,25 +120,6 @@ def update_config(config, new_config, scope, force_local=False): config.update(new_config) -def open_journal(name, config): - """ - Creates a normal, encrypted or DayOne journal based on the passed config. - """ - if os.path.isdir(config['journal']): - if config['journal'].strip("/").endswith(".dayone") or "entries" in os.listdir(config['journal']): - from . import DayOneJournal - return DayOneJournal.DayOne(**config).open() - else: - util.prompt("[Error: {0} is a directory, but doesn't seem to be a DayOne journal either.".format(config['journal'])) - sys.exit(1) - - if not config['encrypt']: - return Journal.PlainJournal(name, **config).open() - else: - from . import EncryptedJournal - return EncryptedJournal.EncryptedJournal(name, **config).open() - - def run(manual_args=None): args = parse_args(manual_args) args.text = [p.decode('utf-8') if util.PY2 and not isinstance(p, unicode) else p for p in args.text]