texlive[62766] branches/branch2021.final/Master/texmf-dist: pyluatex

commits+karl at tug.org commits+karl at tug.org
Thu Mar 17 21:29:52 CET 2022


Revision: 62766
          http://tug.org/svn/texlive?view=revision&revision=62766
Author:   karl
Date:     2022-03-17 21:29:51 +0100 (Thu, 17 Mar 2022)
Log Message:
-----------
pyluatex (17mar22) (branch)

Modified Paths:
--------------
    branches/branch2021.final/Master/texmf-dist/doc/lualatex/pyluatex/pyluatex.pdf
    branches/branch2021.final/Master/texmf-dist/doc/lualatex/pyluatex/pyluatex.tex
    branches/branch2021.final/Master/texmf-dist/tex/lualatex/pyluatex/pyluatex-interpreter.py
    branches/branch2021.final/Master/texmf-dist/tex/lualatex/pyluatex/pyluatex.lua
    branches/branch2021.final/Master/texmf-dist/tex/lualatex/pyluatex/pyluatex.sty

Modified: branches/branch2021.final/Master/texmf-dist/doc/lualatex/pyluatex/pyluatex.pdf
===================================================================
(Binary files differ)

Modified: branches/branch2021.final/Master/texmf-dist/doc/lualatex/pyluatex/pyluatex.tex
===================================================================
--- branches/branch2021.final/Master/texmf-dist/doc/lualatex/pyluatex/pyluatex.tex	2022-03-17 20:29:38 UTC (rev 62765)
+++ branches/branch2021.final/Master/texmf-dist/doc/lualatex/pyluatex/pyluatex.tex	2022-03-17 20:29:51 UTC (rev 62766)
@@ -15,7 +15,7 @@
 \usepackage{url}
 \title{The \emph{pyluatex} package}
 \author{Tobias Enderle\\\url{https://github.com/tndrle/PyLuaTeX}}
-\date{v0.4.3 (2022/03/10)}
+\date{v0.4.4 (2022/03/16)}
 \begin{document}
 \maketitle
 \raggedright

Modified: branches/branch2021.final/Master/texmf-dist/tex/lualatex/pyluatex/pyluatex-interpreter.py
===================================================================
--- branches/branch2021.final/Master/texmf-dist/tex/lualatex/pyluatex/pyluatex-interpreter.py	2022-03-17 20:29:38 UTC (rev 62765)
+++ branches/branch2021.final/Master/texmf-dist/tex/lualatex/pyluatex/pyluatex-interpreter.py	2022-03-17 20:29:51 UTC (rev 62766)
@@ -107,9 +107,7 @@
 
 if __name__ == '__main__':
     try:
-        tex_file = sys.argv[1]
-        tex_file_folder = os.path.normpath(os.path.dirname(tex_file))
-        sys.path.insert(0, tex_file_folder)
+        sys.path.insert(0, os.path.normpath(sys.argv[1]))
     except:
         pass
 

Modified: branches/branch2021.final/Master/texmf-dist/tex/lualatex/pyluatex/pyluatex.lua
===================================================================
--- branches/branch2021.final/Master/texmf-dist/tex/lualatex/pyluatex/pyluatex.lua	2022-03-17 20:29:38 UTC (rev 62765)
+++ branches/branch2021.final/Master/texmf-dist/tex/lualatex/pyluatex/pyluatex.lua	2022-03-17 20:29:51 UTC (rev 62766)
@@ -45,16 +45,16 @@
 local last_code = nil
 local last_output = nil
 
-local function get_tex_file()
+local function get_tex_file_folder()
     for k, v in ipairs(arg) do
         if not v:find("^%-") then
-            local path = lfs.currentdir() .. dir_sep .. v
-            if lfs.attributes(path, "mode") == "file" then
-                return path
+            local path = file.collapsepath(v, true)
+            if lfs.isfile(path) then
+                return file.pathpart(path)
             else
-                path = path .. ".tex"
-                if lfs.attributes(path, "mode") == "file" then
-                    return path
+                path = file.addsuffix(path, "tex")
+                if lfs.isfile(path) then
+                    return file.pathpart(path)
                 end
             end
         end
@@ -76,9 +76,9 @@
 
     local cmd = ""
     if local_imports then
-        local tex_file = get_tex_file()
-        if tex_file ~= nil then
-            cmd = " \"" .. tex_file .. "\""
+        local tex_file_folder = get_tex_file_folder()
+        if tex_file_folder ~= nil then
+            cmd = " \"" .. tex_file_folder .. "\""
         end
     end
     cmd = executable .. " \"" .. script .. "\"" .. cmd

Modified: branches/branch2021.final/Master/texmf-dist/tex/lualatex/pyluatex/pyluatex.sty
===================================================================
--- branches/branch2021.final/Master/texmf-dist/tex/lualatex/pyluatex/pyluatex.sty	2022-03-17 20:29:38 UTC (rev 62765)
+++ branches/branch2021.final/Master/texmf-dist/tex/lualatex/pyluatex/pyluatex.sty	2022-03-17 20:29:51 UTC (rev 62766)
@@ -9,7 +9,7 @@
 %% version 2005/12/01 or later.
 
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{pyluatex}[2022/03/10 v0.4.3 Execute Python code on the fly]
+\ProvidesPackage{pyluatex}[2022/03/16 v0.4.4 Execute Python code on the fly]
 
 \RequirePackage{expl3}
 \ExplSyntaxOn



More information about the tex-live-commits mailing list.