-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
75 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
include LICENSE.txt | ||
include README.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
CodeGenLoader | ||
============= | ||
|
||
CodeGenLoader is a Python import hook that transparently runs a code | ||
generator at import time, allowing the use of generated code without | ||
a separate compilation step. The package includes an extensible base | ||
class as well as implementations for the Protocol Buffer and | ||
Thrift code generators. | ||
|
||
Installation | ||
------------ | ||
|
||
:: | ||
|
||
pip install codegenloader | ||
|
||
Prerequisites | ||
------------- | ||
|
||
CodeGenLoader runs on Python 2.5, 2.6, 2.7, pypy, and Jython. The base | ||
class does not have any external dependencies, but to use the Thrift or | ||
Protocol Buffer subclasses you will need the thrift or protobuf packages | ||
installed. | ||
|
||
Example | ||
------- | ||
|
||
Add the following two lines to `mypackage/proto/__init__.py`:: | ||
|
||
import codegenloader.protobuf | ||
__path__ = codegenloader.protobuf.make_path(__name__, ".") | ||
|
||
Now, assuming `foo.proto` exists in in `mypackage/proto/`, you can do:: | ||
|
||
from mypackage.proto.foo_pb2 import Foo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters