GitThisJoel / intakt

A tool to generate intäktsräkningar from the sales of Zettle and Swish.
Apache License 2.0
2 stars 4 forks source link

Improve/investigate ways of reading content from files #24

Closed GitThisJoel closed 3 days ago

GitThisJoel commented 1 year ago

@erik-stein Suggested in a PR that we could/should change the way we read contents from files. Since our path are represented using the class Path we can use function from that package to read files.

e.g. in main/tex_compiler/tex_compiler.py:

self.intakt_skeleton: Path = ... 
with open(self.intakt_skeleton, "r") as skel_f:
    tex_skeleton = skel_f.read()

could be written as

self.intakt_skeleton: Path = ... 
tex_skeleton = self.intakt_skeleton.read_text()

If someone could do this/look in this, that would be great.