Bugzilla – Attachment 79052 Details for
Bug 63230
Calc: Date decreased by 1 depending on Timezone
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Script which looks for similar bug
tztest.py (text/x-python), 2.29 KB, created by
Isamu Mogi
on 2013-05-09 13:14:40 UTC
(
hide
)
Description:
Script which looks for similar bug
Filename:
MIME Type:
Creator:
Isamu Mogi
Created:
2013-05-09 13:14:40 UTC
Size:
2.29 KB
patch
obsolete
># -*- coding: utf-8 -*- > >import uno >import unohelper >import atexit >import os >import signal >import datetime > >from time import sleep >from subprocess import Popen >from com.sun.star.script.provider import XScriptContext >from com.sun.star.connection import NoConnectException >from com.sun.star.util import Date >from com.sun.star.beans import PropertyValue > >pipeName = "pythonpipe" >acceptArg = "--accept=pipe,name=%s;urp;StarOffice.ServiceManager" % pipeName >url = "uno:pipe,name=%s;urp;StarOffice.ComponentContext" % pipeName >officePath = "soffice" >process = Popen([officePath, "--nologo", "--headless", > acceptArg]) > >ctx = None >for i in range(5): > try: > localctx = uno.getComponentContext() > resolver = localctx.getServiceManager().createInstanceWithContext( > "com.sun.star.bridge.UnoUrlResolver", localctx) > ctx = resolver.resolve(url) > except NoConnectException: > sleep(1) > if ctx: > break > >desktop = ctx.getServiceManager().createInstanceWithContext("com.sun.star.frame.Desktop", ctx) >loadArg = PropertyValue() >loadArg.Name = "Hidden" >loadArg.Value = True >document = desktop.loadComponentFromURL("private:factory/scalc", "_blank", 0, (loadArg,)); >frame = document.CurrentController.Frame >dispatchHelper = ctx.getServiceManager().createInstance('com.sun.star.frame.DispatchHelper') >cell = document.CurrentController.ActiveSheet.getCellByPosition(0, 0) > >goToCellArg = PropertyValue() >goToCellArg.Name = "ToPoint" >goToCellArg.Value = "$A$1" >dispatchHelper.executeDispatch(frame, ".uno:GoToCell", "", 0, (goToCellArg,)) > >baseDate = datetime.date(1800, 1, 1) >numErrors = 0 >for i in range(365 * 300): > date = baseDate + datetime.timedelta(days = i) > dateString = date.isoformat() > enterStringArg = PropertyValue() > enterStringArg.Name = "StringName" > enterStringArg.Value = dateString > dispatchHelper.executeDispatch(frame, ".uno:EnterString", "", 0, (enterStringArg,)) > result = "" + cell.String > if dateString != result: > numErrors += 1 > if numErrors > 100: > break > print '"' + os.environ["TZ"] + '","' + dateString + '","' + result + '"' > >try: > document.dispose() >except Exception: # __main__.DisposeException > None > >try: > desktop.terminate() >except Exception: # __main__.DisposeException > None >process.terminate()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 63230
:
79051
|
79052
|
99582
|
100184