Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@rajumsys
Copy link
Contributor

@rajumsys rajumsys commented Mar 2, 2017

Handles #133

@rajumsys
Copy link
Contributor Author

rajumsys commented Mar 2, 2017

Duh! And I noticed it now that the endpoint is deprecated 🏅

@richleland
Copy link
Contributor

I would modify this endpoint (you can keep the work done to date) to do a deprecation warning (docs).

@rajumsys
Copy link
Contributor Author

rajumsys commented Mar 6, 2017

@richleland added the deprecation notice

"""
results = self.request('GET', self.uri)
return results
warnings.warn('deprecated', DeprecationWarning)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would customize the message rather than put in deprecated. For instance we could say it will be removed from the API soon. After looking a little more, you might want to use PendingDeprecationWarning. Curious - what does this look like at the command line for users?

Copy link
Contributor Author

@rajumsys rajumsys Mar 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put a giant message initially but seemed too much. something like

This endpoint is deprecated. For details, check https://developers.sparkpost.com/api/transmissions.html#transmissions-list-get

To me it seemed verbose. But if you find this (or modify as you want) helpful, I can put that.

Also the endpoint is already deprecated; so PendingDeprecationWarning may not be correct.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point on it already being deprecated, let's keep it as DeprecationWarning. Maybe use the URL shortener for that message. Otherwise the message you suggested seems OK to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i can shorten; i hope it won't feel creepy to users :).

import os
import tempfile
import warnings
from mock import patch
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this below the external libraries. The ordering should follow this format:

  1. Standard library (built-in) imports
  2. Standard library (built-in) froms

line break

  1. External library imports
  2. External library froms

line break

  1. Local imports
  2. Local froms

In each the imports/froms should be in alphabetical order.

"""
warnings.warn('deprecated', DeprecationWarning)
warn_msg = 'This endpoint is deprecated. For details, '
'check http://bit.ly/2lAKj60.'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have our own URL shortener: https://sparkpo.st/mklink.php

import copy
import json
import warnings

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no line break needed here - email is in the standard lib.

@rajumsys rajumsys force-pushed the issue133 branch 2 times, most recently from eddbe00 to 7153d37 Compare March 7, 2017 16:53
'Content-Type': 'application/json',
'Authorization': self.api_key
}
print uri, kwargs
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops!

@rajumsys rajumsys merged commit f3d2ec6 into master Mar 7, 2017
@richleland richleland deleted the issue133 branch March 7, 2017 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants