Kaydet (Commit) 0e5318aa authored tarafından Andrea Gelmini's avatar Andrea Gelmini Kaydeden (comit) Noel Grandin

Script: better way to detect Windows

Change-Id: I0e99443f3715cde4414d14b2fa507ecab0995c6d
Reviewed-on: https://gerrit.libreoffice.org/18937Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
Tested-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst b78a2bc3
...@@ -23,6 +23,7 @@ import os ...@@ -23,6 +23,7 @@ import os
import imp import imp
import time import time
import ast import ast
import platform
try: try:
unicode unicode
...@@ -161,9 +162,9 @@ def readTextFromStream( inputStream ): ...@@ -161,9 +162,9 @@ def readTextFromStream( inputStream ):
return code.value return code.value
def toIniName( str ): def toIniName( str ):
# TODO: what is the official way to get to know whether i am on the windows platform ? if platform.system() == "Windows":
if( hasattr(sys , "dllhandle") ):
return str + ".ini" return str + ".ini"
else:
return str + "rc" return str + "rc"
...@@ -561,7 +562,7 @@ class ScriptBrowseNode( unohelper.Base, XBrowseNode , XPropertySet, XInvocation, ...@@ -561,7 +562,7 @@ class ScriptBrowseNode( unohelper.Base, XBrowseNode , XPropertySet, XInvocation,
# text = self.editor.getControl("EditorTextField").getText() # text = self.editor.getControl("EditorTextField").getText()
# log.debug("Would save: " + text) # log.debug("Would save: " + text)
except: except:
# TODO: add an error box here ! # TODO: add an error box here!
log.error( lastException2String() ) log.error( lastException2String() )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment