Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use semicolon as file path separator for lua_load #2154

Merged
merged 4 commits into from
Feb 20, 2025

Conversation

Caellian
Copy link
Collaborator

@Caellian Caellian commented Feb 3, 2025

lua_load config option previously expected space separated list of file names, it can now handle names with spaces if ';' delimiter is used.

to_real_path now properly handles names with spaces as well.

Moved call to llua_load from lua_load code to initialisation so that lua state gets loaded right before any config variables are handled (simplifies global state init).

Improved performance a tiny bit where practical.

Testing

  • Added functionality
  • Previous behavior still works
  • Reloading (does llua_load get called multiple times?)
    • It does, did lua_load get called multiple times previously?
      • It was.

@github-actions github-actions bot added documentation suggests documentation changes or improvements sources PR modifies project sources lua related to Lua integration in conky labels Feb 3, 2025
Copy link

netlify bot commented Feb 3, 2025

Deploy Preview for conkyweb ready!

Name Link
🔨 Latest commit 382b2cf
🔍 Latest deploy log https://app.netlify.com/sites/conkyweb/deploys/67b7b45505ade400085f5395
😎 Deploy Preview https://deploy-preview-2154--conkyweb.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Caellian Caellian added enhancement suggests alteration of existing functionality to better support different use cases documentation suggests documentation changes or improvements sources PR modifies project sources and removed documentation suggests documentation changes or improvements sources PR modifies project sources labels Feb 3, 2025
@Caellian Caellian requested a review from brndnmtthws February 3, 2025 03:22
@Caellian Caellian force-pushed the fix/lua-load-separator branch from d52a0fd to f9a3134 Compare February 3, 2025 03:23
Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
@Caellian Caellian force-pushed the fix/lua-load-separator branch from f9a3134 to 5b95330 Compare February 3, 2025 03:25
- Move llua_init to initialisation(), to ensure lua state is initialized
  before dealing with config file. This means that it's effectively static for
  all contexts which need to rely on lua state - and doesn't need to be
  checked everywhere.
- Move package.path setup to llua_init so globals all get set from the
  same place.
- Handle paths with spaces correctly in to_real_path by wrapping them
  with double quotes.
- Testing:
  - that old space delimiter still works.
  - new semicolon delimiter works.
  - empty file names are ignored.

Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
@Caellian Caellian merged commit 97b4ec7 into main Feb 20, 2025
30 checks passed
@Caellian Caellian deleted the fix/lua-load-separator branch February 20, 2025 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation suggests documentation changes or improvements enhancement suggests alteration of existing functionality to better support different use cases lua related to Lua integration in conky sources PR modifies project sources
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants