#718: Permitir caracteres Unicode y mensajes de varias líneas en OGAgent para Windows.

git-svn-id: https://opengnsys.es/svn/branches/version1.1@5481 a21b9725-9963-47de-94b9-378ad31fedc9
remotes/github/oglive
ramon 2017-10-24 12:58:32 +00:00
parent e37d561c50
commit aac3fb9aab
3 changed files with 10 additions and 6 deletions

View File

@ -32,14 +32,13 @@
from __future__ import unicode_literals from __future__ import unicode_literals
import sys import sys
from PyQt4 import QtGui
from PyQt4 import QtCore
import time import time
import signal import signal
import json import json
import six import six
import atexit import atexit
from PyQt4 import QtGui
from PyQt4 import QtCore
from opengnsys import ipc from opengnsys import ipc
from opengnsys import utils from opengnsys import utils
@ -53,6 +52,11 @@ from opengnsys import VERSION
from opengnsys.config import readConfig from opengnsys.config import readConfig
from opengnsys.loader import loadModules from opengnsys.loader import loadModules
# Set default characters encoding to UTF-8
reload(sys)
if hasattr(sys, 'setdefaultencoding'):
sys.setdefaultencoding('utf-8')
trayIcon = None trayIcon = None
def sigAtExit(): def sigAtExit():
@ -309,7 +313,7 @@ class OGASystemTray(QtGui.QSystemTrayIcon):
self.cleanup() self.cleanup()
self.app.quit() self.app.quit()
def closeEvent(self,event): def closeEvent(self, event):
logger.debug("Exec closeEvent") logger.debug("Exec closeEvent")
event.accept() event.accept()
self.quit() self.quit()

View File

@ -237,5 +237,5 @@ def showPopup(title, message):
''' '''
Displays a message box on user's session (during 1 min). Displays a message box on user's session (during 1 min).
''' '''
return subprocess.call('mshta "javascript:var sh=new ActiveXObject(\'WScript.Shell\'); sh.Popup( \'{}\', 60, \'{}\', 64); close()"'.format(message, title), shell=True) return subprocess.call('mshta "javascript:var sh=new ActiveXObject(\'WScript.Shell\'); sh.Popup( \'{}\', 60, \'{}\', 64); close()"'.format(message.encode('unicode_escape'), title.encode('unicode_escape')), shell=True)

View File

@ -121,7 +121,7 @@ setup(
'bundle_files': 3, 'bundle_files': 3,
'compressed': True, 'compressed': True,
'optimize': 2, 'optimize': 2,
'includes': ['sip', 'PyQt4', 'win32com.shell', 'requests'] + HIDDEN_BY_SIX, 'includes': ['sip', 'PyQt4', 'win32com.shell', 'requests', 'encodings', 'encodings.utf_8'] + HIDDEN_BY_SIX,
'excludes': ['doctest', 'unittest'], 'excludes': ['doctest', 'unittest'],
'dll_excludes': ['msvcp90.dll'], 'dll_excludes': ['msvcp90.dll'],
'dist_dir': '..\\bin', 'dist_dir': '..\\bin',