Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

lua require statement & penlight

New Here ,
Jan 31, 2015 Jan 31, 2015

Hello community,

I have written direct with lua some code and here I'm using the penlight library with several classes.

stevedonovan/Penlight · GitHub

This library is based in a Sub Directory structure and can be loaded with code like

require ('pl.pretty)     OR

local pretty = require ('pl.pretty');

Usage:

pretty.dump(list);

The "pl" is like a package and the lua script is loaded from the Sub Directory.

If I use this library in my lightroom plugin I will get some error

"error loading toolkit script could not load"

In the PDF from SDK there are some informations, that "require" is not the original lua implementation. This is a overriden function.

Has somebody any idea, how to use the penlight library. How can I load this library.

Thanks

TOPICS
SDK
885
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Jan 31, 2015 Jan 31, 2015

I don't recall anyone posting here about Penlight.  Over the years, people have alluded to the difficulties of using Lua libraries not written for the Lightroom environment.

So I think you'll have to debug this yourself. I suggest starting with the section "Using built-in Lua features" on page 19 of the Lightroom SDK 5 Programmer's Guide, which lists the restrictions LR places on its use of Lua 5.1.4.  (It appears that Penlight claims to support 5.1, but who knows.)

If what you want primarily is p

...
Translate
LEGEND ,
Jan 31, 2015 Jan 31, 2015

I don't recall anyone posting here about Penlight.  Over the years, people have alluded to the difficulties of using Lua libraries not written for the Lightroom environment.

So I think you'll have to debug this yourself. I suggest starting with the section "Using built-in Lua features" on page 19 of the Lightroom SDK 5 Programmer's Guide, which lists the restrictions LR places on its use of Lua 5.1.4.  (It appears that Penlight claims to support 5.1, but who knows.)

If what you want primarily is pretty printing of Lua data structures, you could use my Debugging Toolkit for Lightroom SDK.  The toolkit is much more limited in scope than Penlight, but it's implemented specifically for LR.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 13, 2015 Feb 13, 2015
LATEST

Thanks.

OK I see the problem. And the penlight is using unsupported methods.

So I have to write my own classes.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines