Skip to content

Commit

Permalink
New naming for Facebook plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Dec 17, 2019
1 parent 9c663be commit dbabe41
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 28 deletions.
12 changes: 6 additions & 6 deletions api_dropbox/src/api_dropbox/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,22 +92,22 @@
""" The map associating the hmac values with the hashlib hash function modules """

BASE_REST_URL = "http://api.dropbox.com/1/"
""" The base rest URL to be used """
""" The base REST URL to be used """

BASE_REST_SECURE_URL = "https://api.dropbox.com/1/"
""" The base rest secure URL to be used """
""" The base REST secure URL to be used """

WWW_REST_SECURE_URL = "http://www.dropbox.com/1/"
""" The www rest URL to be used """
""" The www REST URL to be used """

WWW_REST_SECURE_URL = "https://www.dropbox.com/1/"
""" The www rest secure URL to be used """
""" The www REST secure URL to be used """

CONTENT_REST_SECURE_URL = "http://api-content.dropbox.com/1/"
""" The content rest URL to be used """
""" The content REST URL to be used """

CONTENT_REST_SECURE_URL = "https://api-content.dropbox.com/1/"
""" The content rest secure URL to be used """
""" The content REST secure URL to be used """

class APIDropbox(colony.System):
"""
Expand Down
4 changes: 2 additions & 2 deletions api_facebook/src/api_facebook/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@
from . import exceptions
from . import system

from .exceptions import ApiFacebookException, FacebookApiError
from .system import ApiFacebook
from .exceptions import APIFacebookException, FacebookAPIError
from .system import APIFacebook
6 changes: 3 additions & 3 deletions api_facebook/src/api_facebook/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@

import colony

class ApiFacebookException(colony.ColonyException):
class APIFacebookException(colony.ColonyException):
"""
The API Facebook exception class.
"""

message = None
""" The exception's message """

class FacebookApiError(ApiFacebookException):
class FacebookAPIError(APIFacebookException):
"""
The Facebook API error class.
"""
Expand All @@ -60,7 +60,7 @@ def __init__(self, message):
:param message: The message to be printed.
"""

ApiFacebookException.__init__(self)
APIFacebookException.__init__(self)
self.message = message

def __str__(self):
Expand Down
28 changes: 14 additions & 14 deletions api_facebook/src/api_facebook/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@
""" The default scope """

BASE_REST_URL = "http://api.facebook.com/restserver.php"
""" The base rest URL to be used """
""" The base REST URL to be used """

BASE_REST_SECURE_URL = "https://api.facebook.com/restserver.php"
""" The base rest secure URL to be used """
""" The base REST secure URL to be used """

BASE_HOME_URL = "http://www.facebook.com/"
""" The base home URL """
Expand All @@ -83,27 +83,27 @@
""" The base home secure URL """

BASE_REST_OAUTH_URL = "http://www.facebook.com/"
""" The base rest oauth URL """
""" The base REST OAuth URL """

BASE_REST_OAUTH_SECURE_URL = "https://www.facebook.com/"
""" The base rest oauth secure URL """
""" The base REST OAuth secure URL """

BASE_REST_GRAPH_URL = "http://graph.facebook.com/"
""" The base rest graph URL """
""" The base REST graph URL """

BASE_REST_GRAPH_SECURE_URL = "https://graph.facebook.com/"
""" The base rest graph secure URL """
""" The base REST graph secure URL """

FACEBOOK_CLIENT_TYPE_REST = "rest"
""" The rest Facebook client type """
""" The REST Facebook client type """

FACEBOOK_CLIENT_TYPE_OAUTH = "oauth"
""" The oauth Facebook client type """
""" The OAuth Facebook client type """

DEFAULT_FACEBOOK_CLIENT_TYPE = FACEBOOK_CLIENT_TYPE_REST
""" The default Facebook client type is rest """
""" The default Facebook client type is REST """

class ApiFacebook(colony.System):
class APIFacebook(colony.System):
"""
The API Facebook class.
"""
Expand Down Expand Up @@ -485,7 +485,7 @@ def _get_signature(self, parameters):

def _set_base_parameters(self, method_name, parameters):
"""
Sets the base Facebook rest request parameters
Sets the base Facebook REST request parameters
in the parameters map.
:type method_name: String
Expand Down Expand Up @@ -592,7 +592,7 @@ def _check_facebook_errors(self, data):
error_message = data.get("error_msg", None)

# raises the Facebook API error
raise exceptions.FacebookApiError("error in request: " + error_message)
raise exceptions.FacebookAPIError("error in request: " + error_message)

def _get_http_client(self):
"""
Expand Down Expand Up @@ -621,7 +621,7 @@ def _get_http_client(self):

class FacebookClientOauth(object):
"""
The class that represents a Facebook client oauth connection.
The class that represents a Facebook client OAuth connection.
"""

json_plugin = None
Expand Down Expand Up @@ -901,7 +901,7 @@ def _check_facebook_errors(self, data):
error_message = data.get("error_msg", None)

# raises the Facebook API error
raise exceptions.FacebookApiError("error in request: " + error_message)
raise exceptions.FacebookAPIError("error in request: " + error_message)

def _parse_query_string(self, query_string):
"""
Expand Down
6 changes: 3 additions & 3 deletions api_facebook/src/api_facebook_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@

import colony

class ApiFacebookPlugin(colony.Plugin):
class APIFacebookPlugin(colony.Plugin):
"""
The main class for the Facebook Api plugin.
The main class for the Facebook API plugin.
"""

id = "pt.hive.colony.plugins.api.facebook"
Expand All @@ -66,7 +66,7 @@ class ApiFacebookPlugin(colony.Plugin):
def load_plugin(self):
colony.Plugin.load_plugin(self)
import api_facebook
self.system = api_facebook.ApiFacebook(self)
self.system = api_facebook.APIFacebook(self)

def create_client(self, api_attributes):
"""
Expand Down

0 comments on commit dbabe41

Please sign in to comment.