Code Duplication    Length = 14-21 lines in 2 locations

th_trello/my_trello.py 1 location

@@ 41-61 (lines=21) @@
38
39
    # Boards own Lists own Cards
40
41
    def __init__(self, token=None):
42
        super(ServiceTrello, self).__init__(token)
43
        # app name
44
        self.app_name = DjangoThConfig.verbose_name
45
        # expiration
46
        self.expiry = "30days"
47
        # scope define the rights access
48
        self.scope = 'read,write'
49
50
        base = 'https://www.trello.com'
51
        self.AUTH_URL = '{}/1/OAuthAuthorizeToken'.format(base)
52
        self.REQ_TOKEN = '{}/1/OAuthGetRequestToken'.format(base)
53
        self.ACC_TOKEN = '{}/1/OAuthGetAccessToken'.format(base)
54
        self.consumer_key = settings.TH_TRELLO['consumer_key']
55
        self.consumer_secret = settings.TH_TRELLO['consumer_secret']
56
        if token:
57
            token_key, token_secret = token.split('#TH#')
58
            self.trello_instance = TrelloClient(self.consumer_key,
59
                                                self.consumer_secret,
60
                                                token_key,
61
                                                token_secret)
62
63
    def read_data(self, **kwargs):
64
        """

th_readability/my_readability.py 1 location

@@ 38-51 (lines=14) @@
35
36
class ServiceReadability(ServicesMgr):
37
38
    def __init__(self, token=None):
39
        super(ServiceReadability, self).__init__(token)
40
        base = 'https://www.readability.com'
41
        self.AUTH_URL = '{}/api/rest/v1/oauth/authorize/'.format(base)
42
        self.REQ_TOKEN = '{}/api/rest/v1/oauth/request_token/'.format(base)
43
        self.ACC_TOKEN = '{}/api/rest/v1/oauth/access_token/'.format(base)
44
        self.consumer_key = settings.TH_READABILITY['consumer_key']
45
        self.consumer_secret = settings.TH_READABILITY['consumer_secret']
46
        self.token = token
47
        kwargs = {'consumer_key': self.consumer_key,
48
                  'consumer_secret': self.consumer_secret}
49
        if token:
50
            token_key, token_secret = self.token.split('#TH#')
51
            self.client = ReaderClient(token_key, token_secret, **kwargs)
52
53
    def read_data(self, **kwargs):
54
        """