lmaurits / BEASTling

A linguistics-focussed command line tool for generating BEAST XML files.
BSD 2-Clause "Simplified" License
20 stars 6 forks source link

Unify file handling #241

Open xrotwang opened 5 years ago

xrotwang commented 5 years ago

Now that we have py3.5 as baseline, we should unify all file handling to make use of pathlib. I.e. filenames should be handled like encoded strings: Convert to pathlib.Path as early as possible, and pass around pathlib.Path objects internally exclusively.

Also, reading and writing files can then be handled using the read_text and write_text method, etc.

Anaphory commented 5 years ago

Yes! You taught me to love pathlib.Path, this sounds like an excellent plan.

xrotwang commented 5 years ago

@Anaphory and if you still love it, after the rough years of pathlib2 and backports for py2, you'll love it happily ever after.