I installed ODEV in a Virtual Environment as per the docs.
Class Calc — OOO Development Tools 0.7.0 documentation shows Return type: XSpreadsheetDocument
. How can I get the Return type
succinctly from python?
Microsoft Windows [Version 10.0.19044.2251]
(c) Microsoft Corporation. All rights reserved.
E:\SOURCE\repos\python_ooo_dev_tools\.venv\Scripts>activate
(.venv) E:\SOURCE\repos\python_ooo_dev_tools\.venv\Scripts>cd ..\..
(.venv) E:\SOURCE\repos\python_ooo_dev_tools>python
Python 3.8.15 (default, Nov 18 2022, 00:40:36) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> from ooodev.utils.lo import Lo
>>> loader = Lo.load_office(Lo.ConnectSocket(headless=True))
>>>
>>> from ooodev.office.calc import Calc
>>> wb = Calc.create_doc()
>>>
>>> type(wb)
<class 'pyuno'>
>>>
>>> wb
pyuno object (com.sun.star.sheet.XSpreadsheetDocument)0x210c4347578{implementationName=ScModelObj, supportedServices={com.sun.star.sheet.SpreadsheetDocument,com.sun.star.sheet.SpreadsheetDocumentSettings,com.sun.star.document.OfficeDocument}, supportedInterfaces={com.sun.star.container.XChild,com.sun.star.document.XDocumentPropertiesSupplier,com.sun.star.document.XCmisDocument,com.sun.star.rdf.XDocumentMetadataAccess,com.sun.star.document.XDocumentRecovery,com.sun.star.document.XUndoManagerSupplier,com.sun.star.document.XShapeEventBroadcaster,com.sun.star.document.XDocumentEventBroadcaster,com.sun.star.lang.XEventListener,com.sun.star.document.XEventsSupplier,com.sun.star.document.XEmbeddedScripts,com.sun.star.document.XScriptInvocationContext,com.sun.star.frame.XModel3,com.sun.star.util.XModifiable2,com.sun.star.view.XPrintable,com.sun.star.view.XPrintJobBroadcaster,com.sun.star.frame.XStorable2,com.sun.star.frame.XLoadable,com.sun.star.script.XStarBasicAccess,com.sun.star.document.XViewDataSupplier,com.sun.star.util.XCloseable,com.sun.star.datatransfer.XTransferable,com.sun.star.document.XDocumentSubStorageSupplier,com.sun.star.document.XStorageBasedDocument,com.sun.star.script.provider.XScriptProviderSupplier,com.sun.star.ui.XUIConfigurationManagerSupplier,com.sun.star.embed.XVisualObject,com.sun.star.lang.XUnoTunnel,com.sun.star.frame.XModule,com.sun.star.frame.XTitle,com.sun.star.frame.XTitleChangeBroadcaster,com.sun.star.frame.XUntitledNumbers,com.sun.star.lang.XTypeProvider,com.sun.star.uno.XWeak,com.sun.star.util.XNumberFormatsSupplier,com.sun.star.lang.XUnoTunnel,com.sun.star.lang.XTypeProvider,com.sun.star.uno.XWeak,com.sun.star.uno.XAggregation,com.sun.star.sheet.XSpreadsheetDocument,com.sun.star.document.XActionLockable,com.sun.star.sheet.XCalculatable,com.sun.star.util.XProtectable,com.sun.star.drawing.XDrawPagesSupplier,com.sun.star.sheet.XGoalSeek,com.sun.star.sheet.XConsolidatable,com.sun.star.sheet.XDocumentAuditing,com.sun.star.style.XStyleFamiliesSupplier,com.sun.star.view.XRenderable,com.sun.star.document.XLinkTargetSupplier,com.sun.star.beans.XPropertySet,com.sun.star.lang.XMultiServiceFactory,com.sun.star.lang.XServiceInfo,com.sun.star.util.XChangesNotifier,com.sun.star.sheet.opencl.XOpenCLSelection}}
>>>
PS Restore LO with:
>>> Lo.close_doc(wb)
>>> Lo.close_office()