From 79a8b59e6f5ea9970f184fae395610ce64b20e7c Mon Sep 17 00:00:00 2001 From: William Minchin Date: Wed, 27 Nov 2013 10:25:17 -0700 Subject: [PATCH] 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 --- jrnl/Journal.py | 2 +- jrnl/install.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/jrnl/Journal.py b/jrnl/Journal.py index f9122892..41d7a225 100644 --- a/jrnl/Journal.py +++ b/jrnl/Journal.py @@ -134,7 +134,7 @@ class Journal(object): line = line.strip() 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: entries.append(current_entry) diff --git a/jrnl/install.py b/jrnl/install.py index cd1683d9..129365f5 100644 --- a/jrnl/install.py +++ b/jrnl/install.py @@ -34,10 +34,13 @@ default_config = { 'linewrap': 80, } +if "win32" in sys.platform: + default_config['linewrap'] = 79 + 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. - 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.""" missing_keys = set(default_config).difference(config) if missing_keys: