commonsmachinery / lo-paste-with-credit

GNU General Public License v2.0
1 stars 2 forks source link

Python exception while installing #4

Closed vmiklos closed 10 years ago

vmiklos commented 10 years ago

Hi,

Sorry can't be more specific: when I install the OXT, I get:

$ unopkg add paste_with_credit.oxt 
ERROR: <type 'exceptions.ImportError'>: No module named libcredit, traceback follows
  /usr/lib64/libreoffice/program/uno.py:269 in function _uno_import() [return _g_delegatee( name, *optargs, **kwargs )]
  /home/vmiklos/.config/libreoffice/4-suse/user/uno_packages/cache/uno_packages/lund4oc4.tmp_/paste_with_credit.oxt/cm-paste.py:12 in function <module>() [import libcredit]
  /usr/lib64/libreoffice/program/pythonloader.py:103 in function getModuleFromUrl() [exec(codeobject, mod.__dict__)]
  /usr/lib64/libreoffice/program/pythonloader.py:149 in function writeRegistryInfo() [mod = self.getModuleFromUrl( locationUrl )]

unopkg failed.

This is with lo-paste-with-credit from git (commit 1004317498274b182c024229dafcdd9f19bd91e2) and stock LibreOffice that comes with openSUSE 13.1, up to date as of today (4.1.5.3).

Any ideas? :-)

Thanks,

Miklos

vmiklos commented 10 years ago

Ah, missing libcredit, that's because I built the OXT myself. With the stock OXT from git (which has pythonpath), I get instead:

$ unopkg add paste_with_credit.oxt
ERROR: <type 'exceptions.ImportError'>: No module named parse (or 'urllib.parse.urlparse' is unknown), traceback follows
  /usr/lib64/libreoffice/program/uno.py:339 in function _uno_import() [raise uno_import_exc]
  /home/vmiklos/.config/libreoffice/4-suse/user/uno_packages/cache/uno_packages/lundaq8g.tmp_/paste_with_credit.oxt/pythonpath/rdflib/term.py:46 in function <module>() [from urllib.parse import urlparse, urljoin, urldefrag]
  /usr/lib64/libreoffice/program/uno.py:269 in function _uno_import() [return _g_delegatee( name, *optargs, **kwargs )]
  /home/vmiklos/.config/libreoffice/4-suse/user/uno_packages/cache/uno_packages/lundaq8g.tmp_/paste_with_credit.oxt/pythonpath/rdflib/__init__.py:108 in function <module>() [from rdflib.term import (]
  /usr/lib64/libreoffice/program/uno.py:269 in function _uno_import() [return _g_delegatee( name, *optargs, **kwargs )]
  /home/vmiklos/.config/libreoffice/4-suse/user/uno_packages/cache/uno_packages/lundaq8g.tmp_/paste_with_credit.oxt/pythonpath/libcredit.py:14 in function <module>() [import rdflib]
  /usr/lib64/libreoffice/program/uno.py:269 in function _uno_import() [return _g_delegatee( name, *optargs, **kwargs )]
  /home/vmiklos/.config/libreoffice/4-suse/user/uno_packages/cache/uno_packages/lundaq8g.tmp_/paste_with_credit.oxt/cm-paste.py:12 in function <module>() [import libcredit]
  /usr/lib64/libreoffice/program/pythonloader.py:103 in function getModuleFromUrl() [exec(codeobject, mod.__dict__)]
  /usr/lib64/libreoffice/program/pythonloader.py:149 in function writeRegistryInfo() [mod = self.getModuleFromUrl( locationUrl )]
artfwo commented 10 years ago

@vmiklos please try the current oxt from master. Previous build contained a slightly broken version of rdflib which had issues with some LibreOffice/Python versions.

vmiklos commented 10 years ago

@artfwo Thanks! That helped. Actually first I got:

$ unopkg add paste_with_credit.oxt

ERROR: unsatisfied dependencies
       Cause: unsatisfied dependencies

unopkg failed.

And I had to apply this diff:

$ git diff
diff --git a/description.xml b/description.xml
index d5eba35..899883c 100644
--- a/description.xml
+++ b/description.xml
@@ -7,7 +7,6 @@
   <identifier value="se.commonsmachinery.extensions.paste_with_credit"/>
   <platform value="all"/>
   <dependencies>
-    <OpenOffice.org-minimal-version value="3.5" d:name="OpenOffice.org 3.5"/>
     <l:LibreOffice-minimal-version value="3.5" d:name="LibreOffice 3.5"/>
   </dependencies>
   <display-name>

To allow installation on LibreOffice 4.1. Seems multiple entries represent an AND relation, and while LO meets the second requirement, not the first one. Though there were no OOo 3.5 (they released 4.0 after 3.4), so maybe it makes sense to just apply the patch, it's up to you. :-)

What's more interesting: now the extension works perfectly in case of Writer, however for Impress the "Paste with credit" button on the boolbar just pastes the image, without credits. Is that expected? Or should I open a separate issue about that?

Thanks,

Miklos

petli commented 10 years ago

Thanks Miklos, we stumbled on that dependency issue too. :) Since we found some additional python 2-vs-3 issues Artem is trying to fix them too.

The Impress behaviour is indeed expected, but I see the README makes no mention of it - sorry about that. Try Insert -> Credit after pasting the image. The idea is that in a typical presentation you wouldn't want the credit in the slide with the image, but rather on a separate slide at the end.

vmiklos commented 10 years ago

Aha, that works. Thanks! :-)