mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Qt Wrapper complitant to pep8
This commit is contained in:
parent
b4533c3de5
commit
9090d624b1
@ -12,7 +12,8 @@ select = ['E', 'F', 'I']
|
||||
|
||||
[tool.ruff.lint.per-file-ignores]
|
||||
"src/calibre/ebooks/unihandecode/unicodepoints.py" = ["E501"]
|
||||
"src/qt/__init__.py" = ["E501"]
|
||||
"src/qt/*.py" = ['I']
|
||||
"src/qt/*.pyi" = ['I']
|
||||
|
||||
[tool.ruff.format]
|
||||
quote-style = 'single'
|
||||
|
@ -1,5 +1,19 @@
|
||||
# autogenerated by __main__.py do not edit
|
||||
top_level_module_names=('QtCore', 'QtGui', 'QtWidgets', 'QtNetwork', 'QtSvg', 'QtPrintSupport', 'QtOpenGL', 'QtOpenGLWidgets', 'QtQuick', 'QtMultimedia', 'QtMultimediaWidgets', 'QtTextToSpeech', 'QtWebEngineCore', 'QtWebEngineWidgets', 'QtDBus')
|
||||
top_level_module_names = ('QtCore',
|
||||
'QtGui',
|
||||
'QtWidgets',
|
||||
'QtNetwork',
|
||||
'QtSvg',
|
||||
'QtPrintSupport',
|
||||
'QtOpenGL',
|
||||
'QtOpenGLWidgets',
|
||||
'QtQuick',
|
||||
'QtMultimedia',
|
||||
'QtMultimediaWidgets',
|
||||
'QtTextToSpeech',
|
||||
'QtWebEngineCore',
|
||||
'QtWebEngineWidgets',
|
||||
'QtDBus')
|
||||
|
||||
|
||||
def __getattr__(name):
|
||||
@ -7,4 +21,3 @@ def __getattr__(name):
|
||||
import importlib
|
||||
return importlib.import_module("PyQt6." + name)
|
||||
raise AttributeError(name)
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
# vim:fileencoding=utf-8
|
||||
# License: GPL v3 Copyright: 2021, Kovid Goyal <kovid at kovidgoyal.net>
|
||||
|
||||
import importlib
|
||||
@ -56,10 +55,10 @@ qt_modules = {}
|
||||
|
||||
def __getattr__(name):
|
||||
return dynamic_load(name, name_map, already_imported, qt_modules, module_names)
|
||||
''', file=f)
|
||||
''', end='', file=f)
|
||||
with open(f'{base}/{name}.pyi', 'w') as f:
|
||||
print('# autogenerated by __main__.py do not edit', file=f)
|
||||
f.write('\n'.join(types))
|
||||
print('\n'.join(types), file=f)
|
||||
if name == 'core':
|
||||
module_names += ('sip',)
|
||||
mod = importlib.import_module(f'{QT_WRAPPER}.sip')
|
||||
@ -79,7 +78,8 @@ for name in module_lists.keys():
|
||||
scan(name)
|
||||
with open(f'{base}/__init__.py', 'w') as f:
|
||||
print('# autogenerated by __main__.py do not edit', file=f)
|
||||
print(f'{top_level_module_names=}', file=f)
|
||||
print('top_level_module_names = ', end='', file=f)
|
||||
pprint(top_level_module_names, stream=f)
|
||||
print(f'''
|
||||
|
||||
def __getattr__(name):
|
||||
@ -87,4 +87,4 @@ def __getattr__(name):
|
||||
import importlib
|
||||
return importlib.import_module("{QT_WRAPPER}." + name)
|
||||
raise AttributeError(name)
|
||||
''', file=f)
|
||||
''', end='', file=f)
|
||||
|
@ -766,4 +766,4 @@ QGraphicsVideoItem = PyQt6.QtMultimediaWidgets.QGraphicsVideoItem
|
||||
QVideoWidget = PyQt6.QtMultimediaWidgets.QVideoWidget
|
||||
import PyQt6.QtTextToSpeech
|
||||
QTextToSpeech = PyQt6.QtTextToSpeech.QTextToSpeech
|
||||
QVoice = PyQt6.QtTextToSpeech.QVoice
|
||||
QVoice = PyQt6.QtTextToSpeech.QVoice
|
||||
|
@ -17,4 +17,4 @@ QDBusReply = PyQt6.QtDBus.QDBusReply
|
||||
QDBusServiceWatcher = PyQt6.QtDBus.QDBusServiceWatcher
|
||||
QDBusSignature = PyQt6.QtDBus.QDBusSignature
|
||||
QDBusUnixFileDescriptor = PyQt6.QtDBus.QDBusUnixFileDescriptor
|
||||
QDBusVariant = PyQt6.QtDBus.QDBusVariant
|
||||
QDBusVariant = PyQt6.QtDBus.QDBusVariant
|
||||
|
@ -1,5 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
# vim:fileencoding=utf-8
|
||||
# License: GPL v3 Copyright: 2021, Kovid Goyal <kovid at kovidgoyal.net>
|
||||
|
||||
import sys
|
||||
|
@ -41,4 +41,4 @@ qWebEngineGetDomainAndRegistry = PyQt6.QtWebEngineCore.qWebEngineGetDomainAndReg
|
||||
qWebEngineProcessName = PyQt6.QtWebEngineCore.qWebEngineProcessName
|
||||
qWebEngineVersion = PyQt6.QtWebEngineCore.qWebEngineVersion
|
||||
import PyQt6.QtWebEngineWidgets
|
||||
QWebEngineView = PyQt6.QtWebEngineWidgets.QWebEngineView
|
||||
QWebEngineView = PyQt6.QtWebEngineWidgets.QWebEngineView
|
||||
|
Loading…
x
Reference in New Issue
Block a user