summaryrefslogtreecommitdiff
path: root/macros/luatex/latex/pyluatex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-03-17 03:00:46 +0000
committerNorbert Preining <norbert@preining.info>2022-03-17 03:00:46 +0000
commit8208f204439f3a899e43187857e3f9c86d4ebb7c (patch)
tree70c940f6d7a58f7878aeef16a87a1af85f6f3f69 /macros/luatex/latex/pyluatex
parent725ce6a3e602c7516d471df841ea433b8c5bcd9d (diff)
CTAN sync 202203170300
Diffstat (limited to 'macros/luatex/latex/pyluatex')
-rw-r--r--macros/luatex/latex/pyluatex/pyluatex-interpreter.py4
-rw-r--r--macros/luatex/latex/pyluatex/pyluatex.lua20
-rw-r--r--macros/luatex/latex/pyluatex/pyluatex.pdfbin81863 -> 81863 bytes
-rw-r--r--macros/luatex/latex/pyluatex/pyluatex.sty2
-rw-r--r--macros/luatex/latex/pyluatex/pyluatex.tex2
5 files changed, 13 insertions, 15 deletions
diff --git a/macros/luatex/latex/pyluatex/pyluatex-interpreter.py b/macros/luatex/latex/pyluatex/pyluatex-interpreter.py
index 77d09bbb64..5a21e6d0f0 100644
--- a/macros/luatex/latex/pyluatex/pyluatex-interpreter.py
+++ b/macros/luatex/latex/pyluatex/pyluatex-interpreter.py
@@ -107,9 +107,7 @@ class Handler(socketserver.StreamRequestHandler):
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
diff --git a/macros/luatex/latex/pyluatex/pyluatex.lua b/macros/luatex/latex/pyluatex/pyluatex.lua
index 0b785239da..efa80c75f4 100644
--- a/macros/luatex/latex/pyluatex/pyluatex.lua
+++ b/macros/luatex/latex/pyluatex/pyluatex.lua
@@ -45,16 +45,16 @@ local env_repl_mode = false
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 @@ function pyluatex.start(executable, local_imports)
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
diff --git a/macros/luatex/latex/pyluatex/pyluatex.pdf b/macros/luatex/latex/pyluatex/pyluatex.pdf
index 62127e2871..82ff4f85bf 100644
--- a/macros/luatex/latex/pyluatex/pyluatex.pdf
+++ b/macros/luatex/latex/pyluatex/pyluatex.pdf
Binary files differ
diff --git a/macros/luatex/latex/pyluatex/pyluatex.sty b/macros/luatex/latex/pyluatex/pyluatex.sty
index 3413dba4c3..4d8325c807 100644
--- a/macros/luatex/latex/pyluatex/pyluatex.sty
+++ b/macros/luatex/latex/pyluatex/pyluatex.sty
@@ -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
diff --git a/macros/luatex/latex/pyluatex/pyluatex.tex b/macros/luatex/latex/pyluatex/pyluatex.tex
index eeff387c21..c4a10738ac 100644
--- a/macros/luatex/latex/pyluatex/pyluatex.tex
+++ b/macros/luatex/latex/pyluatex/pyluatex.tex
@@ -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