Commit Graph

59 Commits

Author SHA1 Message Date
wpferguson
258def1cf8 Merge pull request #304 from wpferguson/logging_cleanup
Reduce the amount of trace information in log messages.
2020-12-24 09:55:24 -05:00
wpferguson
e51278f76e Merge branch 'master' into fix_check_if_bin_exists_and_executable_paths 2020-12-24 09:54:29 -05:00
wpferguson
9af60063d8 [dtutils.log] changed the amount of trace information based on log level.
script, caller, line number, msg were printed for all log
              levels, but changed to return less info except in log.debug
              log.error, and log.critical messages.  All messages print
              the script name except for log.screen.
2020-12-23 22:52:46 -05:00
wpferguson
96ba075e86 Removed debugging statement 2020-12-22 22:00:41 -05:00
Bill Ferguson
e86a3a3236 [file.lua] removed debugging statement 2020-12-18 11:08:12 -05:00
Bill Ferguson
b41b2a1566 [file.lua] Added create_tmp_file() back in. 2020-11-30 21:51:55 -05:00
Bill Ferguson
b893383353 [file.lua] Added comments for local functions. Added more API
documentation for check_if_bin_exists.  Added save
           executable path preference to _search_for_nix_bin()
           so that we can save a little time on subsequent runs
           once an executable is found.
2020-11-30 21:06:57 -05:00
Bill Ferguson
ddcf3ed3f4 [file.lua] fixed line trimming in macos search for bin 2020-11-29 18:41:32 -05:00
Bill Ferguson
da05748393 [file.lua] combined the is_ functions into file_test() which allows
testing to see if a path exists, is a dir, is a file, or
	   is executable.  Added case insensitive search to the
           windows search for bin.
2020-11-29 18:00:47 -05:00
Bill Ferguson
4ab20d8088 Removed official/yield.lua since it was only required for lua API 3.x and less (darktable 2.0 and before). Removed require from scripts that had included it. 2020-11-21 18:33:26 -05:00
Bill Ferguson
7790c9700b Separated check_if_bin_exists() into 2 functions, one to check the returned
executable_path variable and another to search for the binary if it
wasn't detected.  All results are checked to ensure they exist, are
a file, and are executable.  This fixes the situation where a directory
gets stored as an executable path. Search functions are operating system
specific.  Executable paths are saved for MacOS and Windows to make for
shorter searches in the future.
2020-08-02 18:33:49 -04:00
Bill Ferguson
1d5192a39c removed duplpicate copies of the is_ functions 2020-07-21 20:40:22 -04:00
Bill Ferguson
04525e1258 Added functions is_file(path), is_dir(path, and is_executable(path) to
ensure a path is a file, directory, or executable respectively.  Replaced
code in check_if_bin_exists with these functions to reduce the lines of code
and make it more understandable.
2020-07-21 16:39:34 -04:00
Tobias Scheck
87502fb17f move function to create temp files to dtutils/file.lua 2020-06-15 11:16:14 +02:00
Bill Ferguson
1c9042c496 Added a sanitize_lua function to the string library for sanitizing
strings of lua "magic" characters before using the string in a string
function that involves matching.

script_manager needs the path to the lua directory sanitized of lua
"magic" characters to prevent failure to extract the category and script
names.
2020-06-09 20:22:02 -04:00
Bill Ferguson
4c536b41bc checkpoint 2020-06-08 12:45:49 -04:00
U-DESKTOP-HQME86J\marco
635ea3f231 fix #229 2020-03-07 08:57:03 +01:00
August Schwerdfeger
51eda4e755 Made Windows- and POSIX-specific sanitization functions local; moved the 'sanitize' functions after the 'is_not_sanitized' functions that they call. 2020-01-21 22:17:12 -06:00
August Schwerdfeger
847c39749d Corrected escaping of command-line arguments in the 'sanitize' and 'is_not_sanitized' functions. 2020-01-21 00:29:18 -06:00
Bill Ferguson
5b977733b3 Rewrote sanitize and is_not_sanitized to handle strings with embedded operatings system quotes. Fixes #216. 2020-01-19 23:11:41 -05:00
Bill Ferguson
e427294ec1 fix library problems found during unit testing 2019-12-16 22:42:32 -05:00
wpferguson
b7857c8462 Revert "Library fixes" 2019-12-16 22:30:50 -05:00
Bill Ferguson
1c295a88ac Fixed bugs found during unit testing with testing framework 2019-12-11 22:55:44 -05:00
supertobi
0fe95e91d5 Merge pull request #185 from darktable-org/file.lua
file.lua copy for windows
2019-04-16 11:00:19 +02:00
supertobi
cadd98dc59 dtutils_file.file_copy: use the result 2019-04-16 10:58:32 +02:00
supertobi
d355095e16 file.lua copy for windows 2019-04-15 15:27:53 +02:00
supertobi
a81d992552 On Windows we don't need anything to open a file
On Windows we don't need any command to open a file. 
And "start" has problems with spaces in the filename, even if we put quoter around them:
https://stackoverflow.com/questions/13691827/opening-file-with-spaces-in-windows-via-command-prompt
2019-04-15 14:27:17 +02:00
Bill Ferguson
11881b3b73 removed sanitize_filename wrapper from path argument 2019-02-27 13:29:29 -05:00
Bill Ferguson
5ff36fe2ec Added a space after the commands and removed quotes in the command invocation. 2019-02-26 12:03:04 -05:00
Bill Ferguson
de087f743f Fixed compatibility issues. Added new version check to scripts. Renamed lib/dtutils/file/rm() to lib/dtutils/file/rmdir since removing a file in windows with rmdir /q/s results in an error. Fixed os.tmpname() issued in enfuse. Under windows os.tmpname() doesn't put the file in a temporary directory, so fixed it to use darktable.configuration.tmp_dir. Cleaned up documentation in lib/dtutils/system.lua. 2019-02-24 15:19:37 -05:00
Bill Ferguson
8f6a236eb6 Updated files 2019-02-21 23:49:52 -05:00
wpferguson
d9ce826b9d Merge pull request #157 from theres/dm_timelapse
Timelapse plugin based on ffmpeg
2019-02-21 11:57:03 -05:00
Bill Ferguson
245a7b59c4 Incorporated supertobi's comment about spacing. 2019-02-20 11:48:37 -05:00
Bill Ferguson
8b714edb67 Changed check_min_api_version() to print error messages and throw an error if the minimum api is not satisfied. Updated the scripts to reflect the changed check_min_api_version(). 2019-02-20 00:22:05 -05:00
Dominik Markiewicz
5555ee278e file lib: mkdir - handle existing directory case on Windows 2019-02-19 11:35:02 +01:00
Bill Ferguson
451c7fb956 Added check_min_api_function to dtutils.lua to check the minimum version of the lua API required for a script to run. This is intended to replace the API check done with darktable.configuration.check_version(), which requires changing each time the API version changes. check_min_api_version should work for all API version changes unless backward compatibility is broken. All the scripts using darktable.configuration.check_version() were changed to use check_min_api_version(). 2019-02-18 19:46:11 -05:00
theres
3675f4d7cd video ffmpeg - post review fixes
- rename OS_PATH_SEPARATOR -> PS and use in all needed places
- change function name from `open_file` to `launch_default_app`
- move `mkdir`, `rm` and `launch_default_app` helper functions to libs
- add executable_path_widget to export module if needed, not to the
preferences
- add show_status
- remove support_format
- change function name `format` to `format_string`, add comments
- replace apostrophes by quote marks
2019-01-27 22:43:47 +01:00
Bill Ferguson
8b5a43e435 Added require statement for official/yield.lua so that darktable.control.execute() would have all of it's requirements met without the user having to remember to add it somewhere else 2018-07-12 13:23:33 -04:00
Bill Ferguson
1a22bfbcef Added system library to handle running external commands on different operating systems in a transparent manner. Added file and path quoting that is cross platform compatible. Changed gimp.lua to use the new utilities. 2018-07-11 11:32:48 -04:00
Bill Ferguson
4b32c34ebd Removed 'open -W -a' for mac commands from check_if_bin_exists since it only appears to be needed for GUIs. Added 'open -W -a' for macs using GIMP in gimp.lua 2018-07-06 23:04:44 -04:00
Bill Ferguson
7acf2b9cac Fixed bug where log_level() always returned log.success instead of the correct log level 2018-05-15 01:22:09 -04:00
Bill Ferguson
f961e6aa6b Replaced dt_print_log = dt.print_error with dt.print_log now that the function exists 2018-05-14 20:30:09 -04:00
Bill Ferguson
5266aa7547 Used a less aggressive quoting strategy that works with check_if_bin_exists, check_if_file_exists, and io.popen(). 2018-03-16 12:16:45 -04:00
Bill Ferguson
1c587d3726 Changed wine test to check for .exe"$ or .EXE"$ because of quoting string paths 2018-03-10 13:45:04 -05:00
Bill Ferguson
b4ea97ce37 Fixed accidently wiped out check for macos 2018-03-10 13:38:17 -05:00
Bill Ferguson
83c1a5789a Changed wine check to operating system isn't windows 2018-03-10 13:07:19 -05:00
Bill Ferguson
841026661a Removed debugging statement 2018-03-10 12:56:18 -05:00
Bill Ferguson
692441e1d5 Added wine awareness for unix, linux, and macos. Added open -a -W to the macos path so that the path returned by the finder will work correctly. 2018-03-10 12:52:22 -05:00
supertobi
de18432a7d Merge pull request #112 from wpferguson/os_path_fix
Windows and macOS external executable compatibility
2018-03-05 14:13:29 +01:00
Bill Ferguson
c073ecf0dd Added check_os to lib/dtutils.lua so that scripts can check compatibility with the current operating system 2018-03-03 20:22:47 -05:00