mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-18029 Shadow thriftpy and ply modules
Add `_jetbrains_` prefix to `thriftpy` and `ply` module names to shadow the original package names that could be used in the user codebase.
This commit is contained in:
@@ -9,12 +9,12 @@ try:
|
||||
except AttributeError:
|
||||
pass #Not all versions have sys.version_info
|
||||
|
||||
import thriftpy
|
||||
profiler = thriftpy.load(os.path.join(os.path.dirname(os.path.realpath(__file__)), "profiler.thrift"), module_name="profiler_thrift")
|
||||
import _jetbrains_thriftpy
|
||||
profiler = _jetbrains_thriftpy.load(os.path.join(os.path.dirname(os.path.realpath(__file__)), "profiler.thrift"), module_name="profiler_thrift")
|
||||
|
||||
|
||||
from thriftpy.protocol.binary import TBinaryProtocolFactory
|
||||
from thriftpy.transport import TMemoryBuffer
|
||||
from _jetbrains_thriftpy.protocol.binary import TBinaryProtocolFactory
|
||||
from _jetbrains_thriftpy.transport import TMemoryBuffer
|
||||
|
||||
# noinspection PyUnresolvedReferences
|
||||
from profiler_thrift import ProfilerRequest, ProfilerResponse, Stats, FuncStat, Function, TreeStats, CallTreeStat
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import os
|
||||
|
||||
import thriftpy
|
||||
import _jetbrains_thriftpy
|
||||
|
||||
# dynamically import console.thrift classes into `console_thrift` module
|
||||
console_thrift = thriftpy.load(os.path.join(os.path.dirname(os.path.realpath(__file__)), "console.thrift"), module_name="console_thrift")
|
||||
console_thrift = _jetbrains_thriftpy.load(os.path.join(os.path.dirname(os.path.realpath(__file__)), "console.thrift"), module_name="console_thrift")
|
||||
|
||||
@@ -2,9 +2,9 @@ import socket
|
||||
import threading
|
||||
|
||||
from pydev_console.thrift_transport import TSyncClient, open_transports_as_client, _create_client_server_transports
|
||||
from thriftpy.protocol import TBinaryProtocolFactory
|
||||
from thriftpy.server import TThreadedServer
|
||||
from thriftpy.thrift import TProcessor
|
||||
from _jetbrains_thriftpy.protocol import TBinaryProtocolFactory
|
||||
from _jetbrains_thriftpy.server import TThreadedServer
|
||||
from _jetbrains_thriftpy.thrift import TProcessor
|
||||
|
||||
|
||||
def make_rpc_client(client_service, host, port, proto_factory=TBinaryProtocolFactory()):
|
||||
|
||||
@@ -4,8 +4,8 @@ import sys
|
||||
import threading
|
||||
|
||||
from pydev_console.io import PipeIO
|
||||
from thriftpy.thrift import TClient
|
||||
from thriftpy.transport import TTransportBase, readall
|
||||
from _jetbrains_thriftpy.thrift import TClient
|
||||
from _jetbrains_thriftpy.transport import TTransportBase, readall
|
||||
|
||||
REQUEST = 0
|
||||
RESPONSE = 1
|
||||
|
||||
+1
-1
@@ -881,7 +881,7 @@ class Preprocessor(object):
|
||||
return None
|
||||
|
||||
if __name__ == '__main__':
|
||||
import ply.lex as lex
|
||||
import _jetbrains_ply.lex as lex
|
||||
lexer = lex.lex()
|
||||
|
||||
# Run a preprocessor
|
||||
+1
-1
@@ -11,7 +11,7 @@ import collections
|
||||
import os
|
||||
import sys
|
||||
import types
|
||||
from ply import lex, yacc
|
||||
from _jetbrains_ply import lex, yacc
|
||||
from .lexer import * # noqa
|
||||
from .exc import ThriftParserError, ThriftGrammerError
|
||||
from ..thrift import gen_init, TType, TPayload, TException
|
||||
+1
-1
@@ -7,7 +7,7 @@ from .json import TJSONProtocol, TJSONProtocolFactory
|
||||
from .compact import TCompactProtocol, TCompactProtocolFactory
|
||||
from .multiplex import TMultiplexedProtocol, TMultiplexedProtocolFactory
|
||||
|
||||
from thriftpy._compat import PYPY, CYTHON
|
||||
from _jetbrains_thriftpy._compat import PYPY, CYTHON
|
||||
if not PYPY:
|
||||
# enable cython binary by default for CPython.
|
||||
if CYTHON:
|
||||
+1
-1
@@ -9,7 +9,7 @@ from .exc import TProtocolException
|
||||
from ..thrift import TException
|
||||
from ..thrift import TType
|
||||
|
||||
from thriftpy._compat import PY3
|
||||
from _jetbrains_thriftpy._compat import PY3
|
||||
|
||||
CLEAR = 0
|
||||
FIELD_WRITE = 1
|
||||
+1
-1
@@ -5,7 +5,7 @@ from __future__ import absolute_import
|
||||
import json
|
||||
import struct
|
||||
|
||||
from thriftpy.thrift import TType
|
||||
from _jetbrains_thriftpy.thrift import TType
|
||||
|
||||
from .exc import TProtocolException
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from thriftpy.thrift import TMultiplexedProcessor, TMessageType
|
||||
from _jetbrains_thriftpy.thrift import TMultiplexedProcessor, TMessageType
|
||||
|
||||
|
||||
class TMultiplexedProtocol(object):
|
||||
+4
-4
@@ -5,10 +5,10 @@ from __future__ import absolute_import
|
||||
import contextlib
|
||||
import warnings
|
||||
|
||||
from thriftpy.protocol import TBinaryProtocolFactory
|
||||
from thriftpy.server import TThreadedServer
|
||||
from thriftpy.thrift import TProcessor, TClient
|
||||
from thriftpy.transport import (
|
||||
from _jetbrains_thriftpy.protocol import TBinaryProtocolFactory
|
||||
from _jetbrains_thriftpy.server import TThreadedServer
|
||||
from _jetbrains_thriftpy.thrift import TProcessor, TClient
|
||||
from _jetbrains_thriftpy.transport import (
|
||||
TBufferedTransportFactory,
|
||||
TServerSocket,
|
||||
TSocket,
|
||||
+2
-2
@@ -5,8 +5,8 @@ from __future__ import absolute_import
|
||||
import logging
|
||||
import threading
|
||||
|
||||
from thriftpy.protocol import TBinaryProtocolFactory
|
||||
from thriftpy.transport import (
|
||||
from _jetbrains_thriftpy.protocol import TBinaryProtocolFactory
|
||||
from _jetbrains_thriftpy.transport import (
|
||||
TBufferedTransportFactory,
|
||||
TTransportException
|
||||
)
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
from thriftpy._compat import CYTHON
|
||||
from _jetbrains_thriftpy._compat import CYTHON
|
||||
|
||||
from ..thrift import TType, TException
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ from __future__ import absolute_import
|
||||
|
||||
from io import BytesIO
|
||||
|
||||
from thriftpy._compat import CYTHON
|
||||
from _jetbrains_thriftpy._compat import CYTHON
|
||||
from .. import TTransportBase
|
||||
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ from __future__ import absolute_import
|
||||
import struct
|
||||
from io import BytesIO
|
||||
|
||||
from thriftpy._compat import CYTHON
|
||||
from _jetbrains_thriftpy._compat import CYTHON
|
||||
from .. import TTransportBase, readall
|
||||
from ..buffered import TBufferedTransport
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ from __future__ import absolute_import
|
||||
|
||||
from io import BytesIO
|
||||
|
||||
from thriftpy._compat import CYTHON
|
||||
from _jetbrains_thriftpy._compat import CYTHON
|
||||
from .. import TTransportBase
|
||||
|
||||
|
||||
Reference in New Issue
Block a user