|
@@ -6,13 +6,13 @@ from pyramid.config import Configurator
|
6
|
6
|
from wsgiref.simple_server import make_server
|
7
|
7
|
import time
|
8
|
8
|
from datetime import datetime
|
9
|
|
-import hapic
|
|
9
|
+from hapic import Hapic
|
10
|
10
|
from example.fake_api.schema import *
|
11
|
|
-from hapic.data import HapicData
|
12
|
11
|
|
|
12
|
+from hapic.data import HapicData
|
|
13
|
+from hapic.ext.pyramid import PyramidContext
|
13
|
14
|
|
14
|
|
-class NoContentException(Exception):
|
15
|
|
- pass
|
|
15
|
+hapic = Hapic()
|
16
|
16
|
|
17
|
17
|
|
18
|
18
|
class PyramidController(object):
|
|
@@ -121,7 +121,7 @@ if __name__ == "__main__":
|
121
|
121
|
configurator = Configurator(autocommit=True)
|
122
|
122
|
controllers = PyramidController()
|
123
|
123
|
controllers.bind(configurator)
|
124
|
|
- hapic.set_context(hapic.ext.pyramid.PyramidContext(configurator))
|
|
124
|
+ hapic.set_context(PyramidContext(configurator))
|
125
|
125
|
time.sleep(1)
|
126
|
126
|
s = json.dumps(hapic.generate_doc())
|
127
|
127
|
time.sleep(1)
|