mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-17 11:38:32 +02:00
Updated docs from master
This commit is contained in:
parent
936c54e70c
commit
40f406f6e2
4 changed files with 11 additions and 4 deletions
|
@ -134,7 +134,7 @@ class Journal(object):
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
new_date = datetime.strptime(line[:date_length], self.config['timeformat'])
|
new_date = datetime.strptime(line[:date_length], self.config['timeformat'])
|
||||||
|
|
||||||
# parsing successfull => save old entry and create new one
|
# parsing successful => save old entry and create new one
|
||||||
if new_date and current_entry:
|
if new_date and current_entry:
|
||||||
entries.append(current_entry)
|
entries.append(current_entry)
|
||||||
|
|
||||||
|
|
BIN
jrnl/cli.pyc
Normal file
BIN
jrnl/cli.pyc
Normal file
Binary file not shown.
|
@ -31,13 +31,13 @@ default_config = {
|
||||||
'timeformat': "%Y-%m-%d %H:%M",
|
'timeformat': "%Y-%m-%d %H:%M",
|
||||||
'tagsymbols': '@',
|
'tagsymbols': '@',
|
||||||
'highlight': True,
|
'highlight': True,
|
||||||
'linewrap': 80,
|
'linewrap': 79,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def upgrade_config(config, config_path=os.path.expanduser("~/.jrnl_conf")):
|
def upgrade_config(config, config_path=os.path.expanduser("~/.jrnl_conf")):
|
||||||
"""Checks if there are keys missing in a given config dict, and if so, updates the config file accordingly.
|
"""Checks if there are keys missing in a given config dict, and if so, updates the config file accordingly.
|
||||||
This essentially automatically ports jrnl installations if new config parameters are introduced in later
|
This essentially automatically ports jrnl installations if new config parameters are introduced in later
|
||||||
versions."""
|
versions."""
|
||||||
missing_keys = set(default_config).difference(config)
|
missing_keys = set(default_config).difference(config)
|
||||||
if missing_keys:
|
if missing_keys:
|
||||||
|
|
|
@ -156,6 +156,13 @@ def cli(manual_args=None):
|
||||||
else:
|
else:
|
||||||
journal = Journal.Journal(journal_name, **config)
|
journal = Journal.Journal(journal_name, **config)
|
||||||
|
|
||||||
|
if "win32" in sys.platform:
|
||||||
|
# for Windows systems
|
||||||
|
_exit_multiline_code = "on a blank line, press Ctrl+Z and then Enter"
|
||||||
|
else:
|
||||||
|
# for *nix systems (and others?)
|
||||||
|
_exit_multiline_code = "press Ctrl+D"
|
||||||
|
|
||||||
if mode_compose and not args.text:
|
if mode_compose and not args.text:
|
||||||
if not sys.stdin.isatty():
|
if not sys.stdin.isatty():
|
||||||
# Piping data into jrnl
|
# Piping data into jrnl
|
||||||
|
@ -163,7 +170,7 @@ def cli(manual_args=None):
|
||||||
elif config['editor']:
|
elif config['editor']:
|
||||||
raw = get_text_from_editor(config)
|
raw = get_text_from_editor(config)
|
||||||
else:
|
else:
|
||||||
raw = util.py23_read("[Compose Entry, press Ctrl+D to finish writing]\n")
|
raw = util.py23_read("[Compose Entry; " + _exit_multiline_code + " to finish writing]\n")
|
||||||
if raw:
|
if raw:
|
||||||
args.text = [raw]
|
args.text = [raw]
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Reference in a new issue