Modularizing Python routines

20 views
Skip to first unread message

Rob Beezer

unread,
Jun 2, 2026, 8:12:14 PMJun 2
to prete...@googlegroups.com

I'd like to slightly re-architect the Python script. The braille conversion
relies on Python code to *format* abstract braille text into word-wrapped lines
and pages of a fixed width and height (measured by cells). This is in its own
file/module now.

I'd like to do the same for WeBWorK routines (one-sixth of the current module)
and for STACK routines (likely to grow). Mostly just to modularize what has
grown to become a bit unwieldy. Maintenance.

* Alex, and Georg - actively working on this code? An OK time for some bulk moves?

* Some shared code (across four or five modules, once done) will need to go
into a new helpers.py, shared.py, core.py, support.py, common.py, or similar.
Oscar will need to know to copy those over to the CLI, so that will need
coordination. Though it appears that the CLI will copy over the new files, and
only directly calls "higher level" routines, so it is possbile nothing will
really need to be done. Oscar? (Yes, core.py might be a bad choice for a name.)

* Any red flags from aybody else affected?

Rob

Oscar Levin

unread,
Jun 3, 2026, 3:19:30 PMJun 3
to prete...@googlegroups.com
The cli copies the two specific files (pretext.py and braille_format.py, but I'm not really sure why we don't just copy the entire lib directory (I think because we have a custom __init__.py file in that directory).  So either we will switch to that or copy each new file as needed.  Either way, should be straightforward.

--
You received this message because you are subscribed to the Google Groups "PreTeXt development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/MTAwMDAzNi5iZWV6ZXI.1780445532%40pnsh.

Rob Beezer

unread,
Jun 3, 2026, 8:01:53 PMJun 3
to prete...@googlegroups.com
And now a PR, that'll let simmer for 24-48 hours.

Oscar - I had my assistant review the pretext-cli and I think your core.* naming
will all just work. You will need to copy over three new files. I know you are
busy this week, so let me know about any timing coordination that will be good
for you.

Rob

Rob Beezer

unread,
Jun 3, 2026, 8:06:57 PMJun 3
to prete...@googlegroups.com
Oscar - check that. May need some small adjustments so you can just run with
this. Stay tuned.

Rob Beezer

unread,
Jun 3, 2026, 9:54:08 PMJun 3
to prete...@googlegroups.com
Small force-push, just now.

Ready for a look.

https://github.com/PreTeXtBook/pretext/pull/2888

Oscar Levin

unread,
Jun 4, 2026, 12:21:27 AMJun 4
to PreTeXt development
As far as I can tell, this looks reasonable.  If you merge it by the end of the day Thursday, I should be able to fix up the import scripts so that nightlies don't stay broken for too long.

Rob Beezer

unread,
Jun 4, 2026, 9:27:23 AMJun 4
to prete...@googlegroups.com
Dear Oscar,

Thanks for taking a look, when I know you have other things going.

I will be off-duty most of the day, so I went ahead and merged this now.

If there is a disaster, my assistant can always revert the seven commits if we
need to.

I think this modularization is going to have some really good long-term benefits.

Rob

On 6/3/26 21:21, Oscar Levin wrote:
> As far as I can tell, this looks reasonable.  If you merge it by the end of the
> day Thursday, I should be able to fix up the import scripts so that nightlies
> don't stay broken for too long.
>
> On Wednesday, June 3, 2026 at 8:54:08 PM UTC-5 Rob Beezer wrote:
>
> Small force-push, just now.
>
> Ready for a look.
>
> https://github.com/PreTeXtBook/pretext/pull/2888 <https://github.com/
> PreTeXtBook/pretext/pull/2888>
> --
> You received this message because you are subscribed to the Google Groups
> "PreTeXt development" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to pretext-dev...@googlegroups.com <mailto:pretext-
> dev+uns...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/
> fc507fe6-d08f-44c6-9207-23420ff177b1n%40googlegroups.com <https://
> groups.google.com/d/msgid/pretext-dev/fc507fe6-
> d08f-44c6-9207-23420ff177b1n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Oscar Levin

unread,
Jun 4, 2026, 2:43:02 PMJun 4
to PreTeXt development
Updated the CLI to use the new structure without any issues.  Should be good to go for nightly and new releases.
Reply all
Reply to author
Forward
0 new messages