def __getattr__(self, elt): value = None RuntimeException = pyuno.getClass("com.sun.star.uno.RuntimeException") try: value = pyuno.getClass(self.__path__ + "." + elt) except RuntimeException: try: value = Enum(self.__path__, elt) except RuntimeException: try: value = pyuno.getConstantByName(self.__path__ + "." + elt) except RuntimeException: if elt.startswith("typeOf"): try: value = pyuno.getTypeByName(self.__path__ + "." + elt[6:]) except RuntimeException: raise AttributeError("type {}.{} is unknown".format(self.__path__, elt)) elif elt == "__all__": try: module_names = pyuno.getModuleElementNames(self.__path__) self.__all__ = module_names return module_names except RuntimeException: raise AttributeError("__all__") else: raise AttributeError("type {}.{} is unknown".format(self.__path__, elt)) setattr(self, elt, value) return value
def getConstantByName( constant ): "Looks up the value of a idl constant by giving its explicit name" return pyuno.getConstantByName( constant )
def getConstantByName(constant): """Looks up the value of an IDL constant by giving its explicit name.""" return pyuno.getConstantByName(constant)
def constant(name: str) -> object: """ >>> constant('com.sun.star.util.NumberFormat.DATE') 2 """ return pyuno.getConstantByName(name)
def getConstantByName(constant): "Looks up the value of a idl constant by giving its explicit name" return pyuno.getConstantByName(constant)