Update some data types
This commit is contained in:
parent
ee2c32bef0
commit
433be8f75d
|
@ -290,7 +290,7 @@ def create_instance(name: str, with_context: bool=False, args: Any=None) -> Any:
|
||||||
return instance
|
return instance
|
||||||
|
|
||||||
|
|
||||||
def get_app_config(node_name, key=''):
|
def get_app_config(node_name: str, key: str=''):
|
||||||
name = 'com.sun.star.configuration.ConfigurationProvider'
|
name = 'com.sun.star.configuration.ConfigurationProvider'
|
||||||
service = 'com.sun.star.configuration.ConfigurationAccess'
|
service = 'com.sun.star.configuration.ConfigurationAccess'
|
||||||
cp = create_instance(name, True)
|
cp = create_instance(name, True)
|
||||||
|
@ -337,7 +337,7 @@ def info(*args):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
def save_log(path, data):
|
def save_log(path: str, data):
|
||||||
with open(path, 'a') as f:
|
with open(path, 'a') as f:
|
||||||
f.write(f'{str(now())[:19]} -{LOG_NAME}- ')
|
f.write(f'{str(now())[:19]} -{LOG_NAME}- ')
|
||||||
pprint(data, stream=f)
|
pprint(data, stream=f)
|
||||||
|
@ -365,7 +365,7 @@ def inspect(obj: Any) -> None:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
def mri(obj):
|
def mri(obj: Any) -> None:
|
||||||
m = create_instance('mytools.Mri')
|
m = create_instance('mytools.Mri')
|
||||||
if m is None:
|
if m is None:
|
||||||
msg = 'Extension MRI not found'
|
msg = 'Extension MRI not found'
|
||||||
|
@ -384,7 +384,7 @@ def run_in_thread(fn):
|
||||||
return run
|
return run
|
||||||
|
|
||||||
|
|
||||||
def now(only_time=False):
|
def now(only_time: bool=False):
|
||||||
now = datetime.datetime.now()
|
now = datetime.datetime.now()
|
||||||
if only_time:
|
if only_time:
|
||||||
now = now.time()
|
now = now.time()
|
||||||
|
@ -538,7 +538,7 @@ def _struct_to_date(value):
|
||||||
return d
|
return d
|
||||||
|
|
||||||
|
|
||||||
def _get_url_script(args):
|
def _get_url_script(args: dict):
|
||||||
library = args['library']
|
library = args['library']
|
||||||
module = '.'
|
module = '.'
|
||||||
name = args['name']
|
name = args['name']
|
||||||
|
@ -557,7 +557,7 @@ def _get_url_script(args):
|
||||||
return url
|
return url
|
||||||
|
|
||||||
|
|
||||||
def _call_macro(args):
|
def _call_macro(args: dict):
|
||||||
#~ https://wiki.openoffice.org/wiki/Documentation/DevGuide/Scripting/Scripting_Framework_URI_Specification
|
#~ https://wiki.openoffice.org/wiki/Documentation/DevGuide/Scripting/Scripting_Framework_URI_Specification
|
||||||
|
|
||||||
url = _get_url_script(args)
|
url = _get_url_script(args)
|
||||||
|
@ -5407,9 +5407,9 @@ class LOMenu(object):
|
||||||
if MENUS[index.lower()] == cmd:
|
if MENUS[index.lower()] == cmd:
|
||||||
self._menu = menu
|
self._menu = menu
|
||||||
break
|
break
|
||||||
line = self._menu.get('CommandURL', '')
|
# ~ line = self._menu.get('CommandURL', '')
|
||||||
line += self._get_submenus(self._menu['ItemDescriptorContainer'])
|
# ~ line += self._get_submenus(self._menu['ItemDescriptorContainer'])
|
||||||
return line
|
return self._menu
|
||||||
|
|
||||||
def _get_menus(self):
|
def _get_menus(self):
|
||||||
instance = 'com.sun.star.ui.ModuleUIConfigurationManagerSupplier'
|
instance = 'com.sun.star.ui.ModuleUIConfigurationManagerSupplier'
|
||||||
|
|
Loading…
Reference in New Issue