Permalink
Browse files

upgrade notes, changed Settings to _Settings to make migration errors…

… more obvious (they should be using ginkgo.Setting not config.Setting)
  • Loading branch information...
1 parent fb3feff commit 644e9e6befedf6604bef7fca694c7c683eebbd08 @progrium committed Apr 2, 2012
Showing with 35 additions and 4 deletions.
  1. +32 −0 UPGRADING
  2. +1 −1 ginkgo/async/gevent.py
  3. +2 −3 ginkgo/config.py
View
@@ -0,0 +1,32 @@
+
+ * Change imports of `ginkgo.config.Setting` to `ginkgo.Setting`
+ * Change imports of `ginkgo.core.Service` to `ginkgo.Service`
+ * Use `.ready` instead of `.started` on Service objects
+ * The `doc` named argument of Setting is now `help`
+ * If you access settings outside of classes like this:
+
+ Setting("setting").value
+
+ Then you should just import ginkgo and do this:
+
+ ginkgo.settings.get("setting")
+
+ * If you use any gevent-based server (based on baseserver,
+ StreamServer, etc), you need to explicitly wrap it when adding
+ to a service using ginkgo.async.gevent.ServerWrapper. For
+ example, this code:
+
+ from gevent.server import StreamServer
+ class MyService(Service):
+ def __init__(self):
+ self.server = StreamServer(...)
+ self.add_service(self.server)
+
+ Would need to become:
+
+ from gevent.server import StreamServer
+ from ginkgo.async.gevent import ServerWrapper
+ class MyService(Service):
+ def __init__(self):
+ self.server = StreamServer(...)
+ self.add_service(ServerWrapper(self.server))
View
@@ -7,7 +7,7 @@
import gevent.pool
import gevent.baseserver
-from ..core import BasicService
+from ..core import BasicService, Service
from ..util import defaultproperty
class AsyncManager(BasicService):
View
@@ -2,7 +2,6 @@
import runpy
from peak.util.proxies import ObjectWrapper
-
class Config(object):
"""Represents a collection of settings
@@ -27,7 +26,7 @@ def group(self, path=''):
return Group(self, path)
def setting(self, *args, **kwargs):
- descriptor = Setting(self, *args, **kwargs)
+ descriptor = _Setting(self, *args, **kwargs)
self._descriptors.append(descriptor)
return descriptor
@@ -105,7 +104,7 @@ def __repr__(self):
return 'Group[{}]'.format(self._name)
-class Setting(object):
+class _Setting(object):
"""Setting descriptor for embedding in component classes.
Do not use this object directly, instead use `Config.setting()`.

0 comments on commit 644e9e6

Please sign in to comment.