From fc2ebe92347b3f579601b4e3e15b1a8cefd25160 Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Sat, 28 Jan 2017 18:45:28 -0700 Subject: [PATCH 1/4] Add manifest to include idd, increment version, are we done? --- MANIFEST.in | 1 + eptransition/__init__.py | 2 +- setup.py | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 MANIFEST.in diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..319d72a --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +recursive-include eptransition *.idf *.idd diff --git a/eptransition/__init__.py b/eptransition/__init__.py index 13faa15..904fbfd 100644 --- a/eptransition/__init__.py +++ b/eptransition/__init__.py @@ -1,3 +1,3 @@ __name__ = "EPTransition" -__version__ = 0.92 +__version__ = 0.95 __description__ = "This tool is used to transition EnergyPlus input files between versions" diff --git a/setup.py b/setup.py index 8052a7e..598af88 100755 --- a/setup.py +++ b/setup.py @@ -36,6 +36,7 @@ def my_test_suite(): ], keywords='cli energyplus', packages=setuptools.find_packages(exclude=['test', 'test.*', '.tox']), + include_package_data=True, install_requires=[], extras_require={ 'test': ['coverage', 'unittest', 'coveralls'], From b0e8495761737595c5f1041f04fa41719d7c2591 Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Sat, 28 Jan 2017 19:07:03 -0700 Subject: [PATCH 2/4] Try catching windows line endings --- eptransition/idd/processor.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/eptransition/idd/processor.py b/eptransition/idd/processor.py index b5b991e..f2b937c 100644 --- a/eptransition/idd/processor.py +++ b/eptransition/idd/processor.py @@ -64,7 +64,7 @@ def process_file_given_file_path(self, file_path): """ if not os.path.exists(file_path): raise exceptions.ProcessingException("Input IDD file not found=\"" + file_path + "\"") # pragma: no cover - self.idd_file_stream = open(file_path, "r") + self.idd_file_stream = open(file_path, "rb") self.file_path = file_path return self.process_file() @@ -159,6 +159,13 @@ def process_file(self): if not peeked_char: peeked_char = "\n" # to simulate that the line ended + # if we are on Windows, we may end up with "\r", so move the read and peeked characters forward once + if peeked_char == "\r": + just_read_char = self.read_one_char() + peeked_char = self.peek_one_char() + if not peeked_char: + peeked_char = "\n" + # jump if we are at an EOL if just_read_char == "\n": # increment the counter From e88a838edcde855f293207e139ac74e60eccc8fb Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Sat, 28 Jan 2017 19:19:06 -0700 Subject: [PATCH 3/4] Increment version; barely --- eptransition/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eptransition/__init__.py b/eptransition/__init__.py index 904fbfd..28e6093 100644 --- a/eptransition/__init__.py +++ b/eptransition/__init__.py @@ -1,3 +1,3 @@ __name__ = "EPTransition" -__version__ = 0.95 +__version__ = 0.951 __description__ = "This tool is used to transition EnergyPlus input files between versions" From 9f7c985e54e9c0ecb0d419e16181813fbe6113e5 Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Mon, 6 Feb 2017 07:53:01 -0700 Subject: [PATCH 4/4] Add pragma for windows line ending --- eptransition/idd/processor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eptransition/idd/processor.py b/eptransition/idd/processor.py index f2b937c..facdac2 100644 --- a/eptransition/idd/processor.py +++ b/eptransition/idd/processor.py @@ -160,7 +160,7 @@ def process_file(self): peeked_char = "\n" # to simulate that the line ended # if we are on Windows, we may end up with "\r", so move the read and peeked characters forward once - if peeked_char == "\r": + if peeked_char == "\r": # pragma no cover -- we don't unit test on windows, so this won't be caught just_read_char = self.read_one_char() peeked_char = self.peek_one_char() if not peeked_char: