Mathewpeterson/add more deprecation

@dianakhuang @dmitchell @cpennington Review?
Ok.


On Thu, Jul 3, 2014 at 1:15 PM, Mathew Peterson <notifications@github.com>
wrote:

> In opaque_keys/edx/locations.py:
>
> > @@ -148,14 +174,55 @@ class Location(LocationBase, BlockUsageLocator):
> >
> >      DEPRECATED_TAG = 'i4x'
> >
> > +    def replace(self, **kwargs):
> > +        """
> > +        Using BlockUsageLocator's replace function results in a mismatch of __init__ args and kwargs.
> > +        Replace tries to instantiate an Location object with BlockUsageLocator's args and kwargs.
> > +        """
> > +        self._deprecation_warning()
> > +        return Location(
> > +            kwargs.pop('org', self.course_key.org),
> > +            kwargs.pop('course', self.course_key.course),
> > +            kwargs.pop('run', self.course_key.run),
> > +            kwargs.pop('category', self.category),
> > +            kwargs.pop('name', self.name),
> > +            revision=kwargs.pop('revision', self.revision),
> > +            **kwargs
> > +        )
>
> The init functions hard code deprecated to True. Devs don't get a choice.
> So I don't need to pass deprecated.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/edx/opaque-keys/pull/24/files#r14526092>.
>