[Qgis-user] qgscodeeditorhtml (used in lizmap plugin) missing in ubuntu trusty qgis 2.14.3 package

Daniel Vicente Lühr Sierra dluhr at ieee.org
Wed Jun 29 07:21:21 PDT 2016


In case anyone is interested, I have made some few tests (with success) 
adding a fallback line into qgis.gui.__init__.py:

try:
     from qgis._gui import QgsCodeEditor
except:
     from CodeEditorPatch import *

CodeEditorPatch is a "pure-python" module which mimics the CodeEditor 
class (and derivatives) implementation as much as possible (there are 
two workarounds for some event handling issues which I haven't been able 
incorporate without errors, and there is some code regarding case 
sensitivity for the SQL editor, which apparently is not possible/needed 
to implement in python).

I think this patch is appealing, because it will provide a (temporal) 
centralized solution, without having to modify each plugin which decides 
to use these classes. Also, it will target two active ubuntu LTRs (12.04 
and 14.04) plus some debian and mint versions.

The moment the missing sip files in qscintilla issue is fixed, this 
patch can be removed.

If someone is interested in the module I can share the code, or I guess 
I could make a pull-request if some people think it is a good idea.

Regards,

El 24/06/16 a las 20:22, Daniel Vicente Lühr Sierra escribió:
>
> Hi,
>
>
> El 24/06/16 a las 18:35, Jürgen E. Fischer escribió:
>> Hi Daniel,
>>
>> On Fri, 24. Jun 2016 at 18:03:01 -0400, Daniel Vicente Lühr Sierra wrote:
>>> I noticed that the qgscodeeditor python class is not available in (my
>>> installation of) trusty's qgis-2.14.3 packages (from repository with
>>> ubuntugis dependencies), but it is available in xenial's qgis-2.14.3
>>> (from repository without ubuntugis dependencies).
>> That's because of missing qsci sip files in trusty.  See #12011[0]
> Missed this one.
>> db_manager uses a workaround that could probably be adapted for
>> the lizmap plugin too.
> I found it too, and I was testing some alternative. I was able to call 
> the Scintilla editor directly in python and set it up for HTML syntax 
> (2 lines of code). Could it be a fallback for the PyQgis API, when the 
> c++ signatures fail? Because, even though the sip files  might not be 
> present, the python scintilla class is available, and it could work 
> for all QgsCodeEditor derived classes.
>
> Thanks.
>> Jürgen
>>
>>
>> [0]http://hub.qgis.org/issues/12011
>>
>>
>>
>> _______________________________________________
>> Qgis-user mailing list
>> Qgis-user at lists.osgeo.org
>> List info:http://lists.osgeo.org/mailman/listinfo/qgis-user
>> Unsubscribe:http://lists.osgeo.org/mailman/listinfo/qgis-user
>
> -- 
> Daniel Vicente Lühr Sierra
> IEEE Member
> IEEE Student Branch Counselor - Universidad Austral de Chile
>

-- 
Daniel Vicente Lühr Sierra
IEEE Member
IEEE UACh Student Branch Counselor

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20160629/f5444bc8/attachment.html>


More information about the Qgis-user mailing list