Permalink
Browse files

Rename UnwrapAsync descriptor to more accurate "Unwrap".

  • Loading branch information...
1 parent f74e95d commit d07ad95299e8b7b77cc5ca791db8c523643720f9 @ajdavis ajdavis committed Feb 16, 2014
Showing with 5 additions and 5 deletions.
  1. +4 −4 motor/__init__.py
  2. +1 −1 synchro/__init__.py
View
8 motor/__init__.py
@@ -716,7 +716,7 @@ def wrap(self, original_class):
return WrapAsync(self, original_class)
def unwrap(self, motor_class):
- return UnwrapAsync(self, motor_class)
+ return Unwrap(self, motor_class)
class WrapBase(MotorAttributeFactory):
@@ -768,17 +768,17 @@ def wrapper(self, *args, **kwargs):
return wrapper
-class UnwrapAsync(WrapBase):
+class Unwrap(WrapBase):
def __init__(self, prop, motor_class):
- """Like Async, but checks if arguments are Motor classes and unwraps
+ """A descriptor that checks if arguments are Motor classes and unwraps
them. E.g., Motor's drop_database takes a MotorDatabase, unwraps it,
and passes a PyMongo Database instead.
:Parameters:
- `prop`: An Async, the async method to call with unwrapped arguments.
- `motor_class`: A Motor class to be unwrapped.
"""
- super(UnwrapAsync, self).__init__(prop)
+ super(Unwrap, self).__init__(prop)
self.motor_class = motor_class
def create_attribute(self, cls, attr_name):
View
2 synchro/__init__.py
@@ -196,7 +196,7 @@ def __new__(cls, name, bases, attrs):
attrname, delegate_attr.has_write_concern)
setattr(new_class, attrname, sync_method)
elif isinstance(
- delegate_attr, motor.UnwrapAsync):
+ delegate_attr, motor.Unwrap):
# Re-synchronize the method.
sync_method = Sync(
attrname, delegate_attr.prop.has_write_concern)

0 comments on commit d07ad95

Please sign in to comment.