mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge branch 'qt-wrapper-autogenerated-submodules' of https://github.com/un-pogaz/calibre
This commit is contained in:
commit
8d7c41cdba
@ -20,7 +20,9 @@ module_lists = {
|
|||||||
'QtOpenGL',
|
'QtOpenGL',
|
||||||
'QtOpenGLWidgets',
|
'QtOpenGLWidgets',
|
||||||
'QtQuick',
|
'QtQuick',
|
||||||
'QtMultimedia', 'QtMultimediaWidgets', 'QtTextToSpeech',
|
'QtMultimedia',
|
||||||
|
'QtMultimediaWidgets',
|
||||||
|
'QtTextToSpeech',
|
||||||
),
|
),
|
||||||
'webengine': (
|
'webengine': (
|
||||||
'QtWebEngineCore',
|
'QtWebEngineCore',
|
||||||
@ -44,6 +46,17 @@ def scan(name):
|
|||||||
if not obj_name.startswith('_') and obj_name not in name_map:
|
if not obj_name.startswith('_') and obj_name not in name_map:
|
||||||
name_map[obj_name] = full_name
|
name_map[obj_name] = full_name
|
||||||
types.append(f'{obj_name} = {full_name}.{obj_name}')
|
types.append(f'{obj_name} = {full_name}.{obj_name}')
|
||||||
|
with open(f'{base}/{name}.py', 'w') as f:
|
||||||
|
print('# autogenerated by __main__.py do not edit', file=f)
|
||||||
|
print(f'from .{name}_name_map import module_names, name_map', file=f)
|
||||||
|
print('''from .loader import dynamic_load
|
||||||
|
|
||||||
|
already_imported = {}
|
||||||
|
qt_modules = {}
|
||||||
|
|
||||||
|
def __getattr__(name):
|
||||||
|
return dynamic_load(name, name_map, already_imported, qt_modules, module_names)
|
||||||
|
''', file=f)
|
||||||
with open(f'{base}/{name}.pyi', 'w') as f:
|
with open(f'{base}/{name}.pyi', 'w') as f:
|
||||||
print('# autogenerated by __main__.py do not edit', file=f)
|
print('# autogenerated by __main__.py do not edit', file=f)
|
||||||
f.write('\n'.join(types))
|
f.write('\n'.join(types))
|
||||||
@ -61,7 +74,7 @@ def scan(name):
|
|||||||
|
|
||||||
|
|
||||||
top_level_module_names = ()
|
top_level_module_names = ()
|
||||||
for name in ('core', 'webengine', 'dbus'):
|
for name in module_lists.keys():
|
||||||
top_level_module_names += module_lists[name]
|
top_level_module_names += module_lists[name]
|
||||||
scan(name)
|
scan(name)
|
||||||
with open(f'{base}/__init__.py', 'w') as f:
|
with open(f'{base}/__init__.py', 'w') as f:
|
||||||
|
@ -1,14 +1,9 @@
|
|||||||
#!/usr/bin/env python
|
# autogenerated by __main__.py do not edit
|
||||||
# vim:fileencoding=utf-8
|
|
||||||
# License: GPL v3 Copyright: 2021, Kovid Goyal <kovid at kovidgoyal.net>
|
|
||||||
|
|
||||||
|
|
||||||
from .core_name_map import module_names, name_map
|
from .core_name_map import module_names, name_map
|
||||||
from .loader import dynamic_load
|
from .loader import dynamic_load
|
||||||
|
|
||||||
already_imported = {}
|
already_imported = {}
|
||||||
qt_modules = {}
|
qt_modules = {}
|
||||||
|
|
||||||
|
|
||||||
def __getattr__(name):
|
def __getattr__(name):
|
||||||
return dynamic_load(name, name_map, already_imported, qt_modules, module_names)
|
return dynamic_load(name, name_map, already_imported, qt_modules, module_names)
|
||||||
|
@ -1,14 +1,9 @@
|
|||||||
#!/usr/bin/env python
|
# autogenerated by __main__.py do not edit
|
||||||
# vim:fileencoding=utf-8
|
|
||||||
# License: GPL v3 Copyright: 2021, Kovid Goyal <kovid at kovidgoyal.net>
|
|
||||||
|
|
||||||
|
|
||||||
from .dbus_name_map import module_names, name_map
|
from .dbus_name_map import module_names, name_map
|
||||||
from .loader import dynamic_load
|
from .loader import dynamic_load
|
||||||
|
|
||||||
already_imported = {}
|
already_imported = {}
|
||||||
qt_modules = {}
|
qt_modules = {}
|
||||||
|
|
||||||
|
|
||||||
def __getattr__(name):
|
def __getattr__(name):
|
||||||
return dynamic_load(name, name_map, already_imported, qt_modules, module_names)
|
return dynamic_load(name, name_map, already_imported, qt_modules, module_names)
|
||||||
|
@ -1,14 +1,9 @@
|
|||||||
#!/usr/bin/env python
|
# autogenerated by __main__.py do not edit
|
||||||
# vim:fileencoding=utf-8
|
|
||||||
# License: GPL v3 Copyright: 2021, Kovid Goyal <kovid at kovidgoyal.net>
|
|
||||||
|
|
||||||
|
|
||||||
from .loader import dynamic_load
|
|
||||||
from .webengine_name_map import module_names, name_map
|
from .webengine_name_map import module_names, name_map
|
||||||
|
from .loader import dynamic_load
|
||||||
|
|
||||||
already_imported = {}
|
already_imported = {}
|
||||||
qt_modules = {}
|
qt_modules = {}
|
||||||
|
|
||||||
|
|
||||||
def __getattr__(name):
|
def __getattr__(name):
|
||||||
return dynamic_load(name, name_map, already_imported, qt_modules, module_names)
|
return dynamic_load(name, name_map, already_imported, qt_modules, module_names)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user