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

View File

@ -237,5 +237,5 @@ def showPopup(title, message):
'''
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,
'compressed': True,
'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'],
'dll_excludes': ['msvcp90.dll'],
'dist_dir': '..\\bin',