pretext 2.33.3.dev20251221064246__py3-none-any.whl → 2.33.3.dev20251227064414__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
pretext/__init__.py CHANGED
@@ -19,7 +19,7 @@ from single_version import get_version
19
19
  VERSION = get_version("pretext", Path(__file__).parent.parent)
20
20
 
21
21
 
22
- CORE_COMMIT = '306dc85ecb1f3b42733093ca5c892f83a7b2c4ab'
22
+ CORE_COMMIT = 'aa22f79b0c98cbe210fba4ec6824ec2ce97bf11e'
23
23
 
24
24
 
25
25
  def activate() -> None:
pretext/core/pretext.py CHANGED
@@ -2799,7 +2799,7 @@ def stack_extraction(xml_source, pub_file, stringparams, xmlid_root, dest_dir ):
2799
2799
  pub_vars = get_publisher_variable_report(xml_source, pub_file, stringparams)
2800
2800
  stack_server = get_publisher_variable(pub_vars, 'stack-server')
2801
2801
  api_url = urllib.parse.urljoin(stack_server, 'render')
2802
- log.info(f"Using STACK API at {api_url}")
2802
+ log.info("Using STACK API server at {}".format(api_url))
2803
2803
 
2804
2804
  os.makedirs(dest_dir, exist_ok=True)
2805
2805
  msg = 'converting STACK exercises from {} to static forms for placement in {}'
@@ -2818,21 +2818,35 @@ def stack_extraction(xml_source, pub_file, stringparams, xmlid_root, dest_dir ):
2818
2818
 
2819
2819
  log.info("extracting STACK exercises from {}".format(xml_source))
2820
2820
  log.info("string parameters passed to extraction stylesheet: {}".format(stringparams) )
2821
- # place verbatim copies of STACK XML into a temporary directory
2822
- xsltproc(extraction_xslt, xml_source, None, tmp_dir, stringparams)
2823
2821
 
2824
- # Course over files in temporary directory,
2825
- # converting to PreTeXt XML. Innermosat loop
2822
+ # Build list of stack/@source into a scratch directory/file
2823
+ tmp_dir = get_temporary_directory()
2824
+ source_filename = os.path.join(tmp_dir, "stack-source.txt")
2825
+ log.debug("STACK source filenames temporarily in {}".format(source_filename))
2826
+ xsltproc(extraction_xslt, xml_source, source_filename, None, stringparams)
2827
+
2828
+ # Course over (source, id) pairs in file created by
2829
+ # extraction stylesheet, converting source STACK files
2830
+ # to PreTeXt files based on id/label. Innermost loop
2826
2831
  # is modeled after work provided in
2827
2832
  # https://github.com/PreTeXtBook/pretext/pull/2576
2828
- with working_directory(tmp_dir):
2829
- for stack_file in os.listdir(tmp_dir):
2830
- # form output file now, for diagnostic
2831
- # message before it is needed
2832
- # just change extension, easy
2833
- pretext_file = os.path.join(dest_dir, stack_file.replace('.xml', '.ptx'))
2834
- msg = 'converting STACK question file "{}/{}" to static PreTeXt XML file "{}"'
2835
- log.debug(msg.format(tmp_dir, stack_file, pretext_file))
2833
+
2834
+ # location of external directory for STACK files
2835
+ _, external_dir = get_managed_directories(xml_source, pub_file)
2836
+
2837
+ with open(source_filename, "r") as source_file:
2838
+ for source in source_file:
2839
+
2840
+ # source is the stack/@source attribute
2841
+ # label is the "assembly-id" used for base filename
2842
+ source, label = source.split()
2843
+ # external directory plus authored @source is STACK question
2844
+ stack_file = os.path.join(external_dir, source)
2845
+ # destination directory, label/id filename, PTX extension is
2846
+ # static version of question, to be melded in by assembly stylesheet
2847
+ pretext_file = os.path.join(dest_dir, label + '.ptx')
2848
+ msg = 'converting STACK question file "{}" to static PreTeXt XML file "{}"'
2849
+ log.debug(msg.format(stack_file, pretext_file))
2836
2850
 
2837
2851
  # Open STACK XML file, send to server, unravel JSON response into
2838
2852
  # a text version of the static PreTeXt XML question
Binary file
Binary file
@@ -523,14 +523,14 @@
523
523
  "installPandoc.sh": "a18b850870b5e2d744c99300c0643f12a81eba3e27dfd985927554af2062c967",
524
524
  "installSage.sh": "8020b532e1101c77c5681c0dfaff308a36c60e95db6b0f652bf230f7de216cb8"
525
525
  },
526
- "2.33.3.dev20251221064246": {
527
- "project.ptx": "9bf8e71768dcfa88b60a6e2e3c241fa8e0921c0cb95945dea1f7e096d20fc7b9",
528
- "codechat_config.yaml": "f353a4d8fbd84259495bb2d11dd7d5ef2fbcb06cc928b6803700fab5774bc123",
529
- ".gitignore": "73de277de1b136536d664a97faaf7abf59c2e3e702408eeca0a102cc3e479f45",
530
- "devcontainer.json": "3e9a6c934f3b047dc641050e66ff23105c9b304e76502551a7e72632b0f8f119",
531
- "pretext-cli.yml": "1f05cd60fed3faa6a461b84b4091a752326930b71cda7a3bf41cbd2ce1865605",
532
- "pretext-deploy.yml": "83315bdfa65c66eb492f581b0870dc66bd77a30786f8ede7befa936ee854a43e",
533
- "installPandoc.sh": "3ebc5000c918689eecb220c0c0b4147885c10a6ba325f4d09ee113b40539266d",
534
- "installSage.sh": "b0699be2c66b69d94a408411200b1193d822633a61efc334dae7d05f5c9ae1b3"
526
+ "2.33.3.dev20251227064414": {
527
+ "project.ptx": "7f55ca3bae8682566bbd86339076a96da3a6b5027cb4c7a8b2c9cac3c864c862",
528
+ "codechat_config.yaml": "588babed2d0101d80cfe02a5ccead7bd7983893ac30431d2653da1d41f2fab65",
529
+ ".gitignore": "50317925b357a35e6316de355bd12c6c4d9a4070ce6c9cdc3d52e9a3310bef67",
530
+ "devcontainer.json": "24e4e3dfc5006798628f67b7e99d756ac8e54d9c04c7a3f56744af8562c9e771",
531
+ "pretext-cli.yml": "140d7c4428d7fd1f05e7b338fbc73de2493a37c4916de818a2dc845cea818850",
532
+ "pretext-deploy.yml": "28a7451a806d307bcb769754389bfb8065cdce6327c6f015a93b1c3d2ab20afe",
533
+ "installPandoc.sh": "1281030858e10259fba1a2553055594303ca126d71cf64a7e0809273dde55053",
534
+ "installSage.sh": "35846511b1d377a5a69a6143c17233b117ee415f0ecbbda93bdd63ec82b4593d"
535
535
  }
536
536
  }
Binary file
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pretext
3
- Version: 2.33.3.dev20251221064246
3
+ Version: 2.33.3.dev20251227064414
4
4
  Summary: A package to author, build, and deploy PreTeXt projects.
5
5
  Home-page: https://pretextbook.org
6
6
  License: GPL-3.0-or-later
@@ -1,11 +1,11 @@
1
- pretext/__init__.py,sha256=6_kEfcaeakXKF4bueg4vvdtm_lxMxt8LTLEijBXBEzc,1453
1
+ pretext/__init__.py,sha256=luvaeUyDmSp_csVF6fXwshfFGiM4FRZscktQ5tH0Yvc,1453
2
2
  pretext/__main__.py,sha256=MSmt_5Xg84uHqzTN38JwgseJK8rsJn_11A8WD99VtEo,61
3
3
  pretext/cli.py,sha256=VkDFWViY4Wa8aYdXC4rIHaAEq5-UUuVZR4Pw8mqp1f0,40546
4
4
  pretext/codechat.py,sha256=7FCz_TLf8yVSG5doGRvJ0rrpShZEejtlZ3ZyaWJrm9I,6305
5
5
  pretext/constants.py,sha256=cKxyUUy0SNX1M41CtJJtBpaHXTrKrZQPLrrbOJpCoU8,6843
6
6
  pretext/core/__init__.py,sha256=CmOXWPslsSiVzldc2UXNRug-xL8Ax601zGrp_3VhWxQ,739
7
7
  pretext/core/braille_format.py,sha256=ra1zVsyoUSUuGWCtY0VGF0FuEfHQ34oXtJvgKiiImdg,36377
8
- pretext/core/pretext.py,sha256=QT0j80YoBGDLOXGjUZsroqAoC9W5MoqcekFTOwaHsTk,272536
8
+ pretext/core/pretext.py,sha256=51GDW1ERfMZKfq3dMDod8__NWq1AUwlIw-Q4DYxfvl0,273225
9
9
  pretext/logger.py,sha256=b58izYIs9xEmVOXd3wvKpQ-AH1mRsGFG2FDjJM_MyOE,1456
10
10
  pretext/plastex/Alignment.jinja2s,sha256=AfFPeWxhTo6H6MDWogYTGylWfZed4BX5BgkWLCObBqI,409
11
11
  pretext/plastex/Arrays.jinja2s,sha256=MHWFbO7CoYzIRWwg5QH38dhrU20N5x7BxEnzuIQ0rfU,294
@@ -50,16 +50,16 @@ pretext/project/__init__.py,sha256=Q4Met0dWYgoIA-hma8xiJipbQU48zEeubQJ8-joXOqk,8
50
50
  pretext/project/generate.py,sha256=Qn79ap89dSHKYhFUw494nkMVCN4qJUQjZBnJOhAbyqQ,9158
51
51
  pretext/project/xml.py,sha256=wtaXS2isRG6QlfyfNNccAbFt6Izwm7yxAledwd1Q6AA,3456
52
52
  pretext/resources/__init__.py,sha256=1qPohIxCtL1_sUtlAoFrWzhl31l-oFj4RrBBsb3RzQQ,4081
53
- pretext/resources/core.zip,sha256=iTh24ejUhmZd4k4rHNJhIUIAzIzfoGjmVszEeHyOoeI,1758215
54
- pretext/resources/pelican.zip,sha256=OaWS3b-R6NAlZowKbuz4a-OoD2-PdLjumMD6EsrMgic,15974
55
- pretext/resources/resource_hash_table.json,sha256=qsCkCTRdm29_vt5yMooXZeLMSpMLalriCwjtq_bVmcU,39814
56
- pretext/resources/rs_cache.zip,sha256=Xz0xxyDlR6-8X17TInsBq3mKX1s-9TFYuG7qha37NFA,14934918
57
- pretext/resources/templates.zip,sha256=hNgpKO2GOfVv_ASeJeEPn88QZfOZWzMActQZfUM4ioA,375353
53
+ pretext/resources/core.zip,sha256=agbyIPw62W6lt7zjeW0q6r7GUe6GmhmiX0zHicsPZKI,1757887
54
+ pretext/resources/pelican.zip,sha256=0w1Gb59Pa2KNc352qDME4VxGdK6_x-URlUNzuJMOqUI,15974
55
+ pretext/resources/resource_hash_table.json,sha256=k2c_u_JjDndkVlWzi54gg8hhCht3ApykdtcC1OG0aw0,39814
56
+ pretext/resources/rs_cache.zip,sha256=SrmIWzNvuC4phGikSv0NxodtfqQeNOl9ERQ2S8TdBO0,14940790
57
+ pretext/resources/templates.zip,sha256=Oo_Fqwo_zCLxbtRlzto3j13tIl5zvi3ko9nJBksN3sc,375357
58
58
  pretext/server.py,sha256=B90NC6kevNeJNbwtUh3iVxF_BH5tiA4522XsjONsGSc,10800
59
59
  pretext/types.py,sha256=Eyyu6xmmCYnKBfvzBZzZMWZMa3yNjZ8NnGmlFGj9p5I,168
60
60
  pretext/utils.py,sha256=xAOsqcJo3Z6v3UlRbZeQN9nFWTNdhBpfUZ_BwqJFpio,45029
61
- pretext-2.33.3.dev20251221064246.dist-info/LICENSE,sha256=ixuiBLtpoK3iv89l7ylKkg9rs2GzF9ukPH7ynZYzK5s,35148
62
- pretext-2.33.3.dev20251221064246.dist-info/METADATA,sha256=ySWDkFWZ2bACS56rCcC-NVRpvHBSYlKwwolaXFYJvvM,11492
63
- pretext-2.33.3.dev20251221064246.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
64
- pretext-2.33.3.dev20251221064246.dist-info/entry_points.txt,sha256=L-rrQFUIWZhdOdu-XBQ9iuFK3X1cMVOtC-0I7T87II8,44
65
- pretext-2.33.3.dev20251221064246.dist-info/RECORD,,
61
+ pretext-2.33.3.dev20251227064414.dist-info/LICENSE,sha256=ixuiBLtpoK3iv89l7ylKkg9rs2GzF9ukPH7ynZYzK5s,35148
62
+ pretext-2.33.3.dev20251227064414.dist-info/METADATA,sha256=f2YBPAsyieHtRoKG_v6oQ6D2ApYqwy_v919_PTC9fYA,11492
63
+ pretext-2.33.3.dev20251227064414.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
64
+ pretext-2.33.3.dev20251227064414.dist-info/entry_points.txt,sha256=L-rrQFUIWZhdOdu-XBQ9iuFK3X1cMVOtC-0I7T87II8,44
65
+ pretext-2.33.3.dev20251227064414.dist-info/RECORD,,