Top > OOoPython > mytools > tools
* tools [#o3e0d10c]
拡張機能などでの利用。

tools.py
#code(python){{
def get_extension_dirurl(ctx, extid):
	"""Get extension directory url from the extension id."""
	pip_name = u'/singletons/com.sun.star.deployment.PackageInformationProvider'
	if ctx.hasByName(pip_name):
		pip = ctx.getByName(pip_name)
		return pip.getPackageLocation(extid)
	return u''


def create_dialog_from_url(ctx, dlg_url):
	"""Create dialog from URL."""
	dlgprov = ctx.ServiceManager.createInstanceWithContext(
		u'com.sun.star.awt.DialogProvider', ctx )
	return dlgprov.createDialog(dlg_url)
}}

Reload   New Lower page making Edit Freeze Diff Upload Copy Rename   Front page List of pages Search Recent changes Backup   Help   RSS of recent changes