Windows: wraps lines at 79 chars by default

trying to wrap lines at 80 char in Windows' CMD results in blank lines
following lines that are exactly 80 char long
This commit is contained in:
William Minchin 2013-11-27 10:25:17 -07:00
parent e176e1145b
commit 79a8b59e6f
2 changed files with 5 additions and 2 deletions

View file

@ -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)

View file

@ -34,6 +34,9 @@ default_config = {
'linewrap': 80, 'linewrap': 80,
} }
if "win32" in sys.platform:
default_config['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.