<div dir="ltr"><div><div>Hi everyone,<br><br></div>I recently sent an e-mail here about JSON string variables messing up my globals in QGIS 2.18. Today I experienced another bug (?) - very simple global variable just does not get loaded. The code is:<br><br></div><div>    # Inside SocketIO worker class:<br><br></div><div>    def get_srid(self):<br></div>        # socket request to the server, returning EPSG code as integer<br><div>        self.emit('srid', {}, lambda data: self.assign_srid(data))<br><br>    def assign_srid(self, data):<br>        QgsExpressionContextUtils.setGlobalVariable('srid', str(data))<br>        QgsMessageLog.logMessage('Assigned SRID: %d' % data , 'myPlugin')<br><br></div><div>The result of calling get_srid() is correct "Assigned SRID: 4326" in Log Messages Panel, but in Properties the variable "SRID" is still empty. Sometimes it works though, after some random number of tries. It also worked after I purged ~/.config/QGIS/QGIS2.conf file, but it'll possibly happen again.<br><br></div><div>Is there anything I have to take special care of? <br></div><div><br></div><div><br><div><div>Best regards<br clear="all"></div><div><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><b><font color="#333333">Adam Borczyk</font></b></div></div></div></div></div></div></div></div></div></div></div></div>
</div></div></div></div>