Page 2 of 3
Re: About Insert Pics plugins
Posted: 05.09.2023 07:32
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))
Re: About Insert Pics plugins
Posted: 05.09.2023 08:09
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.
Re: About Insert Pics plugins
Posted: 05.09.2023 08:24
by main Alexey
Maybe before 'doc.save' you can call `os.chdir(path)` (change working directory)? then call 'doc.save' w/o the path?
Re: About Insert Pics plugins
Posted: 05.09.2023 08:28
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 ?
Re: About Insert Pics plugins
Posted: 05.09.2023 08:28
by main Alexey
no, since the plugin uses absolute paths.
but better - return the old current-dir.
Re: About Insert Pics plugins
Posted: 05.09.2023 09:37
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.
Re: About Insert Pics plugins
Posted: 06.09.2023 00:14
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!
Re: Insert Pics plugin
Posted: 07.09.2023 04:03
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!
Re: Insert Pics plugin
Posted: 07.09.2023 04:31
by main Alexey
currently no way to change it to the left. is it really needed, why? i want to avoid one more option.
Re: Insert Pics plugin
Posted: 08.09.2023 00:16
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~