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