briot / geneapro

Genealogical software based on the GenTech data model
http://briot.github.com/geneapro/
GNU General Public License v2.0
33 stars 8 forks source link

Fix `gedcom_view.py` for very large GEDCOM file. #46

Closed changeling closed 5 years ago

changeling commented 5 years ago

Fix gedcom_view.py for very large GEDCOM files as input.

This should correct the python issue with handling read() for files in the multi-gigabyte range in open() in gedcom_view.py.

changeling commented 5 years ago

Also, note that I've moved the colorizing into the colorize() function, and updated the output formatting to the new style.

One question: Is there a reason for using sys.stdout.write() rather than print()? print() defaults to sys.stdout unless the file value is specified. I've left it as sys.stdout.write() for now pending your thoughts.

changeling commented 5 years ago

I've also removed the line_num counter pattern in favor of creating line_number along line using enumerate(gedcom).

briot commented 5 years ago

Thanks for the fixes !

changeling commented 5 years ago

Glad I could contribute!

Cheers.

On Mon, Feb 18, 2019 at 12:51 AM Emmanuel Briot notifications@github.com wrote:

Thanks for the fixes !

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/briot/geneapro/pull/46#issuecomment-464607696, or mute the thread https://github.com/notifications/unsubscribe-auth/AAYd_sO4YCpUY-nDuPOkYmIcPo5_c71-ks5vOk2DgaJpZM4a_YrL .