Insert Pics plugin

Plugins for SynWrite and CudaText...
main Alexey
Posts: 2323
Joined: 25.08.2021 18:15

Re: About Insert Pics plugins

Post by main Alexey »

msg_status(e) will not work, since 'e' is not a string.
msg_status(str(e)) must work.
also maybe add in the exception handler:

print('ERROR: '+str(e))
SamC
Posts: 208
Joined: 12.08.2023 00:49

Re: About Insert Pics plugins

Post by SamC »

The msg_status(e) is added because I want to know why Cuda crash. So after fix this, Cuda still crash.
Fortunately,as you metioned the path of Linux, I tried to not use absolute path with D:\ ,like below, and Cuda can works well:
doc.save('test.docx')
doc.save('..\test.docx')
Thus, it seem doc.save() can't use absolute path in windows in Cuda plugin.
For now, I can use relative path to avoid it.
main Alexey
Posts: 2323
Joined: 25.08.2021 18:15

Re: About Insert Pics plugins

Post by main Alexey »

Maybe before 'doc.save' you can call `os.chdir(path)` (change working directory)? then call 'doc.save' w/o the path?
SamC
Posts: 208
Joined: 12.08.2023 00:49

Re: About Insert Pics plugins

Post by SamC »

Will that affect other part of insert-pic plugin later? Do I need to change it back to cuda path after doc_save ?
main Alexey
Posts: 2323
Joined: 25.08.2021 18:15

Re: About Insert Pics plugins

Post by main Alexey »

no, since the plugin uses absolute paths.
but better - return the old current-dir.
main Alexey
Posts: 2323
Joined: 25.08.2021 18:15

Re: About Insert Pics plugins

Post by main Alexey »

I think now that adding DOCX-export to InsertPics is too much. this addition needs LXML and Python-docx libraries. on Linux it's easy to install (pip3) but not on Windows version. so let's keep DOCX-export as additional plugin, if possible.
SamC
Posts: 208
Joined: 12.08.2023 00:49

Re: About Insert Pics plugins

Post by SamC »

main Alexey wrote: 05.09.2023 08:24 Maybe before 'doc.save' you can call `os.chdir(path)` (change working directory)? then call 'doc.save' w/o the path?
It works, thanks!
SamC
Posts: 208
Joined: 12.08.2023 00:49

Re: Insert Pics plugin

Post by SamC »

Is it possible to make the inserted pictures always displayed at left rather than in the middle, to make the files look more compacted.
I suppose that maybe a key to assign this?
Thanks!
main Alexey
Posts: 2323
Joined: 25.08.2021 18:15

Re: Insert Pics plugin

Post by main Alexey »

currently no way to change it to the left. is it really needed, why? i want to avoid one more option.
SamC
Posts: 208
Joined: 12.08.2023 00:49

Re: Insert Pics plugin

Post by SamC »

If it's not supposed to be an option, That's OK! Not very important.
For my case, the text of each line is rather short and main for brief record, thus left justifying pictures would be more suitable for view.
Thanks~
Post Reply