Пример #1
0
 def getObservationsUrl (self):
     try:
         url = QUrl(self.operationsMetadata['GetObservation'].methods['Post'])
         #Para servidores mal configurados
         if url.host() == 'localhost':
             url.setHost (self.url.host())
             url.setPort (self.url.port())
             return url
         return url
     except:
         return QUrl()
Пример #2
0
 def getObservationsUrl(self):
     try:
         url = QUrl(
             self.operationsMetadata['GetObservation'].methods['Post'])
         #Para servidores mal configurados
         if url.host() == 'localhost':
             url.setHost(self.url.host())
             url.setPort(self.url.port())
             return url
         return url
     except:
         return QUrl()
Пример #3
0
 def get_authorization_url(self, scopes):
     host, port = config.setting['server_host'], config.setting['server_port']
     url = QUrl()
     if (host in MUSICBRAINZ_SERVERS and port == 80) or port == 443:
         url.setScheme("https")
     else:
         url.setScheme("http")
         if port != 80:
             url.setPort(port)
     url.setHost(host)
     url.setPath("/oauth2/authorize")
     url.addQueryItem("response_type", "code")
     url.addQueryItem("client_id", MUSICBRAINZ_OAUTH_CLIENT_ID)
     url.addQueryItem("redirect_uri", "urn:ietf:wg:oauth:2.0:oob")
     url.addQueryItem("scope", scopes)
     return str(url.toEncoded())