diff --git a/CMakeLists.txt b/CMakeLists.txt index a6b0b150..fb266801 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,154 +1,154 @@ cmake_minimum_required(VERSION 3.0) project(kdevpython) # write the plugin version to a file set(KDEVPYTHON_VERSION_MAJOR 5) set(KDEVPYTHON_VERSION_MINOR 3) set(KDEVPYTHON_VERSION_PATCH 40) # KDevplatform dependency version set( KDEVPLATFORM_VERSION "${KDEVPYTHON_VERSION_MAJOR}.${KDEVPYTHON_VERSION_MINOR}" ) find_package (ECM "5.14.0" REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${kdevpython_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH}) include(KDECompilerSettings NO_POLICY_SCOPE) include(KDEInstallDirs) include(KDECMakeSettings) include(GenerateExportHeader) include(ECMAddTests) include(ECMSetupVersion) include(ECMQtDeclareLoggingCategory) if(NOT CMAKE_VERSION VERSION_LESS "3.10.0") # Avoids bogus warnings with CMake 3.10+ list(APPEND CMAKE_AUTOMOC_MACRO_NAMES "K_PLUGIN_FACTORY_WITH_JSON") endif() if(POLICY CMP0071) # Avoids compat messages from CMake 3.10+, with Qt < 5.9.4 # See https://bugreports.qt.io/browse/QTBUG-63442 cmake_policy(SET CMP0071 OLD) endif() if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wdocumentation") endif() add_definitions( -DTRANSLATION_DOMAIN=\"kdevpython\" ) # CMake looks for exactly the specified version first and ignores newer versions. # To avoid that, start looking for the newest supported version and work down. set(Python_ADDITIONAL_VERSIONS 3.7 3.6 3.5 3.4) foreach(_PYTHON_V ${Python_ADDITIONAL_VERSIONS}) find_package(PythonInterp ${_PYTHON_V}) if ( PYTHONINTERP_FOUND ) break() endif() endforeach() # Must unset before searching for libs, otherwise these are checked before the required version... unset(Python_ADDITIONAL_VERSIONS) if ( PYTHONINTERP_FOUND AND PYTHON_VERSION_STRING VERSION_GREATER "3.4" ) # Find libraries that match the found interpreter (mismatched versions not supported). # This assumes libs are available for the newest Python version on the system. # KDevelop should _always_ be built against the newest possible version, so notabug. find_package(PythonLibs "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}" REQUIRED EXACT) endif() if ( NOT PYTHONLIBS_FOUND OR PYTHONLIBS_VERSION_STRING VERSION_LESS "3.4.3" ) message(FATAL_ERROR "Python >= 3.4.3 but < 3.8 with --enable-shared is required to build kdev-python") endif() configure_file(kdevpythonversion.h.cmake "${CMAKE_CURRENT_BINARY_DIR}/kdevpythonversion.h" @ONLY) set(QT_MIN_VERSION "5.5.0") find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED Core Widgets Test) set(KF5_DEP_VERSION "5.15.0") find_package(KF5 ${KF5_DEP_VERSION} REQUIRED I18n ThreadWeaver TextEditor ) find_package(KDevPlatform ${KDEVPLATFORM_VERSION} CONFIG REQUIRED) find_package(KDevelop ${KDEVPLATFORM_VERSION} REQUIRED) if ( NOT WIN32 ) set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wfatal-errors -Wall") endif ( NOT WIN32 ) # then, build the plugin include_directories( ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/duchain ${CMAKE_CURRENT_SOURCE_DIR}/parser ${CMAKE_CURRENT_BINARY_DIR}/parser ) add_subdirectory(app_templates) add_subdirectory(parser) add_subdirectory(duchain) add_subdirectory(codecompletion) add_subdirectory(debugger) add_subdirectory(docfilekcm) set(kdevpythonlanguagesupport_PART_SRCS codegen/correctionfilegenerator.cpp codegen/refactoring.cpp pythonlanguagesupport.cpp pythonparsejob.cpp pythonhighlighting.cpp pythonstylechecking.cpp # config pages: docfilekcm/docfilewizard.cpp docfilekcm/docfilemanagerwidget.cpp docfilekcm/kcm_docfiles.cpp pep8kcm/kcm_pep8.cpp projectconfig/projectconfigpage.cpp ) ecm_qt_declare_logging_category(kdevpythonlanguagesupport_PART_SRCS HEADER codegendebug.h IDENTIFIER KDEV_PYTHON_CODEGEN - CATEGORY_NAME "kdevelop.languages.python.codegen" + CATEGORY_NAME "kdevelop.plugins.python.codegen" ) ecm_qt_declare_logging_category(kdevpythonlanguagesupport_PART_SRCS HEADER pythondebug.h IDENTIFIER KDEV_PYTHON - CATEGORY_NAME "kdevelop.languages.python" + CATEGORY_NAME "kdevelop.plugins.python" ) ki18n_wrap_ui(kdevpythonlanguagesupport_PART_SRCS codegen/correctionwidget.ui projectconfig/projectconfig.ui pep8kcm/pep8.ui ) kdevplatform_add_plugin(kdevpythonlanguagesupport JSON kdevpythonsupport.json SOURCES ${kdevpythonlanguagesupport_PART_SRCS}) target_link_libraries(kdevpythonlanguagesupport KDev::Interfaces KDev::Language KDev::Util KF5::ThreadWeaver KF5::TextEditor kdevpythoncompletion kdevpythonparser kdevpythonduchain ) get_target_property(DEFINESANDINCLUDES_INCLUDE_DIRS KDev::DefinesAndIncludesManager INTERFACE_INCLUDE_DIRECTORIES) include_directories(${DEFINESANDINCLUDES_INCLUDE_DIRS}) install(DIRECTORY documentation_files DESTINATION ${KDE_INSTALL_DATADIR}/kdevpythonsupport) install(DIRECTORY correction_files DESTINATION ${KDE_INSTALL_DATADIR}/kdevpythonsupport) install(FILES codestyle.py DESTINATION ${KDE_INSTALL_DATADIR}/kdevpythonsupport) install(FILES org.kde.kdev-python.metainfo.xml DESTINATION ${KDE_INSTALL_METAINFODIR}) # kdebugsettings file install(FILES kdevpythonsupport.categories DESTINATION ${KDE_INSTALL_CONFDIR}) feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/codecompletion/CMakeLists.txt b/codecompletion/CMakeLists.txt index 828c0daa..3f9fd955 100644 --- a/codecompletion/CMakeLists.txt +++ b/codecompletion/CMakeLists.txt @@ -1,44 +1,44 @@ set(completion_SRCS context.cpp model.cpp worker.cpp helpers.cpp items/missingincludeitem.cpp items/declaration.cpp items/functiondeclaration.cpp items/implementfunction.cpp items/importfile.cpp items/keyword.cpp items/replacementvariable.cpp ) ecm_qt_declare_logging_category(completion_SRCS HEADER codecompletiondebug.h IDENTIFIER KDEV_PYTHON_CODECOMPLETION - CATEGORY_NAME "kdevelop.languages.python.codecompletion" + CATEGORY_NAME "kdevelop.plugins.python.codecompletion" ) add_library(kdevpythoncompletion SHARED ${completion_SRCS}) generate_export_header(kdevpythoncompletion EXPORT_MACRO_NAME KDEVPYTHONCOMPLETION_EXPORT EXPORT_FILE_NAME pythoncompletionexport.h ) add_dependencies(kdevpythoncompletion kdevpythonparser kdevpythonduchain ) target_link_libraries(kdevpythoncompletion LINK_PRIVATE KDev::Language KDev::Interfaces KDev::Project kdevpythonduchain kdevpythonparser ) install(TARGETS kdevpythoncompletion DESTINATION ${INSTALL_TARGETS_DEFAULT_ARGS}) if (BUILD_TESTING) add_subdirectory(tests) endif() diff --git a/debugger/CMakeLists.txt b/debugger/CMakeLists.txt index 8df59fbe..60ea9f30 100644 --- a/debugger/CMakeLists.txt +++ b/debugger/CMakeLists.txt @@ -1,33 +1,33 @@ set(kdevpdb_PART_SRCS breakpointcontroller.cpp variable.cpp variablecontroller.cpp pdbframestackmodel.cpp pdblauncher.cpp debugjob.cpp debugsession.cpp pdbdebuggerplugin.cpp ) ecm_qt_declare_logging_category(kdevpdb_PART_SRCS HEADER debuggerdebug.h IDENTIFIER KDEV_PYTHON_DEBUGGER - CATEGORY_NAME "kdevelop.languages.python.debugger" + CATEGORY_NAME "kdevelop.plugins.python.debugger" ) kdevplatform_add_plugin(kdevpdb JSON kdevpdb.json SOURCES ${kdevpdb_PART_SRCS}) generate_export_header(kdevpdb EXPORT_MACRO_NAME KDEVPYTHONDEBUG_EXPORT) target_link_libraries(kdevpdb kdevpythonparser KDev::Interfaces KDev::Language KDev::Debugger KDev::OutputView KDev::Project KDev::Util KF5::TextEditor ) install(FILES __kdevpython_debugger_utils.py DESTINATION ${KDE_INSTALL_DATADIR}/kdevpythonsupport/debugger) install(FILES kdevpdb.py DESTINATION ${KDE_INSTALL_DATADIR}/kdevpythonsupport/debugger) diff --git a/debugger/kdevpdb.json b/debugger/kdevpdb.json index d25443e8..624dbb1c 100644 --- a/debugger/kdevpdb.json +++ b/debugger/kdevpdb.json @@ -1,90 +1,91 @@ { "KPlugin": { "Authors": [ { "Email": "svenbrauch@googlemail.com", "Name": "Sven Brauch", "Name[ca@valencia]": "Sven Brauch", "Name[ca]": "Sven Brauch", "Name[cs]": "Sven Brauch", "Name[de]": "Sven Brauch", "Name[en_GB]": "Sven Brauch", "Name[es]": "Sven Brauch", + "Name[et]": "Sven Brauch", "Name[fi]": "Sven Brauch", "Name[fr]": "Sven Brauch", "Name[gl]": "Sven Brauch", "Name[it]": "Sven Brauch", "Name[nl]": "Sven Brauch", "Name[pl]": "Sven Brauch", "Name[pt]": "Sven Brauch", "Name[pt_BR]": "Sven Brauch", "Name[ru]": "Sven Brauch", "Name[sk]": "Sven Brauch", "Name[sl]": "Sven Brauch", "Name[sv]": "Sven Brauch", "Name[tr]": "Sven Brauch", "Name[uk]": "Sven Brauch", "Name[x-test]": "xxSven Brauchxx", "Name[zh_CN]": "Sven Brauch", "Name[zh_TW]": "Sven Brauch" } ], "Category": "Debugging", "Description": "This plugin provides a frontend for PDB", "Description[ca@valencia]": "Aquest connector proveeix d'un frontal pel PDB", "Description[ca]": "Aquest connector proveeix d'un frontal pel PDB", "Description[cs]": "Tento modul poskytuje rozhraní pro PDB", "Description[de]": "Dieses Modul stellt eine Oberfläche für PDB zur Verfügung.", "Description[en_GB]": "This plugin provides a frontend for PDB", "Description[es]": "Este complemento proporciona una interfaz para PDB", "Description[fi]": "Tämä liitännäinen tarjoaa PDB-käyttöliittymän", "Description[fr]": "Ce module externe fournit une interface pour PDB", "Description[gl]": "Este complemento fornece unha interface para PDB.", "Description[it]": "Questa estensione fornisce un'interfaccia per PDB", "Description[ko]": "이 플러그인은 PDB 프론트엔드를 제공합니다", "Description[nl]": "Deze plug-in levert een frontend voor PDB", "Description[pl]": "Wtyczka ta zapewnia nakładkę graficzną dla PDB", "Description[pt]": "Este 'plugin' oferece uma interface para o PDB", "Description[pt_BR]": "Este plugin fornece uma interface para o PDB", "Description[sk]": "Tento plugin poskytuje rozhranie pre PDB", "Description[sl]": "Ta vstavek ponuja začelje za PDB", "Description[sv]": "Insticksprogrammet tillhandahåller ett gränssnitt för PDB", "Description[tr]": "Bu eklenti PDB için bir önuç sağlar", "Description[uk]": "Цей додаток є графічною оболонкою до PDB", "Description[x-test]": "xxThis plugin provides a frontend for PDBxx", "Description[zh_CN]": "插件提供了 PDB 前端", "Description[zh_TW]": "此外掛程式提供了 PDB 的前端", "Icon": "text-x-python", "Id": "kdevpdb", "License": "GPL", "Name": "Python Debugger (PDB) support", "Name[ca@valencia]": "Implementació del depurador de Python (PDB)", "Name[ca]": "Implementació del depurador de Python (PDB)", "Name[cs]": "Podpora ladění pro Python (PDB)", "Name[de]": "Unterstützung für Python Debugger (PDB)", "Name[en_GB]": "Python Debugger (PDB) support", "Name[es]": "Implementación del depurador Python (PDB)", "Name[fr]": "Prise en charge du débogueur Python (pdb)", "Name[gl]": "Compatibilidade co depurador de Python (PDB)", "Name[it]": "Supporto al debugger di Python (PDB)", "Name[nl]": "Ondersteuning voor Python-debugger", "Name[pl]": "Obsługa diagnostyki Pythona (PDB)", "Name[pt]": "Suporte para o Depurador de Python (PDB)", "Name[pt_BR]": "Suporte ao Python Debugger (PDB)", "Name[sl]": "Podpora razhroščevalniku za Python (PDB)", "Name[sv]": "Stöd för Python-avlusare (PDB)", "Name[tr]": "Python Hata Ayıklayıcı (PDB) desteği", "Name[uk]": "Підтримка засобу діагностики Python (PDB)", "Name[x-test]": "xxPython Debugger (PDB) supportxx", "Name[zh_CN]": "Python 调试器 (PDB) 支持", "Name[zh_TW]": "Python 偵錯器 (PDB) 支援", "ServiceTypes": [ "KDevelop/Plugin" ] }, "X-KDevelop-Category": "Global", "X-KDevelop-IRequired": [ "org.kdevelop.IExecuteScriptPlugin" ], "X-KDevelop-Mode": "GUI" } diff --git a/documentation_files/builtindocumentation.py b/documentation_files/builtindocumentation.py index 953da543..a7e1a5c0 100644 --- a/documentation_files/builtindocumentation.py +++ b/documentation_files/builtindocumentation.py @@ -1,695 +1,689 @@ # This file denotes the built-in python library. It is imported into every file which is parsed. class Exception(object): pass class object(): def __init__(self): pass def __new__(cls): pass def __del__(self): pass def __repr__(self): pass def __str__(self): pass def __lt__(self, other): pass def __gt__(self, other): pass def __le__(self, other): pass def __eq__(self, other): pass def __ne__(self, other): pass def __gt__(self, other): pass def __ge__(self, other): pass def __cmp__(self, other): pass def __hash__(self): pass def __nonzero__(self): pass def __unicode__(self): pass def __getattr__(self, name): pass def __setattr__(self, name, value): pass def __delattr__(self, name): pass def __getattribute__(self, name): pass def __get__(self, instance, owner): pass def __set__(self, instance, value): pass def __delete__(self, instance): pass def __instancecheck__(self, instance): pass def __subclasscheck__(self, subclass): pass def __call__(self): pass def __len__(self): pass def __getitem__(self, key): pass def __setitem__(self, key, value): pass def __delitem__(self, key): pass def __iter__(self): pass def __reversed__(self): pass def __contains__(self, item): pass def __getslice__(self, i, j): pass def __delslice__(self, i, j): pass def __add__(self, other): pass def __sub__(self, other): pass def __mul__(self, other): pass def __matmul__(self, other): pass def __rmatmul__(self, other): pass def __imatmul__(self, other): pass def __floordiv__(self, other): pass def __mod__(self, other): pass def __divmod__(self, other): pass def __pow__(self, other): pass def __lshift__(self, other): pass def __rshift__(self, other): pass def __and__(self, other): pass def __xor__(self, other): pass def __or__(self, other): pass def __div__(self, other): pass def __truediv__(self, other): pass def __radd__(self, other): pass def __rsub__(self, other): pass def __rmul__(self, other): pass def __rtruediv__(self, other): pass def __rfloordiv__(self, other): pass def __rmod__(self, other): pass def __rdivmod__(self, other): pass def __rpow__(self, other): pass def __rlshift__(self, other): pass def __rrshift__(self, other): pass def __rand__(self, other): pass def __rxor__(self, other): pass def __ror__(self, other): pass def __iadd__(self, other): pass def __isub__(self, other): pass def __imul__(self, other): pass def __idiv__(self, other): pass def __itruediv__(self, other): pass def __ifloordiv__(self, other): pass def __imod__(self, other): pass def __ipow__(self, other): pass def __ilshift__(self, other): pass def __irshift__(self, other): pass def __iand__(self, other): pass def __ixor__(self, other): pass def __ior__(self, other): pass def __neg__(self): pass def __pos__(self): pass def __abs__(self): pass def __invert__(self): pass def __complex__(self): pass def __int__(self): pass def __long__(self): pass def __float__(self): pass def __oct__(self): pass def __hex__(self): pass def __index__(self): pass def __coerce__(self, other): pass __class__ = str() class basestring(): pass class list(): """! TypeContainer !""" def __init__(self, items): """! returnContentEqualsContentOf ! 0""" return [] def __setitem__(self, key, value): """! addsTypeOfArg ! 1 ! getsType !""" def __getitem__(self, key): """! addsTypeOfArg ! 0""" def append(self,obj): """! addsTypeOfArg ! 0""" def extend(self,obj): """! addsTypeOfArgContent ! 0""" return None def insert(self,i, x): """! getsType !""" return None def pop(self,i): """! getsType !""" return None def index(self,x): return 0 def count(self,x): """! getsList !""" return 0 def sort(self,): """! getsList !""" return [] def reverse(self,): """! getsList !""" return [] def remove(self, x): pass class _io_TextIOWrapper(): def close(self,): return None def detach(self): return self # Not quite def flush(self,): return None def fileno(self,): return 0 def isatty(self,): return True def next(self,): return None def read(self,size = 0): return "" def readable(self): return True def readline(self,size = 0): return "" def readlines(self,sizehint = 0): return [""] def seek(self,offset, whence = 0): return None def seekable(self): return True def tell(self,): return 0 def truncate(self,size = 0): return 0 def write(self,string): return None def writable(self): return True def writelines(self,sequence): return None def __iter__(self): return self def __next__(self): return "" def __enter__(self): return self buffer = _io_TextIOWrapper() # Not quite closed = True encoding = "" errors = None line_buffering = True mode = "" name = "" newlines = "" softspace = True class dict(): """! TypeContainer ! ! hasTypedKeys !""" def __init__(self, items): """! returnContentEqualsContentOf ! 0""" return {} def __setitem__(self, key, value): """! addsTypeOfArg ! 1 ! addsKeyTypeOfArg ! 0""" def __getitem__(self, key): """! getsType !""" def clear(self,): return None def copy(self,): return {} def fromkeys(self,seq, value = None): """! addsKeyTypeOfArgContent ! 0 ! addsTypeOfArg ! 1""" return {} def get(self,key, default = ""): """! getsType !""" return None def has_key(self,key): return True def items(self,): """! getsListOfBoth !""" return {} def iteritems(self,): """! getsListOfBoth !""" return [] def iterkeys(self,): """! getsListOfKeys !""" return [] def itervalues(self,): """! getsList !""" return [] def keys(self,): """! getsListOfKeys !""" return [] def pop(self,key, default = ""): """! getsType !""" return None def popitem(self,): """! getsBoth !""" return None def setdefault(self,key, default = ""): return None def update(self,other = None): return None def values(self,): """! getsList !""" return [] def viewitems(self,): return None def viewkeys(self,): return None def viewvalues(self,): return None class str(): def __init__(self, obj): pass def __mod__(self, modulo): return str() def __getitem__(self): return "" def __iter__(self): return self def __next__(self): return "" def replace(self,before, after): return "" def capitalize(self,): return "" def center(self,width, fillchar = None): return "" def count(self,substring, start = 0, end = 0): return 0 def encode(self, encoding): return bytes() def endswith(self,suffix, start = 0, end = 0): return True def expandtabs(self,tabsize = 0): return "" def find(self,substring, start = 0, end = 0): return 0 def format(self,*args, **kwargs): return "" def index(self,substring, start = 0, end = 0): return 0 def isalnum(self,): return True def isalpha(self,): return True def isdigit(self,): return True def islower(self,): return True def isspace(self,): return True def istitle(self,): return True def isupper(self,): return True def join(self,iterable): return "" def ljust(self,width, fillchar = ""): return "" def lower(self,): return "" def lstrip(self,chars = ""): return "" def partition(self,seperator): return ("", "", "") def replace(self,old, new, count = 0): return "" def rfind(self,substring, start = 0, end = 0): return 0 def rindex(self,substring, start = 0, end = 0): return 0 def rjust(self,width, fillchar = ""): return "" def rpartition(self,seperator): return ("", "", "") def rsplit(self,seperator = "", maxsplit = 0): return [] def rstrip(self,chars = ""): return "" def split(self,seperator = "", maxsplit = 0): return ["string"] def splitlines(self,keepends = False): return ["string"] def startswith(self,prefix, start = 0, end = 0): return True def strip(self,chars = ""): return "" def swapcase(self,): return "" def title(self,): return "" def translate(self,table, deletechars = ""): return "" def upper(self,): return "" def zfill(self,width): return "" class float(): def bit_length(self,): return 0 def as_integer_ration(self,): return (self,0, 0) def is_integer(self,): return True def hex(self,): return 0x0 def fromhex(self,s): return 0 def __add__(self, other): return float() def __sub__(self, other): return float() def __mul__(self, other): return float() def __div__(self, other): return float() class int(): def __add__(self, other): return int() def __sub__(self, other): return int() def __mul__(self, other): return int() def __div__(self, other): return float() class complex(): real = 3 imag = 5 def __add__(self, other): return complex() def __sub__(self, other): return complex() def __mul__(self, other): return complex() def __div__(self, other): return complex() def __mod__(self, other): return complex() class BaseException: args = () __cause__ = BaseException __context__ = BaseException __traceback__ = TracebackType def __init__(self, *args): ... def with_traceback(self, tb): return self class GeneratorExit(BaseException): ... class KeyboardInterrupt(BaseException): ... class SystemExit(BaseException): code = 0 class Exception(BaseException): ... class ArithmeticError(Exception): ... class EnvironmentError(Exception): errno = 0 strerror = "" filename = "" class LookupError(Exception): ... class RuntimeError(Exception): ... class ValueError(Exception): ... class AssertionError(Exception): ... class AttributeError(Exception): ... class BufferError(Exception): ... class EOFError(Exception): ... class FloatingPointError(ArithmeticError): ... class IOError(EnvironmentError): ... class ImportError(Exception): ... class IndexError(LookupError): ... class KeyError(LookupError): ... class MemoryError(Exception): ... class NameError(Exception): ... class NotImplementedError(RuntimeError): ... class OSError(EnvironmentError): ... class BlockingIOError(OSError): characters_written = 0 class ChildProcessError(OSError): ... class ConnectionError(OSError): ... class BrokenPipeError(ConnectionError): ... class ConnectionAbortedError(ConnectionError): ... class ConnectionRefusedError(ConnectionError): ... class ConnectionResetError(ConnectionError): ... class FileExistsError(OSError): ... class FileNotFoundError(OSError): ... class InterruptedError(OSError): ... class IsADirectoryError(OSError): ... class NotADirectoryError(OSError): ... class PermissionError(OSError): ... class ProcessLookupError(OSError): ... class TimeoutError(OSError): ... class WindowsError(OSError): winerror = 0 class OverflowError(ArithmeticError): ... class ReferenceError(Exception): ... class StopIteration(Exception): value = ... # type: Any class StopAsyncIteration(Exception): value = ... # type: Any class RecursionError(RuntimeError): ... class SyntaxError(Exception): msg = "" lineno = 0 offset = 0 text = "" class IndentationError(SyntaxError): ... class TabError(IndentationError): ... class SystemError(Exception): ... class TypeError(Exception): ... class UnboundLocalError(NameError): ... class UnicodeError(ValueError): ... class UnicodeDecodeError(UnicodeError): encoding = "" object = b"" start = 0 end = 0 reason = "" def __init__(self, __encoding: str, __object: bytes, __start: int, __end: int, __reason: str): ... class UnicodeEncodeError(UnicodeError): encoding = "" object = "" start = 0 end = 0 reason = "" def __init__(self, __encoding: str, __object: str, __start: int, __end: int, __reason: str): ... class UnicodeTranslateError(UnicodeError): ... class ZeroDivisionError(ArithmeticError): ... class Warning(Exception): ... class UserWarning(Warning): ... class DeprecationWarning(Warning): ... class SyntaxWarning(Warning): ... class RuntimeWarning(Warning): ... class FutureWarning(Warning): ... class PendingDeprecationWarning(Warning): ... class ImportWarning(Warning): ... class UnicodeWarning(Warning): ... class BytesWarning(Warning): ... class ResourceWarning(Warning): ... class tuple(): """! IndexedTypeContainer !""" def __mul__(self, other): return tuple() class bytes: def __init__(self, data): pass def __getitem__(self, key): return int() def __iter__(self): return self def __next__(self): return int() def capitalize(self): return bytes() def center(self): return bytes() def count(self): return int() def decode(self, encoding): return str() def endswith(self, data): return True def expandtabs(self): return bytes() def find(self): return int() def fromhex(self, hexdata): return bytes() def index(self): return int() def isalnum(self): return True def isalpha(self): return True def isdigit(self): return True def islower(self): return True def isspace(self): return True def istitle(self): return True def isupper(self): return True def join(self, other): return bytes() def ljust(self, space): return bytes(); def lower(self): return bytes() def lstrip(self): return bytes() def maketrans(self, frm, to): return bytes() def partition(self, separator): return (bytes(), bytes(), bytes()) def replace(self, find, replace): return bytes() def rfind(self, data): return int() def rindex(self, data): return int() def rjust(self, justify): return bytes() def rpartition(self, separator): return (bytes(), bytes(), bytes()) def rsplit(self, separator): return [bytes()] def rstrip(self): return bytes() def split(self, separator): return [bytes()] def splitlines(self): return [bytes()] def startswith(self): return False def strip(self): return bytes() def swapcase(self): return bytes() def title(self): return bytes() def translate(self, table, deletechars=None): return bytes() def upper(self): return bytes() def zfill(self, width): return bytes() class set(): """! TypeContainer !""" def __init__(self, iterable): """! returnContentEqualsContentOf ! 0""" pass def len(self): return 0 def isdisjoint(self, other): return True def issubset(self, other): return True def issuperset(self, other): return True def union(self, other, *others): return set() def intersection(self, other, *others): return set() def difference(self, other, *others): return set() def symmetric_difference(self, other): return set() def copy(self): return set() def update(self, other): pass def intersection_update(self, other, *others): pass def difference_update(self, other, *others): pass def symmetric_difference_update(self, other, *others): pass def add(self, elem): pass def remove(self, elem): pass def discard(self, elem): pass def pop(self): pass def clear(self): pass class frozenset(): """! TypeContainer !""" def __init__(self, iterable): """! returnContentEqualsContentOf ! 0""" pass def len(self): return 0 def isdisjoint(self, other): return True def issubset(self, other): return True def issuperset(self, other): return True def union(self, other, *others): return set() def intersection(self, other, *others): return set() def difference(self, other, *others): return set() def symmetric_difference(self, other): return set() def copy(self): return set() def abs(x): """ Return the absolute value of a number. The argument may be a plain or long integer or a floating point number. If the argument is a complex number, its magnitude is returned.""" return 0 def int(x): return 0 def all(iterable): return True def any(iterable): """Return True if any element of the iterable is true. If the iterable is empty, return False.""" return True def bin(x): """Convert an integer number to a binary string. The result is a valid Python expression. If x is not a Python int object, it has to define an __index__() method that returns an integer.""" return "" def bool(x = False): """Convert a value to a Boolean, using the standard truth testing procedure. If x is false or omitted, this returns False; otherwise it returns True. bool is also a class, which is a subclass of int. Class bool cannot be subclassed further. Its only instances are False and True.""" return True def bytearray(source = None, encoding = None, errors = None): """Return a new array of bytes. The bytearray type is a mutable sequence of integers in the range 0 <= x < 256.""" return bytes() def callable(object): """Return True if the object argument appears callable, False if not. If this returns true, it is still possible that a call fails, but if it is false, calling object will never succeed. Note that classes are callable (calling a class returns a new instance); class instances are callable if they have a __call__() method.""" return True def chr(i): """Return a string of one character whose ASCII code is the integer i. For example, chr(97) returns the string 'a'. This is the inverse of ord(). The argument must be in the range [0..255], inclusive; ValueError will be raised if i is outside that range. See also unichr().""" return "" def classmethod(function): """Return a class method for function.""" return None def cmp(x, y): """Compare the two objects x and y and return an integer according to the outcome. The return value is negative if x < y, zero if x == y and strictly positive if x > y.""" return 0 def compile(source, filename, mode, flags = None, dont_inherit = None): """Compile the source into a code or AST object. Code objects can be executed by an exec statement or evaluated by a call to eval(). source can either be a Unicode string, a Latin-1 encoded string or an AST object. Refer to the ast module documentation for information on how to work with AST objects.""" return None def delattr(obj, name): """This is a relative of setattr(). The arguments are an object and a string. The string must be the name of one of the object’s attributes. The function deletes the named attribute, provided the object allows it. For example, delattr(x, 'foobar') is equivalent to del x.foobar.""" return None def dir(obj = None): """Without arguments, return the list of names in the current local scope. With an argument, attempt to return a list of valid attributes for that object.""" return {"string" : None} def divmod(a, b): """Take two (non complex) numbers as arguments and return a pair of numbers consisting of their quotient and remainder when using long division.""" return 0 def enumerate(sequence, start = 0): """Return an enumerate object. sequence must be a sequence, an iterator, or some other object which supports iteration. ! enumerate ! 0 """ return [(0, 0)] def eval(expression, glob = None, loc = None): """The expression argument is parsed and evaluated as a Python expression (technically speaking, a condition list) using the globals and locals dictionaries as global and local namespace.""" return None -def execfile(filename, glob = None, loc = None): - """This function is similar to the exec statement, but parses a file instead of a string. It is different from the import statement in that it does not use the module administration — it reads the file unconditionally and does not create a new module. """ - return None -def file(filename, mode = None, bufsize = None): - """Constructor function for the file type, described further in section File Objects.""" - return _io_TextIOWrapper() def filter(function, iterable): """Construct a list from those elements of iterable for which function returns true. iterable may be either a sequence, a container which supports iteration, or an iterator. If iterable is a string or a tuple, the result also has that type; otherwise it is always a list. If function is None, the identity function is assumed, that is, all elements of iterable that are false are removed.""" return [] def float(x = 0): """Convert a string or a number to floating point.""" return 0.0 def format(value, format_spec = None): """Convert a value to a “formatted” representation, as controlled by format_spec.""" return "" def getattr(obj, name, default = None): """Return the value of the named attribute of object. name must be a string.""" return None def globals(): """Return a dictionary representing the current global symbol table.""" return {} def hasattr(obj, name): """The arguments are an object and a string. The result is True if the string is the name of one of the object’s attributes, False if not. (This is implemented by calling getattr(object, name) and seeing whether it raises an exception or not.)""" return bool def hash(obj): """Return the hash value of the object (if it has one).""" return 0 def hex(x): """Convert an integer number (of any size) to a hexadecimal string.""" return 0x0 def id(obj): """Return the “identity” of an object. This is an integer (or long integer) which is guaranteed to be unique and constant for this object during its lifetime. Two objects with non-overlapping lifetimes may have the same id() value.""" return 0 def input(prompt = None): """ Read a string from standard input. The trailing newline is stripped. The prompt string, if given, is printed to standard output without a trailing newline before reading input. If the user hits EOF (*nix: Ctrl-D, Windows: Ctrl-Z+Return), raise EOFError. On *nix systems, readline is used if available. """ return "" def isinstance(obj, cls): """Return true if the object argument is an instance of the classinfo argument, or of a (direct, indirect or virtual) subclass thereof.""" return True def issubclass(cls, info): """Return true if class is a subclass (direct, indirect or virtual) of classinfo.""" return True def iter(o, s = None): """Return an iterator object. ! returnContentEqualsContentOf ! 0 """ return [] def len(s): """Return the length (the number of items) of an object. The argument may be a sequence (string, tuple or list) or a mapping (dictionary).""" return 0 def locals(): """Update and return a dictionary representing the current local symbol table.""" return {} def long(x = None, base = None): """Convert a string or number to a long integer.""" return 0 def map(func, iterab): """Apply function to every item of iterable and return a list of the results.""" return [] def max(lst, args = None, key = None): """Return the largest item in an iterable or the largest of two or more arguments.""" return 0 def memoryview(obj): """Return a “memory view” object created from the given argument.""" return None def min(lst, default = None): """Return the smallest item in an iterable or the smallest of two or more arguments.""" return 0 def next(iterator, default = None): """Retrieve the next item from the iterator by calling its next() method.""" return iterator[0] def oct(x): """Convert an integer number (of any size) to an octal string.""" return 0o0 def open(filename, mode = None, bufsize = None): """Open a file, returning an object of the file type described in section File Objects.""" return _io_TextIOWrapper() def ord(c): """Given a string of length one, return an integer representing the Unicode code point of the character when the argument is a unicode object, or the value of the byte when the argument is an 8-bit string.""" return 0 def pow(x, y, z = 0): """Return x to the power y; if z is present, return x to the power y, modulo z.""" return 0.0 def property(fget = 0, fset = 0, fdel = 0, doc = 0): """Return a property attribute for new-style classes (classes that derive from object).""" return 0 def range(start = 0, stop = 0, step = 0): """This is a versatile function to create lists containing arithmetic progressions. It is most often used in for loops. The arguments must be plain integers.""" return [0] def reduce(function, iterable, init = None): """Apply function of two arguments cumulatively to the items of iterable, from left to right, so as to reduce the iterable to a single value.""" return None def reload(module): """Reload a previously imported module.""" return None def repr(object): """Return a string containing a printable representation of an object.""" return "" def reversed(seq): """Return a reverse iterator. ! returnContentEqualsContentOf ! 0""" return None def round(x, n=0): """Return the floating point value number rounded to ndigits digits after the decimal point.""" return 0.0 def setattr(obj, name, value): """This is the counterpart of getattr(). The arguments are an object, a string and an arbitrary value. The string may name an existing attribute or a new attribute. The function assigns the value to the attribute, provided the object allows it.""" return None def slice(start = 0, stop = 0, step = 0): """Return a slice object representing the set of indices specified by range(start, stop, step).""" return slice() def sorted(iterable, cmpre = None, key = None, reverse = False): """Return a new sorted list from the items in iterable. ! returnContentEqualsContentOf ! 0""" return [] def staticmethod(function): """Return a static method for function.""" return function def sum(iterable): """Sums start and the items of an iterable from left to right and returns the total.""" return 0.0 def super(_type, obj = None): """Return a proxy object that delegates method calls to a parent or sibling class of type.""" return None def tuple(iterable = None): """Return a tuple whose items are the same and in the same order as iterable‘s items.""" return () def type(object): """With one argument, return the type of an object.""" return object def unichr(i): """Return the Unicode string of one character whose Unicode code is the integer i.""" return "" def unicode(obj = None, encoding = None, errors = None): """Return the Unicode string version of object.""" return "" def vars(obj): """Return the __dict__ attribute for a module, class, instance, or any other object with a __dict__ attribute.""" return None def xrange(start = 0, stop = 0, step = 0): """This function is very similar to range(), but returns an xrange object instead of a list.""" return [0] def zip(iterable = None): """This function returns a list of tuples, where the i-th tuple contains the i-th element from each of the argument sequences or iterables.""" return [] def __import__(name, globa = None, loca = None, fromlist = None, level = 0): """This function is invoked by the import statement. It can be replaced (by importing the __builtin__ module and assigning to __builtin__.__import__) in order to change semantics of the import statement, but nowadays it is usually simpler to use import hooks (see PEP 302).""" return None def exit(status): return None __name__ = "none" __file__ = "none" __doc__ = "none" __package__ = "none" NotImplemented = None def print(obj, sep='', end='\n', file=open()): pass diff --git a/duchain/CMakeLists.txt b/duchain/CMakeLists.txt index 33e0ca53..16462b66 100644 --- a/duchain/CMakeLists.txt +++ b/duchain/CMakeLists.txt @@ -1,60 +1,60 @@ set(duchain_SRCS declarations/functiondeclaration.cpp types/nonetype.cpp types/hintedtype.cpp types/unsuretype.cpp types/indexedcontainer.cpp expressionvisitor.cpp helpers.cpp pythonducontext.cpp contextbuilder.cpp pythoneditorintegrator.cpp declarationbuilder.cpp usebuilder.cpp dumpchain.cpp navigation/navigationwidget.cpp navigation/declarationnavigationcontext.cpp correctionhelper.cpp assistants/missingincludeassistant.cpp ../docfilekcm/docfilewizard.cpp # for the docfile generation assistant widget, to be used in the problem resolver ) ecm_qt_declare_logging_category(duchain_SRCS HEADER duchaindebug.h IDENTIFIER KDEV_PYTHON_DUCHAIN - CATEGORY_NAME "kdevelop.languages.python.duchain" + CATEGORY_NAME "kdevelop.plugins.python.duchain" ) add_library( kdevpythonduchain SHARED ${duchain_SRCS} ) generate_export_header( kdevpythonduchain EXPORT_MACRO_NAME KDEVPYTHONDUCHAIN_EXPORT EXPORT_FILE_NAME pythonduchainexport.h ) target_link_libraries( kdevpythonduchain LINK_PRIVATE KF5::TextEditor KDev::Interfaces KDev::Language KDev::Project KDev::Util kdevpythonparser ) install(TARGETS kdevpythonduchain DESTINATION ${INSTALL_TARGETS_DEFAULT_ARGS}) add_subdirectory(navigation) if (BUILD_TESTING) add_subdirectory(tests) endif() add_subdirectory(types) add_subdirectory(declarations) add_subdirectory(assistants) diff --git a/kdevpythonsupport.categories b/kdevpythonsupport.categories index b3f3cf1e..cdd89abf 100644 --- a/kdevpythonsupport.categories +++ b/kdevpythonsupport.categories @@ -1,10 +1,10 @@ # KDebugSettings data file # Format: # lognamedescription -kdevelop.languages.python KDevelop plugin: Python language support -kdevelop.languages.python.codecompletion KDevelop plugin: Python language support - codecompletion -kdevelop.languages.python.codegen KDevelop plugin: Python language support - codegen -kdevelop.languages.python.debugger KDevelop plugin: Python language support - debugger -kdevelop.languages.python.duchain KDevelop plugin: Python language support - duchain -kdevelop.languages.python.parser KDevelop plugin: Python language support - parser +kdevelop.plugins.python KDevelop plugin: Python language support +kdevelop.plugins.python.codecompletion KDevelop plugin: Python language support - codecompletion +kdevelop.plugins.python.codegen KDevelop plugin: Python language support - codegen +kdevelop.plugins.python.debugger KDevelop plugin: Python language support - debugger +kdevelop.plugins.python.duchain KDevelop plugin: Python language support - duchain +kdevelop.plugins.python.parser KDevelop plugin: Python language support - parser diff --git a/kdevpythonsupport.json b/kdevpythonsupport.json index 71d2cc67..4ce219a1 100644 --- a/kdevpythonsupport.json +++ b/kdevpythonsupport.json @@ -1,100 +1,101 @@ { "KPlugin": { "Authors": [ { "Email": "svenbrauch@googlemail.com", "Name": "Sven Brauch", "Name[ca@valencia]": "Sven Brauch", "Name[ca]": "Sven Brauch", "Name[cs]": "Sven Brauch", "Name[de]": "Sven Brauch", "Name[en_GB]": "Sven Brauch", "Name[es]": "Sven Brauch", + "Name[et]": "Sven Brauch", "Name[fi]": "Sven Brauch", "Name[fr]": "Sven Brauch", "Name[gl]": "Sven Brauch", "Name[it]": "Sven Brauch", "Name[nl]": "Sven Brauch", "Name[pl]": "Sven Brauch", "Name[pt]": "Sven Brauch", "Name[pt_BR]": "Sven Brauch", "Name[ru]": "Sven Brauch", "Name[sk]": "Sven Brauch", "Name[sl]": "Sven Brauch", "Name[sv]": "Sven Brauch", "Name[tr]": "Sven Brauch", "Name[uk]": "Sven Brauch", "Name[x-test]": "xxSven Brauchxx", "Name[zh_CN]": "Sven Brauch", "Name[zh_TW]": "Sven Brauch" } ], "Category": "Language Support", "Description": "Python Language Support", "Description[ca@valencia]": "Implementació del llenguatge Python", "Description[ca]": "Implementació del llenguatge Python", "Description[cs]": "Podpora jazyka Python", "Description[de]": "Sprachunterstützung für Python", "Description[en_GB]": "Python Language Support", "Description[es]": "Implementación del lenguaje Python", "Description[fi]": "Python-kielituki", "Description[fr]": "Prise en charge du langage Python", "Description[gl]": "Compatibilidade coa linguaxe Python.", "Description[it]": "Supporto per il linguaggio Python", "Description[ko]": "파이썬 언어 지원", "Description[nl]": "Ondersteuning voor de taal Python", "Description[pl]": "Obsługa języka Python", "Description[pt]": "Suporte à Linguagem Python", "Description[pt_BR]": "Suporte à linguagem Python", "Description[ru]": "Поддержка языка программирования Python", "Description[sk]": "Podpora jazyka Python", "Description[sl]": "Podpora jeziku Python", "Description[sv]": "Stöd för språket Python", "Description[tr]": "Python Dil Desteği", "Description[uk]": "Підтримка мови програмування Python", "Description[x-test]": "xxPython Language Supportxx", "Description[zh_CN]": "Python 语言支持", "Description[zh_TW]": "Python 語言支援", "Icon": "text-x-python", "Id": "kdevpythonsupport", "Name": "Python Support", "Name[ca@valencia]": "Implementació de Python", "Name[ca]": "Implementació de Python", "Name[cs]": "Podpora Pythonu", "Name[de]": "Unterstützung für Python", "Name[en_GB]": "Python Support", "Name[es]": "Implementación de Python", "Name[fi]": "Python-tuki", "Name[fr]": "Prise en charge de Python", "Name[gl]": "Compatibilidade con Python", "Name[it]": "Supporto per Python", "Name[ko]": "파이썬 지원", "Name[nl]": "Python-ondersteuning", "Name[pl]": "Obsługa Pythona", "Name[pt]": "Suporte para Python", "Name[pt_BR]": "Suporte à Python", "Name[ru]": "Поддержка Python", "Name[sk]": "Podpora Pythonu", "Name[sl]": "Podpora Pythonu", "Name[sv]": "Python-stöd", "Name[tr]": "Python Desteği", "Name[uk]": "Підтримка Python", "Name[x-test]": "xxPython Supportxx", "Name[zh_CN]": "Python 支持", "Name[zh_TW]": "Python 支援", "ServiceTypes": [ "KDevelop/Plugin" ] }, "X-KDevelop-Interfaces": [ "ILanguageSupport" ], "X-KDevelop-Languages": [ "Python" ], "X-KDevelop-Mode": "NoGUI", "X-KDevelop-SupportedMimeTypes": [ "text/x-python", "text/x-python3" ] } diff --git a/org.kde.kdev-python.metainfo.xml b/org.kde.kdev-python.metainfo.xml index 90bed212..0fdf4f59 100644 --- a/org.kde.kdev-python.metainfo.xml +++ b/org.kde.kdev-python.metainfo.xml @@ -1,75 +1,75 @@ org.kde.kdev-python org.kde.kdevelop.desktop KDevelop Python Support Implementació de Python al KDevelop Implementació de Python al KDevelop Podpora Pythonu v KDevelop KDevelop – Python-Unterstützung KDevelop Python Support Implementación de Python para KDevelop Prise en charge de Python pour KDevelop Compatibilidade con Python para KDevelop Supporto Python per KDevelop Python ondersteuning in KDevelop Obsługa Pythona w KDevelop Suporte para Python do KDevelop - Podpora Pythonu za KDevelop + Suporte a Python no KDevelop KDevelop Python-stöd Підтримка Python у KDevelop xxKDevelop Python Supportxx KDevelop Python 支持 KDevelop Python 支援 Python language support for KDevelop Implementació del llenguatge Python al KDevelop Implementació del llenguatge Python al KDevelop Python-Sprachunterstützung für KDevelop Python language support for KDevelop Implementación del lenguaje Python para KDevelop KDevelopi Pythoni keele toetus Prise en charge du langage Python pour KDevelop Compatibilidade coa linguaxe Python para KDevelop Supporto per il linguaggio Python in KDevelop Ondersteuning voor de taal Python voor KDevelop Obsługa języka Python dla KDevelop Suporte para a linguagem Python no KDevelop Podpora jazyka Python pre KDevelop Podpora jeziku Python za KDevelop Stöd för språket Python i KDevelop KDevelop için Python dil desteği Підтримка мови Python у KDevelop xxPython language support for KDevelopxx KDevelop 的 Python 语言支持 KDevelop 的 Python 語言支援 Sven Brauch <mail@svenbrauch.de> Sven Brauch <mail@svenbrauch.de> Sven Brauch <mail@svenbrauch.de> Sven Brauch <mail@svenbrauch.de> Sven Brauch <mail@svenbrauch.de> Sven Brauch <mail@svenbrauch.de> Sven Brauch <mail@svenbrauch.de> Sven Brauch <mail@svenbrauch.de> Sven Brauch <mail@svenbrauch.de> Sven Brauch <mail@svenbrauch.de> Sven Brauch <mail@svenbrauch.de> Sven Brauch <mail@svenbrauch.de> Sven Brauch <mail@svenbrauch.de> Sven Brauch <mail@svenbrauch.de> Sven Brauch <mail@svenbrauch.de> Sven Brauch <mail@svenbrauch.de> Sven Brauch <mail@svenbrauch.de> Sven Brauch <mail@svenbrauch.de> Sven Brauch <mail@svenbrauch.de> xxSven Brauch <mail@svenbrauch.de>xx Sven Brauch <mail@svenbrauch.de> Sven Brauch <mail@svenbrauch.de> GPL-2.0+ CC0-1.0 https://kdevelop.org https://bugs.kde.org/enter_bug.cgi?format=guided&product=kdev-python https://docs.kde.org/index.php?application=kdevelop https://www.kde.org/community/donations/?app=kdevelop KDE mail@svenbrauch.de diff --git a/parser/CMakeLists.txt b/parser/CMakeLists.txt index df12ddde..899e2d17 100644 --- a/parser/CMakeLists.txt +++ b/parser/CMakeLists.txt @@ -1,34 +1,34 @@ set(parser_STAT_SRCS codehelpers.cpp parsesession.cpp ast.cpp astdefaultvisitor.cpp astvisitor.cpp astbuilder.cpp cythonsyntaxremover.cpp rangefixvisitor.cpp ) ecm_qt_declare_logging_category(parser_STAT_SRCS HEADER parserdebug.h IDENTIFIER KDEV_PYTHON_PARSER - CATEGORY_NAME "kdevelop.languages.python.parser" + CATEGORY_NAME "kdevelop.plugins.python.parser" ) include_directories(${PYTHON_INCLUDE_DIRS}) add_library( kdevpythonparser SHARED ${parser_STAT_SRCS} ) generate_export_header(kdevpythonparser EXPORT_MACRO_NAME KDEVPYTHONPARSER_EXPORT EXPORT_FILE_NAME parserexport.h) target_link_libraries(kdevpythonparser LINK_PRIVATE KDev::Language Qt5::Core ${PYTHON_LIBRARIES} ) install(TARGETS kdevpythonparser DESTINATION ${INSTALL_TARGETS_DEFAULT_ARGS}) if (BUILD_TESTING) add_subdirectory(tests) endif()