Name |
Date |
Size |
#Lines |
LOC |
||
---|---|---|---|---|---|---|
.. | - | - | ||||
google/ | 03-May-2024 | - | 16,584 | 11,874 | ||
README.txt | D | 03-May-2024 | 3.5 KiB | 101 | 70 | |
ez_setup.py | D | 03-May-2024 | 10.1 KiB | 284 | 214 | |
mox.py | D | 03-May-2024 | 37.3 KiB | 1,402 | 948 | |
setup.py | D | 03-May-2024 | 7.7 KiB | 197 | 160 | |
stubout.py | D | 03-May-2024 | 4.8 KiB | 141 | 91 |
README.txt
1Protocol Buffers - Google's data interchange format 2Copyright 2008 Google Inc. 3 4This directory contains the Python Protocol Buffers runtime library. 5 6Normally, this directory comes as part of the protobuf package, available 7from: 8 9 http://code.google.com/p/protobuf 10 11The complete package includes the C++ source code, which includes the 12Protocol Compiler (protoc). If you downloaded this package from PyPI 13or some other Python-specific source, you may have received only the 14Python part of the code. In this case, you will need to obtain the 15Protocol Compiler from some other source before you can use this 16package. 17 18Development Warning 19=================== 20 21The Python implementation of Protocol Buffers is not as mature as the C++ 22and Java implementations. It may be more buggy, and it is known to be 23pretty slow at this time. If you would like to help fix these issues, 24join the Protocol Buffers discussion list and let us know! 25 26Installation 27============ 28 291) Make sure you have Python 2.4 or newer. If in doubt, run: 30 31 $ python -V 32 332) If you do not have setuptools installed, note that it will be 34 downloaded and installed automatically as soon as you run setup.py. 35 If you would rather install it manually, you may do so by following 36 the instructions on this page: 37 38 http://peak.telecommunity.com/DevCenter/EasyInstall#installation-instructions 39 403) Build the C++ code, or install a binary distribution of protoc. If 41 you install a binary distribution, make sure that it is the same 42 version as this package. If in doubt, run: 43 44 $ protoc --version 45 464) Run the tests: 47 48 $ python setup.py test 49 50 If some tests fail, this library may not work correctly on your 51 system. Continue at your own risk. 52 53 Please note that there is a known problem with some versions of 54 Python on Cygwin which causes the tests to fail after printing the 55 error: "sem_init: Resource temporarily unavailable". This appears 56 to be a bug either in Cygwin or in Python: 57 http://www.cygwin.com/ml/cygwin/2005-07/msg01378.html 58 We do not know if or when it might me fixed. We also do not know 59 how likely it is that this bug will affect users in practice. 60 615) Install: 62 63 $ python setup.py install 64 65 This step may require superuser privileges. 66 NOTE: To use C++ implementation, you need to install C++ protobuf runtime 67 library of the same version and export the environment variable before this 68 step. See the "C++ Implementation" section below for more details. 69 70Usage 71===== 72 73The complete documentation for Protocol Buffers is available via the 74web at: 75 76 http://code.google.com/apis/protocolbuffers/ 77 78C++ Implementation 79================== 80 81WARNING: This is EXPERIMENTAL and only available for CPython platforms. 82 83The C++ implementation for Python messages is built as a Python extension to 84improve the overall protobuf Python performance. 85 86To use the C++ implementation, you need to: 871) Install the C++ protobuf runtime library, please see instructions in the 88 parent directory. 892) Export an environment variable: 90 91 $ export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp 92 93You need to export this variable before running setup.py script to build and 94install the extension. You must also set the variable at runtime, otherwise 95the pure-Python implementation will be used. In a future release, we will 96change the default so that C++ implementation is used whenever it is available. 97It is strongly recommended to run `python setup.py test` after setting the 98variable to "cpp", so the tests will be against C++ implemented Python 99messages. 100 101