diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..1d47a70 --- /dev/null +++ b/TODO.md @@ -0,0 +1,29 @@ +# Things planned for this project + +## Tests + +- [ ] Commandline +- [ ] File +- [ ] DynamoFile +- [ ] PythonFile +- [x] PythonNode + +## CI/CD + +- [x] Tests on Linux +- [ ] Tests on Windows +- [ ] Windows Build +- [ ] Windows Installer +- [ ] Pip +- [ ] Winget + +## Documentation + +- [x] API docs +- [ ] Installation in readme +- [ ] Terminal examples in readme +- [ ] About git hooks in readme + +## Extra features maybe later + +- [ ] Autocomplete \ No newline at end of file diff --git a/dyn2py/files.py b/dyn2py/files.py index 9fb3759..8f2a5d9 100644 --- a/dyn2py/files.py +++ b/dyn2py/files.py @@ -295,7 +295,7 @@ class DynamoFile(File): def write_file(self) -> None: """Write this file to the disk. Should be called only from File.write()""" - with open(self.filepath, "w", encoding="utf-8") as output_file: + with open(self.filepath, "w", encoding="utf-8", newline="") as output_file: json.dump(self.full_dict, output_file, indent=2, use_decimal=True) def get_related_python_files(self, options: Options | None = None) -> list["PythonFile"]: @@ -472,7 +472,7 @@ class PythonFile(File): if not self in self.open_files: logging.info(f"Reading file: {self.filepath}") - with open(self.filepath, mode="r", newline="\r\n", encoding="utf-8") as input_py: + with open(self.filepath, mode="r", newline="", encoding="utf-8") as input_py: python_lines = input_py.readlines() self.header_data = {} @@ -508,7 +508,7 @@ class PythonFile(File): def write_file(self) -> None: """Write this file to the disk. Should be called only from File.write()""" - with open(self.filepath, "w", encoding="utf-8", newline='') as output_file: + with open(self.filepath, "w", encoding="utf-8", newline="") as output_file: output_file.write(self.text) diff --git a/tests/test_File.py b/tests/test_File.py index 6884451..3d0f9d3 100644 --- a/tests/test_File.py +++ b/tests/test_File.py @@ -33,8 +33,6 @@ class TestFile(unittest.TestCase): self.assertEqual(the_file.dirpath, pathlib.Path(INPUT_DIR)) self.assertEqual(the_file.realpath, pathlib.Path(path).resolve()) - self.assertEqual(the_file.mtime, 1678287111.4672492) - self.assertEqual(the_file.mtimeiso, "2023-03-08T15:51:51.467249") self.assertTrue(the_file.exists) self.assertEqual(the_file.extension, ".dyn") self.assertFalse(the_file.modified) diff --git a/tests/test_PythonNode.py b/tests/test_PythonNode.py index 760111b..13bf889 100644 --- a/tests/test_PythonNode.py +++ b/tests/test_PythonNode.py @@ -59,5 +59,5 @@ class TestPythonNode(unittest.TestCase): self.assertEqual(node.id, "1c5d99792882409e97e132b3e9f814b0") self.assertEqual(node.engine, "CPython3") - self.assertEqual(node.checksum, "bf0f039ef6f11c3043e0821143801d48") + self.assertEqual(node.checksum, "8d9091d24788a6fdfa5e1e109298b50e") \ No newline at end of file