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

sento_silhouette: logfile param defaults to /tmp/inkscape-silhouette.log #249

Merged
merged 8 commits into from
Aug 26, 2023

Conversation

mofosyne
Copy link
Contributor

Still trying to understand how inx works, but I think this would be how to add /tmp/inkscape-silhouette.log as the default logfile path.

This consistency if correct would make bug filing easier for newbies.

@t0b3
Copy link
Collaborator

t0b3 commented Aug 13, 2023

INX value works like this. 👍
Can you test if this default value works for Win and Mac?

@mofosyne
Copy link
Contributor Author

mofosyne commented Aug 13, 2023

Don't have windows or mac, but did some digging and this seems like the best approach.

Added a function called get_default_logfile_path() to auto create a logfile path if non is given.


image

~$ cat /tmp/inkscape-silhouette.log 
Inkscape 1.3 (1:1.3+202307231459+0e150ed6c4)
Inkex: 1.3.0
Inkscape-Silhouette: 1.28
Path: /usr/share/inkscape/extensions/sendto_silhouette.py
Python: /usr/bin/python3
Version: 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0]
Platform: linux
Arguments: sendto_silhouette.py --active-tab=logdump --x_off=0.00 --y_off=0.00 --cuttingmat=cameo_12x12 --toolholder=1 --tool=default --media=300 --speed=0 --pressure=0 --depth=-1 --preview=true --dashes=false --autocrop=false --bbox-only=false --multipass=1 --reversetoggle=false --endposition=start --end_offset=0.0 --regmark=false --regsearch=true --regwidth=190.0 --reglength=277.0 --regoriginx=10.0 --regoriginy=10.0 --wait_done=false --sharpencorners=false --sharpencorners_start=0.1 --sharpencorners_end=0.1 --overcut=0.5 --strategy=zorder --orient_paths=natural --fuse_paths=true --sw_clipping=true --create_log=true --log_paths=false --append_logs=false --inc_queries=false --dry_run=false --force_hardware=DETECT --bladediameter=0.9 /tmp/ink_ext_XXXXXX.svgG3SA91
Preview aborted.
 done. 0 min 0 sec

@mofosyne
Copy link
Contributor Author

This is ready, just needs merging

Copy link
Collaborator

@t0b3 t0b3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks elegant and seems to work on any platforms.

can you ensure it works on different platforms by introducing some kind of test?
i.e. check for self.default_logfile_path and assert you can write a file to this path by appending another test?

sendto_silhouette.py Outdated Show resolved Hide resolved
sendto_silhouette.py Outdated Show resolved Hide resolved
sendto_silhouette.py Outdated Show resolved Hide resolved
@t0b3 t0b3 merged commit 91897cc into fablabnbg:main Aug 26, 2023
8 checks passed
@mofosyne mofosyne deleted the logfile_default branch August 26, 2023 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants