Example #1
0
 def _token(self, url, token, method):
     if token is None:
         token = urltoken(url)
         if token is None:
             if method == 'GET':
                 token = self.settings['DDFS_READ_TOKEN']
                 return token if isinstance(token, basestring) else None
             token = self.settings['DDFS_WRITE_TOKEN']
             return token if isinstance(token, basestring) else None
     return token
Example #2
0
 def _token(self, url, token, method):
     if token is None:
         token = urltoken(url)
         if token is None:
             if method == "GET":
                 token = self.settings["DDFS_READ_TOKEN"]
                 return token if isinstance(token, basestring) else None
             token = self.settings["DDFS_WRITE_TOKEN"]
             return token if isinstance(token, basestring) else None
     return token
Example #3
0
 def _token(self, url, token, method):
     if token is None:
         token = urltoken(url)
         if token is None:
             if method == 'GET':
                 token = self.settings['DDFS_READ_TOKEN']
                 return token if token else None
             token = self.settings['DDFS_WRITE_TOKEN']
             return token if token else None
     return token